From 2bc2e7470a103b81cb16cbbb745c43fe985ef6f2 Mon Sep 17 00:00:00 2001 From: Brett Gilio Date: Sun, 25 Oct 2020 17:48:11 -0500 Subject: [PATCH] Set ox-hugo preemption fallback for < 27.x --- org-webring.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/org-webring.el b/org-webring.el index 8090174..06cf94c 100644 --- a/org-webring.el +++ b/org-webring.el @@ -433,7 +433,20 @@ The POST will be skipped (cond ((stringp content) (with-temp-buffer (insert content) - (delete-indentation nil (point-min) (point-max)) + ;; XXX: `delete-indentation' holds only 1 + ;; argument before 27.x. Create fallback. + (if (version< emacs-version "27") + (let ((prefix (and (> (length fill-prefix) 0) + (regexp-quote fill-prefix)))) + (while (and (> (line-beginning-position) + (point-min)) + (forward-line 0) + (= (preceding-char) ?\n)) + (delete-char -1) + (if (and prefix (looking-at prefix)) + (replace-match "" t t)) + (fixup-whitespace))) + (delete-indentation nil (point-min) (point-max))) (libxml-parse-html-region (point-min) (point-max)))) ((consp content) -- 2.45.2