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

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

[elpa] externals/org 945c019 1/2: lisp/org.el: Fix indentation when `org


From: ELPA Syncer
Subject: [elpa] externals/org 945c019 1/2: lisp/org.el: Fix indentation when `org-adapt-indentation' is 'headline-data
Date: Mon, 3 May 2021 00:57:17 -0400 (EDT)

branch: externals/org
commit 945c019176b2d23c5006377c95ce8d69b4b4de66
Author: Bastien <bzg@gnu.org>
Commit: Bastien <bzg@gnu.org>

    lisp/org.el: Fix indentation when `org-adapt-indentation' is 'headline-data
    
    * lisp/org.el (org--get-expected-indentation): Fix indentation of
    non-headllines with `org-adapt-indentation' set to 'headline-data.
    (org-indent-line): When `org-adapt-indentation' is 'headline-data,
    don't indent when point is at the first line after a headline.
    Update the docstring to make it explicit that indenting relatively
    to current level only happens when `org-adapt-indentation' is set
    to `t'.
---
 lisp/org.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 57a58a8..434feda 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -18973,7 +18973,7 @@ ELEMENT."
                            (org--get-expected-indentation
                             (org-element-property :parent previous) t))))))))))
       ;; Otherwise, move to the first non-blank line above.
-      ((not (eq org-adapt-indentation 'headline-data))
+      (t
        (beginning-of-line)
        (let ((pos (point)))
         (skip-chars-backward " \r\t\n")
@@ -19050,7 +19050,7 @@ Indentation is done according to the following rules:
        Else, indent like parent's first line.
 
     3. Otherwise, indent relatively to current level, if
-       `org-adapt-indentation' is non-nil, or to left margin.
+       `org-adapt-indentation' is `t', or to left margin.
 
   - On a blank line at the end of an element, indent according to
     the type of the element.  More precisely
@@ -19075,7 +19075,11 @@ list structure.  Instead, use 
\\<org-mode-map>`\\[org-shiftmetaleft]' or \
 
 Also align node properties according to `org-property-format'."
   (interactive)
-  (unless (org-at-heading-p)
+  (unless (or (org-at-heading-p)
+              (and (eq org-adapt-indentation 'headline-data)
+                   (save-excursion
+                     (move-beginning-of-line 0)
+                     (org-at-heading-p))))
     (let* ((element (save-excursion (beginning-of-line) 
(org-element-at-point)))
           (type (org-element-type element)))
       (cond ((and (memq type '(plain-list item))



reply via email to

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