help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [solved]: Re: Finding last *Async Shell Command* buffer?


From: Jean Louis
Subject: Re: [solved]: Re: Finding last *Async Shell Command* buffer?
Date: Fri, 26 Mar 2021 11:55:52 +0300
User-agent: Mutt/2.0.6 (2021-03-06)

* Eli Zaretskii <eliz@gnu.org> [2021-03-26 10:57]:
> What happens if that buffer was meanwhile killed?

If it gets killed, new buffer with same name is created. But if it
really gets killed, most probably I killed it by using the key binding
from that function, like `C-c l'. Purpose is to see output of async
command, so if there is no output to be seen that new buffer is
created does not matter.

No, it is not elegant, it is very personal.

> Personally, I find it un-Emacsy to write a wrapper command each time
> you want to manipulate the results of an existing command.  Emacs
> provides hooks for that very purpose, so it's best to use those
> instead of inventing a new command each time you need something like
> that.

Yes, I agree. 

Coming from my experience with databases, for me it would be most
usable if buffers have their creation time recorded, as that way would
be easy to find the last async buffer, or others.

In this specific example users can change the async buffer name or
Elisp programs could change last async buffer names. There is no easy
and default way how to get last buffer or last few to look into
outputs easily. It requires listing, inspecting. 

But it is terrible when there are many, as the generate-new-buffer
will create the next available number in a series and not the next
increased number compared to previous buffer.

Maybe the function `get-buffer-create' could be changed to increase
the number of newly created buffers instead of just taking some of
empty numbers in a series?

For end users I do not think that would make any difference, as the
added buffer number is not interactively influencing users.

What do you think about that change? I would not know how to do it in
C. 

> Redefining a key binding each time you run an async command is also
> ... inelegant.

Ah, definitely.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]