GNU bug report logs - #13197
24.3.50; org-odt.el code that kills modified buffers

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Sat, 15 Dec 2012 22:38:02 UTC

Severity: normal

Found in version 24.3.50

Done: Bastien <bzg <at> altern.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jambunathan K <kjambunathan <at> gmail.com>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 13197 <at> debbugs.gnu.org
Subject: bug#13197: 24.3.50; org-odt.el code that kills modified buffers
Date: Sun, 16 Dec 2012 10:07:29 +0530
"Drew Adams" <drew.adams <at> oracle.com> writes:

> I was grepping some source files to see how other code handles this kind
> of thing, and I came across this in org-odt.el (in
> `org-odt-cleanup-xml-buffers'):
>  
> (mapc (lambda (file)
>         (let ((buf (find-file-noselect
>                      (expand-file-name file org-odt-zip-dir) t)))
>           (when (buffer-name buf)
>             (set-buffer-modified-p nil)
>             (kill-buffer buf))))
>       xml-files)
>  
> I don't see how that can work properly, since `find-file-noselect' does
> not make the visited-file buffer current, and `set-buffer-modified-p'
> acts only on the current buffer.
>  
> Am I missing something here, or is that a bug?

It looks like a slip on my part.  In all other places in org-odt.el, I
do

    (with-current-buffer (find-file-noselect )

      )

When an error is thrown during the export process, the buffer will be in
modified but unsaved state.  I forcibly mark the buffer as modified
before killing it.

Let me put in a fix in Org repo.  Next merge will take care of this
issue.
-- 




This bug report was last modified 12 years and 157 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.