From: Max Nikulin <manikulin@gmail.com>
To: Joseph Turner <joseph@breatheoutbreathe.in>, emacs-orgmode@gnu.org
Cc: bohonghuang@qq.com
Subject: Re: Ignore Local Variables list in source blocks
Date: Fri, 20 Dec 2024 21:46:03 +0700 [thread overview]
Message-ID: <e9c48f83-91ad-4129-914d-a18eb10bbe51@gmail.com> (raw)
In-Reply-To: <87zfkr4amw.fsf@breatheoutbreathe.in>
On 20/12/2024 04:37, Joseph Turner wrote:
> Max Nikulin writes:
>> Have you tried to create a comment block below?
>>
>> #+begin_comment
>> Deactivate local variables above in the example block:
>> Local Variables:
>> End:
>> #+end_comment
>
> In my testing, in order to make Emacs ignore the `foo: bar' binding, the
> empty Local Variables list actually needs to go first.
Then it is more fragile in the case of complex documents, but still may
be viable for simple ones with single example.
> Splitting the example into two parts results in "File mode specification
> error: (user-error Local variables entry is missing the prefix) " upon
> opening the file.
I expected that the code looking up for local variables is reasonably shy.
> You can test with this:
> #+BEGIN_SRC org
> # Local Variables:
> #+END_SRC
>
> #+BEGIN_SRC org
> # org-srs-review-new-items-per-day: 30
> # org-srs-review-max-reviews-per-day: 100
> # End:
> #+END_SRC
Unfortunately
: # Local Variables:
#+BEGIN_EXAMPLE
# org-srs-review-new-items-per-day: 30
# org-srs-review-max-reviews-per-day: 100
# End:
#+END_EXAMPLE
Causes a warning as well:
"Local variables list is not properly terminated"
>> (info "(emacs) Specifying File Variables")
>
> By the way, is there a built-in command to copy that (info ...) sexp
> when viewing that info page?
A short answer "C-0 c" or "C-0 w". Maybe I will send a longer one,
dropping bohonghuang from Cc.
>> <https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html>
>
> Thanks, I just re-read that page more carefully, and I see this:
>
> If some unrelated text might look to Emacs as a local variables
> list, you can countermand that by inserting a form-feed character (a
> page delimiter, *note Pages::) after that text. Emacs only looks for
> file-local variables in the last page of a file, after the last page
> delimiter.
I do not like non-printable characters. E.g. Thunderbird rendered your
message with confusingly large vertical space in the middle. Outside of
Emacs, kludges like ";;; org.el ends here" are not common. I would not
be surprised by some issues on attempt to edit the README.org file on
the GitHub site directly.
next prev parent reply other threads:[~2024-12-20 14:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-18 4:13 Ignore Local Variables list in source blocks Joseph Turner
2024-12-18 17:16 ` Max Nikulin
2024-12-19 21:37 ` Joseph Turner via General discussions about Org-mode.
2024-12-20 14:46 ` Max Nikulin [this message]
2024-12-20 14:53 ` Nikolaos Chatzikonstantinou
2024-12-21 2:13 ` Joseph Turner
2024-12-21 2:13 ` Joseph Turner
2024-12-21 2:11 ` Joseph Turner
2024-12-20 15:37 ` Copy info node name (was: Re: Ignore Local Variables list in source blocks) Max Nikulin
-- strict thread matches above, loose matches on Subject: below --
2024-12-18 4:12 Ignore Local Variables list in source blocks Joseph Turner
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e9c48f83-91ad-4129-914d-a18eb10bbe51@gmail.com \
--to=manikulin@gmail.com \
--cc=bohonghuang@qq.com \
--cc=emacs-orgmode@gnu.org \
--cc=joseph@breatheoutbreathe.in \
/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 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.