From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marco Wahl Subject: Re: Is it generally better practice to specify local variables at the first line for Org files? Date: Wed, 05 Oct 2016 08:40:47 +0200 Message-ID: <84vax7uwls.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40332) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brftX-0000EH-2h for emacs-orgmode@gnu.org; Wed, 05 Oct 2016 02:41:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1brftS-0002nc-VU for emacs-orgmode@gnu.org; Wed, 05 Oct 2016 02:41:34 -0400 Received: from [195.159.176.226] (port=57125 helo=blaine.gmane.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brftS-0002mx-OK for emacs-orgmode@gnu.org; Wed, 05 Oct 2016 02:41:30 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1brft2-0005xl-IP for emacs-orgmode@gnu.org; Wed, 05 Oct 2016 08:41:04 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Hi Jorge! > 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. Yes. > 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. Yes. > 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. I have the same issue. Currently I try to have an extra eye on the bottommost org tree. I also use an extra tag to mark the org tree which should be bottommost. I also use the idea stated in http://www.mail-archive.com/emacs-orgmode@gnu.org/msg106940.html which sorts the wanted org tree to the bottom when sorting. For me this works reasonably well. When you put the local variables to the top of the file you are on the save side AFAICT. I try to avoid too much information in the first line. I prefer to have the variables at the bottom. Best regards, -- Marco