From 683df456a41a2b0e308bdbf746f5db0235a6058a Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Thu, 31 Jan 2019 00:20:09 +0100 Subject: [PATCH] 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. --- etc/ORG-NEWS | 6 ++++++ lisp/org-list.el | 34 +++++++--------------------------- lisp/org.el | 6 ++---- 3 files changed, 15 insertions(+), 31 deletions(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 5a12abb37..e112eebcc 100644 --- a/etc/ORG-NEWS +++ b/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 diff --git a/lisp/org-list.el b/lisp/org-list.el index 425f77f4f..88fcc6e96 100644 --- a/lisp/org-list.el +++ b/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)))) diff --git a/lisp/org.el b/lisp/org.el index e009cb62c..f018d0f94 100644 --- a/lisp/org.el +++ b/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. -- 2.11.4.GIT