[-- Attachment #1: Type: text/plain, Size: 616 bytes --] Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.17.6) The variable org-startup-folded does not work expected in .dir-locals.el.The option "#+startup: fold" works as expected. To replicate - start emacs -q - create a test dir - create or copy an .org file with a few headers, sub headers and some content in(to) the test dir. - add "((org-mode . ((org-startup-folded . t))))" to "./.dir-locals.el" - open the org file - check M-x describe-variable to confirm variable org-startup-folded is set to t and not default value thanks [-- Attachment #2: Type: text/html, Size: 1571 bytes --]
Hello Max,
On Tuesday, 3 May 2022 at 00:37, Max Fujimoto wrote:
> Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo
> version 1.17.6)
I must apologise for, I haven't made the jump to emacs 28 yet: GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.24) of 2022-01-16.
I'm on the following version of Org mode version 9.5.3 (release_9.5.3-467-g2bd34e @ /home/djj/src/org-mode/lisp/)
and I don't know where is .dir-locals.el.
but, with the following unfoled file /tmp/test.org
* Some Heading Title [0/2]
** TODO Some Todo Item
** TODO heading 3
the following command
$ emacs -Q -L ./lisp -l org --eval "(setq org-startup-folded t)"
/tmp/test.org
Produces your desired results
* Some Heading Title [0/2] ...
HTH,
Jeremie
Max Fujimoto <max.fujimoto@rogers.com> writes:
> Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.17.6)
>
> The variable org-startup-folded does not work expected in .dir-locals.el.The option "#+startup: fold" works as expected.
This is because Emacs loads directory-local variables _after_ Org mode
is loaded. That is, you set org-startup-folded after startup is
complete.
I recommend reporting this to Emacs bug tracker.
Best,
Ihor
>>>>> On Wed, 04 May 2022 18:37:47 +0800, Ihor Radchenko <yantar92@gmail.com> said:
Ihor> Max Fujimoto <max.fujimoto@rogers.com> writes:
>> Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.17.6)
>>
>> The variable org-startup-folded does not work expected in
>> .dir-locals.el.The option "#+startup: fold" works as expected.
Ihor> This is because Emacs loads directory-local variables _after_ Org mode
Ihor> is loaded. That is, you set org-startup-folded after startup is
Ihor> complete.
Ihor> I recommend reporting this to Emacs bug tracker.
I donʼt think this is a bug: directory-local variables are supposed to
behave the same as file-local variables, and setting
org-startup-folded in a local variable section also doesnʼt get
applied.
Robert
--
Robert Pluim <rpluim@gmail.com> writes:
> Ihor> I recommend reporting this to Emacs bug tracker.
>
> I donʼt think this is a bug: directory-local variables are supposed to
> behave the same as file-local variables, and setting
> org-startup-folded in a local variable section also doesnʼt get
> applied.
This is no different. org-startup-folded controls loading of Org mode.
However, Emacs applies directory-local variables and file-local
variables _after_ loading Org mode. Org cannot do much about it without
hacking Emacs defaults.
Best,
Ihor
>>>>> On Wed, 04 May 2022 21:46:14 +0800, Ihor Radchenko <yantar92@gmail.com> said:
Ihor> Robert Pluim <rpluim@gmail.com> writes:
Ihor> I recommend reporting this to Emacs bug tracker.
>>
>> I donʼt think this is a bug: directory-local variables are supposed to
>> behave the same as file-local variables, and setting
>> org-startup-folded in a local variable section also doesnʼt get
>> applied.
Ihor> This is no different. org-startup-folded controls loading of Org mode.
Ihor> However, Emacs applies directory-local variables and file-local
Ihor> variables _after_ loading Org mode. Org cannot do much about it without
Ihor> hacking Emacs defaults.
Weʼre in agreement there. My point is that itʼs not a bug (although I
guess you could ask for a feature to apply local/directory variables
before applying the mode, but in this case thereʼs an easy
workaround).
Robert
--
Robert Pluim <rpluim@gmail.com> writes: > Ihor> This is no different. org-startup-folded controls loading of Org mode. > Ihor> However, Emacs applies directory-local variables and file-local > Ihor> variables _after_ loading Org mode. Org cannot do much about it without > Ihor> hacking Emacs defaults. > > Weʼre in agreement there. My point is that itʼs not a bug (although I > guess you could ask for a feature to apply local/directory variables > before applying the mode It's not exactly a bug, but feature request to Emacs is exactly what I was implying. > , but in this case thereʼs an easy > workaround). I am not sure which workaround you are referring to. Setting org-startup-folded globally? On per-file basis? the former is global and will apply to broader scope than a directory-local variable. The latter only works in a single file (and works instead of file-local variable). Best, Ihor
>>>>> On Wed, 04 May 2022 22:46:56 +0800, Ihor Radchenko <yantar92@gmail.com> said:
Ihor> Robert Pluim <rpluim@gmail.com> writes:
Ihor> This is no different. org-startup-folded controls loading of Org mode.
Ihor> However, Emacs applies directory-local variables and file-local
Ihor> variables _after_ loading Org mode. Org cannot do much about it without
Ihor> hacking Emacs defaults.
>>
>> Weʼre in agreement there. My point is that itʼs not a bug (although I
>> guess you could ask for a feature to apply local/directory variables
>> before applying the mode
Ihor> It's not exactly a bug, but feature request to Emacs is exactly what I
Ihor> was implying.
Right. My predictatron says itʼs unlikely to be greeted
enthusiastically.
>> , but in this case thereʼs an easy
>> workaround).
Ihor> I am not sure which workaround you are referring to.
Ihor> Setting org-startup-folded globally? On per-file basis? the former is
Ihor> global and will apply to broader scope than a directory-local variable.
Ihor> The latter only works in a single file (and works instead of file-local
Ihor> variable).
I was talking about #+STARTUP: (Iʼm assuming #+SETUPFILE: also works,
but I haven't tried it).
Robert
--
[-- Attachment #1: Type: text/plain, Size: 1606 bytes --] Thanks for the info, I will look into reporting the issue with the emacs bug-tracker and for now use the per file "STARTUP:" option. thanks again On Wednesday, May 4, 2022, 11:04:42 a.m. EDT, Robert Pluim <rpluim@gmail.com> wrote: >>>>> On Wed, 04 May 2022 22:46:56 +0800, Ihor Radchenko <yantar92@gmail.com> said: Ihor> Robert Pluim <rpluim@gmail.com> writes: Ihor> This is no different. org-startup-folded controls loading of Org mode. Ihor> However, Emacs applies directory-local variables and file-local Ihor> variables _after_ loading Org mode. Org cannot do much about it without Ihor> hacking Emacs defaults. >> >> Weʼre in agreement there. My point is that itʼs not a bug (although I >> guess you could ask for a feature to apply local/directory variables >> before applying the mode Ihor> It's not exactly a bug, but feature request to Emacs is exactly what I Ihor> was implying. Right. My predictatron says itʼs unlikely to be greeted enthusiastically. >> , but in this case thereʼs an easy >> workaround). Ihor> I am not sure which workaround you are referring to. Ihor> Setting org-startup-folded globally? On per-file basis? the former is Ihor> global and will apply to broader scope than a directory-local variable. Ihor> The latter only works in a single file (and works instead of file-local Ihor> variable). I was talking about #+STARTUP: (Iʼm assuming #+SETUPFILE: also works, but I haven't tried it). Robert -- [-- Attachment #2: Type: text/html, Size: 3387 bytes --]
Robert Pluim <rpluim@gmail.com> writes:
> I was talking about #+STARTUP: (Iʼm assuming #+SETUPFILE: also works,
> but I haven't tried it).
FYI. #+SETUPFILE also does work.
Best,
Ihor