emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jorge Morais Neto <jorge13515@gmail.com>
To: org mode <Emacs-orgmode@gnu.org>
Subject: Is it generally better practice to specify local variables at the first line for Org files?
Date: Tue, 4 Oct 2016 17:36:45 -0300	[thread overview]
Message-ID: <CAJR3QnfTcq94-7-RkPESU=W0_Lm30nyguY9v8Eshi-ecQAc02g@mail.gmail.com> (raw)

Hi.  In most of my Emacs files, I set any file local variables using a local
variables list near the end of the file.  However I just realized a pitfall.
Emacs, according to its manual, only recognizes this local variables list if
its location fulfills two criteria:
1. It starts no more than 3000 characters from the end of the file.
2. It is on the last page if the file is divided into pages.

This means that if I refile some Org subtree to another Org file, and the
refile target is below the local variables list (e. g. if I refile to the top
level, so that Org chooses the end of the file) then the local variables list
may start failing one of the criteria and thus silently stop working.  There
may be other problematic scenarios.

Therefore it seems that, for Org files, it is good practice to avoid this
pitfall by specifying any file local variables via the other method, i.e. on
the first line.  I ask for confirmation that this is a general Org Mode good
practice before I adopt it for all my existing Org files and any future ones.

And if this is in fact a general Org Mode good practice, I propose documenting
it in both manuals: the Emacs manual at [[info:emacs#Specifying File Variables]]
and the Org manual somewhere.

Regards

-- 
• I am Brazilian.  I hope my English is correct and I welcome corrections.
• Please adopt free formats like PDF, ODF, Org, LaTeX, Opus, WebM and 7z.
• Free (as in free speech) software for Android: https://f-droid.org/

             reply	other threads:[~2016-10-04 20:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-04 20:36 Jorge Morais Neto [this message]
2016-10-05  6:40 ` Is it generally better practice to specify local variables at the first line for Org files? Marco Wahl
2016-10-05  9:33   ` Nicolas Goaziou
2016-10-05 11:35     ` John Kitchin
2016-10-05 13:50     ` Marco Wahl

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJR3QnfTcq94-7-RkPESU=W0_Lm30nyguY9v8Eshi-ecQAc02g@mail.gmail.com' \
    --to=jorge13515@gmail.com \
    --cc=Emacs-orgmode@gnu.org \
    /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 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).