[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#46374: 28.0.50; Ask me to save buffers only if they are under caller
From: |
Juri Linkov |
Subject: |
bug#46374: 28.0.50; Ask me to save buffers only if they are under callers dir |
Date: |
Tue, 16 Mar 2021 19:49:27 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) |
>> OK, back to my original implementation (i.e., adding a new option
>> to `save-some-buffers-default-predicate`).
>
> Is it a problem that such separate function can't get
> information about the original default-directory when
> called as: (with-current-buffer buffer (funcall pred))?
>
> Actually, this is the shortcoming of the old design of
> save-some-buffers-default-predicate. Is it possible to add
> a new arg (with an original dir) to the predicate function?
> Then for backward-compatibility before calling it, the function arity
> could be checked, then called with one arg when it's accepted
> by the function, otherwise call without args.
I meant to replace in 'save-some-buffers'
(with-current-buffer buffer (funcall pred))
with
(let ((one-arg (equal (func-arity pred) '(1 . 1))))
(dolist (buffer (buffer-list))
(if one-arg
(funcall pred buffer)
(with-current-buffer buffer (funcall pred))))
Then 'default-directory' of the original buffer will be preserved
inside the pred function, so it will be possible to call the pred function
with one arg 'buffer' and check whether the buffer is under the original
'default-directory' with
(file-in-directory-p (buffer-local-value 'default-directory buffer)
default-directory)
- bug#46374: 28.0.50; Ask me to save buffers only if they are under callers dir, Tino Calancha, 2021/03/07
- bug#46374: 28.0.50; Ask me to save buffers only if they are under callers dir, Juri Linkov, 2021/03/07
- Message not available
- bug#46374: 28.0.50; Ask me to save buffers only if they are under callers dir, Juri Linkov, 2021/03/08
- bug#46374: 28.0.50; Ask me to save buffers only if they are under callers dir, Tino Calancha, 2021/03/14
- bug#46374: 28.0.50; Ask me to save buffers only if they are under callers dir, Juri Linkov, 2021/03/15
- bug#46374: 28.0.50; Ask me to save buffers only if they are under callers dir,
Juri Linkov <=
- bug#46374: 28.0.50; Ask me to save buffers only if they are under callers dir, Stefan Monnier, 2021/03/16
- bug#46374: [External] : bug#46374: 28.0.50; Ask me to save buffers only if they are under callers dir, Drew Adams, 2021/03/16
- bug#46374: [External] : bug#46374: 28.0.50; Ask me to save buffers only if they are under callers dir, Juri Linkov, 2021/03/17
- bug#46374: 28.0.50; Ask me to save buffers only if they are under callers dir, Juri Linkov, 2021/03/17
- bug#46374: 28.0.50; Ask me to save buffers only if they are under callers dir, Tino Calancha, 2021/03/21
- bug#46374: 28.0.50; Ask me to save buffers only if they are under callers dir, Juri Linkov, 2021/03/21