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

To reply to this bug, email your comments to 57792 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#57792; Package emacs. (Wed, 14 Sep 2022 04:01:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Vladimir Nikishkin <lockywolf <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 14 Sep 2022 04:01:02 GMT) Full text and rfc822 format available.

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

From: Vladimir Nikishkin <lockywolf <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; async-shell-command fails with prefix-argument on -master
Date: Wed, 14 Sep 2022 11:55:21 +0800
Dear Emacs developers,

I have recently compiled Emacs from -master
(5abcc2fc679cc256b4fe5fe300cc67fd205aaf26),
and found the following issue:

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)

Hope this helps.


In GNU Emacs 29.0.50 (build 1, x86_64-slackware-linux-gnu, GTK+ Version
 3.24.31, cairo version 1.16.0) of 2022-09-13 built on
 laptop.lockywolf.net
System Description: Slackware 15.0 x86_64

Configured using:
 'configure --prefix=/usr --libdir=/usr/lib64 --sysconfdir=/etc
 --localstatedir=/var --program-prefix= --program-suffix=
 --mandir=/usr/man --infodir=/usr/info --without-gconf
 --without-gsettings --with-modules --with-native-compilation
 --with-pgtk --with-json --with-imagemagick --with-pdumper
 --with-xwidgets --build=x86_64-slackware-linux 'CFLAGS=-O2 -fPIC''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM HARFBUZZ IMAGEMAGICK
JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK
PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP XIM
XWIDGETS GTK3 ZLIB

Important settings:
  value of $LC_COLLATE: C
  value of $LC_TIME: en_GB.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: mu4e-headers

Minor modes in effect:
  memento-mori-mode: t
  hes-mode: t
  global-highlight-parentheses-mode: t
  highlight-parentheses-mode: t
  global-color-identifiers-mode: t
  idle-org-agenda-mode: t
  mu4e-search-minor-mode: t
  mu4e-update-minor-mode: t
  mu4e-context-minor-mode: t
  TeX-PDF-mode: t
  TeX-source-correlate-mode: t
  async-bytecomp-package-mode: t
  hl-line-mode: t
  magit-todos-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  shell-dirtrack-mode: t
  global-flycheck-mode: t
  global-hl-todo-mode: t
  gdb-many-windows: t
  global-company-mode: t
  company-mode: t
  auto-insert-mode: t
  pdf-occur-global-minor-mode: t
  shackle-mode: t
  ido-everywhere: t
  global-auto-revert-mode: t
  electric-pair-mode: t
  global-display-fill-column-indicator-mode: t
  global-hi-lock-mode: t
  hi-lock-mode: t
  windmove-mode: t
  savehist-mode: t
  recentf-mode: t
  save-place-mode: t
  super-save-mode: t
  xterm-mouse-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-layout-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  global-prettify-symbols-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  buffer-read-only: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  auto-save-visited-mode: t
  abbrev-mode: t

Load-path shadows:
/home/lockywolf/.emacs.d/elpa/company-cmake-0.1/company-cmake hides /home/lockywolf/.emacs.d/elpa/company-20220825.1044/company-cmake
/home/lockywolf/.emacs.d/elpa/cmake-mode-20220823.1201/cmake-mode hides /usr/share/emacs/site-lisp/cmake-mode
/home/lockywolf/.emacs.d/elpa/transient-20220806.2224/transient hides /usr/share/emacs/29.0.50/lisp/transient
/home/lockywolf/.emacs.d/elpa/flim-20220720.1311/sasl hides /usr/share/emacs/29.0.50/lisp/net/sasl

Features:
(shadow mail-extr emacsbug time-stamp misearch multi-isearch view
cal-china lunar solar cal-dst cal-bahai cal-islam cal-hebrew holidays
holiday-loaddefs org-duration org-eldoc latexenc disp-table ol-eww
ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect ol-docview ol-bbdb
ol-w3m ol-doi org-link-doi face-remap macros info-look ffap dired-aux
company-oddmuse company-keywords company-etags company-gtags
company-dabbrev-code company-dabbrev company-files company-clang
company-capf company-cmake company-semantic company-template
company-bbdb init rc-local lockywolf-postamble-laptop
display-line-numbers lockywolf-exwm exwm exwm-input xcb-keysyms xcb-xkb
exwm-manage exwm-floating xcb-cursor xcb-render exwm-layout
exwm-workspace exwm-core xcb-ewmh xcb-icccm xcb xcb-xproto xcb-types
xcb-debug lockywolf-erc erc-track erc-match erc-networks erc-goodies
erc-backend erc erc-compat erc-loaddefs lockywolf-equake equake
lockywolf-gui-x11 hamburger-menu lockywolf-gui-general diary-lib
diary-loaddefs memento-mori highlight-escape-sequences
highlight-parentheses rainbow-mode color-identifiers-mode python
prettify-greek form-feed tsdh-dark-theme lockywolf-monitoring
idle-org-agenda lockywolf-autocomplete-ido
lockywolf-org-scientific-large org-pdftools pdf-annot facemenu org-noter
org2blog ox-wp writegood-mode metaweblog xml-rpc url-http url-auth
url-gw nsm hydra lv htmlize org-journal org-crypt cal-iso org-sidebar
org-ql-search org-ql-view ov org-super-agenda ht org-ql peg ts org-habit
org-mru-clock org-capture ox-beamer ox-org ox-md ox-odt rng-loc rng-uri
rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns
nxml-enc xmltok nxml-util ox-latex ox-icalendar org-agenda org-refile
ox-html table ox-ascii ox-publish ox org-clock ob-fortran ob-shell
ob-latex ob-scheme geiser-impl help-fns radix-tree geiser-custom
geiser-base ob-C ob-plantuml org-tempo tempo org-protocol ox-youtube
org-ebib org-bibtex-extras ol-bibtex ox-bibtex org-fancy-priorities
lockywolf-cryptography pinentry lockywolf-elfeed elfeed-protocol-ttrss
elfeed-protocol-owncloud elfeed-protocol-newsblur elfeed-protocol-fever
elfeed-protocol elfeed-protocol-common elfeed-show elfeed-search matlab
matlab-scan matlab-syntax matlab-compat pulse vc-hg vc-git vc-bzr vc-src
vc-sccs vc-svn vc-cvs vc-rcs log-view elfeed-csv elfeed elfeed-curl
elfeed-log elfeed-db elfeed-lib xml-query lockywolf-email-pim bbdb
bbdb-site timezone gnus-dired mu4e-speedbar speedbar ezimage dframe mu4e
mu4e-org mu4e-view gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls
dig gnus-sum gnus-group gnus-undo gnus-start gnus-dbus gnus-cloud nnimap
nnmail mail-source utf7 nnoo parse-time gnus-spec gnus-int gnus-range
gnus-win mu4e-main mu4e-headers mu4e-compose mu4e-draft mu4e-actions
mu4e-search mu4e-lists mu4e-bookmarks mu4e-mark mu4e-message flow-fill
mu4e-contacts mu4e-update mu4e-folders mu4e-server mu4e-context
mu4e-vars mu4e-helpers mu4e-config auth-source-xoauth2 auth-source-pass
smtpmail-multi smtpmail khardel yaml-mode vdirel org-vcard lockywolf-tex
company-auctex vdm-snippets yasnippet bib-cite auctex-latexmk latex
latex-flymake tex-ispell tex-style tex texmathp cdlatex lockywolf-bibtex
ebib helm helm-global-bindings helm-easymenu helm-core async-bytecomp
helm-source helm-multi-match helm-lib ivy delsel ivy-faces ivy-overlay
colir ebib-reading-list ebib-notes org-element org ob ob-tangle ob-ref
ob-lob ob-table ob-exp org-macro org-footnote org-src ob-comint
org-pcomplete org-list org-faces org-entities org-version ob-emacs-lisp
ob-core ob-eval org-table oc-basic org-keys oc org-loaddefs cal-menu
calendar cal-loaddefs ol org-compat org-macs avl-tree ebib-filters
ebib-keywords ebib-utils ebib-db parsebib mule-util hl-line bibretrieve
bibtex-utils reftex reftex-loaddefs reftex-vars bibtex iso8601
lockywolf-plantuml flycheck-plantuml plantuml-mode lockywolf-matlab
lockywolf-scheme geiser scheme-complete scheme lockywolf-emacs-lisp
paredit-menu paredit lockywolf-helm lockywolf-vala vala-mode cc-langs
lockywolf-cpp clang-format+ clang-format eldoc-cmake cmake-mode rst
company-c-headers flycheck-clangcheck google-c-style cc-mode cc-fonts
cc-guess cc-menus cc-cmds lockywolf-fortran f90 lockywolf-bash sh-script
smie executable lockywolf-version-control magit-todos pcre2el rxt
re-builder f f-shortdoc shortdoc s async grep magit-bookmark
magit-submodule magit-obsolete magit-blame magit-stash magit-reflog
magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote
magit-commit magit-sequence magit-notes magit-worktree magit-tag
magit-merge magit-branch magit-reset magit-files magit-refs magit-status
magit magit-repos magit-apply magit-wip magit-log which-func edebug
magit-diff smerge-mode diff diff-mode git-commit log-edit message
sendmail yank-media rfc822 mml mml-sec epa derived epg rfc6068
epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils pcvs-util add-log magit-core magit-autorevert magit-margin
magit-transient magit-process with-editor shell server magit-mode
transient magit-git magit-base magit-section crm compat-27 compat-26 vc
vc-dispatcher lockywolf-spellchecking-hard languagetool
languagetool-server request mailheader languagetool-console
languagetool-java languagetool-issue languagetool-correction
languagetool-core flycheck lockywolf-spellchecking-simple hl-todo compat
flyspell ispell lockywolf-debugging gdb-mi bindat gud
lockywolf-advanced-editing eglot array jsonrpc ert debug backtrace
flymake-proc flymake markdown-mode color company pcase hippie-exp
autoinsert ediff ediff-merg ediff-mult ediff-wind ediff-diff ediff-help
ediff-init ediff-util lockywolf-ggtags ggtags etags fileloop xref
project ewoc lockywolf-tramp files-x lockywolf-shells esh-help dash
em-unix pcomplete em-smart esh-mode eshell esh-cmd generator esh-ext
esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util
lockywolf-paper-pdf-djvu djvu pdf-occur ibuf-ext ibuffer
ibuffer-loaddefs tablist advice tablist-filter semantic/wisent/comp
semantic/wisent semantic/wisent/wisent semantic/util-modes semantic/util
semantic semantic/tag semantic/lex semantic/fw mode-local find-func
cedet pdf-isearch let-alist pdf-misc imenu pdf-tools pdf-view pdf-cache
pdf-info tq pdf-util format-spec pdf-macs doc-view jka-compr image-mode
exif ps-print ps-print-loaddefs lpr lockywolf-downloaded-packages
diminish shackle trace mic-paren lockywolf-dired dired-x
lockywolf-standard-packages eww xdg url-queue thingatpt shr pixel-fill
kinsoku url-file svg dom puny mm-url gnus nnheader gnus-util time-date
range woman man info-colors secrets dbus ido-completing-read+ memoize
minibuf-eldef ido xml locate dired dired-loaddefs arc-mode archive-mode
compile comint ansi-color ring autorevert filenotify elec-pair
display-fill-column-indicator hi-lock foldout edmacro kmacro noutline
outline windmove bookmark text-property-search savehist recentf
tree-widget saveplace super-save rmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils image-file image-converter
lockywolf-handy-own-functions-keybindings lockywolf-basic-init xt-mouse
use-package-ensure-system-package system-packages cus-edit pp cus-load
wid-edit use-package use-package-ensure use-package-delight
use-package-diminish use-package-bind-key bind-key easy-mmode
use-package-core init-custom finder-inf auth-source-xoauth2-autoloads
cdlatex-autoloads cmake-mode-autoloads anaconda-mode-autoloads tex-site
company-quickhelp-autoloads company-shell-autoloads company-autoloads
diminish-autoloads ebib-autoloads eglot-autoloads ess-autoloads
flycheck-phpstan-autoloads flycheck-autoloads ghub-autoloads
gnuplot-autoloads go-mode-autoloads comp comp-cstr warnings icons rx
cl-extra help-mode ivy-autoloads lua-mode-autoloads
magit-todos-autoloads magit-autoloads magit-section-autoloads
git-commit-autoloads markdown-mode-autoloads math-symbol-lists-autoloads
org-contrib-autoloads org-download-autoloads org-journal-autoloads
org-mru-clock-autoloads org-noter-pdftools-autoloads
org-pdftools-autoloads org-noter-autoloads org-sidebar-autoloads
org-ql-autoloads org-super-agenda-autoloads ht-autoloads
org2blog-autoloads metaweblog-autoloads hydra-autoloads
paredit-autoloads parsebib-autoloads pdf-tools-autoloads
phpstan-autoloads php-mode-autoloads polymode-autoloads
pos-tip-autoloads pythonic-autoloads f-autoloads request-autoloads
semi-autoloads flim-autoloads apel-autoloads slime-autoloads
spell-fu-autoloads sudo-edit-autoloads transient-autoloads ts-autoloads
use-package-ensure-system-package-autoloads use-package-autoloads
bind-key-autoloads cc-styles cc-align cc-engine cc-vars cc-defs
helm-autoloads popup-autoloads helm-core-autoloads async-autoloads
with-editor-autoloads info compat-autoloads writegood-mode-autoloads
yaml-mode-autoloads s-autoloads package browse-url url url-proxy
url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x
map byte-opt gv bytecomp byte-compile cconv url-vars cl-loaddefs cl-lib
rmc iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win term/common-win
pgtk-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list
replace newcomment text-mode lisp-mode prog-mode register page tab-bar
menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse
jit-lock font-lock syntax font-core term/tty-colors frame minibuffer
nadvice seq simple cl-generic indonesian philippine cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop
case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote threads
xwidget-internal dbusbind inotify dynamic-setting font-render-setting
cairo gtk pgtk lcms2 multi-tty make-network-process native-compile
emacs)

Memory information:
((conses 16 1357877 106448)
 (symbols 48 79618 1)
 (strings 32 359428 14866)
 (string-bytes 1 11925016)
 (vectors 16 190806)
 (vector-slots 8 4002197 212536)
 (floats 8 2315 479)
 (intervals 56 13482 3318)
 (buffers 1000 40))

-- 
Your sincerely,
Vladimir Nikishkin (MiEr, lockywolf)
(Laptop)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57792; Package emacs. (Wed, 14 Sep 2022 07:53:02 GMT) Full text and rfc822 format available.

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?




bug Marked as found in versions 27.1. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 14 Sep 2022 07:53:02 GMT) Full text and rfc822 format available.

bug Marked as found in versions 28.2. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 14 Sep 2022 07:53:02 GMT) Full text and rfc822 format available.

Added tag(s) confirmed. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 14 Sep 2022 07:53:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57792; Package emacs. (Wed, 14 Sep 2022 14:14:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 57792 <at> debbugs.gnu.org, Vladimir Nikishkin <lockywolf <at> gmail.com>
Subject: Re: bug#57792: 29.0.50; async-shell-command fails with
 prefix-argument on -master
Date: Wed, 14 Sep 2022 16:13:41 +0200
Stefan Kangas <stefankangas <at> gmail.com> writes:

> 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?

The prefix isn't documented to do anything (and currently bugs out), so
perhaps we should just remove the prefix from the interactive spec
instead?

Is the intention that `C-u M-&' insert the output in the current buffer?





Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 14 Sep 2022 14:14:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57792; Package emacs. (Wed, 14 Sep 2022 14:23:02 GMT) Full text and rfc822 format available.

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

From: Vladimir Nikishkin <lockywolf <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 57792 <at> debbugs.gnu.org, Stefan Kangas <stefankangas <at> gmail.com>
Subject: Re: bug#57792: 29.0.50; async-shell-command fails with
 prefix-argument on -master
Date: Wed, 14 Sep 2022 22:17:23 +0800
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Stefan Kangas <stefankangas <at> gmail.com> writes:
>
>> 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?
>
> The prefix isn't documented to do anything (and currently bugs out), so
> perhaps we should just remove the prefix from the interactive spec
> instead?

> Is the intention that `C-u M-&' insert the output in the current buffer?

I am quite sure it used to do that in the past. Perhaps, as late as
27.2. I can try to do a bisect to find when exactly this has changed.
Moreover, it would be analogous to C-u M-: inserting the return value
into the buffer at point.

-- 
Your sincerely,
Vladimir Nikishkin (MiEr, lockywolf)
(Laptop)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57792; Package emacs. (Wed, 14 Sep 2022 14:38:02 GMT) Full text and rfc822 format available.

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

From: Vladimir Nikishkin <lockywolf <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 57792 <at> debbugs.gnu.org, Stefan Kangas <stefankangas <at> gmail.com>
Subject: Re: bug#57792: 29.0.50; async-shell-command fails with
 prefix-argument on -master
Date: Wed, 14 Sep 2022 22:36:19 +0800
Maybe I am confusing it with C-u M-! , but for the async version would
do the same would make sense.

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

> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> Stefan Kangas <stefankangas <at> gmail.com> writes:
>>
>>> 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?
>>
>> The prefix isn't documented to do anything (and currently bugs out), so
>> perhaps we should just remove the prefix from the interactive spec
>> instead?
>
>> Is the intention that `C-u M-&' insert the output in the current buffer?
>
> I am quite sure it used to do that in the past. Perhaps, as late as
> 27.2. I can try to do a bisect to find when exactly this has changed.
> Moreover, it would be analogous to C-u M-: inserting the return value
> into the buffer at point.


-- 
Your sincerely,
Vladimir Nikishkin (MiEr, lockywolf)
(Laptop)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57792; Package emacs. (Wed, 14 Sep 2022 15:12:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Vladimir Nikishkin <lockywolf <at> gmail.com>
Cc: 57792 <at> debbugs.gnu.org, Stefan Kangas <stefankangas <at> gmail.com>
Subject: Re: bug#57792: 29.0.50; async-shell-command fails with
 prefix-argument on -master
Date: Wed, 14 Sep 2022 17:10:44 +0200
Vladimir Nikishkin <lockywolf <at> gmail.com> writes:

> Maybe I am confusing it with C-u M-! , but for the async version would
> do the same would make sense.

The problem is basically the same with M-! asynchronously --
`C-u M-! echo hello &' will also bug out.

So inserting things into the current buffer asynchronously has possibly
never worked?

The issue here is that in the async case, we set up a sentinel to handle
the output, and we also erase the output buffer, and we set the mode to
shell-mode.

I think it should be able to make this work (I think it'd be nice to
have), but I think it requires some serious rewriting of this code...




Removed tag(s) moreinfo. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 10 Jan 2024 10:57:02 GMT) Full text and rfc822 format available.

This bug report was last modified 117 days ago.

Previous Next


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