emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: D <d.williams@posteo.net>
To: emacs-orgmode@gnu.org
Subject: org-hide-leading-stars-before-indent-mode
Date: Wed, 19 Feb 2020 21:59:05 +0100	[thread overview]
Message-ID: <9408b6f4-2180-98bd-92b7-415f739d99a4@posteo.net> (raw)

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.

             reply	other threads:[~2020-02-19 20:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-19 20:59 D [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9408b6f4-2180-98bd-92b7-415f739d99a4@posteo.net \
    --to=d.williams@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).