GNU bug report logs - #65928
[PATCH] Introduce 'project-save-buffers'

Previous Next

Package: emacs;

Reported by: me <at> elken.dev

Date: Wed, 13 Sep 2023 21:28:02 UTC

Severity: wishlist

Tags: patch, wontfix

Done: Dmitry Gutov <dmitry <at> gutov.dev>

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 65928 in the body.
You can then email your comments to 65928 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#65928; Package emacs. (Wed, 13 Sep 2023 21:28:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to me <at> elken.dev:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 13 Sep 2023 21:28:02 GMT) Full text and rfc822 format available.

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

From: me <at> elken.dev
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Introduce 'project-save-buffers'
Date: Wed, 13 Sep 2023 22:26:39 +0100
[Message part 1 (text/plain, inline)]
Hi all,

A small patch to introduce a function from projectile that I feel is 
missing, please feel free to yell at me if this has already been 
rejected :)

Thanks all,

Ellis (@lkn)
[0001-Introduce-project-save-buffers.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65928; Package emacs. (Thu, 14 Sep 2023 07:01:03 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: me <at> elken.dev
Cc: 65928 <at> debbugs.gnu.org
Subject: Re: bug#65928: [PATCH] Introduce 'project-save-buffers'
Date: Thu, 14 Sep 2023 09:51:02 +0300
> A small patch to introduce a function from projectile that I feel is
> missing, please feel free to yell at me if this has already been rejected
> :)

Thanks for the patch.  However, this is already implemented in
'save-some-buffers-root'.  OTOH, having a separate command
maybe be not so bad.  It could be bound to 'C-x p C-x s'.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65928; Package emacs. (Thu, 14 Sep 2023 13:46:01 GMT) Full text and rfc822 format available.

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

From: Elken <me <at> elken.dev>
To: Juri Linkov <juri <at> linkov.net>
Cc: 65928 <at> debbugs.gnu.org
Subject: Re: bug#65928: [PATCH] Introduce 'project-save-buffers'
Date: Thu, 14 Sep 2023 14:45:04 +0100
[Message part 1 (text/plain, inline)]
Implemented somewhat yeah, but I think it's sensible and more discoverable having one here as you say. :)

On 14 September 2023 07:51:02 BST, Juri Linkov <juri <at> linkov.net> wrote:
>> A small patch to introduce a function from projectile that I feel is
>> missing, please feel free to yell at me if this has already been rejected
>> :)
>
>Thanks for the patch.  However, this is already implemented in
>'save-some-buffers-root'.  OTOH, having a separate command
>maybe be not so bad.  It could be bound to 'C-x p C-x s'.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65928; Package emacs. (Thu, 14 Sep 2023 14:08:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>, me <at> elken.dev
Cc: 65928 <at> debbugs.gnu.org
Subject: Re: bug#65928: [PATCH] Introduce 'project-save-buffers'
Date: Thu, 14 Sep 2023 07:07:30 -0700
Juri Linkov <juri <at> linkov.net> writes:

> It could be bound to 'C-x p C-x s'.

What's the binding in projectile?  All else being equal, I'd suggest we
use the same one.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65928; Package emacs. (Thu, 14 Sep 2023 14:10:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Elken <me <at> elken.dev>, Juri Linkov <juri <at> linkov.net>
Cc: 65928 <at> debbugs.gnu.org
Subject: Re: bug#65928: [PATCH] Introduce 'project-save-buffers'
Date: Thu, 14 Sep 2023 07:09:12 -0700
Elken via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs <at> gnu.org> writes:

> Implemented somewhat yeah, but I think it's sensible and more
> discoverable having one here as you say. :)

Would something like

    (defalias 'project-save-buffers #'save-some-buffers-root)

do the job?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65928; Package emacs. (Thu, 14 Sep 2023 14:13:02 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Stefan Kangas <stefankangas <at> gmail.com>, Elken <me <at> elken.dev>,
 Juri Linkov <juri <at> linkov.net>
Cc: 65928 <at> debbugs.gnu.org
Subject: Re: bug#65928: [PATCH] Introduce 'project-save-buffers'
Date: Thu, 14 Sep 2023 17:12:18 +0300
On 14/09/2023 17:09, Stefan Kangas wrote:
> Elken via "Bug reports for GNU Emacs, the Swiss army knife of text
> editors"<bug-gnu-emacs <at> gnu.org>  writes:
> 
>> Implemented somewhat yeah, but I think it's sensible and more
>> discoverable having one here as you say. 😄
> Would something like
> 
>      (defalias 'project-save-buffers #'save-some-buffers-root)
> 
> do the job?

save-some-buffers-root is not a command, just a predicate function.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65928; Package emacs. (Thu, 14 Sep 2023 14:15:01 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Stefan Kangas <stefankangas <at> gmail.com>, Juri Linkov <juri <at> linkov.net>,
 me <at> elken.dev
Cc: 65928 <at> debbugs.gnu.org
Subject: Re: bug#65928: [PATCH] Introduce 'project-save-buffers'
Date: Thu, 14 Sep 2023 17:13:50 +0300
On 14/09/2023 17:07, Stefan Kangas wrote:
> Juri Linkov<juri <at> linkov.net>  writes:
> 
>> It could be bound to 'C-x p C-x s'.
> What's the binding in projectile?  All else being equal, I'd suggest we
> use the same one.

The counterpart to Projectile's binding will be 'C-x p S'.

But in its keymap lowercase 's' is a prefix binding with several 
subcommands (grep, ripgrep, ag, references). Maybe that's not important.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65928; Package emacs. (Thu, 14 Sep 2023 14:18:01 GMT) Full text and rfc822 format available.

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

From: me <at> elken.dev
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 65928 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#65928: [PATCH] Introduce 'project-save-buffers'
Date: Thu, 14 Sep 2023 15:16:58 +0100
On 2023-09-14 15:07, Stefan Kangas wrote:
> Juri Linkov <juri <at> linkov.net> writes:
> 
>> It could be bound to 'C-x p C-x s'.
> 
> What's the binding in projectile?  All else being equal, I'd suggest we
> use the same one.

"S" in the `projectile-command-map'




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65928; Package emacs. (Thu, 14 Sep 2023 14:19:01 GMT) Full text and rfc822 format available.

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

From: me <at> elken.dev
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 65928 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#65928: [PATCH] Introduce 'project-save-buffers'
Date: Thu, 14 Sep 2023 15:18:31 +0100
On 2023-09-14 15:09, Stefan Kangas wrote:
> Elken via "Bug reports for GNU Emacs, the Swiss army knife of text
> editors" <bug-gnu-emacs <at> gnu.org> writes:
> 
>> Implemented somewhat yeah, but I think it's sensible and more
>> discoverable having one here as you say. :)
> 
> Would something like
> 
>     (defalias 'project-save-buffers #'save-some-buffers-root)
> 
> do the job?

It's a predicate to pass to `save-some-buffers`, so you'd still need an 
interactive command to call it and handle the universal argument




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65928; Package emacs. (Thu, 14 Sep 2023 14:32:02 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Elken <me <at> elken.dev>, Juri Linkov <juri <at> linkov.net>
Cc: 65928 <at> debbugs.gnu.org
Subject: Re: bug#65928: [PATCH] Introduce 'project-save-buffers'
Date: Thu, 14 Sep 2023 17:30:59 +0300
On 14/09/2023 16:45, Elken via Bug reports for GNU Emacs, the Swiss army 
knife of text editors wrote:
> Implemented somewhat yeah, but I think it's sensible and more 
> discoverable having one here as you say. :)

I suppose the main question is whether we want a 
project-save-some-buffers (one that can iterate through unsaved buffers 
but can also save them all with an extra keypress) or a straight copy of 
Projectile's command that just saves all buffers.

I don't use the iteration ability often, but once in a blue moon it does 
come in handy. Though perhaps one can continue using save-some-buffer 
for that (with the default predicate or not).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65928; Package emacs. (Fri, 15 Sep 2023 06:47:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 65928 <at> debbugs.gnu.org, me <at> elken.dev
Subject: Re: bug#65928: [PATCH] Introduce 'project-save-buffers'
Date: Fri, 15 Sep 2023 09:32:25 +0300
>> It could be bound to 'C-x p C-x s'.

After more thoughts, it's not the best keybinding:
the global 'C-x s' could be used to save all buffers
in another project with 'C-x p p ... C-x s'
implemented in bug#63648.

> What's the binding in projectile?  All else being equal, I'd suggest we
> use the same one.

Maybe Projectile's binding 'C-x p S' is not too bad.

> Would something like
>     (defalias 'project-save-buffers #'save-some-buffers-root)
> do the job?

Rather something more like this will do the job:

```
(keymap-set project-prefix-map "S"
            (lambda (&optional arg)
              (interactive "P")
              (let ((save-some-buffers-default-predicate 'save-some-buffers-root))
                (save-some-buffers arg))))
```




Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 15 Sep 2023 10:52:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65928; Package emacs. (Fri, 15 Sep 2023 16:40:01 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Juri Linkov <juri <at> linkov.net>, Stefan Kangas <stefankangas <at> gmail.com>
Cc: 65928 <at> debbugs.gnu.org, me <at> elken.dev
Subject: Re: bug#65928: [PATCH] Introduce 'project-save-buffers'
Date: Fri, 15 Sep 2023 19:39:21 +0300
On 15/09/2023 09:32, Juri Linkov wrote:
>> Would something like
>>      (defalias 'project-save-buffers #'save-some-buffers-root)
>> do the job?
> Rather something more like this will do the job:
> 
> ```
> (keymap-set project-prefix-map "S"
>              (lambda (&optional arg)
>                (interactive "P")
>                (let ((save-some-buffers-default-predicate 'save-some-buffers-root))
>                  (save-some-buffers arg))))
> ```

Would you say that the added capability to only save certain buffers but 
not others, is something you found useful in practice?

More than once a year or so.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65928; Package emacs. (Mon, 18 Sep 2023 07:00:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: Stefan Kangas <stefankangas <at> gmail.com>, me <at> elken.dev, 65928 <at> debbugs.gnu.org
Subject: Re: bug#65928: [PATCH] Introduce 'project-save-buffers'
Date: Mon, 18 Sep 2023 09:56:03 +0300
>>> Would something like
>>>      (defalias 'project-save-buffers #'save-some-buffers-root)
>>> do the job?
>> Rather something more like this will do the job:
>> ```
>> (keymap-set project-prefix-map "S"
>>              (lambda (&optional arg)
>>                (interactive "P")
>>                (let ((save-some-buffers-default-predicate 'save-some-buffers-root))
>>                  (save-some-buffers arg))))
>> ```
>
> Would you say that the added capability to only save certain buffers but
> not others, is something you found useful in practice?
>
> More than once a year or so.

I don't know why might anyone want to save only project's buffer,
but not all.  I use 'C-x s' only when 'C-c C-a' from diff-mode modifies
different buffers (hopefully a new diff command will save them at once),
but I don't mind when 'C-x s' saves non-project buffers as well.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65928; Package emacs. (Wed, 12 Feb 2025 04:23:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: 65928 <at> debbugs.gnu.org, me <at> elken.dev, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#65928: [PATCH] Introduce 'project-save-buffers'
Date: Tue, 11 Feb 2025 20:22:36 -0800
Dmitry Gutov <dmitry <at> gutov.dev> writes:

> On 15/09/2023 09:32, Juri Linkov wrote:
>>> Would something like
>>>      (defalias 'project-save-buffers #'save-some-buffers-root)
>>> do the job?
>> Rather something more like this will do the job:
>> ```
>> (keymap-set project-prefix-map "S"
>>              (lambda (&optional arg)
>>                (interactive "P")
>>                (let ((save-some-buffers-default-predicate 'save-some-buffers-root))
>>                  (save-some-buffers arg))))
>> ```
>
> Would you say that the added capability to only save certain buffers but not
> others, is something you found useful in practice?
>
> More than once a year or so.

Maybe we should just close this as a wontfix?




Reply sent to Dmitry Gutov <dmitry <at> gutov.dev>:
You have taken responsibility. (Wed, 12 Feb 2025 13:56:03 GMT) Full text and rfc822 format available.

Notification sent to me <at> elken.dev:
bug acknowledged by developer. (Wed, 12 Feb 2025 13:56:03 GMT) Full text and rfc822 format available.

Message #51 received at 65928-done <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 65928-done <at> debbugs.gnu.org, me <at> elken.dev, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#65928: [PATCH] Introduce 'project-save-buffers'
Date: Wed, 12 Feb 2025 15:55:42 +0200
On 12/02/2025 06:22, Stefan Kangas wrote:
> Dmitry Gutov<dmitry <at> gutov.dev> writes:
> 
>> On 15/09/2023 09:32, Juri Linkov wrote:
>>>> Would something like
>>>>       (defalias 'project-save-buffers #'save-some-buffers-root)
>>>> do the job?
>>> Rather something more like this will do the job:
>>> ```
>>> (keymap-set project-prefix-map "S"
>>>               (lambda (&optional arg)
>>>                 (interactive "P")
>>>                 (let ((save-some-buffers-default-predicate 'save-some-buffers-root))
>>>                   (save-some-buffers arg))))
>>> ```
>> Would you say that the added capability to only save certain buffers but not
>> others, is something you found useful in practice?
>>
>> More than once a year or so.
> Maybe we should just close this as a wontfix?

Let's!

Please reopen if somebody disagrees.




Added tag(s) wontfix. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 12 Feb 2025 14:29:01 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. (Thu, 13 Mar 2025 11:24:13 GMT) Full text and rfc822 format available.

This bug report was last modified today.

Previous Next


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