GNU bug report logs -
#56311
[PATCH] new function: delete-visited-file
Previous Next
Reported by: Zachary Kanfer <zkanfer <at> gmail.com>
Date: Thu, 30 Jun 2022 04:27:02 UTC
Severity: wishlist
Tags: moreinfo, patch, wontfix
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
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 56311 in the body.
You can then email your comments to 56311 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#56311
; Package
emacs
.
(Thu, 30 Jun 2022 04:27:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Zachary Kanfer <zkanfer <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Thu, 30 Jun 2022 04:27:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
When I delete a file, I almost always want the buffer visiting it to go
away also. Why keep it around? So I have to do the following steps:
1. M-x delete-file
2. navigate to the file, select it.
3. C-x k <ret>
So I wrote a function to delete the file a buffer is visiting, and close
the buffer. Now I do everything in a single logical action:
1. M-x delete-visited-file
2. select the buffer.
Patch is attached.
[Message part 2 (text/html, inline)]
[0001-Add-new-function-delete-visited-file.patch (text/x-patch, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#56311
; Package
emacs
.
(Thu, 30 Jun 2022 05:31:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 56311 <at> debbugs.gnu.org (full text, mbox):
> From: Zachary Kanfer <zkanfer <at> gmail.com>
> Date: Thu, 30 Jun 2022 00:26:06 -0400
>
> +** New command 'delete-visited-file'.
> +This command deletes the file visited by a buffer, then closes the
> +buffer.
"Close the buffer" is not our terminology, you won't find it in our
documentation. We say "kill the buffer".
I also think "delete-visited-file" is not the best name for the
command, since it doesn't tell all the truth about what it does.
Apart of that, I have no opinion about this proposal, although each
time I see suggestions for features to kill unused buffers or see
people who are worried about such buffers, I raise a brow: in Emacs,
we generally don't care about that (because it does no harm to have
unused buffers), and if someone's usage patterns are such that they
tend to create _gobs_ of large buffers most of which quickly become
unused, there's midnight.el to take care of that.
But if the ultimate decision is to add this command, please keep it
out of files.el, because that's a preloaded package, and thus it will
increase the memory footprint of every Emacs session for the benefit
of a command that I don't think is important enough.
Thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#56311
; Package
emacs
.
(Thu, 30 Jun 2022 05:50:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 56311 <at> debbugs.gnu.org (full text, mbox):
Hello,
On Thu 30 Jun 2022 at 08:30am +03, Eli Zaretskii wrote:
>> From: Zachary Kanfer <zkanfer <at> gmail.com>
>> Date: Thu, 30 Jun 2022 00:26:06 -0400
>>
>> +** New command 'delete-visited-file'.
>> +This command deletes the file visited by a buffer, then closes the
>> +buffer.
>
> "Close the buffer" is not our terminology, you won't find it in our
> documentation. We say "kill the buffer".
>
> I also think "delete-visited-file" is not the best name for the
> command, since it doesn't tell all the truth about what it does.
>
> Apart of that, I have no opinion about this proposal, although each
> time I see suggestions for features to kill unused buffers or see
> people who are worried about such buffers, I raise a brow: in Emacs,
> we generally don't care about that (because it does no harm to have
> unused buffers), and if someone's usage patterns are such that they
> tend to create _gobs_ of large buffers most of which quickly become
> unused, there's midnight.el to take care of that.
I don't care about the buffer being killed either, but there isn't
currently a quick way to delete the file the selected buffer is
visiting, you have to type/complete its name. It would be nice to have
that, which I think this command provides.
--
Sean Whitton
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#56311
; Package
emacs
.
(Thu, 30 Jun 2022 05:57:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 56311 <at> debbugs.gnu.org (full text, mbox):
> From: Sean Whitton <spwhitton <at> spwhitton.name>
> Cc: 56311 <at> debbugs.gnu.org
> Date: Wed, 29 Jun 2022 22:49:47 -0700
>
> I don't care about the buffer being killed either, but there isn't
> currently a quick way to delete the file the selected buffer is
> visiting, you have to type/complete its name.
No, you don't:
M-x delete-file RET M-n RET
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#56311
; Package
emacs
.
(Thu, 30 Jun 2022 06:22:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 56311 <at> debbugs.gnu.org (full text, mbox):
[வியாழன் ஜூன் 30, 2022] Eli Zaretskii wrote:
> Apart of that, I have no opinion about this proposal, although each
> time I see suggestions for features to kill unused buffers or see
> people who are worried about such buffers, I raise a brow: in Emacs,
> we generally don't care about that (because it does no harm to have
> unused buffers), and if someone's usage patterns are such that they
> tend to create _gobs_ of large buffers most of which quickly become
> unused, there's midnight.el to take care of that.
FWIW, the fact that Emacs leaves the buffer around has saved my back at
least twice,
. when I accidentally deleted the wrong files in dired due to
stale marks.
. when I tried to fix a broken symlink but got the argument order in
ln wrong and had the real file "zeroed".
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#56311
; Package
emacs
.
(Thu, 30 Jun 2022 10:28:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 56311 <at> debbugs.gnu.org (full text, mbox):
Visuwesh <visuweshm <at> gmail.com> writes:
> FWIW, the fact that Emacs leaves the buffer around has saved my back at
> least twice,
>
> . when I accidentally deleted the wrong files in dired due to
> stale marks.
> . when I tried to fix a broken symlink but got the argument order in
> ln wrong and had the real file "zeroed".
And since deleting the visited file is currently very easy, as Eli
pointed out:
M-x delete-file RET M-n RET
I don't think this would be a command that people would use a lot.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Added tag(s) moreinfo.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Thu, 30 Jun 2022 10:28:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#56311
; Package
emacs
.
(Thu, 30 Jun 2022 16:30:02 GMT)
Full text and
rfc822 format available.
Message #25 received at 56311 <at> debbugs.gnu.org (full text, mbox):
Hello,
On Thu 30 Jun 2022 at 12:27pm +02, Lars Ingebrigtsen wrote:
> And since deleting the visited file is currently very easy, as Eli
> pointed out:
>
> M-x delete-file RET M-n RET
There's also C-x C-j D.
> I don't think this would be a command that people would use a lot.
They shouldn't be using it a lot, and I agree that it probably shouldn't
be added, but it does seem worth noting that a lot of users have
something like this in their init, and use it a lot. I did until today,
and used it almost daily. (After reading this thread, I've replaced it
with something calling bury-buffer.) It's also to be found in Spacemacs
and Doom Emacs.
--
Sean Whitton
Severity set to 'wishlist' from 'normal'
Request was from
Stefan Kangas <stefan <at> marxist.se>
to
control <at> debbugs.gnu.org
.
(Thu, 30 Jun 2022 20:54:01 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#56311
; Package
emacs
.
(Fri, 01 Jul 2022 03:30:02 GMT)
Full text and
rfc822 format available.
Message #30 received at 56311 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
It's interesting to see commentary about how one shouldn't want to kill
buffers. There is a lot of functionality revolving around killing buffers.
> ...each time I see suggestions for features to kill unused buffers or
> see people who are worried about such buffers, I raise a brow: in
> Emacs, we generally don't care about that (because it does no harm to
> have unused buffers)...
I use desktop-mode. So I currently have 267 buffers open in my Emacs.
Perhaps you might think I'm "doing it wrong", but I find that the more
buffers I have open, the longer it takes to find a given buffer. The more
open buffers I have open, the greater the chance I'll accidently switch to
the wrong one. Sometimes I know that I want a file to go away -- why keep
the buffer around?
> And since deleting the visited file is currently very easy, as Eli
> pointed out:
>
> > M-x delete-file RET M-n RET
>
> I don't think this would be a command that people would use a lot.
Personally, I never want to delete a file and keep the buffer around. So I
have replaced *all* my usages of `delete-file` with this new one.
There are many ways to work with Emacs -- many workflows I don't know why
this one is considered wrong.
On Thu, Jun 30, 2022 at 12:29 PM Sean Whitton <spwhitton <at> spwhitton.name>
wrote:
> Hello,
>
> On Thu 30 Jun 2022 at 12:27pm +02, Lars Ingebrigtsen wrote:
>
> > And since deleting the visited file is currently very easy, as Eli
> > pointed out:
> >
> > M-x delete-file RET M-n RET
>
> There's also C-x C-j D.
>
> > I don't think this would be a command that people would use a lot.
>
> They shouldn't be using it a lot, and I agree that it probably shouldn't
> be added, but it does seem worth noting that a lot of users have
> something like this in their init, and use it a lot. I did until today,
> and used it almost daily. (After reading this thread, I've replaced it
> with something calling bury-buffer.) It's also to be found in Spacemacs
> and Doom Emacs.
>
> --
> Sean Whitton
>
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#56311
; Package
emacs
.
(Fri, 01 Jul 2022 05:59:02 GMT)
Full text and
rfc822 format available.
Message #33 received at 56311 <at> debbugs.gnu.org (full text, mbox):
> From: Zachary Kanfer <zkanfer <at> gmail.com>
> Date: Thu, 30 Jun 2022 23:29:36 -0400
> Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, Visuwesh <visuweshm <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
> 56311 <at> debbugs.gnu.org
>
> It's interesting to see commentary about how one shouldn't want to kill buffers. There is a lot of functionality
> revolving around killing buffers.
Examples of such functionality? I'm not sure I understand what you
have in mind here.
> > ...each time I see suggestions for features to kill unused buffers or
> > see people who are worried about such buffers, I raise a brow: in
> > Emacs, we generally don't care about that (because it does no harm to
> > have unused buffers)...
>
> I use desktop-mode. So I currently have 267 buffers open in my Emacs. Perhaps you might think I'm "doing
> it wrong",
Why would I think so? In the session in which I'm writing this, I
have 287 buffers. Having around 300 buffers in my sessions is quite
normal, and I don't consider such numbers excessive.
> I find that the more buffers I have open, the longer it takes to
> find a given buffer.
"Find" in what way? Please tell more about the problems you have in
sessions with many buffers, because I'm not aware of any significant
problems.
> The more open
> buffers I have open, the greater the chance I'll accidently switch
> to the wrong one.
Again, please tell more details. How does the number of buffers
contribute to the chance of selecting a wrong one? For that matter,
which commands do you use to switch between buffers?
> > And since deleting the visited file is currently very easy, as Eli
> > pointed out:
> >
> > > M-x delete-file RET M-n RET
> >
> > I don't think this would be a command that people would use a lot.
>
> Personally, I never want to delete a file and keep the buffer around. So I have replaced *all* my usages of
> `delete-file` with this new one.
That's fine: Emacs is great because it lets you do that to fit your
personal needs. No one here is saying that it's wrong for you to do
that; the discussion is whether doing so is TRT for many/most Emacs
users (which could have different workflows).
> There are many ways to work with Emacs -- many workflows I don't know why this one is considered
> wrong.
Sure. But there's no reason for Emacs to support all of the OOTB.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#56311
; Package
emacs
.
(Sun, 03 Jul 2022 05:08:01 GMT)
Full text and
rfc822 format available.
Message #36 received at 56311 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
> > It's interesting to see commentary about how one shouldn't want to kill
buffers. There is a lot of functionality
> > revolving around killing buffers.
>
> Examples of such functionality? I'm not sure I understand what you
> have in mind here.
I mean functions like kill-buffer, eww-buffer-kill,ido-kill-buffer,
project-kill-buffers, gnus-kill-buffer. There are many functions that
assist killing buffers.
> > I find that the more buffers I have open, the longer it takes to
> > find a given buffer.
>
> "Find" in what way? Please tell more about the problems you have in
> sessions with many buffers, because I'm not aware of any significant
> problems.
When trying to switch to a buffer, the more buffers in the list, the more
work needs to be done to find the single buffer I do want.
> > The more open
> > buffers I have open, the greater the chance I'll accidently switch
> > to the wrong one.
>
> Again, please tell more details. How does the number of buffers
> contribute to the chance of selecting a wrong one?
Say I delete a file, and kill the buffer. Then there is zero chance I'll
ever open that buffer accidentally. If I delete a file, and don't kill the
buffer, that buffer is there to be accidentally opened.
> For that matter,
> which commands do you use to switch between buffers?
I'm using switch-to-buffer, using selectrum to display and winnow the
buffers.
> > > And since deleting the visited file is currently very easy, as Eli
> > > pointed out:
> > >
> > > > M-x delete-file RET M-n RET
> > >
> > > I don't think this would be a command that people would use a lot.
> >
> > Personally, I never want to delete a file and keep the buffer around.
So I have replaced *all* my usages of
> > `delete-file` with this new one.
>
> That's fine: Emacs is great because it lets you do that to fit your
> personal needs. No one here is saying that it's wrong for you to do
> that
In this thread, there are messages like "..we generally don't care about
that (because it does no harm to have unused buffers)...", an argument to
not close the buffer (because it allowed them to resurrect mistakenly
deleted files), and "They shouldn't be using [this command] a lot...".
> the discussion is whether doing so is TRT for many/most Emacs
> users (which could have different workflows).
How would we know if proposed functionality *would* be used by enough
users? What is a threshhold for enough users to add a function?
On Fri, Jul 1, 2022 at 1:57 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
> > From: Zachary Kanfer <zkanfer <at> gmail.com>
> > Date: Thu, 30 Jun 2022 23:29:36 -0400
> > Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, Visuwesh <visuweshm <at> gmail.com>,
> Eli Zaretskii <eliz <at> gnu.org>,
> > 56311 <at> debbugs.gnu.org
> >
> > It's interesting to see commentary about how one shouldn't want to kill
> buffers. There is a lot of functionality
> > revolving around killing buffers.
>
> Examples of such functionality? I'm not sure I understand what you
> have in mind here.
>
> > > ...each time I see suggestions for features to kill unused buffers or
> > > see people who are worried about such buffers, I raise a brow: in
> > > Emacs, we generally don't care about that (because it does no harm to
> > > have unused buffers)...
> >
> > I use desktop-mode. So I currently have 267 buffers open in my Emacs.
> Perhaps you might think I'm "doing
> > it wrong",
>
> Why would I think so? In the session in which I'm writing this, I
> have 287 buffers. Having around 300 buffers in my sessions is quite
> normal, and I don't consider such numbers excessive.
>
> > I find that the more buffers I have open, the longer it takes to
> > find a given buffer.
>
> "Find" in what way? Please tell more about the problems you have in
> sessions with many buffers, because I'm not aware of any significant
> problems.
>
> > The more open
> > buffers I have open, the greater the chance I'll accidently switch
> > to the wrong one.
>
> Again, please tell more details. How does the number of buffers
> contribute to the chance of selecting a wrong one? For that matter,
> which commands do you use to switch between buffers?
>
> > > And since deleting the visited file is currently very easy, as Eli
> > > pointed out:
> > >
> > > > M-x delete-file RET M-n RET
> > >
> > > I don't think this would be a command that people would use a lot.
> >
> > Personally, I never want to delete a file and keep the buffer around. So
> I have replaced *all* my usages of
> > `delete-file` with this new one.
>
> That's fine: Emacs is great because it lets you do that to fit your
> personal needs. No one here is saying that it's wrong for you to do
> that; the discussion is whether doing so is TRT for many/most Emacs
> users (which could have different workflows).
>
> > There are many ways to work with Emacs -- many workflows I don't know
> why this one is considered
> > wrong.
>
> Sure. But there's no reason for Emacs to support all of the OOTB.
>
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#56311
; Package
emacs
.
(Sun, 03 Jul 2022 06:05:01 GMT)
Full text and
rfc822 format available.
Message #39 received at 56311 <at> debbugs.gnu.org (full text, mbox):
> From: Zachary Kanfer <zkanfer <at> gmail.com>
> Date: Sun, 3 Jul 2022 01:06:40 -0400
> Cc: Sean Whitton <spwhitton <at> spwhitton.name>, Lars Ingebrigtsen <larsi <at> gnus.org>,
> Visuwesh <visuweshm <at> gmail.com>, 56311 <at> debbugs.gnu.org
>
> > > It's interesting to see commentary about how one shouldn't want to kill
> buffers. There is a lot of functionality
> > > revolving around killing buffers.
> >
> > Examples of such functionality? I'm not sure I understand what you
> > have in mind here.
>
> I mean functions like kill-buffer, eww-buffer-kill,ido-kill-buffer,
> project-kill-buffers, gnus-kill-buffer. There are many functions that
> assist killing buffers.
OK, and what is the relevance of that to the issue at hand?
> > > I find that the more buffers I have open, the longer it takes to
> > > find a given buffer.
> >
> > "Find" in what way? Please tell more about the problems you have in
> > sessions with many buffers, because I'm not aware of any significant
> > problems.
>
> When trying to switch to a buffer, the more buffers in the list, the more
> work needs to be done to find the single buffer I do want.
We have several features to make this easier. There's completion on
buffer names, there's the "Buffers" menu on the menu bar, there are
"C-x C-b" and electric-buffer-list -- and that's only in vanilla
Emacs.
> > > Personally, I never want to delete a file and keep the buffer around.
> So I have replaced *all* my usages of
> > > `delete-file` with this new one.
> >
> > That's fine: Emacs is great because it lets you do that to fit your
> > personal needs. No one here is saying that it's wrong for you to do
> > that
>
> In this thread, there are messages like "..we generally don't care about
> that (because it does no harm to have unused buffers)...", an argument to
> not close the buffer (because it allowed them to resurrect mistakenly
> deleted files), and "They shouldn't be using [this command] a lot...".
Note the "in general" part. This doesn't contradict your own personal
needs, if they are special ones.
> > the discussion is whether doing so is TRT for many/most Emacs
> > users (which could have different workflows).
>
> How would we know if proposed functionality *would* be used by enough
> users? What is a threshhold for enough users to add a function?
We usually judge that by the number of people who request a feature.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#56311
; Package
emacs
.
(Tue, 02 Aug 2022 11:13:02 GMT)
Full text and
rfc822 format available.
Message #42 received at 56311 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> > the discussion is whether doing so is TRT for many/most Emacs
>> > users (which could have different workflows).
>>
>> How would we know if proposed functionality *would* be used by enough
>> users? What is a threshhold for enough users to add a function?
>
> We usually judge that by the number of people who request a feature.
I think the conclusion here was that there wasn't much enthusiasm for
this new function, so I'm closing this bug report.
Added tag(s) wontfix.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Tue, 02 Aug 2022 11:13:02 GMT)
Full text and
rfc822 format available.
bug closed, send any further explanations to
56311 <at> debbugs.gnu.org and Zachary Kanfer <zkanfer <at> gmail.com>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Tue, 02 Aug 2022 11:13:02 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
.
(Tue, 30 Aug 2022 11:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 2 years and 294 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.