emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Buffer *temp* modified; kill anyway?


From: Nick Dokos
Subject: Re: [Orgmode] Buffer *temp* modified; kill anyway?
Date: Wed, 04 Mar 2009 17:26:55 -0500

Nick Dokos <address@hidden> wrote:

> Bill White <address@hidden> wrote:
> 
> > On Wed Mar 04 2009 at 12:38, Nick Dokos <address@hidden> wrote:
> > 
> > > Bill White <address@hidden> 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 "<pre\\([^>]*\\)>\n?" rtn)


Nick




reply via email to

[Prev in Thread] Current Thread [Next in Thread]