From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alain.Cochard@unistra.fr Subject: Re: LaTeX chunk makes .org file not in Org mode Date: Fri, 16 Nov 2018 13:28:36 +0100 Message-ID: <23534.47092.122698.159146@frac.u-strasbg.fr> References: <23532.3306.739620.803473@frac.u-strasbg.fr> <877ehdxs1h.fsf@ucl.ac.uk> Reply-To: alain.cochard@unistra.fr Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNdF6-0003ex-6D for emacs-orgmode@gnu.org; Fri, 16 Nov 2018 07:29:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNdF2-0000Jr-MF for emacs-orgmode@gnu.org; Fri, 16 Nov 2018 07:28:59 -0500 Received: from smr2.u-strasbg.fr ([130.79.222.218]:51406 helo=mailhost.u-strasbg.fr) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gNdF2-0000BL-Fe for emacs-orgmode@gnu.org; Fri, 16 Nov 2018 07:28:56 -0500 In-Reply-To: <877ehdxs1h.fsf@ucl.ac.uk> 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: Eric S Fraga Cc: emacs-orgmode@gnu.org Eric S Fraga writes on Fri 16 Nov 2018 09:27: > On Wednesday, 14 Nov 2018 at 12:54, Alain.Cochard@unistra.fr wrote: > > Hello. I guess this is normal, but I wanted to report it in case > > there is room for improvement: > > > > After inserting a latex file into an .org file, I ended up with th= e > > following part in the org file (which was an agenda file): > > > > %%% Local Variables:=20 > > %%% mode: latex > > %%% TeX-master: t > > %%% End:=20 >=20 > [...] >=20 > > It the issue could somehow be made apparent to the user right away= > > (that is, when the chunk is inserted), it would be easier/faster t= o > > fix. >=20 > There's really nothing to fix. You've inserted some local variable > settings that take effect next time you visit the file. You've deci= ded > (not on purpose, I realize) that you want this file to be opened in > LaTeX mode and Emacs does what you said. I cannot imagine a fix tha= t > could catch this as it would require org to essentially parse the ne= w > contents as if it were all of Emacs and then somehow figure out what= had > been set that shouldn't have been set. Hi Eric, and thanks a lot for the feedback. By 'fix', I of course meant 'fix my own mistake'... I forgive myself here, though, because I have been using LaTeX for many years without having to pay any attention to this kind of chunks, which are (for me) inserted automatically. But it is certainly not obvious to me why the content of this chunk takes precedence over the file extension -- after all, the manual says: "Files with the =E2=80=98.org=E2=80=99 extension use Org mode by = default." I can certainly understand if the content cannot be examined after each insertion, but, as there are many things in Org which are done on the fly, I felt compelled to ask. (One could also imagine that Org would detect upon loading the file that there is a conflict between the modes -- but I also understand if this is not something reasonable to ask.) Regards, a. --=20 EOST (=C3=89cole et Observatoire des Sciences de la Terre)=20 IPG (Institut de Physique du Globe) | alain.cochard@unistra.fr 5 rue Ren=C3=A9 Descartes [bureau 106] | Phone: +33 (0)3 68 85 50 44=20= F-67084 Strasbourg Cedex, France | Fax: +33 (0)3 68 85 01 25 =20=