GNU bug report logs - #15895
describe-package inserts invalid buffer when readme buffer killed in after-save-hook

Previous Next

Package: emacs;

Reported by: Kazuhiro NISHIYAMA <zn <at> mbf.nifty.com>

Date: Thu, 14 Nov 2013 16:53:02 UTC

Severity: minor

Tags: wontfix

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 15895 in the body.
You can then email your comments to 15895 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#15895; Package emacs. (Thu, 14 Nov 2013 16:53:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kazuhiro NISHIYAMA <zn <at> mbf.nifty.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 14 Nov 2013 16:53:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Kazuhiro NISHIYAMA <zn <at> mbf.nifty.com>
To: bug-gnu-emacs <at> gnu.org
Subject: describe-package inserts invalid buffer when readme buffer killed in
 after-save-hook
Date: Thu, 14 Nov 2013 23:36:19 +0900
I use delete-file-if-no-contents in after-save-hook,
and open git-gutter-fringe or git-gutter-fringe+ from *Packages* buffer,
the hook asks me "Delete file and kill buffer?".
When I answer "y", the buffer for *-readme.txt killed,
and buffer-string after save-buffer in describe-package-1 returns
from invalid buffer's content.

I think that buffer-string should be before save-buffer.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15895; Package emacs. (Sat, 16 Nov 2013 22:50:01 GMT) Full text and rfc822 format available.

Message #8 received at 15895 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Kazuhiro NISHIYAMA <zn <at> mbf.nifty.com>
Cc: 15895 <at> debbugs.gnu.org
Subject: Re: bug#15895: describe-package inserts invalid buffer when readme
 buffer killed in after-save-hook
Date: Sat, 16 Nov 2013 17:49:05 -0500
Kazuhiro NISHIYAMA wrote:

> I use delete-file-if-no-contents in after-save-hook, and open
> git-gutter-fringe or git-gutter-fringe+ from *Packages* buffer, the
> hook asks me "Delete file and kill buffer?". When I answer "y", the
> buffer for *-readme.txt killed, and buffer-string after save-buffer in
> describe-package-1 returns from invalid buffer's content.

I'm going to say: "don't do that then". There are ~ 200 calls to
save-buffer in the Emacs sources, and I imagine none of them expect
save-buffer to kill the buffer in question. Maybe some of them should be
using something lower-level like write-region, but I'm not going to
bother to check them.

I suggest you make your delete-file-if-no-contents thing only take
effect in _interactive_ calls to save-buffer.

> I think that buffer-string should be before save-buffer.

Then it would not get the (minor) benefit of require-final-newline.
Obviously, we could reimplement that, but I don't think we should have
to bother.




Added tag(s) wontfix. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 28 Nov 2013 19:46:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 15895 <at> debbugs.gnu.org and Kazuhiro NISHIYAMA <zn <at> mbf.nifty.com> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 28 Nov 2013 19:46:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 27 Dec 2013 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 173 days ago.

Previous Next


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