From unknown Mon Jun 23 07:48:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#63432: 30.0.50; Handle current-prefix-arg in async-shell-command Resent-From: Gabriel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 May 2023 23:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 63432 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 63432@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.168376018123653 (code B ref -1); Wed, 10 May 2023 23:10:02 +0000 Received: (at submit) by debbugs.gnu.org; 10 May 2023 23:09:41 +0000 Received: from localhost ([127.0.0.1]:49217 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pwswH-00069Q-6W for submit@debbugs.gnu.org; Wed, 10 May 2023 19:09:41 -0400 Received: from lists.gnu.org ([209.51.188.17]:52992) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pwswC-00069E-6F for submit@debbugs.gnu.org; Wed, 10 May 2023 19:09:40 -0400 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 1pwswB-00011O-Vx for bug-gnu-emacs@gnu.org; Wed, 10 May 2023 19:09:36 -0400 Received: from mail-bn1nam02olkn2080c.outbound.protection.outlook.com ([2a01:111:f400:7eb2::80c] helo=NAM02-BN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pwsw9-0001GN-Gz for bug-gnu-emacs@gnu.org; Wed, 10 May 2023 19:09:35 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BsjzQgfsu72cX5pKNBLDfwFsfLOWYqEG8Uic2q/pp+KmVSsGnFjP4Q9a/2t3JbZEt9G5d/+AabyEfMTn9jdJV9rnstYFxevL85yqMdwNFJMYhFfhcZn89VAPFCmH9GCVp3oSRYG5mCUEbPWo3PNcg2W6quStEZ2UWRaRBg8AjzvLHrlWkE3+YVdA1nnLDYZNgUEmuPAfTceDwGDfYr1zVWJm5P6IRFLAzofGzw7SffhRa6yLKPxL0ANfe/OJeR8t2XfKNpFGJzc8sPBLscncO+0SRgVTn12pXE7G3rFWs70r2SLuetV5BsDO4393Ruc/+1VskOvWXBFNvwG8Q3wxbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MfkGMAWUr5+dq96AWD1STKB6xN5c8dc/m/sNLAGcN/A=; b=iuJgEBVjK1Bos732jblzhcGpUTVy3rd00JMH6OqYmUh2wtmhkeCf8mKy6Tyc6+IinTq+SBQLll9N6bKcGJVF3fm7lE3vg4GrCkmPu+Z6dJR0U801gINOfiT9PK4X/HF1dtQ/kr6YDAOtdHaprC61eFlnRiPCC1JI0qM/Xcx02M/ytplXZtfh0qQOemlr0Cj9prB76y+fiUb5erRvW/GizQPukFrk4YSS/l/9HK/JaADf1JmeJFPJi1THYA4/bQFuHZmlCFFRDDvlYn/0r8nlpCkWcc5c0O6WR0b8qmBhy+Uh6iQfjgnEncKKpebLZPia/Luy0RBrkAmYJ8fHPIkfxg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MfkGMAWUr5+dq96AWD1STKB6xN5c8dc/m/sNLAGcN/A=; b=iJPLEQeO1ReoOawsdi9ZtLd0RYPg7eckvJo/Cl9LSurxPnAYyBSyvcla/CmVINcj3q+f0zhdWGU1KLtCBVPwAxtKFhAk+YAl7YyucS1d0330wqBlL6yOEdtg662gleu9wrQ1EBamRdO2Q1mBffIzRbPMnyFazQ4hYShMW+sRUovJoie2mWnd+tZvnBG8AlV7AGtm6Boty8QWqSbZjhX4WaOBzPhzejzFnUp15m2Z4xzgMZxy5ukkn/k20cWnDOGrurSCrEZF0MOB3BMTES1K3Os3Y5KFn+iS7zTjqp8jKNYSnzwpRrTfUX414TzmxNJwvh1eDrT+6W0lO7ya3rjSDQ== Received: from PH8PR19MB7070.namprd19.prod.outlook.com (2603:10b6:510:222::9) by DS7PR19MB4407.namprd19.prod.outlook.com (2603:10b6:5:2c0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.20; Wed, 10 May 2023 23:04:30 +0000 Received: from PH8PR19MB7070.namprd19.prod.outlook.com ([fe80::eb52:9bfc:f218:8635]) by PH8PR19MB7070.namprd19.prod.outlook.com ([fe80::eb52:9bfc:f218:8635%7]) with mapi id 15.20.6387.018; Wed, 10 May 2023 23:04:30 +0000 From: Gabriel Date: Wed, 10 May 2023 20:04:24 -0300 Message-ID: Content-Type: multipart/mixed; boundary="=-=-=" X-TMN: [1Hgo8tPjhGh0anCe2SDI4RmCMXVsqPhg5ZHF8RHL8YrxlcAGYvBacbG42xRxyww1] X-ClientProxiedBy: CP4P284CA0029.BRAP284.PROD.OUTLOOK.COM (2603:10d6:103:126::19) To PH8PR19MB7070.namprd19.prod.outlook.com (2603:10b6:510:222::9) X-Microsoft-Original-Message-ID: <87jzxfhjpj.fsf@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH8PR19MB7070:EE_|DS7PR19MB4407:EE_ X-MS-Office365-Filtering-Correlation-Id: b501f174-cc29-4553-7ddd-08db51aae918 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6wOYqmfO+zFWC6XjHz0XIqPXitORznupvv1cjOGHXODV1/n9ltMdicuXo7G72m019te6vGHf1QNalmiTBpXXfwEZC4txTl9uglLGFCSzNULZSMqz6mzCnrFWqZjP6Bz3TuyNDU7XLYGZm0kSzuW2UdNtjDQaq5kmR/IwLoms0TdUFrWd/q2n0q7cWGCmalGdBZ5Dgep5uTOxJe25qwj6BtxNw1VfBtpOcK6DxwwMcWrnnNwaeye0sqpDe1amgdxEqDsoRfh0D5mYqxfYgz+uDLFP+sip14onIYK2i8+dCs8wkRK4uxAsrISc8CODzUCPkLwtyVgkk1lDovfNjJr/1o2q+z8DMG3M/p02O/Ezhk4KWC8Mf8Nd/25uUJVJ+h+XT+lvAQ0dJpIfKGDxU9sfjzNzzrEMUueOKpcFs8xFpEkNxYO0R7dSKlKQcfqqz/iyh0sbb9jAeYHiHkbSn1dE49NCAXKq7gvtbK3HsokIQfrvzRDYjuw2FHUQqfY2z57NQ6s2IN1YAymouPOyTiPNjroJZ3PaCo7LDmHHY4tYfVXrgvN8v1WB1Bot4isvrO8Y X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ORMRzu4l9J+8IzJFGcj2nXMln2ogkL56r5xKmSzNpY84aZIKNcP1IDIVzzVzYDn9dbA/DOMuUt+MKd/EzYhbo/N5msrmfk+zGp5HNxWjeKj1MAmbvjcuMddoEBDdmTNq+LN0tYOB4IrbmxiS0RaomuZTAg/B/N4bBU3TtjFzQzJhyzlTCk7KSeWeizru3BL63adTn33dHYY/TrOLbWgClFj4mhV3xKxZgbOWqbZhkmWFnjXJp9iNhVSjEFqPghx6Ytu+KNEgr5aDPdBpBpcFjO2kX3qraO6oY4QRGIainFjJKEonAC4VSwraGYUamaV7R5NupC3SEv02Z+MtExfFFMES6w8ZRBto3gFSDfOJx0wwxDp1xB8+4SzbxVAkZDbifnzZh+DqEklH4lrl9+HNzhCj4dytyzA37Rx/33Mym3hNw/jmZfFN1LT6zt5MZ1pGUCQ1zFMyp0SVxbDUajQxhQ0aLuQq793NUkmmidjIDdPCKeih6V3UEJjCPNoD5wFaUZTJLfAdLJQgJn1M2hm+NNDDH+yB2vM7AvwfEvB38j2O6WlgpAspx34tt6a+lmR7UOQK5JCeNZ1CeTS2TddPqyqDRZUOQTIgBvlyFULwMRGVYHXZxZ6lb6A0Wr8Pulii7s9IHhDKQvHuh+EziBwzw+RmrDQeJqZLypIY8lNFyu8uQF0DBln6YkuhXsc/ccrAmWM2Cf42csB28kTe/DtvRk0qMVyLe20viRXRQtjxldV53fGKJH+F9B9PxgKNdQJVSAM5rcSXJSUwOkPZa/yXj+G8q5adHH3/ls4c0HyLXlzS46vIJ8h0jhJvDB9C1ic3WarrmCVjFqlXjWtz067/ZYB1R6mA1Obs94YwCBLqvrZ9cnYsPQp06fHe5MdVcn3yZQDJ4D1TApIOXv+rvfEybol0sIdZEmbKiDuJbhOH/I6V1TRkle91HCPk+IzS36pNxvE8m55/8L2ClJhz24NDhyHCffcd3GGbPKawYfI+RVrciL/P2NLoPfm8lIx3hws9Z6iolu14JLadkJ0uExqelFfv6kbBcqf4tDB6rB+Uy2j1hUidup+pakWwP6WdwibfSxWky7gO8T/EemQEQ/yWOvIZg+AVvSsTWqndYNcuGo+CjlppnlhgUDaVLRLU2xdUPuP9Yg9ziWfNtLWqnO13q+6C+n9nE8ZWoBHDr3VAOPjKgTymNnEi99eaM0zYeyJrEIyEtzG3TfIr8MoFixF1kMlwBfCytwn0Vs+lw/CmOa+hvmUrCbiiVgoA8RM0YkEPacewLVZsUlydtPUYtf4J9kxs1eQcI5A0cm3Af5wkjOc= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-e7757.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: b501f174-cc29-4553-7ddd-08db51aae918 X-MS-Exchange-CrossTenant-AuthSource: PH8PR19MB7070.namprd19.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2023 23:04:30.7542 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR19MB4407 Received-SPF: pass client-ip=2a01:111:f400:7eb2::80c; envelope-from=gabriel376@hotmail.com; helo=NAM02-BN1-obe.outbound.protection.outlook.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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) --=-=-= Content-Type: text/plain Severity: bug Steps: 1) emacs -Q from master branch (3adc1e7f379) 2) C-u M-& "ls" Error: shell-command: Wrong type argument: stringp, (4) Cause: When called interactively, `async-shell-command' pass argument OUTPUT-BUFFER as `current-prefix-arg' to `shell-command'. As per docstring of `shell-command': "If OUTPUT-BUFFER is not a buffer and not nil (which happens interactively when the prefix argument is given), insert the output in current buffer after point leaving mark after it. This cannot be done asynchronously." Patch: --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Handle-current-prefix-arg-in-async-shell-command.patch >From 8016742cfd1d59cf3082afeb1cf77b9a12b9b251 Mon Sep 17 00:00:00 2001 From: Gabriel do Nascimento Ribeiro Date: Wed, 10 May 2023 19:41:05 -0300 Subject: [PATCH 1/1] Handle current-prefix-arg in async-shell-command. * lisp/simple.el (async-shell-command): Properly handle current-prefix-arg. When called interactively, defaults to nil, otherwise, check if it's not a number before passing to `shell-command'. --- lisp/simple.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/simple.el b/lisp/simple.el index 58517dd81f9..ba832581955 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4499,10 +4499,12 @@ async-shell-command ((eq major-mode 'dired-mode) (dired-get-filename nil t))))) (and filename (file-relative-name filename)))) - current-prefix-arg + nil shell-command-default-error-buffer)) (unless (string-match "&[ \t]*\\'" command) (setq command (concat command " &"))) + (when (and output-buffer (numberp output-buffer)) + (error "Invalid output buffer")) (shell-command command output-buffer error-buffer)) (declare-function comint-output-filter "comint" (process string)) -- 2.34.1 --=-=-= Content-Type: text/plain --- Gabriel --=-=-=-- From unknown Mon Jun 23 07:48:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#63432: 30.0.50; Handle current-prefix-arg in async-shell-command Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 May 2023 13:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63432 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Gabriel Cc: 63432@debbugs.gnu.org Received: via spool by 63432-submit@debbugs.gnu.org id=B63432.168398543215301 (code B ref 63432); Sat, 13 May 2023 13:44:02 +0000 Received: (at 63432) by debbugs.gnu.org; 13 May 2023 13:43:52 +0000 Received: from localhost ([127.0.0.1]:36250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxpXM-0003yj-7v for submit@debbugs.gnu.org; Sat, 13 May 2023 09:43:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45264) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxpXK-0003yM-35 for 63432@debbugs.gnu.org; Sat, 13 May 2023 09:43:51 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pxpXE-0003DL-A6; Sat, 13 May 2023 09:43:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ekOrPIqFHFU+nR73fTmF6SXrDL3qy0Sq0oKpveRQTH0=; b=ioaY1aaQpe5P 2mCUfdmBlTEieQh/4G+TXqkwKFfEdRoX5JSZR+9QXWB0mqAVkYeUcLTm4T8c/gATl2cNXClLFOYCo msM5SaOLt2VmGj1zqtSM06Q4zRs/cVIBbhLLDq3MFkrzIe/Z5XRGqK7Cqato0hQd3gnZEWtnR9GJO Px+XVB29kbdGnhHVDN58Eh07uBEOiyP4GEt6mZg8vcOvAjsjABiG4QXMXyCZWuWY4i7lL5cVbx276 ZEQfomhfOw9fbemi0d+CD+o+BYZ5DXbdC/o2ZoiMrS0mh2UanL1VdzdzF6ac1NdyePyEnzZsrraFN YaNncFcrTsTl8S8icqF3zA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pxpXD-0001L1-QT; Sat, 13 May 2023 09:43:44 -0400 Date: Sat, 13 May 2023 16:43:42 +0300 Message-Id: <83ttwg9wj5.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Gabriel on Wed, 10 May 2023 20:04:24 -0300) References: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Gabriel > Date: Wed, 10 May 2023 20:04:24 -0300 > > Steps: > 1) emacs -Q from master branch (3adc1e7f379) > 2) C-u M-& "ls" > Error: shell-command: Wrong type argument: stringp, (4) > > Cause: > When called interactively, `async-shell-command' pass argument > OUTPUT-BUFFER as `current-prefix-arg' to `shell-command'. As per > docstring of `shell-command': > > "If OUTPUT-BUFFER is not a buffer and not nil (which happens > interactively when the prefix argument is given), insert the output in > current buffer after point leaving mark after it. This cannot be done > asynchronously." Yes, this bug was there since the day async-shell-command was added to Emacs. > diff --git a/lisp/simple.el b/lisp/simple.el > index 58517dd81f9..ba832581955 100644 > --- a/lisp/simple.el > +++ b/lisp/simple.el > @@ -4499,10 +4499,12 @@ async-shell-command > ((eq major-mode 'dired-mode) > (dired-get-filename nil t))))) > (and filename (file-relative-name filename)))) > - current-prefix-arg > + nil > shell-command-default-error-buffer)) > (unless (string-match "&[ \t]*\\'" command) > (setq command (concat command " &"))) > + (when (and output-buffer (numberp output-buffer)) > + (error "Invalid output buffer")) > (shell-command command output-buffer error-buffer)) Thanks, but I don't understand why we need the error message. Isn't it enough to pass nil as 2nd argument to shell-command? From unknown Mon Jun 23 07:48:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#63432: 30.0.50; Handle current-prefix-arg in async-shell-command Resent-From: Gabriel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 May 2023 23:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63432 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 63432@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.168402126728035 (code B ref -1); Sat, 13 May 2023 23:42:02 +0000 Received: (at submit) by debbugs.gnu.org; 13 May 2023 23:41:07 +0000 Received: from localhost ([127.0.0.1]:39927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxyrK-0007I7-Ix for submit@debbugs.gnu.org; Sat, 13 May 2023 19:41:06 -0400 Received: from lists.gnu.org ([209.51.188.17]:33748) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxyrJ-0007I0-Qq for submit@debbugs.gnu.org; Sat, 13 May 2023 19:41:06 -0400 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 1pxyrJ-0005mX-LG for bug-gnu-emacs@gnu.org; Sat, 13 May 2023 19:41:05 -0400 Received: from mail-bn8nam11olkn20800.outbound.protection.outlook.com ([2a01:111:f400:7eae::800] helo=NAM11-BN8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pxyrF-00047q-GA for bug-gnu-emacs@gnu.org; Sat, 13 May 2023 19:41:04 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M2ptxqssbCjf+o35y14iQSMZ6mvA0iMR5GwEfi5HP+5eUUShjxl7NBPy1WesCUfT+9AZVPcJe1/YSYIyxM+9tJrSOpIN4Pl9tJaypwWhzLJ66HqvASBNaB37Xb2oYv0eEELvT7geOvqjl6SLFokd6bCkbRaD7OuIL87HZ89yoUZJ1cuzB9ea/9kYDsysVL6kGdrlKamGFMxyqX9+bcoftXuwXkeltU3qFYQ+Ok9T0YcOthyF2+65l3U4miYSrArSq1vqvNJjlNp70MhqNdi40DDrS4HjD/hYc1ju2KrdG2NVe9vO8kHhx3f0lwE6a/z4lHAlvthx5U48wy3Vw3QDGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VsHCmHPsy0WAYPTgI5q0erkDR0tWplBXrg4TItndeJM=; b=YyQmhjvkX4jUI6OB19M5WtcAA/Dz8byl4u9cmgmjTucXKYRDh67p3UaDUMdUxsj/UB82Ie7DVFsjZt7uX5j8A2DQRt890980CZfakdbfIAmYT8ipO9Lroe2xIdGYuIbFLkWeeb/vPJN53JuOaxt895QQkyJV9xZGutjQB9vNy9jD1ChZZ7wCpUnBmux6p7xelYeRvSihpKjkM0tmel8QEf1TlSTF1ktaeSvxYLkfz8AUDopOLiMJelJDMQm1JC80w9DYERXS6OjhBu0gYFY3AQgiQIstmncbGg9793LfDM7fEMi8NBe418YbfPDR5ZV8xadnJ7nhmcIRkfJ78iyHjg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VsHCmHPsy0WAYPTgI5q0erkDR0tWplBXrg4TItndeJM=; b=ra2za0mzDHTSF1rfq0/VuXxbBrstd7h8qkKEdr1IS681Prly2jHy66tfuC/b5X29V/loTNFfd1mFJDa0feGggqPW5SYvMkyCIC/Nr+uCsX0SBsofc09Xhs7unu+vgYM8gMjBkR3+uqlnbaYma6OPlsT7LI7W6KdpHBbZlNcwUCfxnzGl7BrpgjNxCvC3kx67NMP/rrFMLgyl48lbBvLM0dvSeaywKNmpiktq8ugRBz0xLitIDIlfpGljXpwFnbEqf7tlDFZC9WYtC6JtloHYGnajOw++aiPudmZNSWotLKi2jmizRwJQS/oSsFF+lFNRhu3mxW2e9ScTmgj20TOQHw== Received: from PH8PR19MB7070.namprd19.prod.outlook.com (2603:10b6:510:222::9) by CYYPR19MB8101.namprd19.prod.outlook.com (2603:10b6:930:c5::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.11; Sat, 13 May 2023 23:35:57 +0000 Received: from PH8PR19MB7070.namprd19.prod.outlook.com ([fe80::eb52:9bfc:f218:8635]) by PH8PR19MB7070.namprd19.prod.outlook.com ([fe80::eb52:9bfc:f218:8635%7]) with mapi id 15.20.6411.011; Sat, 13 May 2023 23:35:57 +0000 From: Gabriel In-Reply-To: <83ttwg9wj5.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 13 May 2023 16:43:42 +0300") References: <83ttwg9wj5.fsf@gnu.org> Date: Sat, 13 May 2023 20:35:51 -0300 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Content-Type: multipart/mixed; boundary="=-=-=" X-TMN: [SCl2G4n1gerrXDD/ANdgeDNLNgxHC6u0qMCbXCH61YALP4dDiATu9W5WLnV+dmjJ] X-ClientProxiedBy: CP4P284CA0007.BRAP284.PROD.OUTLOOK.COM (2603:10d6:103:128::21) To PH8PR19MB7070.namprd19.prod.outlook.com (2603:10b6:510:222::9) X-Microsoft-Original-Message-ID: <87bking5yg.fsf@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH8PR19MB7070:EE_|CYYPR19MB8101:EE_ X-MS-Office365-Filtering-Correlation-Id: 9ba26c96-127d-4fa8-f27c-08db540acd32 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hbRlzvTDaJKBRerDkn7rvLc2GnLDqNGgY7aA8NLHrOAUrBdnGjN2dgypM64/83Eeon4TnjyWoZw5rH/s3oAb/ojGLHpKXfqqVA/aN1kcpZs8BleFGus21rGqxd4MGMBdX5m6El8rLCHFRQDstwc/RDKOFeuhggZRLnpj2eqQN1Cjb1AW61A2nqSuPsSOoIIWhWMPWRdLzRcn1+6m5TIQfitkv2i+Lvsc7uw6oEOEg5ByiMgOGl5yLZCqiYNoDykBT8eFp+GBqboJdXL7A7cdMEw2sRKTkn47mLZsXPqkgxL/aGanBbnHuufhP0xwdHItIBPPJLYHUjFIb2Lt0k4w045zjF4iEcGxE/p2cZ4GpdHH2z69YdZwx/QM0wQpRwXWum+n8Bn8M7geAR09bvn9+GFS9LtYl6Sw7mROeLvXWEXLo3sPwngRoxf+faI4X5lrbP38M4aW1XyVMGtlB9Ne1CWQle6ZjHCe8KAlEtFgFM3v2x1+MfVNGiRm76H7OS+YF07EJjTVwvEa8JK7daMIDUa+NphLb9J7UAY5eqBO9/Vuo+cX5Pz6ZeiL4IPvpvsVN90bI36oH8KPBdE1czY0EGkgpYdJRelA53ZfjrosKQ1WZ7XSzjx/W5Agcvg/uF4b X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MDNunbdMivVVN6iGNX5m1xqNucsw667hbMh9C8Vy9QTnlKLY9J4JQv/yL2vS/yI+CU19t1m0fHdKxRq2LE/LUrjIdwS+5thNL9jKJKFaWSQkHe7NBFJrk4r5DntiQ33dWZB6qY+P1zD+t5OKljI6I8Js3+C6o9q0iJoXtvhVRfsPC7ZAAdDk+Y9sWKR7BtI8ubb9cih+C6x9KhymwQiJ74sbCMC4+vJAAmQzkYIRa1AncVovxP4HY6qWqjKfpI0wbK53E3p7vV54nRqSJsHXpCOzOsUUWVBYEWdhZeue9eqpiOnKqPgS6Y8ouJB5v9BbCNzE4iI7FsE97VEd1rL694yxoEAyVhlP/tx6+GQ42y2fyxlD+FP5QuqkZ61rVFc92twrJh9A0JVVNBdpaCbwEOpy494dn6WtN+UFbhXZebHEQrS88rerpeSwErKV1EaSzUw/Xlmqr639yvSwXXbaeth5OriVnLphtwogxC/L7lFj9WF3RL+urls8eroYaxMQ4prfxtaBJL26uRVNhFMXIju2hyJNWBfGGmWHBmS+ZfvNZwr4d9HNMEy97z0z8d98rYK0a0I2Bdr5y3hsDg4frJpQqOv5PkYuIHV0l8M/1ATmN8HyddhQEPOD2IXtPDHYkG501AI0SadCqvK+LjfT/TVuedHjoR7NHLzjuTajdZySSdpsrcBg/6jrNm2qcIdq/WQRltBrGMIf0nPyW1StBA+0uoE0A3qDkeKX3Ga1CMJy3SLe/L6WLPH2JZsj+oAHsw1j2hgyrMqeh2SdXXwkb6ruySiSqC5qejvwbXCgaGCMrJrPNa558LILWtAlz+XVsG3FutwrBiQuPcFvjy6+6vXvkPvkuSuuJ5OtSCTFr4CKhOm+El2bVs0jbqJ/jMLd3SNBdTACc0K4pyosbeRBEiU7QzDsUa5YGBDZhq9OtrYB34dLFwQO1x/zEBJnJQq/GsagcwZJgXx9ujuzdIBkDQNfod4IYrKvGlrmKmZyhhDVEuf17fhVnwDV/gXX3Ue7p1IVEU41t+gAvti379lQ4ugcxYbppYPUWhi7fB9+aSnZe/WXECgezlEIQZ7gPacKAxNiQ6RlBL9zK9yIeyip3TeTkRSG249hCc1jpdZ/4PxzBEn+Bhl6mpw1NClmDVFEWyQODpYEKE2v9mzBQFa0OnTkwaMvI3UBRbYlR5hQxakjRGzaJuEasNL3/Cow+gbqu+9cuqJJ8hbRD2HNTEne088H6EISnv7FPWb5aH4U3Sedsqyg7HXD4kmNLyJDH2R9VpxFIY+oK3gwI9rnudd8bAbsPs3ZEOrEiRvpOGxhAok= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-e7757.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 9ba26c96-127d-4fa8-f27c-08db540acd32 X-MS-Exchange-CrossTenant-AuthSource: PH8PR19MB7070.namprd19.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 May 2023 23:35:57.6675 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR19MB8101 Received-SPF: pass client-ip=2a01:111:f400:7eae::800; envelope-from=gabriel376@hotmail.com; helo=NAM11-BN8-obe.outbound.protection.outlook.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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) --=-=-= Content-Type: text/plain Eli Zaretskii writes: > Thanks, but I don't understand why we need the error message. Isn't > it enough to pass nil as 2nd argument to shell-command? The error message is just for noninteractive cases where a caller passes a numeric argument as the second argument of `async-shell-command'. For interactive cases, a nil value will be always passed to `shell-command'. Example: Before patch: (async-shell-command "ls" 1) => error: (wrong-type-argument stringp 1) After patch: (async-shell-command "ls" 1) => error: (error "Invalid output buffer") Here is a patch without the error message, in case it's preferable: --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Ignore-current-prefix-arg-in-async-shell-command.patch >From 60f901126d5c883cc1c1d60a2b2b71ad3524f065 Mon Sep 17 00:00:00 2001 From: Gabriel do Nascimento Ribeiro Date: Sat, 13 May 2023 20:31:24 -0300 Subject: [PATCH 1/1] Ignore current-prefix-arg in async-shell-command. * lisp/simple.el (async-shell-command): Ignore current-prefix-arg and always pass nil to second argument of `shell-command'. --- lisp/simple.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/simple.el b/lisp/simple.el index 73c2dfa365d..98278ef2a18 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4499,7 +4499,7 @@ async-shell-command ((eq major-mode 'dired-mode) (dired-get-filename nil t))))) (and filename (file-relative-name filename)))) - current-prefix-arg + nil shell-command-default-error-buffer)) (unless (string-match "&[ \t]*\\'" command) (setq command (concat command " &"))) -- 2.34.1 --=-=-= Content-Type: text/plain --- Gabriel --=-=-=-- From unknown Mon Jun 23 07:48:59 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Gabriel Subject: bug#63432: closed (Re: bug#63432: 30.0.50; Handle current-prefix-arg in async-shell-command) Message-ID: References: <83h6sfa0kt.fsf@gnu.org> X-Gnu-PR-Message: they-closed 63432 X-Gnu-PR-Package: emacs Reply-To: 63432@debbugs.gnu.org Date: Sun, 14 May 2023 06:29:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1684045742-19501-1" This is a multi-part message in MIME format... ------------=_1684045742-19501-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #63432: 30.0.50; Handle current-prefix-arg in async-shell-command which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 63432@debbugs.gnu.org. --=20 63432: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D63432 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1684045742-19501-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 63432-done) by debbugs.gnu.org; 14 May 2023 06:28:41 +0000 Received: from localhost ([127.0.0.1]:40173 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1py5Dk-000540-Qk for submit@debbugs.gnu.org; Sun, 14 May 2023 02:28:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42822) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1py5Dj-00053n-61 for 63432-done@debbugs.gnu.org; Sun, 14 May 2023 02:28:39 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1py5Dd-0000eW-Pj; Sun, 14 May 2023 02:28:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ss8U5l1KvXfaFc/23KCjkkh5CR5St31llmbIfuYqTrw=; b=ASkgrb8x/eB2 X2myVfI8nXIDMN87SEL4QqQbXBaHyGe+CjOpzjYE/o1HbqrEeRd6+SiDbSL4/h2Xtx2xopAWxyRf/ jHaI08Sx8P5ZhGhnXtXCuccibHccW1TOoCFwpoJjjJsDLgKt3J3RhbPogy1BAW/BFj5Th+xK6seOZ Xv98F31MpGn/Ny0GNcpw7kZC1VewYVf6OarkoUOVYOfYXsWVpPlv1yIVVEdQXK5VbA3QsKkO7LXRa rWH6vIBBz/0mQPSDxz/AiI9c4RlxJB4wb+4t1xFaML8rIzZToSyOufDmXN5pi54/5sZQ/z7HWX9FO nxQ8qtN09eGXtxk8YOivCg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1py5Dc-0005J7-MA; Sun, 14 May 2023 02:28:33 -0400 Date: Sun, 14 May 2023 09:28:34 +0300 Message-Id: <83h6sfa0kt.fsf@gnu.org> From: Eli Zaretskii To: Gabriel In-Reply-To: (message from Gabriel on Sat, 13 May 2023 20:35:51 -0300) Subject: Re: bug#63432: 30.0.50; Handle current-prefix-arg in async-shell-command References: <83ttwg9wj5.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 63432-done Cc: 63432-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Gabriel > Date: Sat, 13 May 2023 20:35:51 -0300 > > Eli Zaretskii writes: > > > Thanks, but I don't understand why we need the error message. Isn't > > it enough to pass nil as 2nd argument to shell-command? > > The error message is just for noninteractive cases where a caller passes > a numeric argument as the second argument of `async-shell-command'. I think the error signaled by shell-command is sufficient in the non-interactive case. We don't usually try detecting wrong-type-argument errors in non-interactive use, we leave it to the underlying primitives to detect and report. > Example: > Before patch: > (async-shell-command "ls" 1) => error: (wrong-type-argument stringp 1) > After patch: > (async-shell-command "ls" 1) => error: (error "Invalid output buffer") I see nothing wrong with the "before" version, it gives an accurate description of the problem for that case. > Here is a patch without the error message, in case it's preferable: Thanks, installed on the emacs-29 branch, and closing the bug. ------------=_1684045742-19501-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 10 May 2023 23:09:41 +0000 Received: from localhost ([127.0.0.1]:49217 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pwswH-00069Q-6W for submit@debbugs.gnu.org; Wed, 10 May 2023 19:09:41 -0400 Received: from lists.gnu.org ([209.51.188.17]:52992) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pwswC-00069E-6F for submit@debbugs.gnu.org; Wed, 10 May 2023 19:09:40 -0400 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 1pwswB-00011O-Vx for bug-gnu-emacs@gnu.org; Wed, 10 May 2023 19:09:36 -0400 Received: from mail-bn1nam02olkn2080c.outbound.protection.outlook.com ([2a01:111:f400:7eb2::80c] helo=NAM02-BN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pwsw9-0001GN-Gz for bug-gnu-emacs@gnu.org; Wed, 10 May 2023 19:09:35 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BsjzQgfsu72cX5pKNBLDfwFsfLOWYqEG8Uic2q/pp+KmVSsGnFjP4Q9a/2t3JbZEt9G5d/+AabyEfMTn9jdJV9rnstYFxevL85yqMdwNFJMYhFfhcZn89VAPFCmH9GCVp3oSRYG5mCUEbPWo3PNcg2W6quStEZ2UWRaRBg8AjzvLHrlWkE3+YVdA1nnLDYZNgUEmuPAfTceDwGDfYr1zVWJm5P6IRFLAzofGzw7SffhRa6yLKPxL0ANfe/OJeR8t2XfKNpFGJzc8sPBLscncO+0SRgVTn12pXE7G3rFWs70r2SLuetV5BsDO4393Ruc/+1VskOvWXBFNvwG8Q3wxbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MfkGMAWUr5+dq96AWD1STKB6xN5c8dc/m/sNLAGcN/A=; b=iuJgEBVjK1Bos732jblzhcGpUTVy3rd00JMH6OqYmUh2wtmhkeCf8mKy6Tyc6+IinTq+SBQLll9N6bKcGJVF3fm7lE3vg4GrCkmPu+Z6dJR0U801gINOfiT9PK4X/HF1dtQ/kr6YDAOtdHaprC61eFlnRiPCC1JI0qM/Xcx02M/ytplXZtfh0qQOemlr0Cj9prB76y+fiUb5erRvW/GizQPukFrk4YSS/l/9HK/JaADf1JmeJFPJi1THYA4/bQFuHZmlCFFRDDvlYn/0r8nlpCkWcc5c0O6WR0b8qmBhy+Uh6iQfjgnEncKKpebLZPia/Luy0RBrkAmYJ8fHPIkfxg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MfkGMAWUr5+dq96AWD1STKB6xN5c8dc/m/sNLAGcN/A=; b=iJPLEQeO1ReoOawsdi9ZtLd0RYPg7eckvJo/Cl9LSurxPnAYyBSyvcla/CmVINcj3q+f0zhdWGU1KLtCBVPwAxtKFhAk+YAl7YyucS1d0330wqBlL6yOEdtg662gleu9wrQ1EBamRdO2Q1mBffIzRbPMnyFazQ4hYShMW+sRUovJoie2mWnd+tZvnBG8AlV7AGtm6Boty8QWqSbZjhX4WaOBzPhzejzFnUp15m2Z4xzgMZxy5ukkn/k20cWnDOGrurSCrEZF0MOB3BMTES1K3Os3Y5KFn+iS7zTjqp8jKNYSnzwpRrTfUX414TzmxNJwvh1eDrT+6W0lO7ya3rjSDQ== Received: from PH8PR19MB7070.namprd19.prod.outlook.com (2603:10b6:510:222::9) by DS7PR19MB4407.namprd19.prod.outlook.com (2603:10b6:5:2c0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.20; Wed, 10 May 2023 23:04:30 +0000 Received: from PH8PR19MB7070.namprd19.prod.outlook.com ([fe80::eb52:9bfc:f218:8635]) by PH8PR19MB7070.namprd19.prod.outlook.com ([fe80::eb52:9bfc:f218:8635%7]) with mapi id 15.20.6387.018; Wed, 10 May 2023 23:04:30 +0000 From: Gabriel To: bug-gnu-emacs@gnu.org Subject: 30.0.50; Handle current-prefix-arg in async-shell-command Date: Wed, 10 May 2023 20:04:24 -0300 Message-ID: Content-Type: multipart/mixed; boundary="=-=-=" X-TMN: [1Hgo8tPjhGh0anCe2SDI4RmCMXVsqPhg5ZHF8RHL8YrxlcAGYvBacbG42xRxyww1] X-ClientProxiedBy: CP4P284CA0029.BRAP284.PROD.OUTLOOK.COM (2603:10d6:103:126::19) To PH8PR19MB7070.namprd19.prod.outlook.com (2603:10b6:510:222::9) X-Microsoft-Original-Message-ID: <87jzxfhjpj.fsf@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH8PR19MB7070:EE_|DS7PR19MB4407:EE_ X-MS-Office365-Filtering-Correlation-Id: b501f174-cc29-4553-7ddd-08db51aae918 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6wOYqmfO+zFWC6XjHz0XIqPXitORznupvv1cjOGHXODV1/n9ltMdicuXo7G72m019te6vGHf1QNalmiTBpXXfwEZC4txTl9uglLGFCSzNULZSMqz6mzCnrFWqZjP6Bz3TuyNDU7XLYGZm0kSzuW2UdNtjDQaq5kmR/IwLoms0TdUFrWd/q2n0q7cWGCmalGdBZ5Dgep5uTOxJe25qwj6BtxNw1VfBtpOcK6DxwwMcWrnnNwaeye0sqpDe1amgdxEqDsoRfh0D5mYqxfYgz+uDLFP+sip14onIYK2i8+dCs8wkRK4uxAsrISc8CODzUCPkLwtyVgkk1lDovfNjJr/1o2q+z8DMG3M/p02O/Ezhk4KWC8Mf8Nd/25uUJVJ+h+XT+lvAQ0dJpIfKGDxU9sfjzNzzrEMUueOKpcFs8xFpEkNxYO0R7dSKlKQcfqqz/iyh0sbb9jAeYHiHkbSn1dE49NCAXKq7gvtbK3HsokIQfrvzRDYjuw2FHUQqfY2z57NQ6s2IN1YAymouPOyTiPNjroJZ3PaCo7LDmHHY4tYfVXrgvN8v1WB1Bot4isvrO8Y X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ORMRzu4l9J+8IzJFGcj2nXMln2ogkL56r5xKmSzNpY84aZIKNcP1IDIVzzVz?= =?us-ascii?Q?YDn9dbA/DOMuUt+MKd/EzYhbo/N5msrmfk+zGp5HNxWjeKj1MAmbvjcuMddo?= =?us-ascii?Q?EBDdmTNq+LN0tYOB4IrbmxiS0RaomuZTAg/B/N4bBU3TtjFzQzJhyzlTCk7K?= =?us-ascii?Q?SeWeizru3BL63adTn33dHYY/TrOLbWgClFj4mhV3xKxZgbOWqbZhkmWFnjXJ?= =?us-ascii?Q?p9iNhVSjEFqPghx6Ytu+KNEgr5aDPdBpBpcFjO2kX3qraO6oY4QRGIainFjJ?= =?us-ascii?Q?KEonAC4VSwraGYUamaV7R5NupC3SEv02Z+MtExfFFMES6w8ZRBto3gFSDfOJ?= =?us-ascii?Q?x0wwxDp1xB8+4SzbxVAkZDbifnzZh+DqEklH4lrl9+HNzhCj4dytyzA37Rx/?= =?us-ascii?Q?33Mym3hNw/jmZfFN1LT6zt5MZ1pGUCQ1zFMyp0SVxbDUajQxhQ0aLuQq793N?= =?us-ascii?Q?UkmmidjIDdPCKeih6V3UEJjCPNoD5wFaUZTJLfAdLJQgJn1M2hm+NNDDH+yB?= =?us-ascii?Q?2vM7AvwfEvB38j2O6WlgpAspx34tt6a+lmR7UOQK5JCeNZ1CeTS2TddPqyqD?= =?us-ascii?Q?RZUOQTIgBvlyFULwMRGVYHXZxZ6lb6A0Wr8Pulii7s9IHhDKQvHuh+EziBwz?= =?us-ascii?Q?w+RmrDQeJqZLypIY8lNFyu8uQF0DBln6YkuhXsc/ccrAmWM2Cf42csB28kTe?= =?us-ascii?Q?/DtvRk0qMVyLe20viRXRQtjxldV53fGKJH+F9B9PxgKNdQJVSAM5rcSXJSUw?= =?us-ascii?Q?OkPZa/yXj+G8q5adHH3/ls4c0HyLXlzS46vIJ8h0jhJvDB9C1ic3WarrmCVj?= =?us-ascii?Q?FqlXjWtz067/ZYB1R6mA1Obs94YwCBLqvrZ9cnYsPQp06fHe5MdVcn3yZQDJ?= =?us-ascii?Q?4D1TApIOXv+rvfEybol0sIdZEmbKiDuJbhOH/I6V1TRkle91HCPk+IzS36pN?= =?us-ascii?Q?xvE8m55/8L2ClJhz24NDhyHCffcd3GGbPKawYfI+RVrciL/P2NLoPfm8lIx3?= =?us-ascii?Q?hws9Z6iolu14JLadkJ0uExqelFfv6kbBcqf4tDB6rB+Uy2j1hUidup+pakWw?= =?us-ascii?Q?P6WdwibfSxWky7gO8T/EemQEQ/yWOvIZg+AVvSsTWqndYNcuGo+Cjlppnlhg?= =?us-ascii?Q?UDaVLRLU2xdUPuP9Yg9ziWfNtLWqnO13q+6C+n9nE8ZWoBHDr3VAOPjKgTym?= =?us-ascii?Q?NnEi99eaM0zYeyJrEIyEtzG3TfIr8MoFixF1kMlwBfCytwn0Vs+lw/CmOa+h?= =?us-ascii?Q?vmUrCbiiVgoA8RM0YkEPacewLVZsUlydtPUYtf4J9kxs1eQcI5A0cm3Af5wk?= =?us-ascii?Q?jOc=3D?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-e7757.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: b501f174-cc29-4553-7ddd-08db51aae918 X-MS-Exchange-CrossTenant-AuthSource: PH8PR19MB7070.namprd19.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2023 23:04:30.7542 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR19MB4407 Received-SPF: pass client-ip=2a01:111:f400:7eb2::80c; envelope-from=gabriel376@hotmail.com; helo=NAM02-BN1-obe.outbound.protection.outlook.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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) --=-=-= Content-Type: text/plain Severity: bug Steps: 1) emacs -Q from master branch (3adc1e7f379) 2) C-u M-& "ls" Error: shell-command: Wrong type argument: stringp, (4) Cause: When called interactively, `async-shell-command' pass argument OUTPUT-BUFFER as `current-prefix-arg' to `shell-command'. As per docstring of `shell-command': "If OUTPUT-BUFFER is not a buffer and not nil (which happens interactively when the prefix argument is given), insert the output in current buffer after point leaving mark after it. This cannot be done asynchronously." Patch: --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Handle-current-prefix-arg-in-async-shell-command.patch >From 8016742cfd1d59cf3082afeb1cf77b9a12b9b251 Mon Sep 17 00:00:00 2001 From: Gabriel do Nascimento Ribeiro Date: Wed, 10 May 2023 19:41:05 -0300 Subject: [PATCH 1/1] Handle current-prefix-arg in async-shell-command. * lisp/simple.el (async-shell-command): Properly handle current-prefix-arg. When called interactively, defaults to nil, otherwise, check if it's not a number before passing to `shell-command'. --- lisp/simple.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/simple.el b/lisp/simple.el index 58517dd81f9..ba832581955 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4499,10 +4499,12 @@ async-shell-command ((eq major-mode 'dired-mode) (dired-get-filename nil t))))) (and filename (file-relative-name filename)))) - current-prefix-arg + nil shell-command-default-error-buffer)) (unless (string-match "&[ \t]*\\'" command) (setq command (concat command " &"))) + (when (and output-buffer (numberp output-buffer)) + (error "Invalid output buffer")) (shell-command command output-buffer error-buffer)) (declare-function comint-output-filter "comint" (process string)) -- 2.34.1 --=-=-= Content-Type: text/plain --- Gabriel --=-=-=-- ------------=_1684045742-19501-1-- From unknown Mon Jun 23 07:48:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#63432: 30.0.50; Handle current-prefix-arg in async-shell-command Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 May 2023 07:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63432 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: gabriel376@hotmail.com, Stefan Monnier , Juri Linkov Cc: 63432@debbugs.gnu.org Received: via spool by 63432-submit@debbugs.gnu.org id=B63432.168404877324985 (code B ref 63432); Sun, 14 May 2023 07:20:02 +0000 Received: (at 63432) by debbugs.gnu.org; 14 May 2023 07:19:33 +0000 Received: from localhost ([127.0.0.1]:40205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1py60z-0006Uv-Jd for submit@debbugs.gnu.org; Sun, 14 May 2023 03:19:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50570) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1py60y-0006Ui-Ai for 63432@debbugs.gnu.org; Sun, 14 May 2023 03:19:32 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1py60r-0008CM-Oq; Sun, 14 May 2023 03:19:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=qVEsoITBPTh8jFW/4PdK/58yd6AdRsuKaqHgMo2zYbQ=; b=cRUx8mE5ESW8 Kg3ivutGTRlzNWw6Z1Si2U4L7qXQlQ80h6QFflpppbdwELJJk/b0fEBc4COoE3VgnBTBumYbM1fkG NHkjlxutaan+wbYi9uNfgZ6Z4G9VCeoLCHWB0ha3kvFHhYycjeuHdtDKzsDARA5T49WRRhk5VlLvO TKdHOOKXuEPW91hg1trbRr4jgAC+2kWw0n2eDu+kmSUeJBJ6SDHDmV/f8yafnq5JkHnkSW7FN4QPQ ryIHyO1NV8opOSpizJ94cix0pkYZuhKhWCBbjYFGhKV/Pb/MbtjDhOfTKlSAypZ6tOXJxhMU6O5rG 1LVBZQ29s3y8sQA9SQ1xmw==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1py60p-0004HN-Sg; Sun, 14 May 2023 03:19:25 -0400 Date: Sun, 14 May 2023 10:19:24 +0300 Message-Id: <83fs7z9y83.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <83h6sfa0kt.fsf@gnu.org> (message from Eli Zaretskii on Sun, 14 May 2023 09:28:34 +0300) References: <83ttwg9wj5.fsf@gnu.org> <83h6sfa0kt.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 63432-done@debbugs.gnu.org > Date: Sun, 14 May 2023 09:28:34 +0300 > From: Eli Zaretskii > > Thanks, installed on the emacs-29 branch, and closing the bug. Btw, I've noticed that the ERROR-BUFFER argument is ignored by async-shell-command, and OUTPUT-BUFFER is not documented. So I've now fixed the doc string to correct these deficiencies. (I wonder why was ERROR-BUFFER at all provided in this function in the first place, since the underlying shell-command cannot support it. Maybe we should have an advertised-calling-convention there which excludes it?) From unknown Mon Jun 23 07:48:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#63432: 30.0.50; Handle current-prefix-arg in async-shell-command Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 May 2023 17:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63432 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: gabriel376@hotmail.com, Stefan Monnier , 63432@debbugs.gnu.org Received: via spool by 63432-submit@debbugs.gnu.org id=B63432.168417113023876 (code B ref 63432); Mon, 15 May 2023 17:19:02 +0000 Received: (at 63432) by debbugs.gnu.org; 15 May 2023 17:18:50 +0000 Received: from localhost ([127.0.0.1]:44273 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pybqU-0006D0-Bj for submit@debbugs.gnu.org; Mon, 15 May 2023 13:18:50 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:49651) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pybqS-0006Cm-Az for 63432@debbugs.gnu.org; Mon, 15 May 2023 13:18:48 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 15356240008; Mon, 15 May 2023 17:18:40 +0000 (UTC) From: Juri Linkov In-Reply-To: <83fs7z9y83.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 14 May 2023 10:19:24 +0300") Organization: LINKOV.NET References: <83ttwg9wj5.fsf@gnu.org> <83h6sfa0kt.fsf@gnu.org> <83fs7z9y83.fsf@gnu.org> Date: Mon, 15 May 2023 20:17:00 +0300 Message-ID: <86a5y5jz03.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > Btw, I've noticed that the ERROR-BUFFER argument is ignored by > async-shell-command, and OUTPUT-BUFFER is not documented. So I've now > fixed the doc string to correct these deficiencies. > > (I wonder why was ERROR-BUFFER at all provided in this function in the > first place, since the underlying shell-command cannot support it. > Maybe we should have an advertised-calling-convention there which > excludes it?) Keeping the same function signatures for shell-command and async-shell-command would allow to implement the error-buffer support for the latter in future. From unknown Mon Jun 23 07:48:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#63432: 30.0.50; Handle current-prefix-arg in async-shell-command Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 May 2023 18:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63432 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: gabriel376@hotmail.com, monnier@iro.umontreal.ca, 63432@debbugs.gnu.org Received: via spool by 63432-submit@debbugs.gnu.org id=B63432.16841750118009 (code B ref 63432); Mon, 15 May 2023 18:24:02 +0000 Received: (at 63432) by debbugs.gnu.org; 15 May 2023 18:23:31 +0000 Received: from localhost ([127.0.0.1]:44364 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pycr4-000257-Uk for submit@debbugs.gnu.org; Mon, 15 May 2023 14:23:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50286) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pycr3-00024u-El for 63432@debbugs.gnu.org; Mon, 15 May 2023 14:23:29 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pycqx-0000xG-3F; Mon, 15 May 2023 14:23:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=24rY5RdYOexlRhM2BkR1TX2QXAXS4FO/fINTcSS6L10=; b=sg1vbAsBEEK7 c6fNKZ0WiaGa66AY4BdNTaA3SRjadM5dZB3QBv0f5l5GEs0ETPu9JQpaTk7Do/AgR+NOpcjQb37GT Nn0Dnm0Yp54oiX1uO87iWS3goGeRVmk60QjeIEcQePMlF0YJrqvd37iS7mFJeowIOrM5yK+c3jVJP Vqehkwng1llOP/BDK8RKtkOHFTons/HiAOEZrvpmgoXQsHfTKM+PfkoFahtfErzaZbUUjMsz1rIoA fNtgrgqnAFGp51LHojYVZnj3hVLt9XvTXnFegQDpBl30YnWHGa1RjZnvNBv5TGBJG72ncTMKIgSQV m7TQIxx3xOt9UUJMr00yPQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pycqw-0002L9-HK; Mon, 15 May 2023 14:23:22 -0400 Date: Mon, 15 May 2023 21:23:26 +0300 Message-Id: <837ct91mjl.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <86a5y5jz03.fsf@mail.linkov.net> (message from Juri Linkov on Mon, 15 May 2023 20:17:00 +0300) References: <83ttwg9wj5.fsf@gnu.org> <83h6sfa0kt.fsf@gnu.org> <83fs7z9y83.fsf@gnu.org> <86a5y5jz03.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Juri Linkov > Cc: gabriel376@hotmail.com, Stefan Monnier , > 63432@debbugs.gnu.org > Date: Mon, 15 May 2023 20:17:00 +0300 > > > Btw, I've noticed that the ERROR-BUFFER argument is ignored by > > async-shell-command, and OUTPUT-BUFFER is not documented. So I've now > > fixed the doc string to correct these deficiencies. > > > > (I wonder why was ERROR-BUFFER at all provided in this function in the > > first place, since the underlying shell-command cannot support it. > > Maybe we should have an advertised-calling-convention there which > > excludes it?) > > Keeping the same function signatures for shell-command and async-shell-command > would allow to implement the error-buffer support for the latter in future. That's fine, but then it would have been better to mention this in a comment. Because otherwise it just looks like a copy-pasta error (after one wastes some time to figure out that it is basically unused).