unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Bryan C. Mills" via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 48940@debbugs.gnu.org
Subject: bug#48940: 27.2; regression: "emacs --script /dev/stdin" parses the script incorrectly when /dev/stdin is a pipe
Date: Wed, 9 Jun 2021 16:31:36 -0400	[thread overview]
Message-ID: <CAKWVi_S959chK+wSCG6wr8Fq2qKwxjy=16Cf=TkZH+Kog78z9w@mail.gmail.com> (raw)

`emacs --script /dev/stdin` worked reliably for me on Emacs 24 through 26.

As of Emacs 27, it no longer works reliably — depending on the script contents,
it either fails with spurious errors or silently exits without
finishing the script.


In the following bash interaction, all three emacs invocations
*should* run the same script.
The third invocation demonstrates the bug: when /dev/stdin is a pipe from `cat`
(instead of the script.el file directly), the script is no longer interpreted.
With other scripts, I get various errors, seemingly due to `;` or `"`
characters being
dropped or ignored from the input.

```
$ cat script.el | cat /dev/stdin
(print "Hello emacs!")

$ emacs --no-init-file --no-site-file --script script.el

"Hello emacs!"

$ emacs --no-init-file --no-site-file --script /dev/stdin <script.el

"Hello emacs!"

$ cat script.el | emacs --no-init-file --no-site-file --script /dev/stdin

$ echo $?
0

$
```

This reproduces with the GNU Emacs 27.1 currently packaged on Debian Testing,
as well as the Google build of GNU Emacs 27.2 from which I produced
the report below.

(My apologies if this is a duplicate report. I tried to send it
earlier using M-x report-emacs-bug,
but the resulting email appears to have gotten stuck or rejected somewhere.)


In GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24,
cairo version 1.16.0)
 of 2021-03-29, modified by Debian built on kokoro-ubuntu
System Description: Debian GNU/Linux rodete

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
<f6> is undefined [2 times]
Making completion list... [2 times]

Configured using:
 'configure --build x86_64-linux-gnu --build x86_64-linux-gnu
 --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --enable-libsystemd --with-pop=yes
 --enable-locallisppath=/etc/google-emacs:/usr/local/share/google-emacs/27.2+gg3+1.20210329.053400.rc147/site-lisp:/usr/local/share/google-emacs/site-lisp:/usr/share/google-emacs/27.2+gg3+1.20210329.053400.rc147/site-lisp:/usr/share/google-emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils
 --program-prefix=google- --disable-silent-rules
 GOOGLE_VERSION=27.2+gg3+1.20210329.053400.rc147 --with-cairo
 --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars
 build_alias=x86_64-linux-gnu 'CFLAGS=-g -O2
 -ffile-prefix-map=/build/google-emacs-avRD2q/google-emacs-27.2+gg3+1.20210329.053400.rc147=.
-fstack-protector-strong
 -Wformat -Werror=format-security -Wall' LDFLAGS=-Wl,-z,relro
 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'OBJCFLAGS=-g -O2
 -ffile-prefix-map=/build/google-emacs-avRD2q/google-emacs-27.2+gg3+1.20210329.053400.rc147=.
-fstack-protector-strong
 -Wformat -Werror=format-security''

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY
INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF
ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD
JSON PDUMPER LCMS2 GMP

Important settings:
  value of $LC_ALL: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Text

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config
gnus-util rmail rmail-loaddefs text-property-search time-date subr-x seq
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr
mail-utils vc-git diff-mode easymenu easy-mmode cl-loaddefs cl-lib
term/tmux term/xterm xterm byte-opt gv bytecomp byte-compile cconv
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
timer select scroll-bar mouse jit-lock font-lock syntax facemenu
font-core term/tty-colors frame minibuffer cl-generic 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 charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 53224 7924)
 (symbols 48 6747 1)
 (strings 32 17548 1920)
 (string-bytes 1 565159)
 (vectors 16 8089)
 (vector-slots 8 89351 7266)
 (floats 8 29 624)
 (intervals 56 241 3)
 (buffers 1000 13))





             reply	other threads:[~2021-06-09 20:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 20:31 Bryan C. Mills via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2021-06-13 10:26 ` bug#48940: 27.2; regression: "emacs --script /dev/stdin" parses the script incorrectly when /dev/stdin is a pipe Eli Zaretskii
2021-06-14 21:37   ` Bryan C. Mills via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-11  5:09     ` Lars Ingebrigtsen
2021-11-11 17:23       ` Bryan C. Mills via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-12  3:26         ` 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='CAKWVi_S959chK+wSCG6wr8Fq2qKwxjy=16Cf=TkZH+Kog78z9w@mail.gmail.com' \
    --to=bug-gnu-emacs@gnu.org \
    --cc=48940@debbugs.gnu.org \
    --cc=bcmills@google.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).