diff options
author | D. Williams <d.williams@posteo.net> | 2020-02-19 23:50:48 +0100 |
---|---|---|
committer | Bastien <bzg@gnu.org> | 2020-02-20 15:17:21 +0100 |
commit | 1b2de14d8444602ec619a0884b8c7cafd08c68d9 (patch) | |
tree | dddf553ec3bb8148af517564838f212e2904ae0d | |
parent | 5d2075abad761e4a8ab491a575a049394134d846 (diff) | |
download | org-mode-1b2de14d8444602ec619a0884b8c7cafd08c68d9.tar.gz |
org-indent.el: Deprecate `org-hide-leading-stars-before-indent-mode'
* lisp/org-indent.el (org-indent-mode): Make `org-hide-leading-stars'
buffer local and revert it back to it's global value when exiting the
mode without storing it's global value manually.
(org-hide-leading-stars-before-indent-mode): Remove declaration.
This commit implements my suggestion from the mailing list
(https://lists.gnu.org/archive/html/emacs-orgmode/2020-02/msg00759.html)
to rely on Emacs' native mechanisms for restoring a buffer-local
variable to it's global default value instead of storing the global
value in a temporary variable (in this case:
`org-hide-leading-stars-before-indent-mode').
TINYCHANGE
-rw-r--r-- | lisp/org-indent.el | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lisp/org-indent.el b/lisp/org-indent.el index c136a75..73b0779 100644 --- a/lisp/org-indent.el +++ b/lisp/org-indent.el @@ -71,8 +71,6 @@ Delay used when the buffer to initialize isn't current.") (defvar org-indent--initial-marker nil "Position of initialization before interrupt. This is used locally in each buffer being initialized.") -(defvar org-hide-leading-stars-before-indent-mode nil - "Used locally.") (defvar org-indent-modified-headline-flag nil "Non-nil means the last deletion operated on a headline. It is modified by `org-indent-notify-modified-headline'.") @@ -183,8 +181,6 @@ during idle time." (or (eq org-adapt-indentation 'headline-data) (setq-local org-adapt-indentation nil))) (when org-indent-mode-turns-on-hiding-stars - (setq-local org-hide-leading-stars-before-indent-mode - org-hide-leading-stars) (setq-local org-hide-leading-stars t)) (org-indent--compute-prefixes) (if (boundp 'filter-buffer-substring-functions) @@ -216,9 +212,8 @@ during idle time." (delq (current-buffer) org-indent-agentized-buffers)) (when (markerp org-indent--initial-marker) (set-marker org-indent--initial-marker nil)) - (when (boundp 'org-hide-leading-stars-before-indent-mode) - (setq-local org-hide-leading-stars - org-hide-leading-stars-before-indent-mode)) + (when (local-variable-p 'org-hide-leading-stars) + (kill-local-variable 'org-hide-leading-stars)) (if (boundp 'filter-buffer-substring-functions) (remove-hook 'filter-buffer-substring-functions (lambda (fun start end delete) |