[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org b967a05 24/85: org-indent: Allow indentation per le
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org b967a05 24/85: org-indent: Allow indentation per level to be 0 |
Date: |
Mon, 27 Sep 2021 15:57:42 -0400 (EDT) |
branch: externals/org
commit b967a05fbcffdb2d37618a1891a75cdc79b9f0eb
Author: David Lukes <dafydd.lukes@gmail.com>
Commit: Bastien <bzg@gnu.org>
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
---
lisp/org-indent.el | 49 +++++++++++++++++++++++++------------------------
1 file changed, 25 insertions(+), 24 deletions(-)
diff --git a/lisp/org-indent.el b/lisp/org-indent.el
index ea7ea07..b87cc4e 100644
--- a/lisp/org-indent.el
+++ b/lisp/org-indent.el
@@ -126,31 +126,32 @@ 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))
- (dotimes (n org-indent--deepest-level)
- (let ((indentation (if (<= n 1) 0
- (* (1- org-indent-indentation-per-level)
- (1- n)))))
- ;; Headlines line prefixes.
- (let ((heading-prefix (make-string indentation ?*)))
- (aset org-indent--heading-line-prefixes
+ (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)
+ (1- n)))))
+ ;; Headlines line prefixes.
+ (let ((heading-prefix (make-string indentation ?*)))
+ (aset org-indent--heading-line-prefixes
+ n
+ (org-add-props heading-prefix nil 'face 'org-indent))
+ ;; Inline tasks line prefixes
+ (aset org-indent--inlinetask-line-prefixes
+ n
+ (cond ((<= n 1) "")
+ ((bound-and-true-p org-inlinetask-show-first-star)
+ (concat org-indent-inlinetask-first-star
+ (substring heading-prefix 1)))
+ (t (org-add-props heading-prefix nil 'face
'org-indent)))))
+ ;; Text line prefixes.
+ (aset org-indent--text-line-prefixes
n
- (org-add-props heading-prefix nil 'face 'org-indent))
- ;; Inline tasks line prefixes
- (aset org-indent--inlinetask-line-prefixes
- n
- (cond ((<= n 1) "")
- ((bound-and-true-p org-inlinetask-show-first-star)
- (concat org-indent-inlinetask-first-star
- (substring heading-prefix 1)))
- (t (org-add-props heading-prefix nil 'face 'org-indent)))))
- ;; Text line prefixes.
- (aset org-indent--text-line-prefixes
- n
- (org-add-props
- (concat (make-string (+ n indentation) ?\s)
- (and (> n 0)
- (char-to-string org-indent-boundary-char)))
- nil 'face 'org-indent)))))
+ (org-add-props
+ (concat (make-string (+ n indentation) ?\s)
+ (and (> n 0)
+ (char-to-string org-indent-boundary-char)))
+ nil 'face 'org-indent))))))
(defsubst org-indent-remove-properties (beg end)
"Remove indentations between BEG and END."
- [elpa] externals/org fb75741 09/85: lisp/ob-gnuplot.el: Add Ihor Radchenko as maintainer, (continued)
- [elpa] externals/org fb75741 09/85: lisp/ob-gnuplot.el: Add Ihor Radchenko as maintainer, ELPA Syncer, 2021/09/27
- [elpa] externals/org e64d5bc 17/85: Merge branch 'bugfix', ELPA Syncer, 2021/09/27
- [elpa] externals/org 9364b2d 35/85: lisp/ox-html.el: Restore org-svg class., ELPA Syncer, 2021/09/27
- [elpa] externals/org d9fcd07 62/85: Backport commit 43c1ee90c from Emacs, ELPA Syncer, 2021/09/27
- [elpa] externals/org 87a8229 60/85: org.el: Use org-contrib module instead of CONTRIB dir in docs, ELPA Syncer, 2021/09/27
- [elpa] externals/org d9d5594 66/85: Merge branch 'km/from-emacs-master', ELPA Syncer, 2021/09/27
- [elpa] externals/org ca441be 71/85: lisp/oc.el: Fix typo in comment string, ELPA Syncer, 2021/09/27
- [elpa] externals/org db167b9 81/85: Do not use mark-whole-buffer noninteractively, ELPA Syncer, 2021/09/27
- [elpa] externals/org c80fea7 82/85: lisp/oc.el: Fix docstring wrapping, ELPA Syncer, 2021/09/27
- [elpa] externals/org 2d2f774 16/85: Merge branch 'bugfix', ELPA Syncer, 2021/09/27
- [elpa] externals/org b967a05 24/85: org-indent: Allow indentation per level to be 0,
ELPA Syncer <=
- [elpa] externals/org e0bf528 30/85: CONTRIBUTE: Update to follow the new structure of doc/, ELPA Syncer, 2021/09/27
- [elpa] externals/org bf1c4c7 22/85: Include support for evaluating julia code, ELPA Syncer, 2021/09/27
- [elpa] externals/org c0ca5e3 29/85: CONTRIBUTE: Fix typo, ELPA Syncer, 2021/09/27
- [elpa] externals/org 4651121 45/85: Merge branch 'bugfix', ELPA Syncer, 2021/09/27
- [elpa] externals/org 98fd6d5 56/85: Remove references to deleted packages, ELPA Syncer, 2021/09/27
- [elpa] externals/org 6300e0e 84/85: test-org-protocol.el: Decode "+" to " " tests, ELPA Syncer, 2021/09/27
- [elpa] externals/org 4b7d80c 50/85: Add faces to improve contextuality of agenda views, ELPA Syncer, 2021/09/27
- [elpa] externals/org d74a824 54/85: org.el (org-fontify-extend-region): Fix headline fontification in edge case, ELPA Syncer, 2021/09/27
- [elpa] externals/org 54c2327 49/85: Allow :var header args to be assigned to cons cells, ELPA Syncer, 2021/09/27
- [elpa] externals/org e0535fa 39/85: ob-sql.el (org-babel-expand-body:sql): Support :prologue :epilogue, ELPA Syncer, 2021/09/27