From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: LaTeX chunk makes .org file not in Org mode Date: Fri, 16 Nov 2018 09:27:05 +0000 Message-ID: <877ehdxs1h.fsf@ucl.ac.uk> References: <23532.3306.739620.803473@frac.u-strasbg.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNatl-0006wE-K2 for emacs-orgmode@gnu.org; Fri, 16 Nov 2018 04:58:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNath-0002tn-Ls for emacs-orgmode@gnu.org; Fri, 16 Nov 2018 04:58:49 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:33938) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gNata-0002rA-Pk for emacs-orgmode@gnu.org; Fri, 16 Nov 2018 04:58:42 -0500 Received: by mail-wr1-x434.google.com with SMTP id j26-v6so24217424wre.1 for ; Fri, 16 Nov 2018 01:58:38 -0800 (PST) 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: Alain.Cochard@unistra.fr Cc: emacs-orgmode@gnu.org 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 the > following part in the org file (which was an agenda file): > > %%% Local Variables: > %%% mode: latex > %%% TeX-master: t > %%% End: [...] > 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 to > fix. There's really nothing to fix. You've inserted some local variable settings that take effect next time you visit the file. You've decided (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 that could catch this as it would require org to essentially parse the new contents as if it were all of Emacs and then somehow figure out what had been set that shouldn't have been set. -- Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-894-gf79545