org-indent: Allow indentation per level to be 0
* lisp/org-indent.el (org-indent--compute-prefixes): Prefixes should only be computed when `org-indent-indentation-per-level' is greater than 0. For one thing, the current algorithm leads to an error otherwise, and for another, this makes it possible to use org-indent just to preserve indentation on continuation lines, without adding any additional indentation per level (by setting the option to 0). TINYCHANGE
This commit is contained in:
parent
e626185081
commit
b967a05fbc
|
@ -126,6 +126,7 @@ useful to make it ever so slightly different."
|
|||
(make-vector org-indent--deepest-level nil))
|
||||
(setq org-indent--text-line-prefixes
|
||||
(make-vector org-indent--deepest-level nil))
|
||||
(when (> org-indent-indentation-per-level 0)
|
||||
(dotimes (n org-indent--deepest-level)
|
||||
(let ((indentation (if (<= n 1) 0
|
||||
(* (1- org-indent-indentation-per-level)
|
||||
|
@ -150,7 +151,7 @@ useful to make it ever so slightly different."
|
|||
(concat (make-string (+ n indentation) ?\s)
|
||||
(and (> n 0)
|
||||
(char-to-string org-indent-boundary-char)))
|
||||
nil 'face 'org-indent)))))
|
||||
nil 'face 'org-indent))))))
|
||||
|
||||
(defsubst org-indent-remove-properties (beg end)
|
||||
"Remove indentations between BEG and END."
|
||||
|
|
Loading…
Reference in New Issue