From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Feature Request: Disable auto-insert-mode exporting Date: Fri, 28 Oct 2011 18:51:32 +0200 Message-ID: <4FE0198B-B467-4195-A951-4ECDD3AC48EE@gmail.com> References: <4ea9b1b7.d185ec0a.0baf.08ab@mx.google.com> <25696.1319749435@alphaville.dokosmarshall.org> <4eaa3475.8a8bec0a.2080.6725@mx.google.com> <8FB20284-B3A5-49B7-9F38-96D6368984FD@gmail.com> <4eaad85d.a8afec0a.3325.fffff37f@mx.google.com> <4845.1319820359@alphaville.americas.hpqcorp.net> Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:59450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJpee-00080t-Oe for emacs-orgmode@gnu.org; Fri, 28 Oct 2011 12:51:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RJped-00009G-Gz for emacs-orgmode@gnu.org; Fri, 28 Oct 2011 12:51:40 -0400 Received: from mail-ey0-f169.google.com ([209.85.215.169]:50164) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJped-00009A-8D for emacs-orgmode@gnu.org; Fri, 28 Oct 2011 12:51:39 -0400 Received: by eye4 with SMTP id 4so4199146eye.0 for ; Fri, 28 Oct 2011 09:51:37 -0700 (PDT) In-Reply-To: <4845.1319820359@alphaville.americas.hpqcorp.net> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: Orgmode Mailing List On 28.10.2011, at 18:45, Nick Dokos wrote: > Darlan Cavalcante Moreira wrote: >=20 >>=20 >> Thanks Carsten, >> That's great. >>=20 >> I tested without the advice it worked as expected for both exporters. >>=20 >> I would be surprised if anyone could give a reason to keep the AUCTeX = query >> or the auto-insert stuff, at least without modifying org-export. = That's >> because the export process replaces anything in the new buffer, be it = the >> file variables inserted by AUCTeX or the content inserted by = auto-insert, >> with the result from the export. >>=20 >=20 > I presume there are no problems if somebody is *not* using auctex = and/or > auto-insert: correct? If org-export does essentially the same thing = that > the advice below does, it should not cause any problems, but... It works exactly the same, just temporarily turning off these features = for the creation of new export buffers. >=20 > OTOH, if it breaks innocent users, then it should not be implemented: = that > would be the only reason I can think of. I don't expect any problems, but we will see. - Carsten >=20 > Nick >=20 >> -- >> Darlan >>=20 >> At Fri, 28 Oct 2011 10:43:00 +0200, >> Carsten Dominik wrote: >>>=20 >>>=20 >>> On 28.10.2011, at 06:49, Darlan Cavalcante Moreira wrote: >>>=20 >>>>=20 >>>> Thanks Nick, >>>>=20 >>>> You right, the master file question comes from auctex. But with = your code >>>> it's simple to add the relevant variable to solve the issue. The = final >>>> function is >>>> --8<---------------cut here---------------start------------->8--- >>>> (defadvice org-export (around org-export-no-auto-insert) >>>> (let ((auto-insert nil) >>>> (TeX-master t) >>>> ) >>>> ad-do-it)) >>>=20 >>>=20 >>> Ahh, that has been bothering me for many years, thanks for this = solution. >>> I have made this behavior (as well as turning off auto-insert) now >>> standard in Org-mode, so the advice will no longer be needed. >>>=20 >>> Or, can anyone come up with a reason why the AUCTeX query or = auto-insert >>> stuff could be useful when creating new files during Org-mode = export? >>>=20 >>> - Carsten >>>=20 >>>=20 >>>>=20 >>>> (ad-activate 'org-export) >>>> --8<---------------cut here---------------end--------------->8--- >>>>=20 >>>> -- >>>> Darlan >>>>=20 >>>> At Thu, 27 Oct 2011 17:03:55 -0400, >>>> Nick Dokos wrote: >>>>>=20 >>>>> Darlan Cavalcante Moreira wrote: >>>>>=20 >>>>>>=20 >>>>>> I consider auto-insert-mode to be a very useful feature in Emacs = and it >>>>>> works great in most situations, except when exporting an org-mode = buffer. >>>>>>=20 >>>>>> If I export to PDF or HTML, for instance, then org-mode creates a = TeX or an >>>>>> HTML buffer and auto-insert kicks-in in both cases (asking for = the title in >>>>>> the HTML buffer, or the master file in the TeX buffer). Whatever = I write >>>>>> will be overwritten by the org-mode exporter and the file exports = just >>>>>> fine, but this interruption is annoying. >>>>>>=20 >>>>>=20 >>>>> I don't think the master file question comes from auto-insert - I = believe >>>>> it comes from auctex. In particular, I get the question but I = don't have >>>>> auto-insert enabled for latex. >>>>>=20 >>>>>> I suppose I could create a function that disable = auto-insert-mode, call >>>>>> org-export and then re-enable auto-insert-mode, but maybe this = should be >>>>>> the default behaviour of org-mode export. Does this make sense? >>>>>>=20 >>>>>=20 >>>>> You can advise org-export: >>>>>=20 >>>>> (defadvice org-export (around org-export-no-auto-insert) >>>>> (let ((auto-insert nil)) >>>>> ad-do-it)) >>>>>=20 >>>>> (ad-activate 'org-export) >>>>>=20 >>>>> should do it (untested). >>>>>=20 >>>>> Nick >>>>=20 >>>=20 >>=20 > tex