diff --git a/bin/doom b/bin/doom index 816900479..a3ba1d973 100755 --- a/bin/doom +++ b/bin/doom @@ -18,8 +18,8 @@ ;; Ensure Doom runs out of this file's parent directory, where Doom is ;; 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"))) + (if (getenv-internal "EMACSDIR") + (file-name-as-directory (expand-file-name (getenv-internal "EMACSDIR"))) (expand-file-name "../" (file-name-directory (file-truename load-file-name))))) diff --git a/core/autoload/files.el b/core/autoload/files.el index 338901658..20a16d634 100644 --- a/core/autoload/files.el +++ b/core/autoload/files.el @@ -37,9 +37,8 @@ This is used by `file-exists-p!' and `project-file-exists-p!'." ,filevar))))) (defun doom--path (&rest segments) - (let ((dir (pop segments))) - (unless segments - (setq dir (expand-file-name dir))) + (let ((segments (delq nil segments)) + dir) (while segments (setq dir (expand-file-name (car segments) dir) segments (cdr segments))) @@ -48,7 +47,8 @@ This is used by `file-exists-p!' and `project-file-exists-p!'." ;;;###autoload (defun doom-glob (&rest segments) "Construct a path from SEGMENTS and expand glob patterns. -Returns nil if the path doesn't exist." +Returns nil if the path doesn't exist. +Ignores `nil' elements in SEGMENTS." (let* (case-fold-search (dir (apply #'doom--path segments))) (if (string-match-p "[[*?]" dir) @@ -58,7 +58,8 @@ Returns nil if the path doesn't exist." ;;;###autoload (defun doom-path (&rest segments) - "Constructs a file path from SEGMENTS." + "Constructs a file path from SEGMENTS. +Ignores `nil' elements in SEGMENTS." (if segments (apply #'doom--path segments) (file!))) @@ -66,7 +67,8 @@ Returns nil if the path doesn't exist." ;;;###autoload (defun doom-dir (&rest segments) "Constructs a path from SEGMENTS. -See `doom-path'." +See `doom-path'. +Ignores `nil' elements in SEGMENTS." (when-let (path (apply #'doom-path segments)) (directory-file-name (file-name-directory path)))) @@ -137,7 +139,8 @@ MATCH is a string regexp. Only entries that match it will be included." "Returns the evaluated result of FORM in a ;;;###COOKIE FORM at the top of FILE. -If COOKIE doesn't exist, return NULL-VALUE." +If COOKIE doesn't exist, or cookie isn't within the first 256 bytes of FILE, +return NULL-VALUE." (unless (file-exists-p file) (signal 'file-missing file)) (unless (file-readable-p file) diff --git a/core/core.el b/core/core.el index 1dfe988a5..3c5e39125 100644 --- a/core/core.el +++ b/core/core.el @@ -285,7 +285,7 @@ config.el instead." (when (boundp 'comp-eln-load-path) (add-to-list 'comp-eln-load-path (concat doom-cache-dir "eln/"))) -(after! comp +(with-eval-after-load 'comp ;; HACK Disable native-compilation for some troublesome packages (dolist (entry (list (concat "\\`" (regexp-quote doom-local-dir) ".*/evil-collection-vterm\\.el\\'") ;; https://github.com/nnicandro/emacs-jupyter/issues/297 diff --git a/modules/config/default/+evil-bindings.el b/modules/config/default/+evil-bindings.el index 15092c9e9..c3aaf9a3e 100644 --- a/modules/config/default/+evil-bindings.el +++ b/modules/config/default/+evil-bindings.el @@ -44,7 +44,7 @@ #'yas-expand (and (featurep! :completion company +tng) (+company-has-completion-p)) - #'+company/complete) + #'company-complete-common) :v [tab] (cmds! (and (bound-and-true-p yas-minor-mode) (or (eq evil-visual-selection 'line) (not (memq (char-after) (list ?\( ?\[ ?\{ ?\} ?\] ?\)))))) diff --git a/modules/emacs/vc/config.el b/modules/emacs/vc/config.el index 1cd5bca25..a358955dd 100644 --- a/modules/emacs/vc/config.el +++ b/modules/emacs/vc/config.el @@ -1,20 +1,19 @@ ;;; emacs/vc/config.el -*- lexical-binding: t; -*- +(when IS-WINDOWS + (setenv "GIT_ASKPASS" "git-gui--askpass")) + ;; Don't complain when these variables are set in file/local vars (put 'git-commit-major-mode 'safe-local-variable 'symbolp) (put 'git-commit-summary-max-length 'safe-local-variable 'symbolp) +;; In case the user is using `bug-reference-mode' (map! :when (fboundp 'bug-reference-mode) :map bug-reference-map "RET" (cmds! (and (bound-and-true-p evil-mode) (evil-normal-state-p)) #'bug-reference-push-button)) - -(when IS-WINDOWS - (setenv "GIT_ASKPASS" "git-gui--askpass")) - - (after! log-view (set-evil-initial-state! '(log-view-mode @@ -52,7 +51,7 @@ "Show revision details in the header-line, instead of the minibuffer. Sometimes I forget `git-timemachine' is enabled in a buffer. Putting revision -info in the `header-line-format' is a good indication." +info in the `header-line-format' is a more visible indicator." :override #'git-timemachine--show-minibuffer-details (let* ((date-relative (nth 3 revision)) (date-full (nth 4 revision)) @@ -65,7 +64,7 @@ info in the `header-line-format' is a good indication." date-full date-relative)))) (after! evil - ;; rehash evil keybindings so they are recognized + ;; Rehash evil keybindings so they are recognized (add-hook 'git-timemachine-mode-hook #'evil-normalize-keymaps)) (when (featurep! :tools magit)