From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Nafiz Islam Newsgroups: gmane.emacs.bugs Subject: bug#67972: Use *command (&)* instead of shell-command-buffer-name(-async) Date: Fri, 22 Dec 2023 12:31:24 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000082ce8b060d1c96c4" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39341"; mail-complaints-to="usenet@ciao.gmane.io" To: 67972@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 22 19:37:18 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rGkOc-000A42-F4 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 22 Dec 2023 19:37:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rGkOK-0007nP-EP; Fri, 22 Dec 2023 13:37:00 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rGkOI-0007n2-2J for bug-gnu-emacs@gnu.org; Fri, 22 Dec 2023 13:36:58 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rGkOH-000723-Q2 for bug-gnu-emacs@gnu.org; Fri, 22 Dec 2023 13:36:57 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rGkOM-00078q-B4 for bug-gnu-emacs@gnu.org; Fri, 22 Dec 2023 13:37:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Nafiz Islam Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Dec 2023 18:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 67972 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.170327019127409 (code B ref -1); Fri, 22 Dec 2023 18:37:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Dec 2023 18:36:31 +0000 Original-Received: from localhost ([127.0.0.1]:47871 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rGkNq-000780-KG for submit@debbugs.gnu.org; Fri, 22 Dec 2023 13:36:31 -0500 Original-Received: from lists.gnu.org ([2001:470:142::17]:45938) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rGjNH-0003KM-Nl for submit@debbugs.gnu.org; Fri, 22 Dec 2023 12:31:53 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rGjN6-00052Q-Qu for bug-gnu-emacs@gnu.org; Fri, 22 Dec 2023 12:31:41 -0500 Original-Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rGjN4-0006gM-7d for bug-gnu-emacs@gnu.org; Fri, 22 Dec 2023 12:31:39 -0500 Original-Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a2340c803c6so251342766b.0 for ; Fri, 22 Dec 2023 09:31:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703266296; x=1703871096; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=ewm4aI2Au3F1hfTxlCY3QEgATiNnZO4IvY13urQOg2o=; b=BM3OD3YcvG5gUhlbaqUnvPzxXd3gZoSs+35QtQc1ASNjLHtgEIwI/zXV/MDEoLCvfE v+KiL8pUobeUcU/N8Qkn6bmLFs7/jQ/QY/1mNBfxzRTbl774UTL8MXGg4qIMstcOArqz ROoqWB1VqWLE/m5sylEGYPppyPiFw1GpHZVjy/d/QeZkyrf6dKfXisgLnu3K9TF5Wbts UHHCmATWtnbA6AY9ClbbFjzQK951zW+fQa8dffUQHi66iopItxBO3pT299HIAeH9Zk1t 5AA1wZBfjsSDWRnEvVBPw3QcBYOmJ7ubN73e+SDmWFgvx33OXV9zCJ1r4e3DbhuWQHO1 8o2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703266296; x=1703871096; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ewm4aI2Au3F1hfTxlCY3QEgATiNnZO4IvY13urQOg2o=; b=V5Sb7yszNHbFbjY6CynPorOJzuycI9/vpgRP/iwD2gbVOPp5D+7nDYGf0gR3OkOfPw hdHdogvTwfVijfYI3M4FqwDTyGkaYlGSEgk2qxBWRnDnFkprmWoSz/GmjbjSP9OBasKF X/7zWkQDADpkRw9OENLeGN8q9SqgNi12FuEz/wCCaDt0bP3e3DTI894p7BCD1l0PthkP su+pDxioLpGZcmqbLO1JdkSvd5K42N8tYjHWfLWC/OvjLsqy+hsGpxTNModmwr2yriXV By3RZoHMTPypNNuqt059vK5B6fTd1c8Fb7bwe+e3TJu6gPFqMdkyeromhz1glwsdTTLB MSOA== X-Gm-Message-State: AOJu0Yyu1Pvgl450Gyph1FMZxnqHhGBOW6YqaWfocBEEwou+y9GFHQ4u qLh7YttwNJzRJKTbywfx908ibNpU0iifW/PamREnU3Y4AVE= X-Google-Smtp-Source: AGHT+IEsQEE6VvaqNfMkXEZmQmeDYFMZWUDc5/G5rJ0tKYCQkB/v2Muw8/9H8ptac6Pt3SOihVdaItjl6NtiSeJCS2A= X-Received: by 2002:a17:907:174a:b0:a26:4625:eea7 with SMTP id lf10-20020a170907174a00b00a264625eea7mr860319ejc.155.1703266295662; Fri, 22 Dec 2023 09:31:35 -0800 (PST) Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=nafiz.islam1001@gmail.com; helo=mail-ej1-x631.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 22 Dec 2023 13:36:28 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:276687 Archived-At: --00000000000082ce8b060d1c96c4 Content-Type: text/plain; charset="UTF-8" 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" --00000000000082ce8b060d1c96c4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The buffer name for the shell-command or async-shell-= command would be much more useful if they were given the name of the comman= d being executed.

I started working a bit on a pat= ch 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-trun= cate
=C2=A0=0C
=C2=A0;;;; Shell commands
=C2=A0
-(defconst shel= l-command-buffer-name "*Shell Command Output*"
- =C2=A0"N= ame of the output buffer for shell commands.")
-
-(defconst shel= l-command-buffer-name-async "*Async Shell Command*"
- =C2=A0&q= uot;Name of the output buffer for asynchronous shell commands.")
-<= br>=C2=A0(defvar shell-command-history nil
=C2=A0 =C2=A0"History li= st for some commands that read shell commands.

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