Unset command line options irrelevant to the current OS

This commit is contained in:
James Cherti
2024-08-19 10:27:10 -04:00
parent 06f49cf6db
commit f369cbe512
2 changed files with 20 additions and 9 deletions

View File

@@ -57,6 +57,8 @@ git clone https://github.com/jamescherti/minimal-emacs.d ~/.emacs.d
- Disables warnings from the legacy advice API and suppresses warnings about aliased variables.
- Avoids unnecessary excessive UI updates.
- Disables font compacting to avoid high memory usage.
- Defer tool bar setup
- Unset command line options irrelevant to the current OS
2. **Native Compilation and Byte Compilation:**
- Configures native compilation and byte compilation settings

View File

@@ -195,7 +195,15 @@
;; Shave seconds off startup time by starting the scratch buffer in
;; `fundamental-mode'
(setq initial-major-mode 'fundamental-mode
initial-scratch-message nil)))
initial-scratch-message nil)
(unless minimal-emacs-debug
;; Unset command line options irrelevant to the current OS. These options
;; are still processed by `command-line-1` but have no effect.
(unless (eq system-type 'darwin)
(setq command-line-ns-option-alist nil))
(unless (memq initial-window-system '(x pgtk))
(setq command-line-x-option-alist nil)))))
;;; Native compilation and Byte compilation
@@ -235,6 +243,7 @@
(unless (memq window-system '(mac ns))
(setq menu-bar-mode nil)))
(unless (daemonp)
(unless noninteractive
;; Temporarily override the tool-bar-setup function to prevent it from
;; running during the initial stages of startup
@@ -242,7 +251,7 @@
(define-advice startup--load-user-init-file
(:before (&rest _) minimal-emacs-setup-toolbar)
(advice-remove #'tool-bar-setup #'ignore)
(tool-bar-setup)))
(tool-bar-setup))))
(when minimal-emacs-disable-tool-bar
(push '(tool-bar-lines . 0) default-frame-alist)
(setq tool-bar-mode nil))