mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-23 18:19:20 +00:00
Simplify and fix indentation code in lists
* org.el (org-indent-line-function): simplify code and remove bug that would insert a tab at the beginning of the line when trying to indent the item.
This commit is contained in:
parent
e1d10a7429
commit
e652a1ed85
17
lisp/org.el
17
lisp/org.el
|
@ -18665,7 +18665,7 @@ which make use of the date at the cursor."
|
||||||
(org-drawer-regexp (or org-drawer-regexp "\000"))
|
(org-drawer-regexp (or org-drawer-regexp "\000"))
|
||||||
(inline-task-p (and (featurep 'org-inlinetask)
|
(inline-task-p (and (featurep 'org-inlinetask)
|
||||||
(org-inlinetask-in-task-p)))
|
(org-inlinetask-in-task-p)))
|
||||||
column bpos bcol tpos tcol bullet btype bullet-type)
|
column bpos bcol tpos tcol)
|
||||||
;; Find the previous relevant line
|
;; Find the previous relevant line
|
||||||
(beginning-of-line 1)
|
(beginning-of-line 1)
|
||||||
(cond
|
(cond
|
||||||
|
@ -18700,22 +18700,11 @@ which make use of the date at the cursor."
|
||||||
(looking-at "[ \t]*\\(\\S-+\\)[ \t]*\\(\\(:?\\[@\\(:?start:\\)?[0-9]+\\][ \t]*\\)?\\[[- X]\\][ \t]*\\|.*? :: \\)?")
|
(looking-at "[ \t]*\\(\\S-+\\)[ \t]*\\(\\(:?\\[@\\(:?start:\\)?[0-9]+\\][ \t]*\\)?\\[[- X]\\][ \t]*\\|.*? :: \\)?")
|
||||||
(setq bpos (match-beginning 1) tpos (match-end 0)
|
(setq bpos (match-beginning 1) tpos (match-end 0)
|
||||||
bcol (progn (goto-char bpos) (current-column))
|
bcol (progn (goto-char bpos) (current-column))
|
||||||
tcol (progn (goto-char tpos) (current-column))
|
tcol (progn (goto-char tpos) (current-column)))
|
||||||
bullet (match-string 1)
|
|
||||||
bullet-type (if (string-match "[0-9]" bullet) "n" bullet))
|
|
||||||
(if (> tcol (+ bcol org-description-max-indent))
|
(if (> tcol (+ bcol org-description-max-indent))
|
||||||
(setq tcol (+ bcol 5)))
|
(setq tcol (+ bcol 5)))
|
||||||
(if (not itemp)
|
|
||||||
(setq column tcol)
|
|
||||||
(beginning-of-line 1)
|
|
||||||
(goto-char pos)
|
(goto-char pos)
|
||||||
(if (looking-at "\\S-")
|
(setq column (if itemp (org-get-indentation) tcol)))
|
||||||
(progn
|
|
||||||
(looking-at "[ \t]*\\(\\S-+\\)[ \t]*")
|
|
||||||
(setq bullet (match-string 1)
|
|
||||||
btype (if (string-match "[0-9]" bullet) "n" bullet))
|
|
||||||
(setq column (if (equal btype bullet-type) bcol tcol)))
|
|
||||||
(setq column (org-get-indentation)))))
|
|
||||||
;; This line has nothing special, look upside to get a clue about
|
;; This line has nothing special, look upside to get a clue about
|
||||||
;; what to do.
|
;; what to do.
|
||||||
(t
|
(t
|
||||||
|
|
Loading…
Reference in a new issue