From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gabriel Newsgroups: gmane.emacs.bugs Subject: bug#63432: 30.0.50; Handle current-prefix-arg in async-shell-command Date: Wed, 10 May 2023 20:04:24 -0300 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38510"; mail-complaints-to="usenet@ciao.gmane.io" To: 63432@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 11 01:10:30 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 1pwsx2-0009pG-QI for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 May 2023 01:10:29 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pwswe-00015B-Ty; Wed, 10 May 2023 19:10:04 -0400 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 1pwswd-00014t-4X for bug-gnu-emacs@gnu.org; Wed, 10 May 2023 19:10:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pwswc-0001JL-Rt for bug-gnu-emacs@gnu.org; Wed, 10 May 2023 19:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pwswc-0006AC-6x for bug-gnu-emacs@gnu.org; Wed, 10 May 2023 19:10:02 -0400 X-Loop: help-debbugs@gnu.org 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-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.168376018123653 (code B ref -1); Wed, 10 May 2023 23:10:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 May 2023 23:09:41 +0000 Original-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 Original-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 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 1pwswB-00011O-Vx for bug-gnu-emacs@gnu.org; Wed, 10 May 2023 19:09:36 -0400 Original-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== Original-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 Original-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 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> 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+zFWC6XjHz0XIqPXitORznupvv1cjOGH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793NUkmmidjIDdPCKeih6V3UEJjCPNoD5wFaUZTJLfAdLJQgJn1M2hm+NNDDH+yB2vM7AvwfEvB38j2O6WlgpAspx34tt6a+lmR7UOQK5JCeNZ1CeTS2TddPqyqDRZUOQTIgBvlyFULwMRGVYHXZxZ6lb6A0Wr8Pulii7s9IHhDKQvHuh+EziBwzw+RmrDQeJqZLypIY8lNFyu8uQF0DBln6YkuhXsc/ccrAmWM2Cf42csB28kTe/DtvRk0qMVyLe20viRXRQtjxldV53fGKJH+F9B9Pxg KNdQJVSAM5rcSXJSUwOkPZa/yXj+G8q5adHH3/ls4c0HyLXlzS46vIJ8h0jhJvDB9C1ic3WarrmCVjFqlXjWtz067/ZYB1R6mA 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-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:261532 Archived-At: --=-=-= 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 --=-=-=--