----------- begin --------------
#!/usr/bin/env bash
:; set -e # -*- mode: emacs-lisp; lexical-binding: t -*-
:; # https://github.com/abo-abo/swiper/issues/2899#issuecomment-889926472
:; # https://github.com/hlissner/doom-emacs/blob/develop/bin/doom
:; emacs -Q --load "$(realpath -e $0)" -- "$@"
;;Bootstrap straight
(defvar bootstrap-version)
----------- end --------------
$ bash the-bash-elisp-mix-script
init.the-bash-elisp-mix-script: line 7: syntax error near
unexpected token `;;'
The above idea is based on code example given on ><https://github.com/hlissner/doom-emacs/blob/develop/bin/doom>.
Any hints for fixing these problems?
"hongy...@gmail.com" <hongy...@gmail.com>:
[An 123 characters long line deleted]
Please make use of your return key to avoid overly long lines
(maximum of 78 characters) when posting via the google web.
----------- begin --------------
#!/usr/bin/env bash
:; set -e # -*- mode: emacs-lisp; lexical-binding: t -*-
:; # https://github.com/abo-abo/swiper/issues/2899#issuecomment-889926472 >:; # https://github.com/hlissner/doom-emacs/blob/develop/bin/doom
:; emacs -Q --load "$(realpath -e $0)" -- "$@"
;;Bootstrap straight[…]
(defvar bootstrap-version)
----------- end --------------
[Another overly long line deleted]
$ bash the-bash-elisp-mix-script
[Another overly long line deleted]
init.the-bash-elisp-mix-script: line 7: syntax error near[…]
unexpected token `;;'
The above idea is based on code example given on ><https://github.com/hlissner/doom-emacs/blob/develop/bin/doom>.
Any hints for fixing these problems?
Yes. Answer the following question: What complains about the token
';;' in line 7 and why does it complain?
Your question reveals, that you don't have any clue about the
mechanism of the script, so the real answer should be: If you don't understand it, don't run it.
You might try
:; exec emacs -Q --load "$(realpath -e $0)" -- "$@"
rather than
:; emacs -Q --load "$(realpath -e $0)" -- "$@"
in that script and see whether that works for you.
Please make use of your return key to avoid overly long lines
(maximum of 78 characters) when posting via the google web.
What about the long URL? Does this break the URL auto recognition by
web browser?
Another question: how to do the same job with the `--script' option of
Emacs? I've tried with the following command, but failed to start
Emacs:
:; exec emacs -Q --script $(realpath -e $0) -- "$@"
rather than
:; emacs -Q --load "$(realpath -e $0)" -- "$@"
in that script and see whether that works for you.
hongy...@gmail.com <hongy...@gmail.com> wrote:
Please make use of your return key to avoid overly long lines
(maximum of 78 characters) when posting via the google web.
What about the long URL? Does this break the URL auto recognition byThe long URLS you don't need to break, but please break the text pararagraphs at 72 chars (or at maximum 78).
web browser?
Another question: how to do the same job with the `--script' option of Emacs? I've tried with the following command, but failed to start
Emacs:
:; exec emacs -Q --script $(realpath -e $0) -- "$@"
You just use --script it in the shebang line with no bash coderather than
:; emacs -Q --load "$(realpath -e $0)" -- "$@"
in that script and see whether that works for you.
#!/usr/bin/emacs --script
; elisp code here
; ...
But with --script emacs is executed in batch mode and does not enter interactive mode as your previous example, so it might not be what you
are looking for.
On Wednesday, August 4, 2021 at 7:24:38 PM UTC+8, Javier wrote:
You just use --script it in the shebang line with no bash code
#!/usr/bin/emacs --script
Based on my tries, the only shebang line can't start Emacs
while the following can
#!/usr/local/bin/emacs -Q --script
But they all will load the already existing configurations.
hongy...@gmail.com <hongy...@gmail.com> wrote:
On Wednesday, August 4, 2021 at 7:24:38 PM UTC+8, Javier wrote:
You just use --script it in the shebang line with no bash code
#!/usr/bin/emacs --script
Based on my tries, the only shebang line can't start EmacsAs I told you before '#!/usr/bin/emacs --script' will start emacs in
batch mode. This means that emacs will exectute the elisp code and
exit without asking for anything interactive. You will not see an
emacs window popping up with --script.
while the following can
#!/usr/local/bin/emacs -Q --script
But they all will load the already existing configurations.You see an emacs window that loads the existing (~/.emacs I guess) configuration because neither of the -Q nor --script configurations
You will most likely see a error message in emacs at startup
Unknown option ‘-Q --script’
That's because the shebang line can only send 1 command-line option to emacs. The shebang line is unable to send two options to emacs (or
any other program for the matter).
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 23:29:02 |
Calls: | 6,646 |
Calls today: | 1 |
Files: | 12,191 |
Messages: | 5,327,626 |