all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: nicholas.dokos@hp.com
Cc: emacs-orgmode@gnu.org
Subject: Re: Buffer *temp* modified; kill anyway?
Date: Wed, 04 Mar 2009 17:26:55 -0500	[thread overview]
Message-ID: <11318.1236205615@alphaville.usa.hp.com> (raw)
In-Reply-To: Message from Nick Dokos <nicholas.dokos@hp.com> of "Wed, 04 Mar 2009 16:47:36 EST." <11062.1236203256@alphaville.usa.hp.com>

Nick Dokos <nicholas.dokos@hp.com> wrote:

> Bill White <billw@wolfram.com> wrote:
> 
> > On Wed Mar 04 2009 at 12:38, Nick Dokos <nicholas.dokos@hp.com> wrote:
> > 
> > > Bill White <billw@wolfram.com> 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	other threads:[~2009-03-04 22:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-04 17:26 Buffer *temp* modified; kill anyway? Bill White
2009-03-04 18:38 ` Nick Dokos
2009-03-04 19:57   ` Bill White
2009-03-04 21:47     ` Nick Dokos
2009-03-04 22:26       ` Nick Dokos [this message]
2009-03-05  4:55         ` Bill White

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11318.1236205615@alphaville.usa.hp.com \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.