GNU bug report logs -
#31220
25.3; emacs --script breaks command-line arguments handling
Previous Next
Reported by: Thibault Polge <thibault <at> thb.lt>
Date: Thu, 19 Apr 2018 20:03:02 UTC
Severity: minor
Found in version 25.3
Done: Thibault Polge <thibault <at> thb.lt>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> Date: Fri, 20 Apr 2018 11:26:04 +1200
> From: Phil Sainty <psainty <at> orcon.net.nz>
> Cc: 31220 <at> debbugs.gnu.org,
> bug-gnu-emacs <bug-gnu-emacs-bounces+psainty=orcon.net.nz <at> gnu.org>
>
> As with many programs, you can use the argument '--' to tell Emacs not
> to process further arguments as if they were options. e.g.:
>
> $ emacs --script -- --help
>
> Which will pass '--' and '--help' to the script.
>
>
> Some boiler-plate for an elisp script is:
>
> #!/bin/sh
> ":"; exec emacs -Q --script "$0" -- "$@" # -*-emacs-lisp-*-
> (pop argv) # Remove the "--" argument
> # ...
> # Always exit explicitly. This returns the desired exit
> # status, and also avoids the need to (setq argv nil).
> (kill-emacs 0)
>
>
> For more information see:
>
> * https://stackoverflow.com/a/6259330/324105
> * https://swsnr.de/posts/emacs-script-pitfalls
See also bug#25670.
This bug report was last modified 7 years and 94 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.