* bug#63733: 28.3; error ("Unknown option ‘--batch’")
@ 2023-05-26 7:43 Ulrich Müller
2023-05-26 9:10 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: Ulrich Müller @ 2023-05-26 7:43 UTC (permalink / raw)
To: 63733
Something is strange with option parsing:
$ emacs -Q -batch -batch --eval '(message "hello, world")'
hello, world
$ emacs -Q --batch --batch --eval '(message "hello, world")'
hello, world
$ emacs -Q -batch --batch --eval '(message "hello, world")'
Debugger entered--Lisp error: (error "Unknown option ‘--batch’")
signal(error ("Unknown option ‘--batch’"))
error("Unknown option `%s'" "--batch")
command-line-1(("--batch" "-Q" "--eval" "(message \"hello, world\")"))
command-line()
normal-top-level()
$ emacs -Q --batch -batch --eval '(message "hello, world")'
Debugger entered--Lisp error: (error "Unknown option ‘-batch’")
signal(error ("Unknown option ‘-batch’"))
error("Unknown option `%s'" "-batch")
command-line-1(("-batch" "-Q" "--eval" "(message \"hello, world\")"))
command-line()
normal-top-level()
I would expect -batch/--batch to be idempotent in all four combinations
above. (I noticed the problem with a Gentoo package, where we add -batch
to Emacs options, and upstream's Makefile adds another --batch.)
In GNU Emacs 28.3 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.17.8)
of 2023-05-14 built on localhost
Windowing system distributor 'The X.Org Foundation', version 11.0.12101008
System Description: Gentoo Linux
Configured using:
'configure --prefix=/usr --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --mandir=/usr/share/man
--infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
--localstatedir=/var/lib --datarootdir=/usr/share
--disable-silent-rules --docdir=/usr/share/doc/emacs-28.3_rc1-r2
--htmldir=/usr/share/doc/emacs-28.3_rc1-r2/html --libdir=/usr/lib64
--program-suffix=-emacs-28 --includedir=/usr/include/emacs-28
--infodir=/usr/share/info/emacs-28 --localstatedir=/var
--enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp
--without-compress-install --without-hesiod --without-pop
--with-file-notification=inotify --with-pdumper --enable-acl
--with-dbus --with-modules --with-gameuser=:gamestat --with-libgmp
--with-gpm --without-native-compilation --without-json
--without-kerberos --without-kerberos5 --with-lcms2 --with-xml2
--without-mailutils --without-selinux --with-gnutls
--without-libsystemd --with-threads --without-wide-int
--with-sound=alsa --with-zlib --with-x --without-ns --without-gconf
--with-gsettings --without-toolkit-scroll-bars --with-gif --with-jpeg
--with-png --with-rsvg --with-tiff --with-xpm --with-imagemagick
--with-xft --with-cairo --with-harfbuzz --with-libotf --with-m17n-flt
--with-x-toolkit=lucid --with-xaw3d --with-dumping=pdumper
'CFLAGS=-march=native -ggdb -O2 -pipe' 'LDFLAGS=-Wl,-O1
-Wl,--as-needed''
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ
IMAGEMAGICK JPEG LCMS2 LIBOTF LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY
PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF X11 XAW3D XDBE XIM XPM LUCID
ZLIB
Important settings:
value of $LC_CTYPE: en_GB.UTF-8
value of $LANG: POSIX
locale-coding-system: utf-8-unix
Major mode: LaTeX/P
Minor modes in effect:
global-edit-server-edit-mode: t
TeX-PDF-mode: t
shell-dirtrack-mode: t
tooltip-mode: t
global-eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-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
auto-fill-function: do-auto-fill
transient-mark-mode: (only . t)
Load-path shadows:
/usr/share/emacs/site-lisp/cmake-mode hides /usr/share/emacs/site-lisp/cmake/cmake-mode
/usr/share/emacs/site-lisp/desktop-entry-mode hides /usr/share/emacs/site-lisp/desktop-file-utils/desktop-entry-mode
/usr/share/emacs/site-lisp/transient/transient hides /usr/share/emacs/28.3/lisp/transient
~ulm/lib/emacs/type-break hides /usr/share/emacs/28.3/lisp/type-break
/usr/share/emacs/site-lisp/org-mode/org-num hides /usr/share/emacs/28.3/lisp/org/org-num
/usr/share/emacs/site-lisp/org-mode/org-src hides /usr/share/emacs/28.3/lisp/org/org-src
/usr/share/emacs/site-lisp/org-mode/ol hides /usr/share/emacs/28.3/lisp/org/ol
/usr/share/emacs/site-lisp/org-mode/ob-maxima hides /usr/share/emacs/28.3/lisp/org/ob-maxima
/usr/share/emacs/site-lisp/org-mode/ol-eshell hides /usr/share/emacs/28.3/lisp/org/ol-eshell
/usr/share/emacs/site-lisp/org-mode/org-loaddefs hides /usr/share/emacs/28.3/lisp/org/org-loaddefs
/usr/share/emacs/site-lisp/org-mode/org-attach-git hides /usr/share/emacs/28.3/lisp/org/org-attach-git
/usr/share/emacs/site-lisp/org-mode/oc-natbib hides /usr/share/emacs/28.3/lisp/org/oc-natbib
/usr/share/emacs/site-lisp/org-mode/org-archive hides /usr/share/emacs/28.3/lisp/org/org-archive
/usr/share/emacs/site-lisp/org-mode/org-plot hides /usr/share/emacs/28.3/lisp/org/org-plot
/usr/share/emacs/site-lisp/org-mode/oc hides /usr/share/emacs/28.3/lisp/org/oc
/usr/share/emacs/site-lisp/org-mode/ob-org hides /usr/share/emacs/28.3/lisp/org/ob-org
/usr/share/emacs/site-lisp/org-mode/org-habit hides /usr/share/emacs/28.3/lisp/org/org-habit
/usr/share/emacs/site-lisp/org-mode/ob hides /usr/share/emacs/28.3/lisp/org/ob
/usr/share/emacs/site-lisp/org-mode/ox-latex hides /usr/share/emacs/28.3/lisp/org/ox-latex
/usr/share/emacs/site-lisp/org-mode/ob-haskell hides /usr/share/emacs/28.3/lisp/org/ob-haskell
/usr/share/emacs/site-lisp/org-mode/org-crypt hides /usr/share/emacs/28.3/lisp/org/org-crypt
/usr/share/emacs/site-lisp/org-mode/ob-gnuplot hides /usr/share/emacs/28.3/lisp/org/ob-gnuplot
/usr/share/emacs/site-lisp/org-mode/ob-eval hides /usr/share/emacs/28.3/lisp/org/ob-eval
/usr/share/emacs/site-lisp/org-mode/ob-julia hides /usr/share/emacs/28.3/lisp/org/ob-julia
/usr/share/emacs/site-lisp/org-mode/ob-fortran hides /usr/share/emacs/28.3/lisp/org/ob-fortran
/usr/share/emacs/site-lisp/org-mode/ob-latex hides /usr/share/emacs/28.3/lisp/org/ob-latex
/usr/share/emacs/site-lisp/org-mode/ob-scheme hides /usr/share/emacs/28.3/lisp/org/ob-scheme
/usr/share/emacs/site-lisp/org-mode/ox-publish hides /usr/share/emacs/28.3/lisp/org/ox-publish
/usr/share/emacs/site-lisp/org-mode/org-colview hides /usr/share/emacs/28.3/lisp/org/org-colview
/usr/share/emacs/site-lisp/org-mode/ob-css hides /usr/share/emacs/28.3/lisp/org/ob-css
/usr/share/emacs/site-lisp/org-mode/org-ctags hides /usr/share/emacs/28.3/lisp/org/org-ctags
/usr/share/emacs/site-lisp/org-mode/ol-mhe hides /usr/share/emacs/28.3/lisp/org/ol-mhe
/usr/share/emacs/site-lisp/org-mode/ob-octave hides /usr/share/emacs/28.3/lisp/org/ob-octave
/usr/share/emacs/site-lisp/org-mode/org-table hides /usr/share/emacs/28.3/lisp/org/org-table
/usr/share/emacs/site-lisp/org-mode/org-attach hides /usr/share/emacs/28.3/lisp/org/org-attach
/usr/share/emacs/site-lisp/org-mode/ob-core hides /usr/share/emacs/28.3/lisp/org/ob-core
/usr/share/emacs/site-lisp/org-mode/org-inlinetask hides /usr/share/emacs/28.3/lisp/org/org-inlinetask
/usr/share/emacs/site-lisp/org-mode/org-pcomplete hides /usr/share/emacs/28.3/lisp/org/org-pcomplete
/usr/share/emacs/site-lisp/org-mode/org-lint hides /usr/share/emacs/28.3/lisp/org/org-lint
/usr/share/emacs/site-lisp/org-mode/org-timer hides /usr/share/emacs/28.3/lisp/org/org-timer
/usr/share/emacs/site-lisp/org-mode/ob-eshell hides /usr/share/emacs/28.3/lisp/org/ob-eshell
/usr/share/emacs/site-lisp/org-mode/org-id hides /usr/share/emacs/28.3/lisp/org/org-id
/usr/share/emacs/site-lisp/org-mode/org-datetree hides /usr/share/emacs/28.3/lisp/org/org-datetree
/usr/share/emacs/site-lisp/org-mode/ob-sql hides /usr/share/emacs/28.3/lisp/org/ob-sql
/usr/share/emacs/site-lisp/org-mode/org-capture hides /usr/share/emacs/28.3/lisp/org/org-capture
/usr/share/emacs/site-lisp/org-mode/ox-html hides /usr/share/emacs/28.3/lisp/org/ox-html
/usr/share/emacs/site-lisp/org-mode/ob-forth hides /usr/share/emacs/28.3/lisp/org/ob-forth
/usr/share/emacs/site-lisp/org-mode/ob-sass hides /usr/share/emacs/28.3/lisp/org/ob-sass
/usr/share/emacs/site-lisp/org-mode/ob-emacs-lisp hides /usr/share/emacs/28.3/lisp/org/ob-emacs-lisp
/usr/share/emacs/site-lisp/org-mode/ol-w3m hides /usr/share/emacs/28.3/lisp/org/ol-w3m
/usr/share/emacs/site-lisp/org-mode/org-mobile hides /usr/share/emacs/28.3/lisp/org/org-mobile
/usr/share/emacs/site-lisp/org-mode/ox-ascii hides /usr/share/emacs/28.3/lisp/org/ox-ascii
/usr/share/emacs/site-lisp/org-mode/ob-sqlite hides /usr/share/emacs/28.3/lisp/org/ob-sqlite
/usr/share/emacs/site-lisp/org-mode/org-mouse hides /usr/share/emacs/28.3/lisp/org/org-mouse
/usr/share/emacs/site-lisp/org-mode/org-agenda hides /usr/share/emacs/28.3/lisp/org/org-agenda
/usr/share/emacs/site-lisp/org-mode/ob-calc hides /usr/share/emacs/28.3/lisp/org/ob-calc
/usr/share/emacs/site-lisp/org-mode/ob-lilypond hides /usr/share/emacs/28.3/lisp/org/ob-lilypond
/usr/share/emacs/site-lisp/org-mode/ob-comint hides /usr/share/emacs/28.3/lisp/org/ob-comint
/usr/share/emacs/site-lisp/org-mode/ob-ruby hides /usr/share/emacs/28.3/lisp/org/ob-ruby
/usr/share/emacs/site-lisp/org-mode/org-feed hides /usr/share/emacs/28.3/lisp/org/org-feed
/usr/share/emacs/site-lisp/org-mode/ob-dot hides /usr/share/emacs/28.3/lisp/org/ob-dot
/usr/share/emacs/site-lisp/org-mode/ob-tangle hides /usr/share/emacs/28.3/lisp/org/ob-tangle
/usr/share/emacs/site-lisp/org-mode/ob-awk hides /usr/share/emacs/28.3/lisp/org/ob-awk
/usr/share/emacs/site-lisp/org-mode/org-entities hides /usr/share/emacs/28.3/lisp/org/org-entities
/usr/share/emacs/site-lisp/org-mode/ob-plantuml hides /usr/share/emacs/28.3/lisp/org/ob-plantuml
/usr/share/emacs/site-lisp/org-mode/ob-lob hides /usr/share/emacs/28.3/lisp/org/ob-lob
/usr/share/emacs/site-lisp/org-mode/org-element hides /usr/share/emacs/28.3/lisp/org/org-element
/usr/share/emacs/site-lisp/org-mode/ox-icalendar hides /usr/share/emacs/28.3/lisp/org/ox-icalendar
/usr/share/emacs/site-lisp/org-mode/org-duration hides /usr/share/emacs/28.3/lisp/org/org-duration
/usr/share/emacs/site-lisp/org-mode/ob-R hides /usr/share/emacs/28.3/lisp/org/ob-R
/usr/share/emacs/site-lisp/org-mode/org-faces hides /usr/share/emacs/28.3/lisp/org/org-faces
/usr/share/emacs/site-lisp/org-mode/org-tempo hides /usr/share/emacs/28.3/lisp/org/org-tempo
/usr/share/emacs/site-lisp/org-mode/ol-man hides /usr/share/emacs/28.3/lisp/org/ol-man
/usr/share/emacs/site-lisp/org-mode/ob-matlab hides /usr/share/emacs/28.3/lisp/org/ob-matlab
/usr/share/emacs/site-lisp/org-mode/ox-texinfo hides /usr/share/emacs/28.3/lisp/org/ox-texinfo
/usr/share/emacs/site-lisp/org-mode/ox-man hides /usr/share/emacs/28.3/lisp/org/ox-man
/usr/share/emacs/site-lisp/org-mode/org-clock hides /usr/share/emacs/28.3/lisp/org/org-clock
/usr/share/emacs/site-lisp/org-mode/org-refile hides /usr/share/emacs/28.3/lisp/org/org-refile
/usr/share/emacs/site-lisp/org-mode/ox-koma-letter hides /usr/share/emacs/28.3/lisp/org/ox-koma-letter
/usr/share/emacs/site-lisp/org-mode/ob-sed hides /usr/share/emacs/28.3/lisp/org/ob-sed
/usr/share/emacs/site-lisp/org-mode/ob-python hides /usr/share/emacs/28.3/lisp/org/ob-python
/usr/share/emacs/site-lisp/org-mode/oc-biblatex hides /usr/share/emacs/28.3/lisp/org/oc-biblatex
/usr/share/emacs/site-lisp/org-mode/ob-ocaml hides /usr/share/emacs/28.3/lisp/org/ob-ocaml
/usr/share/emacs/site-lisp/org-mode/org-protocol hides /usr/share/emacs/28.3/lisp/org/org-protocol
/usr/share/emacs/site-lisp/org-mode/org hides /usr/share/emacs/28.3/lisp/org/org
/usr/share/emacs/site-lisp/org-mode/oc-basic hides /usr/share/emacs/28.3/lisp/org/oc-basic
/usr/share/emacs/site-lisp/org-mode/ox-odt hides /usr/share/emacs/28.3/lisp/org/ox-odt
/usr/share/emacs/site-lisp/org-mode/ob-screen hides /usr/share/emacs/28.3/lisp/org/ob-screen
/usr/share/emacs/site-lisp/org-mode/ob-lua hides /usr/share/emacs/28.3/lisp/org/ob-lua
/usr/share/emacs/site-lisp/org-mode/org-keys hides /usr/share/emacs/28.3/lisp/org/org-keys
/usr/share/emacs/site-lisp/org-mode/ob-processing hides /usr/share/emacs/28.3/lisp/org/ob-processing
/usr/share/emacs/site-lisp/org-mode/ol-docview hides /usr/share/emacs/28.3/lisp/org/ol-docview
/usr/share/emacs/site-lisp/org-mode/ol-bbdb hides /usr/share/emacs/28.3/lisp/org/ol-bbdb
/usr/share/emacs/site-lisp/org-mode/ob-shell hides /usr/share/emacs/28.3/lisp/org/ob-shell
/usr/share/emacs/site-lisp/org-mode/ol-gnus hides /usr/share/emacs/28.3/lisp/org/ol-gnus
/usr/share/emacs/site-lisp/org-mode/org-compat hides /usr/share/emacs/28.3/lisp/org/org-compat
/usr/share/emacs/site-lisp/org-mode/ob-lisp hides /usr/share/emacs/28.3/lisp/org/ob-lisp
/usr/share/emacs/site-lisp/org-mode/ol-doi hides /usr/share/emacs/28.3/lisp/org/ol-doi
/usr/share/emacs/site-lisp/org-mode/ob-C hides /usr/share/emacs/28.3/lisp/org/ob-C
/usr/share/emacs/site-lisp/org-mode/ox-org hides /usr/share/emacs/28.3/lisp/org/ox-org
/usr/share/emacs/site-lisp/org-mode/ol-eww hides /usr/share/emacs/28.3/lisp/org/ol-eww
/usr/share/emacs/site-lisp/org-mode/ob-ditaa hides /usr/share/emacs/28.3/lisp/org/ob-ditaa
/usr/share/emacs/site-lisp/org-mode/ox-beamer hides /usr/share/emacs/28.3/lisp/org/ox-beamer
/usr/share/emacs/site-lisp/org-mode/org-footnote hides /usr/share/emacs/28.3/lisp/org/org-footnote
/usr/share/emacs/site-lisp/org-mode/oc-csl hides /usr/share/emacs/28.3/lisp/org/oc-csl
/usr/share/emacs/site-lisp/org-mode/ol-bibtex hides /usr/share/emacs/28.3/lisp/org/ol-bibtex
/usr/share/emacs/site-lisp/org-mode/ox-md hides /usr/share/emacs/28.3/lisp/org/ox-md
/usr/share/emacs/site-lisp/org-mode/org-indent hides /usr/share/emacs/28.3/lisp/org/org-indent
/usr/share/emacs/site-lisp/org-mode/ob-makefile hides /usr/share/emacs/28.3/lisp/org/ob-makefile
/usr/share/emacs/site-lisp/org-mode/ox hides /usr/share/emacs/28.3/lisp/org/ox
/usr/share/emacs/site-lisp/org-mode/ob-groovy hides /usr/share/emacs/28.3/lisp/org/ob-groovy
/usr/share/emacs/site-lisp/org-mode/ob-clojure hides /usr/share/emacs/28.3/lisp/org/ob-clojure
/usr/share/emacs/site-lisp/org-mode/ol-rmail hides /usr/share/emacs/28.3/lisp/org/ol-rmail
/usr/share/emacs/site-lisp/org-mode/ol-irc hides /usr/share/emacs/28.3/lisp/org/ol-irc
/usr/share/emacs/site-lisp/org-mode/org-goto hides /usr/share/emacs/28.3/lisp/org/org-goto
/usr/share/emacs/site-lisp/org-mode/ob-js hides /usr/share/emacs/28.3/lisp/org/ob-js
/usr/share/emacs/site-lisp/org-mode/ob-perl hides /usr/share/emacs/28.3/lisp/org/ob-perl
/usr/share/emacs/site-lisp/org-mode/org-version hides /usr/share/emacs/28.3/lisp/org/org-version
/usr/share/emacs/site-lisp/org-mode/org-list hides /usr/share/emacs/28.3/lisp/org/org-list
/usr/share/emacs/site-lisp/org-mode/org-macro hides /usr/share/emacs/28.3/lisp/org/org-macro
/usr/share/emacs/site-lisp/org-mode/org-macs hides /usr/share/emacs/28.3/lisp/org/org-macs
/usr/share/emacs/site-lisp/org-mode/ob-table hides /usr/share/emacs/28.3/lisp/org/ob-table
/usr/share/emacs/site-lisp/org-mode/ol-info hides /usr/share/emacs/28.3/lisp/org/ol-info
/usr/share/emacs/site-lisp/org-mode/ob-ref hides /usr/share/emacs/28.3/lisp/org/ob-ref
/usr/share/emacs/site-lisp/org-mode/ob-java hides /usr/share/emacs/28.3/lisp/org/ob-java
/usr/share/emacs/site-lisp/org-mode/ob-exp hides /usr/share/emacs/28.3/lisp/org/ob-exp
/usr/share/emacs/site-lisp/flim/sasl hides /usr/share/emacs/28.3/lisp/net/sasl
~ulm/lib/emacs/todo-mode hides /usr/share/emacs/28.3/lisp/calendar/todo-mode
Features:
(shadow emacsbug tmm markdown-mode cc-mode cc-fonts cc-guess cc-menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs vc-hg vc-bzr
tramp-cache calc-yank make-mode time-stamp autoconf-mode cmake-mode rst
ispell edit-server rng-xsd xsd-regexp rng-cmpct rng-nxml rng-valid
rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn
nxml-ns nxml-mode nxml-outln nxml-rap sgml-mode facemenu nxml-util
nxml-enc xmltok python tramp-sh tramp tramp-loaddefs trampver
tramp-integration files-x tramp-compat ls-lisp cus-edit pp cus-start
cus-load gnus-draft solar cal-dst holidays hol-loaddefs cal-move
gnus-fun tar-mode arc-mode archive-mode gnus-icalendar org-capture
org-refile org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro
org-src ob-comint org-pcomplete org-list org-footnote org-faces
org-entities ob-emacs-lisp ob-core ob-eval org-cycle org-table ol rx
org-fold org-fold-core org-keys oc org-loaddefs find-func org-version
org-compat org-macs format-spec icalendar diary-lib diary-loaddefs
cal-menu calendar cal-loaddefs info preview tex-buf noutline outline
font-latex latex edmacro kmacro latex-flymake flymake-proc flymake
project warnings tex-ispell tex-style tex texmathp tex-mode compile
latexenc calc-comb shr-color color vc smerge-mode diff calc-undo
calc-misc calccomp calc-aent calc-arith calc-alg calc-ext calc-menu calc
calc-loaddefs rect calc-macs mailalias thingatpt supercite regi
bbdb-message sort gnus-cite flow-fill cl-extra help-mode mm-archive
mail-extr gnus-async gnus-bcklg qp gnus-ml utf-7 nndraft nnmh nndoc
epa-file gnutls network-stream nsm nnfolder bbdb-gnus bbdb-mua bbdb-com
crm nnnil gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg
gnus-art mm-uu mml2015 mm-view mml-smime smime dig nntp gnus-cache
gnus-sum shr kinsoku svg dom browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf url-util
url-parse url-vars mailcap gnus-group gnus-undo gnus-start gnus-dbus
dbus xml gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo parse-time
iso8601 gnus-spec gnus-int gnus-range gnus-win gnus nnheader wid-edit
mule-util dired-aux disp-table whitespace conf-mode misearch
multi-isearch vc-git diff-mode easy-mmode vc-dispatcher ebuild-mode
skeleton sh-script smie executable quilt yaml-mode shell pcomplete
comint ansi-color ring tango-dark-theme bbdb bbdb-site timezone message
rmc puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068
epg-config gnus-util rmail rmail-loaddefs text-property-search time-date
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader smtpmail auth-source eieio eieio-core eieio-loaddefs
password-cache json subr-x map seq byte-opt bytecomp byte-compile cconv
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils fff
jka-compr server mic-paren site-gentoo w3m-load ecb-autoloads mime-setup
mail-mime-setup semi-setup advice semi-def alist path-util apel-ver
product preview-latex vm-autoloads vm-version vm-vars mmm-auto mmm-vars
mmm-utils mmm-compat cl-macs gv cl-seq cl-loaddefs cl-lib bbdb-loaddefs
auto-loads tex-site iso-transl tooltip eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode 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 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 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 emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button
loaddefs faces cus-face macroexp files window 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 x-toolkit
x multi-tty make-network-process emacs)
Memory information:
((conses 16 668596 207352)
(symbols 48 42264 36)
(strings 32 169335 13441)
(string-bytes 1 5584176)
(vectors 16 84122)
(vector-slots 8 1911782 101724)
(floats 8 799 364)
(intervals 56 27042 2468)
(buffers 992 77))
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#63733: 28.3; error ("Unknown option ‘--batch’")
2023-05-26 7:43 bug#63733: 28.3; error ("Unknown option ‘--batch’") Ulrich Müller
@ 2023-05-26 9:10 ` Eli Zaretskii
2023-05-26 9:33 ` Ulrich Mueller
0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2023-05-26 9:10 UTC (permalink / raw)
To: Ulrich Müller; +Cc: 63733
> From: Ulrich Müller <ulm@gentoo.org>
> Date: Fri, 26 May 2023 09:43:40 +0200
>
> Something is strange with option parsing:
>
> $ emacs -Q -batch -batch --eval '(message "hello, world")'
> hello, world
> $ emacs -Q --batch --batch --eval '(message "hello, world")'
> hello, world
> $ emacs -Q -batch --batch --eval '(message "hello, world")'
> Debugger entered--Lisp error: (error "Unknown option ‘--batch’")
> signal(error ("Unknown option ‘--batch’"))
> error("Unknown option `%s'" "--batch")
> command-line-1(("--batch" "-Q" "--eval" "(message \"hello, world\")"))
> command-line()
> normal-top-level()
>
> $ emacs -Q --batch -batch --eval '(message "hello, world")'
> Debugger entered--Lisp error: (error "Unknown option ‘-batch’")
> signal(error ("Unknown option ‘-batch’"))
> error("Unknown option `%s'" "-batch")
> command-line-1(("-batch" "-Q" "--eval" "(message \"hello, world\")"))
> command-line()
> normal-top-level()
>
>
> I would expect -batch/--batch to be idempotent in all four combinations
> above.
They are not idempotent. Emacs doesn't use getopt, it uses its own
custom code for parsing the command-line options, because our
situation is complex: we only process part of the command-line options
in C, the rest are processed in Lisp.
What happens here is that, when you use identical "-batch" or
"--batch" options several times, the code in sort_args removes the
identical copies, and we are left with a single option to process.
But if you use both "-batch" and "--batch", the extra option is not
removed, and they both appear in the sorted argv[]. Then one of them
is processed by 'main', the other is left for command-line-1, which
doesn't know what to do with it.
I'm not sure we want to support this use case. It certainly doesn't
make sense to complicate our command-line parsing for its sake.
Perhaps if a simple and safe solution can be found for removing such
"duplicates" in sort_args, we could install such a change, but
definitely not on the emacs-29 release branch.
Thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#63733: 28.3; error ("Unknown option ‘--batch’")
2023-05-26 9:10 ` Eli Zaretskii
@ 2023-05-26 9:33 ` Ulrich Mueller
2023-05-26 10:33 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: Ulrich Mueller @ 2023-05-26 9:33 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 63733
>>>>> On Fri, 26 May 2023, Eli Zaretskii wrote:
>> I would expect -batch/--batch to be idempotent in all four combinations
>> above.
> They are not idempotent.
I figured that. IMHO they should be, because it is surprising when
"-batch -batch" works but "-batch --batch" doesn't.
> Emacs doesn't use getopt, it uses its own custom code for parsing the
> command-line options, because our situation is complex: we only
> process part of the command-line options in C, the rest are processed
> in Lisp.
> What happens here is that, when you use identical "-batch" or
> "--batch" options several times, the code in sort_args removes the
> identical copies, and we are left with a single option to process.
> But if you use both "-batch" and "--batch", the extra option is not
> removed, and they both appear in the sorted argv[]. Then one of them
> is processed by 'main', the other is left for command-line-1, which
> doesn't know what to do with it.
"emacs -quick --quick" or even "emacs -Q -quick --quick" works as
expected, though.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#63733: 28.3; error ("Unknown option ‘--batch’")
2023-05-26 9:33 ` Ulrich Mueller
@ 2023-05-26 10:33 ` Eli Zaretskii
0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2023-05-26 10:33 UTC (permalink / raw)
To: Ulrich Mueller; +Cc: 63733
> From: Ulrich Mueller <ulm@gentoo.org>
> Cc: 63733@debbugs.gnu.org
> Date: Fri, 26 May 2023 11:33:33 +0200
>
> >>>>> On Fri, 26 May 2023, Eli Zaretskii wrote:
>
> > What happens here is that, when you use identical "-batch" or
> > "--batch" options several times, the code in sort_args removes the
> > identical copies, and we are left with a single option to process.
> > But if you use both "-batch" and "--batch", the extra option is not
> > removed, and they both appear in the sorted argv[]. Then one of them
> > is processed by 'main', the other is left for command-line-1, which
> > doesn't know what to do with it.
>
> "emacs -quick --quick" or even "emacs -Q -quick --quick" works as
> expected, though.
Because startup.el knows about it.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-05-26 10:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-26 7:43 bug#63733: 28.3; error ("Unknown option ‘--batch’") Ulrich Müller
2023-05-26 9:10 ` Eli Zaretskii
2023-05-26 9:33 ` Ulrich Mueller
2023-05-26 10:33 ` Eli Zaretskii
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).