diff --git a/bin/doom b/bin/doom index d0dd4e0ee..3b353c802 100755 --- a/bin/doom +++ b/bin/doom @@ -6,7 +6,7 @@ :; [ "${__DOOMCODE:-0}" -eq 128 ] && { "`$EMACS -Q --batch --eval '(princ temporary-file-directory)'`/doom.sh" "$0" "$@" && true; __DOOMCODE=$?; } :; exit $__DOOMCODE -;; The garbage collector isn't important during CLI ops. A higher threshold +;; The garbage collector isn't as important during CLI ops. A higher threshold ;; makes it 15-30% faster, but set it too high and we risk spiralling memory ;; usage in longer sessions. (setq gc-cons-threshold 134217728) ; 128mb @@ -16,8 +16,7 @@ (setq load-prefer-newer t) ;; Ensure Doom runs out of this file's parent directory, where Doom is -;; presumably installed. EMACSDIR is set in the shell script preamble earlier in -;; this file. +;; presumably installed. Use the EMACSDIR envvar to change this. (setq user-emacs-directory (if (getenv "EMACSDIR") (file-name-as-directory (expand-file-name (getenv "EMACSDIR"))) @@ -62,11 +61,9 @@ (load (expand-file-name "core/core.el" user-emacs-directory) nil t) (require 'core-cli) -;; Use our own home-grown debugger to display and log errors + backtraces. -;; Control over its formatting is important, because Emacs produces -;; difficult-to-read debug information otherwise. By making its errors more -;; presentable (and storing them somewhere users can access later) we go a long -;; way toward making it easier for users to write better bug reports. +;; I use our own home-grown debugger so we can capture and store backtraces, +;; make them more presentable, and make it easier for users to produce better +;; bug reports! (setq debugger #'doom-cli--debugger debug-on-error t debug-ignored-errors nil) @@ -83,12 +80,12 @@ ;; return a boolean, integer (error code) or throw an 'exit event, which ;; we handle specially. (apply #'doom-cli-execute :doom (cdr (member "--" argv)))) - ;; Any non-zero integer is treated as an error code. + ;; Any non-zero integer is treated as an explicit exit code. ((and (pred integerp) code) code) - ;; If, instead, we were given a list or string, copy these as shell script - ;; commands to a temp script file which this script will execute after this - ;; session finishes. Also accepts special keywords, like `:restart', to rerun - ;; the current command. + ;; If, instead, we were given a string or list of strings, copy these as + ;; shell script commands to a temporary script file which this script will + ;; execute after this session finishes. Also accepts special keywords, like + ;; `:restart', to rerun the current command. ((and (or (pred consp) (pred stringp) (pred keywordp)) diff --git a/core/core.el b/core/core.el index 5f4b6c20b..a61e194b1 100644 --- a/core/core.el +++ b/core/core.el @@ -25,7 +25,7 @@ (defconst IS-BSD (or IS-MAC (eq system-type 'berkeley-unix))) ;; Unix tools look for HOME, but this is normally not defined on Windows. -(when (and IS-WINDOWS (null (getenv "HOME"))) +(when (and IS-WINDOWS (null (getenv-internal "HOME"))) (setenv "HOME" (getenv "USERPROFILE"))) ;; Ensure `doom-core-dir' is in `load-path' @@ -74,7 +74,7 @@ (defvar doom-init-time nil "The time it took, in seconds, for Doom Emacs to initialize.") -(defvar doom-debug-p (or (getenv "DEBUG") init-file-debug) +(defvar doom-debug-p (or (getenv-internal "DEBUG") init-file-debug) "If non-nil, Doom will log more. Use `doom-debug-mode' to toggle it. The --debug-init flag and setting the DEBUG @@ -95,7 +95,7 @@ envvar will enable this at startup.") "The root directory for Doom's modules. Must end with a slash.") (defconst doom-local-dir - (if-let (localdir (getenv "DOOMLOCALDIR")) + (if-let (localdir (getenv-internal "DOOMLOCALDIR")) (expand-file-name (file-name-as-directory localdir)) (concat doom-emacs-dir ".local/")) "Root directory for local storage. @@ -120,11 +120,11 @@ Use this for files that change often, like cache files. Must end with a slash.") "Where Doom's documentation files are stored. Must end with a slash.") (defconst doom-private-dir - (if-let (doomdir (getenv "DOOMDIR")) + (if-let (doomdir (getenv-internal "DOOMDIR")) (expand-file-name (file-name-as-directory doomdir)) (or (let ((xdgdir (expand-file-name "doom/" - (or (getenv "XDG_CONFIG_HOME") + (or (getenv-internal "XDG_CONFIG_HOME") "~/.config")))) (if (file-directory-p xdgdir) xdgdir)) "~/.doom.d/")) @@ -214,7 +214,7 @@ users).") ;; Emacs is essentially one huge security vulnerability, what with all the ;; dependencies it pulls in from all corners of the globe. Let's try to be at ;; least a little more discerning. -(setq gnutls-verify-error (not (getenv "INSECURE")) +(setq gnutls-verify-error (not (getenv-internal "INSECURE")) gnutls-algorithm-priority (when (boundp 'libgnutls-version) (concat "SECURE128:+SECURE192:-VERS-ALL" diff --git a/docs/contributing.org b/docs/contributing.org index fe3525faa..7d3d38dcd 100644 --- a/docs/contributing.org +++ b/docs/contributing.org @@ -13,7 +13,7 @@ to contribute to our fine corner of the interwebs. * Table of Contents :TOC_3: - [[#where-can-i-help][Where can I help?]] - [[#reporting-issues][Reporting issues]] - - [[#collect-backtraces-of-any-error-messages][Collect backtraces of any error messages]] + - [[#acquire-a-backtrace-from-errors][Acquire a backtrace from errors]] - [[#create-a-step-by-step-reproduction-guide][Create a step-by-step reproduction guide]] - [[#include-information-about-your-doom-install][Include information about your Doom install]] - [[#debugging-crashes-with-gdb][Debugging crashes with gdb]] diff --git a/modules/lang/cc/config.el b/modules/lang/cc/config.el index 8a90874b9..ac682ee92 100644 --- a/modules/lang/cc/config.el +++ b/modules/lang/cc/config.el @@ -159,6 +159,7 @@ This is ignored by ccls.") (set-lookup-handlers! 'cmake-mode :documentation '+cc-cmake-lookup-documentation-fn)) + (use-package! company-cmake ; for `cmake-mode' :when (featurep! :completion company) :after cmake-mode diff --git a/modules/term/eshell/autoload/settings.el b/modules/term/eshell/autoload/settings.el index 14cc197e8..61406ff32 100644 --- a/modules/term/eshell/autoload/settings.el +++ b/modules/term/eshell/autoload/settings.el @@ -11,7 +11,7 @@ ALIASES is a flat list of alias -> command pairs. e.g. \"bye\" \"echo goodbye world\")" (or (cl-evenp (length aliases)) (signal 'wrong-number-of-arguments (list 'even (length aliases)))) - (after! eshell + (after! em-alias (while aliases (let ((alias (pop aliases)) (command (pop aliases))) diff --git a/modules/term/eshell/config.el b/modules/term/eshell/config.el index fcd567ea2..755c598fe 100644 --- a/modules/term/eshell/config.el +++ b/modules/term/eshell/config.el @@ -92,9 +92,7 @@ You should use `set-eshell-alias!' to change this.") (add-hook! 'eshell-mode-hook (defun +eshell-remove-fringes-h () (set-window-fringes nil 0 0) - (set-window-margins nil 1 nil))) - - (add-hook! 'eshell-mode-hook + (set-window-margins nil 1 nil)) (defun +eshell-enable-text-wrapping-h () (visual-line-mode +1) (set-display-table-slot standard-display-table 0 ?\ )))