unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#25964: 26.0.50; byte-recompile-directory saving unrelated buffer
@ 2017-03-04  4:58 Andreas Politz
  2017-03-04  5:08 ` npostavs
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Politz @ 2017-03-04  4:58 UTC (permalink / raw)
  To: 25964

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#25964: 26.0.50; byte-recompile-directory saving unrelated buffer
  2017-03-04  4:58 bug#25964: 26.0.50; byte-recompile-directory saving unrelated buffer Andreas Politz
@ 2017-03-04  5:08 ` npostavs
  2017-03-04 10:08   ` Andreas Politz
  2017-05-20 22:29   ` npostavs
  0 siblings, 2 replies; 4+ messages in thread
From: npostavs @ 2017-03-04  5:08 UTC (permalink / raw)
  To: Andreas Politz; +Cc: 25964

merge 25964 25340
quit

Andreas Politz <politza@hochschule-trier.de> writes:

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

There is a similar patch in #25340, although it makes the behaviour
optional.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#25964: 26.0.50; byte-recompile-directory saving unrelated buffer
  2017-03-04  5:08 ` npostavs
@ 2017-03-04 10:08   ` Andreas Politz
  2017-05-20 22:29   ` npostavs
  1 sibling, 0 replies; 4+ messages in thread
From: Andreas Politz @ 2017-03-04 10:08 UTC (permalink / raw)
  To: npostavs; +Cc: 25964


Ok, thanks.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#25964: 26.0.50; byte-recompile-directory saving unrelated buffer
  2017-03-04  5:08 ` npostavs
  2017-03-04 10:08   ` Andreas Politz
@ 2017-05-20 22:29   ` npostavs
  1 sibling, 0 replies; 4+ messages in thread
From: npostavs @ 2017-05-20 22:29 UTC (permalink / raw)
  To: Andreas Politz; +Cc: 25964

severity 25964 minor
tags 25340 fixed
close 25340 26.1
quit

npostavs@users.sourceforge.net writes:
>
> Andreas Politz <politza@hochschule-trier.de> writes:
>
>> 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:
>
> There is a similar patch in #25340, although it makes the behaviour
> optional.

It seems #25340 is stalled, so I've pushed your patch instead [1: f151eb0141].

[1: f151eb0141]: 2017-05-20 18:28:23 -0400
  Don't save unrelated buffers before recompiling directory (Bug#25964)
  http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=f151eb01418b80d102c767566e93ac332a8bf7c3





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-05-20 22:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-04  4:58 bug#25964: 26.0.50; byte-recompile-directory saving unrelated buffer Andreas Politz
2017-03-04  5:08 ` npostavs
2017-03-04 10:08   ` Andreas Politz
2017-05-20 22:29   ` npostavs

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).