fix: --profile switch in noninteractive sessions
This fixes command-line-args getting prematurely cleared out just before being scanned for a --profile switch. Fix: #7457 Co-authored-by: hpfr <hpfr@users.noreply.github.com>
This commit is contained in:
parent
eb4e8960af
commit
fe18640376
1 changed files with 8 additions and 8 deletions
|
@ -51,14 +51,14 @@
|
|||
;; notable saving in startup time. This let-binding is just a stopgap though,
|
||||
;; a more complete version of this optimization can be found in lisp/doom.el.
|
||||
(let (file-name-handler-alist)
|
||||
(let* (;; FIX: Unset `command-line-args' in noninteractive sessions, to
|
||||
;; ensure upstream switches aren't misinterpreted.
|
||||
(command-line-args (unless noninteractive command-line-args))
|
||||
;; I avoid using `command-switch-alist' to process --profile (and
|
||||
;; --init-directory) because it is processed too late to change
|
||||
;; `user-emacs-directory' in time.
|
||||
(profile (or (cadr (member "--profile" command-line-args))
|
||||
(getenv-internal "DOOMPROFILE"))))
|
||||
(let (;; FIX: Unset `command-line-args' in noninteractive sessions, to
|
||||
;; ensure upstream switches aren't misinterpreted.
|
||||
(command-line-args (unless noninteractive command-line-args))
|
||||
;; I avoid using `command-switch-alist' to process --profile (and
|
||||
;; --init-directory) because it is processed too late to change
|
||||
;; `user-emacs-directory' in time.
|
||||
(profile (or (cadr (member "--profile" command-line-args))
|
||||
(getenv-internal "DOOMPROFILE"))))
|
||||
(if (null profile)
|
||||
;; REVIEW: Backported from Emacs 29. Remove when 28 support is dropped.
|
||||
(let ((init-dir (or (cadr (member "--init-directory" command-line-args))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue