GNU bug report logs -
#25964
26.0.50; byte-recompile-directory saving unrelated buffer
Previous Next
Reported by: Andreas Politz <politza <at> hochschule-trier.de>
Date: Sat, 4 Mar 2017 05:00:02 UTC
Severity: minor
Tags: fixed, patch
Merged with 25340,
26056
Found in version 26.0.50
Fixed in version 26.1
Done: npostavs <at> users.sourceforge.net
Bug is archived. No further changes may be made.
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
I think it is somewhat annoying when I install a Lisp package and it
asks me whether I want to save a completely unrelated buffer in some
other project. This is especially true, if this unrelated buffer has a
function like check-parens on its after-save-hook, which may signal an
error, and in turn will abort the whole package installation.
The buffer saving happens in byte-recompile-directory via
save-some-buffer. So I wonder, if this can be made more selective, like
so:
[Message part 2 (text/x-diff, inline)]
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 25513bd024..86b1617fd7 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1661,7 +1661,12 @@ byte-recompile-directory
(if arg (setq arg (prefix-numeric-value arg)))
(if noninteractive
nil
- (save-some-buffers)
+ (save-some-buffers
+ nil (lambda ()
+ (let ((file (buffer-file-name)))
+ (and file
+ (string-match-p emacs-lisp-file-regexp file)
+ (file-in-directory-p file directory)))))
(force-mode-line-update))
(with-current-buffer (get-buffer-create byte-compile-log-buffer)
(setq default-directory (expand-file-name directory))
[Message part 3 (text/plain, inline)]
Thanks,
-ap
This bug report was last modified 8 years ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.