bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#13197: 24.3.50; org-odt.el code that kills modified buffers


From: Jambunathan K
Subject: bug#13197: 24.3.50; org-odt.el code that kills modified buffers
Date: Sun, 16 Dec 2012 10:07:29 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

"Drew Adams" <drew.adams@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.
-- 





reply via email to

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