Commit graph

15 commits

Author SHA1 Message Date
Henrik Lissner
a320c8183a
revert: fix(cli): set LC_ALL to force english output
LC_ALL must be set to a locale that exists on the current system, and
there is no locale I can safely expect all systems to have (see #7361).
Fortunately, c8070f1 seems to have addressed the underlying issue, so
this fix can be reverted.

Fix: #7361
Revert: #7331
Revert: 150ccd630565
Ref: c8070f11a448
2024-05-21 17:15:48 +02:00
Henrik Lissner
a0da9225ed
fix(cli): set LC_ALL to force english output
Close: #7331
Co-authored-by: xz-dev <xz-dev@users.noreply.github.com>
2024-05-21 17:15:46 +02:00
Henrik Lissner
0ecf69afaf
fix(cli): increment __DOOMSTEP in elisp instead
Some shells (like ksh on SDF) may complain about $((...)) arithmetic
expansion syntax. Rather than wrestle with old shells, I'll offload this
trivial operation to elisp instead.

Close: #6970
2023-03-20 20:42:36 -04:00
Henrik Lissner
c1c966c811
docs: assume ~/.config/emacs by default
From now on, our documentation will assume your Emacs config lives in
~/.config/emacs, by default, rather than ~/.emacs.d. Support for the
latter is not going away, it will simply be mentioned less in the
literature, as all supported versions of Emacs going forward (and future
versions of Doom) will support (and prefer) XDG conventions.

The user manual will be updated separately.

Close: #6965
Co-authored-by: gagbo <gagbo@users.noreply.github.com>
2023-02-25 20:47:28 -05:00
Libin Dang
9f22a0a2a5 fix(cli): split tput call into separate calls
Sync definition of __DOOMGEOM in bin/doomscript with corresponding
variable of bin/doom.

* bin/doomscript (__DOOMGEOM): split tput call into two separate calls

Ref: beef0aef02
2022-10-07 19:48:23 +02:00
Jeff Kowalski
29e30e8af4 fix(cli): follow-on syntax fixes to #6772
While fixing #6772, we also address several other issues found by
sh-shellcheck:

L47C39 SC1007:Remove space after = if trying to assign a value
(for empty string, use var='' ... ).

L47C46 SC2046:Quote this to prevent word splitting.

L62C20 SC2086:Double quote to prevent globbing and word splitting.

L82C9  SC2154:tmpdir is referenced but not assigned
(did you mean 'TMPDIR'?).
2022-09-12 11:44:11 +02:00
Jeff Kowalski
571ab7425a fix(cli): #6772 - trivial doomscripts fail
When trying to establish the value of EMACSDIR, the proper fallback
when BASH_SOURCE is undefined is $0 rather than 0, in correct shell-
scripting parlance.
2022-09-12 11:44:11 +02:00
Henrik Lissner
0172b180a9
refactor(cli): remove superfluous emacs switches
Neither --no-x-resources or --no-splash are relevant to a noninteractive
session.
2022-09-07 17:25:01 +02:00
Henrik Lissner
0100b08402
refactor(cli): handle more errors & POSIX-ify doomscript 2022-09-06 22:55:48 +02:00
Henrik Lissner
b9933e6637
refactor!: restructure Doom core
BREAKING CHANGE: This restructures the project in preparation for Doom
to be split into two repos. Users that have reconfigured Doom's CLI
stand a good chance of seeing breakage, especially if they've referred
to any core-* feature, e.g.

  (after! core-cli-ci ...)

To fix it, simply s/core-/doom-/, i.e.

  (after! doom-cli-ci ...)

What this commit specifically changes is:
- Renames all core features from core-* to doom-*
- Moves core/core-* -> lisp/doom-*
- Moves core/autoloads/* -> lisp/lib/*
- Moves core/templates -> templates/

Ref: #4273
2022-07-30 22:41:13 +02:00
Henrik Lissner
4dcfc37199
nit(cli): clarify comments in bin/doomscript 2022-06-22 23:04:59 +02:00
Henrik Lissner
3ea9051890
fix(cli): remove set -e from bin/doom{,script}
This killed the script prematurely (without displaying the error) if
Emacs failed to execute. In versions prior to bash 4, set -e would not
terminate the script if a non-zero exit code occurred within a subshell,
but it will in bash 4+.

In any case, we don't need this fallback to begin with. The script
handles its errors sufficiently otherwise.
2022-06-22 01:23:39 +02:00
Henrik Lissner
3b3c008b1b
fix(cli): site file loader
I had missed the fact that -Q implies not only
--no-site-file (intended), but --no-site-lisp (unintended). Without the
latter, no site-lisp directory is left in load-path, and any attempt to
load it after-the-fact (which I do in core-cli.el) will fail. Thanks to
@yamanq for noticing this!

Fix: #6473
Fix: #4198
Co-authored-by: Yaman Qalieh <yamanq@users.noreply.github.com>
2022-06-21 22:48:43 +02:00
Henrik Lissner
09ddac1d7a
feat(cli): resolve EMACSDIR to doomscript's parent directory
If no EMACSDIR is given, assume ../ is the Emacs config we want to
operate out of, taking after bin/doom.

And use bash. This script was designed for the convenience of other
scripters on unix systems, so it can afford a small hit to portability.
2022-06-19 02:20:34 +02:00
Henrik Lissner
e5b7edcd8d
feat(cli): add bin/doomscript
Meant as a simple elisp interpreter with Doom's CLI framework preloaded.
Can be used as a shebang line:

  #!/usr/bin/env doomscript
  (princ "hello world!")

This isn't used for bin/doom because it requires doomscript be in your
$PATH, and any attempt to resolve its location in bin/doom's shebang
line would reduce its portability. Neither of these should be an issue
for the type of user who'd find this useful.
2022-06-18 23:53:12 +02:00