emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-hide-leading-stars-before-indent-mode
@ 2020-02-19 20:59 D
  2020-02-19 21:42 ` org-hide-leading-stars-before-indent-mode Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: D @ 2020-02-19 20:59 UTC (permalink / raw)
  To: emacs-orgmode

Hi all,

I have come across this rather strange variable in org-indent, and was
wondering if someone could add a bit of documentation to clarify what it
actually does.

Currently, the variable org-hide-leading-stars-before-indent-mode is
only documented as "used locally".  However, upon closer inspection, the
first thing I noticed was that it is actually declared using "defvar"
instead of "defvar-local", which in turn would render the docstring
redundant as it would automatically append the message "this variable
becomes buffer local when set".  Is this intentional?  Looking at the
code it seems to be a throwaway variable remembering the initial value
of org-hide-leading-stars, restoring it buffer-locally when indent-mode
is turned off.  This leaves two questions for me:

1) Wouldn't it be clearer to use defvar-local for
org-hide-leading-stars-before-indent-mode and replace the docstring with
something like "Holds the original value of `org-hide-leading-stars'
before Org indent."

2) Considering that org-hide-leading-stars is global by default,
wouldn't it be even better to dispose of the temp variable entirely?
One could either use (kill-local-variable 'org-hide-leading-stars) or
(setq-local org-hide-leading-stars (default-value
'org-hide-leading-stars)) for the same effect.

Cheers,
D.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-02-20  0:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-19 20:59 org-hide-leading-stars-before-indent-mode D
2020-02-19 21:42 ` org-hide-leading-stars-before-indent-mode Bastien
2020-02-19 22:59   ` [PATCH] Re: org-hide-eading-stars-before-indent-mode D
2020-02-20  0:07     ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).