bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#25671: Feature request: emacs -Q --script as a single binary


From: Clément Pit--Claudel
Subject: bug#25671: Feature request: emacs -Q --script as a single binary
Date: Thu, 9 Feb 2017 16:14:41 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0

Hi bug-gnu-emacs,

Since version 22 Emacs lets scripts begin with a shebang line:

  #!/usr/bin/emacs --script
  ;; Some ELisp code here

This breaks if Emacs isn't installed in /usr/bin, though.  Thus, one would want 
to write this:

  #!/usr/bin/env emacs --script
  ;; Some ELisp code here

But this doesn't work (env doesn't split its arguments), and it also breaks 
even if one is happy with hardcoding /usr/bin/emacs but tries to pass more than 
one argument (think -Q and --script).  Thus one writes this:

  #!/bin/sh
  ":"; exec emacs -Q --script "$0" "$@" # -*- mode: emacs-lisp; 
lexical-binding: t; -*-

(See 
http://stackoverflow.com/questions/6238331/emacs-shell-scripts-how-to-put-initial-options-into-the-script/6259330#6259330)

This isn't pretty.  Could we set up emacs to assume --script and possibly -Q 
when started as "elisp", or "emacs-script", or some other name (that is, could 
we make it so that invoking emacs with argv[0] = ".../elisp" starts emacs -Q 
--script)? (And ideally Emacs would ignore all options after the script's name, 
to let the script itself process them).

Thanks!
Clément.

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]