branch: externals/orgalist
commit 4341eb71b14416bd0e59fb1000f6fdf422515f8b
Author: Nicolas Goaziou <m...@nicolasgoaziou.fr>
Commit: Nicolas Goaziou <m...@nicolasgoaziou.fr>

    Fix indentation in Text mode in Emacs 27
    
    * orgalist.el (orgalist-mode): Make `indent-line-function'
    buffer-local to adapt to changes introduced in Emacs 27.
    
    Reported-by: Gregor Zattler <telegr...@gmx.net>
    <http://lists.gnu.org/r/emacs-orgmode/2019-04/msg00007.html>
---
 orgalist.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/orgalist.el b/orgalist.el
index 3a3cfaa..433dee1 100644
--- a/orgalist.el
+++ b/orgalist.el
@@ -818,6 +818,12 @@ C-c C-c         `orgalist-check-item'"
     (add-function :before-until
                   (local 'fill-paragraph-function)
                   #'orgalist--fill-item)
+    ;; Unless `indent-line-function' is buffer-local before it is
+    ;; advised with `add-function', the workaround for bug#31361 below
+    ;; will not work, as (advice--cd*r indent-line-function) will not
+    ;; compare `eq' to `indent-relative' in
+    ;; `indent-according-to-mode'.
+    (make-local-variable 'indent-line-function)
     (add-function :before-until
                   (local 'indent-line-function)
                   #'orgalist--indent-line)

Reply via email to