* Putting the value of page-delimiter in some outline regexps?
@ 2020-09-02 4:02 Eric Abrahamsen
2020-09-03 9:09 ` Nicolas Goaziou
0 siblings, 1 reply; 3+ messages in thread
From: Eric Abrahamsen @ 2020-09-02 4:02 UTC (permalink / raw
To: emacs-orgmode
Hi all,
I've been trying to find a way to cordon off the bottom of my Org files,
to create an area for file-local variables and "LocalWords" and what
have you that Org doesn't consider part of the file's final heading.
The usual Emacs thing to do seems to be using the value of
page-delimiter to demarcate the end of content, and the beginning of
meta data. I stuck that into the value of `org-outline-regexp', and also
hard-coded it into the "true heading" branch of `org-end-of-subtree'.
Over the past day this has worked fine for interactive use, and some
automatic Org-based tools. But I'm not so naive as to think that
catastrophic breakage couldn't be right around the corner as a result of
this!
Anyway, I wanted to see if anyone else had tried this, or had any ideas
about it.
Eric
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Putting the value of page-delimiter in some outline regexps?
2020-09-02 4:02 Putting the value of page-delimiter in some outline regexps? Eric Abrahamsen
@ 2020-09-03 9:09 ` Nicolas Goaziou
2020-09-03 16:43 ` Eric Abrahamsen
0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2020-09-03 9:09 UTC (permalink / raw
To: Eric Abrahamsen; +Cc: emacs-orgmode
Hello,
Eric Abrahamsen <eric@ericabrahamsen.net> writes:
> I've been trying to find a way to cordon off the bottom of my Org files,
> to create an area for file-local variables and "LocalWords" and what
> have you that Org doesn't consider part of the file's final heading.
>
> The usual Emacs thing to do seems to be using the value of
> page-delimiter to demarcate the end of content, and the beginning of
> meta data. I stuck that into the value of `org-outline-regexp', and also
> hard-coded it into the "true heading" branch of `org-end-of-subtree'.
> Over the past day this has worked fine for interactive use, and some
> automatic Org-based tools. But I'm not so naive as to think that
> catastrophic breakage couldn't be right around the corner as a result of
> this!
>
> Anyway, I wanted to see if anyone else had tried this, or had any ideas
> about it.
I think Org already puts some care into preserving file-local variables
at the end of the buffer, e.g., when moving around headlines. Maybe the
issues you're encountering can be fixed the same way.
Adding page delimiter in `org-outline-regexp' is clearly not subtle
enough in any case, as it would affect every headline, not only the last
one in the buffer.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Putting the value of page-delimiter in some outline regexps?
2020-09-03 9:09 ` Nicolas Goaziou
@ 2020-09-03 16:43 ` Eric Abrahamsen
0 siblings, 0 replies; 3+ messages in thread
From: Eric Abrahamsen @ 2020-09-03 16:43 UTC (permalink / raw
To: emacs-orgmode
Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
> Hello,
>
> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> I've been trying to find a way to cordon off the bottom of my Org files,
>> to create an area for file-local variables and "LocalWords" and what
>> have you that Org doesn't consider part of the file's final heading.
>>
>> The usual Emacs thing to do seems to be using the value of
>> page-delimiter to demarcate the end of content, and the beginning of
>> meta data. I stuck that into the value of `org-outline-regexp', and also
>> hard-coded it into the "true heading" branch of `org-end-of-subtree'.
>> Over the past day this has worked fine for interactive use, and some
>> automatic Org-based tools. But I'm not so naive as to think that
>> catastrophic breakage couldn't be right around the corner as a result of
>> this!
>>
>> Anyway, I wanted to see if anyone else had tried this, or had any ideas
>> about it.
>
> I think Org already puts some care into preserving file-local variables
> at the end of the buffer, e.g., when moving around headlines. Maybe the
> issues you're encountering can be fixed the same way.
Do you mean `org-preserve-local-variables'? I think it would make sense
to put `page-delimiter' in the re-search-backward regexp. We could also
consider putting in the value of some of the ispell-*-keyword constants,
but it might also be reasonable to just ask the user to hide all that
stuff under a page-delimiter.
This still doesn't stop `org-next-visible-heading' or
`org-end-of-subtree' from treating the end matter as part of the last
heading. This would only be a minor inconvenience if I weren't trying to
write some automatic tools on top of Org. But perhaps I should be making
my tools smarter, not insisting that Org get smarter.
> Adding page delimiter in `org-outline-regexp' is clearly not subtle
> enough in any case, as it would affect every headline, not only the last
> one in the buffer.
No, I guess I didn't really think that was going to be a practical
solution.
Thanks for considering this,
Eric
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-09-03 16:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-02 4:02 Putting the value of page-delimiter in some outline regexps? Eric Abrahamsen
2020-09-03 9:09 ` Nicolas Goaziou
2020-09-03 16:43 ` Eric Abrahamsen
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.