GNU bug report logs - #57792
29.0.50; async-shell-command fails with prefix-argument on -master

Previous Next

Package: emacs;

Reported by: Vladimir Nikishkin <lockywolf <at> gmail.com>

Date: Wed, 14 Sep 2022 04:01:02 UTC

Severity: normal

Tags: confirmed

Found in versions 27.1, 29.0.50, 28.2

Full log


Message #8 received at 57792 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Vladimir Nikishkin <lockywolf <at> gmail.com>
Cc: 57792 <at> debbugs.gnu.org
Subject: Re: bug#57792: 29.0.50; async-shell-command fails with
 prefix-argument on -master
Date: Wed, 14 Sep 2022 00:51:54 -0700
found 57792 27.1
found 57792 28.2
tags 57792 + confirmed
thanks

Vladimir Nikishkin <lockywolf <at> gmail.com> writes:

> In the *scratch* buffer:
> C-u M-& echo test RET
> results in an error, whereas on stable Emacs it pastes "test\n" at
> point.
>
> The error is:
> (wrong-type-argument stringp (4))
> The stack trace is:
> Debugger entered--Lisp error: (wrong-type-argument stringp (4))
>   shell-command("echo test &" (4) nil)
>   async-shell-command("echo test" (4) nil)
>   funcall-interactively(async-shell-command "echo test" (4) nil)
>   command-execute(async-shell-command)

This is from `get-buffer-create' in simple.el:4572.

> Hope this helps.

I can reproduce this bug on master, 27.1 and 28.2.  Here's a test case
(not tested):

(ert-deftest simple-tests-async-shell-command-57792 ()
  "Test for https://debbugs.gnu.org/57792 ."
  (with-temp-buffer
    ;; Pretend we have a prefix argument.
    (async-shell-command "echo \"test\"" '(4))
    (should (equal (buffer-string) "test"))))

I'm not sure what behavior we want here, though.  Should we insert the
command output directly at point in the current buffer, or should we
first insert it into "*Async Shell Command*" and copy it over when done?




This bug report was last modified 1 year and 158 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.