* Local variables in org files
@ 2014-01-09 15:21 Michael Albinus
2014-01-09 16:05 ` Nick Dokos
0 siblings, 1 reply; 12+ messages in thread
From: Michael Albinus @ 2014-01-09 15:21 UTC (permalink / raw)
To: emacs-orgmode@gnu.org
Hi,
I'm trying to save the result of "M-x debbugs-org" into a file (this is
a TODO list). For further handling, also some buffer local variables
must survive. Therefore, I append at the very end of that file something
like this:
* Local Variables
** Local Variables:
** eval: (debbugs-org-mode 1)
** debbugs-org-ids: (1 2 3)
** End:
This has the nice effect, that those variables do not disturb in
overview mode, because they look like
* Local Variables...
Being invisible would be even better, but so what.
Unfortunately, the value of debbugs-org-ids could be very loooong,
exceeding the 3000 chars limit the "Local Variables:" section size is
allowed to be in Emacs. So I must rearrange things like this:
* Local Variables
** debbugs-org-ids: (1 2 3)
** Local Variables:
** eval: (debbugs-org-mode 1)
** debbugs-org-ids: (access-the-value-above)
** End:
Is there some functionality in org I could use implementing
`access-the-value-above'? It is org structure, so I'm hoping there is an
easy way to access a given node with a well defined position.
Or maybe there is already a clever way storing local variables in an org
file, which I'm not aware of.
Thanks, and best regards, Michael.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Local variables in org files
2014-01-09 15:21 Local variables in org files Michael Albinus
@ 2014-01-09 16:05 ` Nick Dokos
2014-01-09 20:51 ` Michael Albinus
0 siblings, 1 reply; 12+ messages in thread
From: Nick Dokos @ 2014-01-09 16:05 UTC (permalink / raw)
To: emacs-orgmode
Michael Albinus <michael.albinus@gmx.de> writes:
> Hi,
>
> I'm trying to save the result of "M-x debbugs-org" into a file (this is
> a TODO list). For further handling, also some buffer local variables
> must survive. Therefore, I append at the very end of that file something
> like this:
>
> * Local Variables
> ** Local Variables:
> ** eval: (debbugs-org-mode 1)
> ** debbugs-org-ids: (1 2 3)
> ** End:
>
> This has the nice effect, that those variables do not disturb in
> overview mode, because they look like
>
> * Local Variables...
>
> Being invisible would be even better, but so what.
>
> Unfortunately, the value of debbugs-org-ids could be very loooong,
> exceeding the 3000 chars limit the "Local Variables:" section size is
> allowed to be in Emacs. So I must rearrange things like this:
>
> * Local Variables
> ** debbugs-org-ids: (1 2 3)
> ** Local Variables:
> ** eval: (debbugs-org-mode 1)
> ** debbugs-org-ids: (access-the-value-above)
> ** End:
>
> Is there some functionality in org I could use implementing
> `access-the-value-above'? It is org structure, so I'm hoping there is an
> easy way to access a given node with a well defined position.
>
> Or maybe there is already a clever way storing local variables in an org
> file, which I'm not aware of.
>
> Thanks, and best regards, Michael.
Not sure if there are any limits for the top style but maybe you could
combine the two styles of local variables - maybe:
--8<---------------cut here---------------start------------->8---
# -*- foo: (1 2 3 4) -*-
* foo
#+BEGIN_SRC elisp
debbugs-org-ids
#+END_SRC
#+RESULTS:
| 1 | 2 | 3 | 4 |
* COMMENT Local variables
** Local Variables:
** eval: (setq debbugs-org-ids foo)
** End:
--8<---------------cut here---------------end--------------->8---
Nick
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Local variables in org files
2014-01-09 16:05 ` Nick Dokos
@ 2014-01-09 20:51 ` Michael Albinus
2014-01-09 21:39 ` Sebastien Vauban
0 siblings, 1 reply; 12+ messages in thread
From: Michael Albinus @ 2014-01-09 20:51 UTC (permalink / raw)
To: Nick Dokos; +Cc: emacs-orgmode
Nick Dokos <ndokos@gmail.com> writes:
> Not sure if there are any limits for the top style but maybe you could
> combine the two styles of local variables - maybe:
>
> # -*- foo: (1 2 3 4) -*-
This would move the problem to the headline. No idea, whether there is a
limit (to be tested). But this extremely long and ugly headline would be
visible - nothing I like to offer :-(
But maybe we don't need the Local Variables block? Code blocks could help?
--8<---------------cut here---------------start------------->8---
* COMMENT Local Variables
#+NAME: init
#+BEGIN_SRC elisp
(set (make-local-variable 'debbugs-org-ids) '(1 2 3))
#+END_SRC
#+CALL: init
--8<---------------cut here---------------end--------------->8---
However, I must have misread the documentation. The "#+CALL: init"
directive has no effect when loading a respective xxx.org file :-(
Best regards, Michael.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Local variables in org files
2014-01-09 20:51 ` Michael Albinus
@ 2014-01-09 21:39 ` Sebastien Vauban
2014-01-09 22:15 ` Michael Albinus
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Sebastien Vauban @ 2014-01-09 21:39 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Hello Michael,
Michael Albinus wrote:
> Nick Dokos <ndokos-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
>> Not sure if there are any limits for the top style but maybe you could
>> combine the two styles of local variables - maybe:
>>
>> # -*- foo: (1 2 3 4) -*-
>
> This would move the problem to the headline. No idea, whether there is a
> limit (to be tested). But this extremely long and ugly headline would be
> visible - nothing I like to offer :-(
>
> But maybe we don't need the Local Variables block? Code blocks could help?
>
> * COMMENT Local Variables
>
> #+NAME: init
> #+BEGIN_SRC elisp
> (set (make-local-variable 'debbugs-org-ids) '(1 2 3))
> #+END_SRC
>
> #+CALL: init
>
> However, I must have misread the documentation. The "#+CALL: init"
> directive has no effect when loading a respective xxx.org file :-(
Nope, it doesn't, but you can add an `eval' directive in your Local
Variables section, and evaluate a call to the init block, like this:
--8<---------------cut here---------------start------------->8---
# Local variables:
# eval: (sbe "init")
# End:
--8<---------------cut here---------------end--------------->8---
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Local variables in org files
2014-01-09 21:39 ` Sebastien Vauban
@ 2014-01-09 22:15 ` Michael Albinus
2014-01-09 22:29 ` Nick Dokos
2014-01-10 6:23 ` Thomas S. Dye
2 siblings, 0 replies; 12+ messages in thread
From: Michael Albinus @ 2014-01-09 22:15 UTC (permalink / raw)
To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ
"Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
writes:
> Hello Michael,
Hi Sebastien,
>> However, I must have misread the documentation. The "#+CALL: init"
>> directive has no effect when loading a respective xxx.org file :-(
>
> Nope, it doesn't, but you can add an `eval' directive in your Local
> Variables section, and evaluate a call to the init block, like this:
>
> # Local variables:
> # eval: (sbe "init")
> # End:
That does the trick. Thanks a lot!
> Best regards,
> Seb
Best regards, Michael.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Local variables in org files
2014-01-09 21:39 ` Sebastien Vauban
2014-01-09 22:15 ` Michael Albinus
@ 2014-01-09 22:29 ` Nick Dokos
2014-01-11 9:25 ` Bastien
2014-01-10 6:23 ` Thomas S. Dye
2 siblings, 1 reply; 12+ messages in thread
From: Nick Dokos @ 2014-01-09 22:29 UTC (permalink / raw)
To: emacs-orgmode
"Sebastien Vauban" <sva-news@mygooglest.com>
writes:
> Hello Michael,
>
> Michael Albinus wrote:
>> Nick Dokos <ndokos@gmail.com> writes:
>>
>>> Not sure if there are any limits for the top style but maybe you could
>>> combine the two styles of local variables - maybe:
>>>
>>> # -*- foo: (1 2 3 4) -*-
>>
>> This would move the problem to the headline. No idea, whether there is a
>> limit (to be tested). But this extremely long and ugly headline would be
>> visible - nothing I like to offer :-(
>>
>> But maybe we don't need the Local Variables block? Code blocks could help?
>>
>> * COMMENT Local Variables
>>
>> #+NAME: init
>> #+BEGIN_SRC elisp
>> (set (make-local-variable 'debbugs-org-ids) '(1 2 3))
>> #+END_SRC
>>
>> #+CALL: init
>>
>> However, I must have misread the documentation. The "#+CALL: init"
>> directive has no effect when loading a respective xxx.org file :-(
>
> Nope, it doesn't, but you can add an `eval' directive in your Local
> Variables section, and evaluate a call to the init block, like this:
>
> # Local variables:
> # eval: (sbe "init")
> # End:
>
Nice!
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Local variables in org files
2014-01-09 21:39 ` Sebastien Vauban
2014-01-09 22:15 ` Michael Albinus
2014-01-09 22:29 ` Nick Dokos
@ 2014-01-10 6:23 ` Thomas S. Dye
2 siblings, 0 replies; 12+ messages in thread
From: Thomas S. Dye @ 2014-01-10 6:23 UTC (permalink / raw)
To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ
Aloha Seb,
"Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
writes:
> Nope, it doesn't, but you can add an `eval' directive in your Local
> Variables section, and evaluate a call to the init block, like this:
>
> # Local variables:
> # eval: (sbe "init")
> # End:
>
> Best regards,
> Seb
Thanks for this!
All the best,
Tom
--
Thomas S. Dye
http://www.tsdye.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Local variables in org files
2014-01-09 22:29 ` Nick Dokos
@ 2014-01-11 9:25 ` Bastien
2014-01-11 11:37 ` Sebastien Vauban
2014-01-11 15:31 ` Nick Dokos
0 siblings, 2 replies; 12+ messages in thread
From: Bastien @ 2014-01-11 9:25 UTC (permalink / raw)
To: Nick Dokos; +Cc: emacs-orgmode
Nick Dokos <ndokos@gmail.com> writes:
>> # Local variables:
>> # eval: (sbe "init")
>> # End:
Nice! But why using the global prefix "sbe"?
Shouldn't we simply rename the macro to org-sbe?
--
Bastien
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Local variables in org files
2014-01-11 9:25 ` Bastien
@ 2014-01-11 11:37 ` Sebastien Vauban
2014-01-12 11:43 ` Bastien
2014-01-11 15:31 ` Nick Dokos
1 sibling, 1 reply; 12+ messages in thread
From: Sebastien Vauban @ 2014-01-11 11:37 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Bastien,
Bastien wrote:
> Nick Dokos <ndokos-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
>>> # Local variables:
>>> # eval: (sbe "init")
>>> # End:
>
> Nice! But why using the global prefix "sbe"?
>
> Shouldn't we simply rename the macro to org-sbe?
It would make sense to be prefixed by `org' (or `ob' or ...) somehow.
`sbe' in itself is quite cryptic, even if it's the (quite logical)
abbreviation of "source block evaluate".
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Local variables in org files
2014-01-11 9:25 ` Bastien
2014-01-11 11:37 ` Sebastien Vauban
@ 2014-01-11 15:31 ` Nick Dokos
2014-01-11 21:08 ` Sebastien Vauban
1 sibling, 1 reply; 12+ messages in thread
From: Nick Dokos @ 2014-01-11 15:31 UTC (permalink / raw)
To: emacs-orgmode
Bastien <bzg@gnu.org> writes:
> Nick Dokos <ndokos@gmail.com> writes:
>
>>> # Local variables:
>>> # eval: (sbe "init")
>>> # End:
>
> Nice! But why using the global prefix "sbe"?
>
> Shouldn't we simply rename the macro to org-sbe?
In the credit-where-credit-is-due department, it was Sebastien
Vauban who came up with this very nice tidbit.
--
Nick
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Local variables in org files
2014-01-11 15:31 ` Nick Dokos
@ 2014-01-11 21:08 ` Sebastien Vauban
0 siblings, 0 replies; 12+ messages in thread
From: Sebastien Vauban @ 2014-01-11 21:08 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Thanks Nick... but...
Nick Dokos wrote:
> Bastien <bzg-mXXj517/zsQ@public.gmane.org> writes:
>
>> Nick Dokos <ndokos-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>>
>>>> # Local variables:
>>>> # eval: (sbe "init")
>>>> # End:
>>
>> Nice! But why using the global prefix "sbe"?
>>
>> Shouldn't we simply rename the macro to org-sbe?
>
> In the credit-where-credit-is-due department, it was Sebastien
> Vauban who came up with this very nice tidbit.
"Give back to Caesar what is Caesar's"...
and take from Caesar everything what's not Caesar's [1] ;-)
Best regards,
Seb
[1] That solution was given by Dan Davison in December 2010
(see http://article.gmane.org/gmane.emacs.orgmode/34609).
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Local variables in org files
2014-01-11 11:37 ` Sebastien Vauban
@ 2014-01-12 11:43 ` Bastien
0 siblings, 0 replies; 12+ messages in thread
From: Bastien @ 2014-01-12 11:43 UTC (permalink / raw)
To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ
Hi Sebastien,
"Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
writes:
> It would make sense to be prefixed by `org' (or `ob' or ...)
> somehow.
It's now named `org-sbe'.
> `sbe' in itself is quite cryptic, even if it's the (quite logical)
> abbreviation of "source block evaluate".
Yes, we can add a good alias at some point.
--
Bastien
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2014-01-12 11:44 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-09 15:21 Local variables in org files Michael Albinus
2014-01-09 16:05 ` Nick Dokos
2014-01-09 20:51 ` Michael Albinus
2014-01-09 21:39 ` Sebastien Vauban
2014-01-09 22:15 ` Michael Albinus
2014-01-09 22:29 ` Nick Dokos
2014-01-11 9:25 ` Bastien
2014-01-11 11:37 ` Sebastien Vauban
2014-01-12 11:43 ` Bastien
2014-01-11 15:31 ` Nick Dokos
2014-01-11 21:08 ` Sebastien Vauban
2014-01-10 6:23 ` Thomas S. Dye
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).