all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#67972: Use *command (&)* instead of shell-command-buffer-name(-async)
@ 2023-12-22 17:31 Nafiz Islam
  2023-12-22 19:18 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Nafiz Islam @ 2023-12-22 17:31 UTC (permalink / raw)
  To: 67972

[-- Attachment #1: Type: text/plain, Size: 1535 bytes --]

The buffer name for the shell-command or async-shell-command would be much
more useful if they were given the name of the command being executed.

I started working a bit on a patch for that, but it's just code changes
right now. Here's a preview of what I mean.

@@ -4252,12 +4252,6 @@ undo-outer-limit-truncate

 ;;;; Shell commands

-(defconst shell-command-buffer-name "*Shell Command Output*"
-  "Name of the output buffer for shell commands.")
-
-(defconst shell-command-buffer-name-async "*Async Shell Command*"
-  "Name of the output buffer for asynchronous shell commands.")
-
 (defvar shell-command-history nil
   "History list for some commands that read shell commands.

@@ -4671,7 +4660,8 @@ shell-command
  ;; Output goes in a separate buffer.
  (if (string-match "[ \t]*&[ \t]*\\'" command)
     ;; Command ending with ampersand means asynchronous.
-            (let* ((buffer (get-buffer-create
+            (let* ((shell-command-buffer-name-async (concat "*" command
"*"))
+                   (buffer (get-buffer-create
                             (or output-buffer
shell-command-buffer-name-async)))
                    (bname (buffer-name buffer))
                    (proc (get-buffer-process buffer))
@@ -4942,7 +4932,8 @@ shell-command-on-region
        shell-command-default-error-buffer
        t
        (region-noncontiguous-p))))
-  (let ((error-file
+  (let ((shell-command-buffer-name (concat "*" command "*"))
+        (error-file
  (if error-buffer
      (make-temp-file
       (expand-file-name "scor"

[-- Attachment #2: Type: text/html, Size: 1949 bytes --]

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

* bug#67972: Use *command (&)* instead of shell-command-buffer-name(-async)
  2023-12-22 17:31 bug#67972: Use *command (&)* instead of shell-command-buffer-name(-async) Nafiz Islam
@ 2023-12-22 19:18 ` Eli Zaretskii
  2023-12-22 19:39   ` Nafiz Islam
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2023-12-22 19:18 UTC (permalink / raw)
  To: Nafiz Islam; +Cc: 67972

> From: Nafiz Islam <nafiz.islam1001@gmail.com>
> Date: Fri, 22 Dec 2023 12:31:24 -0500
> 
> The buffer name for the shell-command or async-shell-command would be much more useful if they
> were given the name of the command being executed.
> 
> I started working a bit on a patch for that, but it's just code changes right now. Here's a preview of
> what I mean.

Instead of removing the default name, why not add one more possible
value to async-shell-command-buffer, which will do what you want?
Then users who are interested in this behavior could customize
async-shell-command-buffer to that new value.

Thanks.





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

* bug#67972: Use *command (&)* instead of shell-command-buffer-name(-async)
  2023-12-22 19:18 ` Eli Zaretskii
@ 2023-12-22 19:39   ` Nafiz Islam
  0 siblings, 0 replies; 3+ messages in thread
From: Nafiz Islam @ 2023-12-22 19:39 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 67972

[-- Attachment #1: Type: text/plain, Size: 933 bytes --]

That is a good idea. They could take a string or a symbol with a default
string value.
The variables shell-command-buffer-name(-async) could be declared as
defcustom instead of defconst.

On Fri, Dec 22, 2023 at 2:18 PM Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Nafiz Islam <nafiz.islam1001@gmail.com>
> > Date: Fri, 22 Dec 2023 12:31:24 -0500
> >
> > The buffer name for the shell-command or async-shell-command would be
> much more useful if they
> > were given the name of the command being executed.
> >
> > I started working a bit on a patch for that, but it's just code changes
> right now. Here's a preview of
> > what I mean.
>
> Instead of removing the default name, why not add one more possible
> value to async-shell-command-buffer, which will do what you want?
> Then users who are interested in this behavior could customize
> async-shell-command-buffer to that new value.
>
> Thanks.
>

[-- Attachment #2: Type: text/html, Size: 1349 bytes --]

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

end of thread, other threads:[~2023-12-22 19:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-22 17:31 bug#67972: Use *command (&)* instead of shell-command-buffer-name(-async) Nafiz Islam
2023-12-22 19:18 ` Eli Zaretskii
2023-12-22 19:39   ` Nafiz Islam

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.