From mboxrd@z Thu Jan 1 00:00:00 1970 From: D Subject: org-hide-leading-stars-before-indent-mode Date: Wed, 19 Feb 2020 21:59:05 +0100 Message-ID: <9408b6f4-2180-98bd-92b7-415f739d99a4@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:53918) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4WR5-0008OR-3Q for emacs-orgmode@gnu.org; Wed, 19 Feb 2020 15:59:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j4WR3-0004zw-W8 for emacs-orgmode@gnu.org; Wed, 19 Feb 2020 15:59:10 -0500 Received: from mout01.posteo.de ([185.67.36.65]:51764) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j4WR3-0004zn-Gf for emacs-orgmode@gnu.org; Wed, 19 Feb 2020 15:59:09 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 45C2916005C for ; Wed, 19 Feb 2020 21:59:07 +0100 (CET) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 48N97Z5CJ8z6tm6 for ; Wed, 19 Feb 2020 21:59:06 +0100 (CET) Content-Language: en-US List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org 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.