Browse Source

org-list: Remove fancy description list indentation

* lisp/org-list.el (org-list-description-max-indent): Remove variable.
(org-list-item-body-column): No longer indent specially description
items.
* lisp/org.el (org-indent-line): Prune reference to removed variable
  in docstring.

Special indentation on description items breaks indentation in
sub-items.
Nicolas Goaziou 1 year ago
parent
commit
683df456a4
3 changed files with 15 additions and 31 deletions
  1. 6 0
      etc/ORG-NEWS
  2. 7 27
      lisp/org-list.el
  3. 2 4
      lisp/org.el

+ 6 - 0
etc/ORG-NEWS

@@ -136,6 +136,12 @@ dynamic block in ~org-dynamic-block-alist~.
 It was unused throughout the code base.
 
 ** Miscellaneous
+*** No more special indentation for description items
+
+Descriptions items are indented like regular ones, i.e., text starts
+after the bullet.  Special indentation used to introduce bugs when
+inserting sub-items in a description list.
+
 *** New hook: ~org-todo-repeat-hook~
 This hook was actually introduced in Org 9.2.1, but wasn't advertised.
 *** Org Table reads numbers starting with 0 as strings

+ 7 - 27
lisp/org-list.el

@@ -328,14 +328,6 @@ with the word \"recursive\" in the value."
   :group 'org-plain-lists
   :type 'boolean)
 
-(defcustom org-list-description-max-indent 20
-  "Maximum indentation for the second line of a description list.
-When the indentation would be larger than this, it will become
-5 characters instead."
-  :group 'org-plain-lists
-  :type 'integer
-  :safe #'wholenump)
-
 (defcustom org-list-indent-offset 0
   "Additional indentation for sub-items in a list.
 By setting this to a small number, usually 1 or 2, one can more
@@ -2070,25 +2062,13 @@ Possible values are: `folded', `children' or `subtree'.  See
   "Return column at which body of ITEM should start."
   (save-excursion
     (goto-char item)
-    (if (save-excursion
-	  (end-of-line)
-	  (re-search-backward
-	   "[ \t]::\\([ \t]\\|$\\)" (line-beginning-position) t))
-	;; Descriptive list item.  Body starts after item's tag, if
-	;; possible.
-	(let ((start (1+ (- (match-beginning 1) (line-beginning-position))))
-	      (ind (current-indentation)))
-	  (if (> start (+ ind org-list-description-max-indent))
-	      (+ ind 5)
-	    start))
-      ;; Regular item.  Body starts after bullet.
-      (looking-at "[ \t]*\\(\\S-+\\)")
-      (+ (progn (goto-char (match-end 1)) (current-column))
-	 (if (and org-list-two-spaces-after-bullet-regexp
-		  (string-match-p org-list-two-spaces-after-bullet-regexp
-				  (match-string 1)))
-	     2
-	   1)))))
+    (looking-at "[ \t]*\\(\\S-+\\)")
+    (+ (progn (goto-char (match-end 1)) (current-column))
+       (if (and org-list-two-spaces-after-bullet-regexp
+		(string-match-p org-list-two-spaces-after-bullet-regexp
+				(match-string 1)))
+	   2
+	 1))))
 
 
 

+ 2 - 4
lisp/org.el

@@ -21100,10 +21100,8 @@ Indentation is done according to the following rules:
        definitions and inline tasks, indent like its first line.
 
     2. If element has a parent, indent like its contents.  More
-       precisely, if parent is an item, indent after the
-       description part, if any, or the bullet (see
-       `org-list-description-max-indent').  Else, indent like
-       parent's first line.
+       precisely, if parent is an item, indent after the bullet.
+       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.