all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andreas Politz <politza@hochschule-trier.de>
To: 25964@debbugs.gnu.org
Subject: bug#25964: 26.0.50; byte-recompile-directory saving unrelated buffer
Date: Sat, 04 Mar 2017 05:58:34 +0100	[thread overview]
Message-ID: <87pohxd4ed.fsf@luca> (raw)

[-- Attachment #1: Type: text/plain, Size: 480 bytes --]


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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: save-some-less-buffers --]
[-- Type: text/x-diff, Size: 727 bytes --]

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))

[-- Attachment #3: Type: text/plain, Size: 13 bytes --]


Thanks,
-ap

             reply	other threads:[~2017-03-04  4:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-04  4:58 Andreas Politz [this message]
2017-03-04  5:08 ` bug#25964: 26.0.50; byte-recompile-directory saving unrelated buffer npostavs
2017-03-04 10:08   ` Andreas Politz
2017-05-20 22:29   ` npostavs

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=87pohxd4ed.fsf@luca \
    --to=politza@hochschule-trier.de \
    --cc=25964@debbugs.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.