emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org 69ef1832bb: Merge branch 'bugfix'


From: ELPA Syncer
Subject: [elpa] externals/org 69ef1832bb: Merge branch 'bugfix'
Date: Tue, 9 Jul 2024 12:58:44 -0400 (EDT)

branch: externals/org
commit 69ef1832bbfca81d067a7e30663e92d73011a034
Merge: d38d53a178 022bb471c1
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    Merge branch 'bugfix'
---
 lisp/org.el              |  6 +++++-
 testing/lisp/test-org.el | 12 ++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index f4abfa676f..5c95824a42 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -19812,7 +19812,11 @@ Also align node properties according to 
`org-property-format'."
                         (+ (org-current-text-indentation)
                            org-edit-src-content-indentation)))))
                (ignore-errors ; do not err when there is no proper major mode
-                 (org-babel-do-in-edit-buffer (funcall indent-line-function)))
+                 ;; It is important to call `indent-according-to-mode'
+                 ;; rather than `indent-line-function' here or we may
+                 ;; sometimes break `electric-indent-mode'
+                 ;; 
https://orgmode.org/list/5O9VMGb6WRaqeHR5_NXTb832Z2Lek_5L40YPDA52-S3kPwGYJspI8kLWaGtuq3DXyhtHpj1J7jTIXb39RX9BtCa2ecrWHjijZqI8QAD742U=@proton.me
+                 (org-babel-do-in-edit-buffer (indent-according-to-mode)))
                (when (and block-content-ind (looking-at-p "^$"))
                  (indent-line-to block-content-ind))))
            (t
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index f21e52bfd4..2487c9ace6 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -1744,6 +1744,18 @@ CLOCK: [2022-09-17 sam. 11:00]--[2022-09-17 sam. 11:46] 
=>  0:46"
              (electric-indent-local-mode 1)
              (call-interactively 'org-return)
              (buffer-string)))))
+  ;; Make sure that we do not mess things up when indenting remotely
+  ;; in src block buffer.
+  (let ((org-edit-src-content-indentation 2))
+    (should
+     ;; Add `org-edit-src-content-indentation' and no more.
+     ;; 
https://orgmode.org/list/5O9VMGb6WRaqeHR5_NXTb832Z2Lek_5L40YPDA52-S3kPwGYJspI8kLWaGtuq3DXyhtHpj1J7jTIXb39RX9BtCa2ecrWHjijZqI8QAD742U=@proton.me
+     (equal "#+begin_src fundamental\n  \n#+end_src" ; 2 spaces
+            (org-test-with-temp-text "#+begin_src 
fundamental<point>\n#+end_src"
+              (electric-indent-local-mode 1)
+              (call-interactively 'org-return)
+              (should (looking-at-p "\n\\#"))
+              (buffer-string)))))
   ;; C-j, like `electric-newline-and-maybe-indent', should not indent.
   (should
    (equal "  Para\ngraph"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]