From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Buffer *temp* modified; kill anyway? Date: Wed, 04 Mar 2009 17:26:55 -0500 Message-ID: <11318.1236205615@alphaville.usa.hp.com> References: <874oy9gpwo.fsf@wolfram.com> <9344.1236191912@alphaville.usa.hp.com> <87d4cxf4cd.fsf@wolfram.com> <11062.1236203256@alphaville.usa.hp.com> Reply-To: nicholas.dokos@hp.com Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LezZF-0003kR-Bz for emacs-orgmode@gnu.org; Wed, 04 Mar 2009 17:27:57 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LezZD-0003gp-0e for emacs-orgmode@gnu.org; Wed, 04 Mar 2009 17:27:56 -0500 Received: from [199.232.76.173] (port=51474 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LezZC-0003gS-RW for emacs-orgmode@gnu.org; Wed, 04 Mar 2009 17:27:54 -0500 Received: from g1t0027.austin.hp.com ([15.216.28.34]:11590) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LezZC-0007s0-Iu for emacs-orgmode@gnu.org; Wed, 04 Mar 2009 17:27:54 -0500 In-Reply-To: Message from Nick Dokos of "Wed, 04 Mar 2009 16:47:36 EST." <11062.1236203256@alphaville.usa.hp.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: emacs-orgmode@gnu.org Nick Dokos wrote: > Bill White wrote: > > > On Wed Mar 04 2009 at 12:38, Nick Dokos wrote: > > > > > Bill White wrote: > > > > > >> Hi all - > > >> > > >> "Buffer *temp* modified; kill anyway?" is driving me nuts. > > >> > > >> Has anyone seen this error message when html-exporting pages that > > >> contain #+begin_src ? I get this once for every #+begin_src > > >> ... #+end_src group on a page. I assume it's coming from htmlize.el, > > >> but I haven't been able to isolate the problem with edebug. I'm using > > >> the latest htmlize.el from > > >> http://fly.srk.fer.hr/~hniksic/emacs/htmlize.el > > >> > > >> Any ideas what's going on and how to silence it? If it weren't for this > > >> I'd be able to publish without babysitting the process through > > >> source-heavy files. > > >> > > > > > > Bill, > > > > > .... > > So I don't understand the difference in behavior between the two cases, > but maybe this provides enough detail for a better elisper than me to > understand and explain to the rest of us. > OK - I think I know why: the mode of the temp buffer is set according to the language in the begin_src construct: emacs-lisp-mode in one case, message-mode (and a bunch of minor modes) in the other. The difference is that the latter associates the buffer with a file, whereas the former does not. It's that difference that makes kill-buffer behave differently. I suspect that the thing to do is to mark the buffer unmodified. Here's a patch: diff --git a/lisp/org-exp.el b/lisp/org-exp.el index a0d1e5f..c20112f 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -2472,6 +2472,7 @@ Numbering lines works for all three major backends (html, latex, and ascii)." (funcall mode) (fundamental-mode)) (font-lock-fontify-buffer) + (set-buffer-modified-p nil) (org-export-htmlize-region-for-paste (point-min) (point-max)))) (if (string-match "]*\\)>\n?" rtn) Nick