all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Start Emacs with a minimal bash and Emacs lisp mixed script for testing.
@ 2021-08-03  8:52 Hongyi Zhao
  2021-08-03 15:55 ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 6+ messages in thread
From: Hongyi Zhao @ 2021-08-03  8:52 UTC (permalink / raw)
  To: help-gnu-emacs

On Ubuntu 20.04, I'm using the following minimal bash and emacs lisp
mix script to test/debug specific Emacs configurations:
----------- 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)
(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 --------------

I find the above script can start Emacs successfully with the
following calling method:

$ bash the-bash-elisp-mix-script

But when quit Emacs with `C-x C-c', the script always complains the
following info:

init.the-bash-elisp-mix-script: line 7: syntax error near unexpected token `;;'


OTOH, if I change the Emacs command line in the above script into the following:

:; emacs -Q --script "$(realpath -e $0)" -- "$@"

The script will refuse to start, and the following info will be
triggered immediately:

$ bash init.the-bash-elisp-mix-script
init.the-bash-elisp-mix-script: line 7: syntax error near unexpected token `;;'
$

The above idea is based on the code example given on
<https://github.com/hlissner/doom-emacs/blob/develop/bin/doom>.

Any hints for fixing these problems?

Regards,
HY
--
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-08-04  0:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-03  8:52 Start Emacs with a minimal bash and Emacs lisp mixed script for testing Hongyi Zhao
2021-08-03 15:55 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-03 16:08   ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-04  0:26     ` Hongyi Zhao
2021-08-04  0:34       ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-04  0:56         ` Hongyi Zhao

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.