On Wednesday, August 4, 2021 at 7:24:38 PM UTC+8, Javier wrote:
>
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 by
> > web browser?
> The long URLS you don't need to break, but please break the text
> pararagraphs at 72 chars (or at maximum 78).
> > 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.
> 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
or
#!/usr/local/bin/emacs -q --script
But they all will load the already existing configurations.
> ; elisp code here
> ; ...
OTOH, I also tried the following method:
------------------- begin ---------------------------
#!/usr/bin/env bash
emacs -Q --load <(tail -n +4 "$0")
exit
;;Bootstrap straight
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"
https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(straight-use-package 'use-package)
(setq straight-use-package-by-default t)
------------------- end ---------------------------
Though the above method can start Emacs, but I'll see the following info in the *Messages* buffer:
For information about GNU Emacs and the GNU system, type C-h C-a.
eval-buffer: Symbol’s function definition is void: straight-use-package
> 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.
Thank you for your explanation.