unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefankangas@gmail.com>
To: Vladimir Nikishkin <lockywolf@gmail.com>
Cc: 57792@debbugs.gnu.org
Subject: bug#57792: 29.0.50; async-shell-command fails with prefix-argument on -master
Date: Wed, 14 Sep 2022 00:51:54 -0700	[thread overview]
Message-ID: <CADwFkm=DMs_4ANgVwSYnqZuYjDkduu38RAeBXTEjD64fxDM6Ag@mail.gmail.com> (raw)
In-Reply-To: <87pmfy38sg.fsf@laptop.lockywolf.net> (Vladimir Nikishkin's message of "Wed, 14 Sep 2022 11:55:21 +0800")

found 57792 27.1
found 57792 28.2
tags 57792 + confirmed
thanks

Vladimir Nikishkin <lockywolf@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?





  reply	other threads:[~2022-09-14  7:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-14  3:55 bug#57792: 29.0.50; async-shell-command fails with prefix-argument on -master Vladimir Nikishkin
2022-09-14  7:51 ` Stefan Kangas [this message]
2022-09-14 14:13   ` Lars Ingebrigtsen
2022-09-14 14:17     ` Vladimir Nikishkin
2022-09-14 14:36       ` Vladimir Nikishkin
2022-09-14 15:10         ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADwFkm=DMs_4ANgVwSYnqZuYjDkduu38RAeBXTEjD64fxDM6Ag@mail.gmail.com' \
    --to=stefankangas@gmail.com \
    --cc=57792@debbugs.gnu.org \
    --cc=lockywolf@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).