Minor refactors & comment revision
This commit is contained in:
parent
0285dd5e0e
commit
b49c40bbb3
5 changed files with 20 additions and 18 deletions
4
bin/doom
4
bin/doom
|
@ -18,8 +18,8 @@
|
||||||
;; Ensure Doom runs out of this file's parent directory, where Doom is
|
;; Ensure Doom runs out of this file's parent directory, where Doom is
|
||||||
;; presumably installed. Use the EMACSDIR envvar to change this.
|
;; presumably installed. Use the EMACSDIR envvar to change this.
|
||||||
(setq user-emacs-directory
|
(setq user-emacs-directory
|
||||||
(if (getenv "EMACSDIR")
|
(if (getenv-internal "EMACSDIR")
|
||||||
(file-name-as-directory (expand-file-name (getenv "EMACSDIR")))
|
(file-name-as-directory (expand-file-name (getenv-internal "EMACSDIR")))
|
||||||
(expand-file-name
|
(expand-file-name
|
||||||
"../" (file-name-directory (file-truename load-file-name)))))
|
"../" (file-name-directory (file-truename load-file-name)))))
|
||||||
|
|
||||||
|
|
|
@ -37,9 +37,8 @@ This is used by `file-exists-p!' and `project-file-exists-p!'."
|
||||||
,filevar)))))
|
,filevar)))))
|
||||||
|
|
||||||
(defun doom--path (&rest segments)
|
(defun doom--path (&rest segments)
|
||||||
(let ((dir (pop segments)))
|
(let ((segments (delq nil segments))
|
||||||
(unless segments
|
dir)
|
||||||
(setq dir (expand-file-name dir)))
|
|
||||||
(while segments
|
(while segments
|
||||||
(setq dir (expand-file-name (car segments) dir)
|
(setq dir (expand-file-name (car segments) dir)
|
||||||
segments (cdr segments)))
|
segments (cdr segments)))
|
||||||
|
@ -48,7 +47,8 @@ This is used by `file-exists-p!' and `project-file-exists-p!'."
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom-glob (&rest segments)
|
(defun doom-glob (&rest segments)
|
||||||
"Construct a path from SEGMENTS and expand glob patterns.
|
"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
|
(let* (case-fold-search
|
||||||
(dir (apply #'doom--path segments)))
|
(dir (apply #'doom--path segments)))
|
||||||
(if (string-match-p "[[*?]" dir)
|
(if (string-match-p "[[*?]" dir)
|
||||||
|
@ -58,7 +58,8 @@ Returns nil if the path doesn't exist."
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom-path (&rest segments)
|
(defun doom-path (&rest segments)
|
||||||
"Constructs a file path from SEGMENTS."
|
"Constructs a file path from SEGMENTS.
|
||||||
|
Ignores `nil' elements in SEGMENTS."
|
||||||
(if segments
|
(if segments
|
||||||
(apply #'doom--path segments)
|
(apply #'doom--path segments)
|
||||||
(file!)))
|
(file!)))
|
||||||
|
@ -66,7 +67,8 @@ Returns nil if the path doesn't exist."
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom-dir (&rest segments)
|
(defun doom-dir (&rest segments)
|
||||||
"Constructs a path from SEGMENTS.
|
"Constructs a path from SEGMENTS.
|
||||||
See `doom-path'."
|
See `doom-path'.
|
||||||
|
Ignores `nil' elements in SEGMENTS."
|
||||||
(when-let (path (apply #'doom-path segments))
|
(when-let (path (apply #'doom-path segments))
|
||||||
(directory-file-name (file-name-directory path))))
|
(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
|
"Returns the evaluated result of FORM in a ;;;###COOKIE FORM at the top of
|
||||||
FILE.
|
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)
|
(unless (file-exists-p file)
|
||||||
(signal 'file-missing file))
|
(signal 'file-missing file))
|
||||||
(unless (file-readable-p file)
|
(unless (file-readable-p file)
|
||||||
|
|
|
@ -285,7 +285,7 @@ config.el instead."
|
||||||
(when (boundp 'comp-eln-load-path)
|
(when (boundp 'comp-eln-load-path)
|
||||||
(add-to-list 'comp-eln-load-path (concat doom-cache-dir "eln/")))
|
(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
|
;; HACK Disable native-compilation for some troublesome packages
|
||||||
(dolist (entry (list (concat "\\`" (regexp-quote doom-local-dir) ".*/evil-collection-vterm\\.el\\'")
|
(dolist (entry (list (concat "\\`" (regexp-quote doom-local-dir) ".*/evil-collection-vterm\\.el\\'")
|
||||||
;; https://github.com/nnicandro/emacs-jupyter/issues/297
|
;; https://github.com/nnicandro/emacs-jupyter/issues/297
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
#'yas-expand
|
#'yas-expand
|
||||||
(and (featurep! :completion company +tng)
|
(and (featurep! :completion company +tng)
|
||||||
(+company-has-completion-p))
|
(+company-has-completion-p))
|
||||||
#'+company/complete)
|
#'company-complete-common)
|
||||||
:v [tab] (cmds! (and (bound-and-true-p yas-minor-mode)
|
:v [tab] (cmds! (and (bound-and-true-p yas-minor-mode)
|
||||||
(or (eq evil-visual-selection 'line)
|
(or (eq evil-visual-selection 'line)
|
||||||
(not (memq (char-after) (list ?\( ?\[ ?\{ ?\} ?\] ?\))))))
|
(not (memq (char-after) (list ?\( ?\[ ?\{ ?\} ?\] ?\))))))
|
||||||
|
|
|
@ -1,20 +1,19 @@
|
||||||
;;; emacs/vc/config.el -*- lexical-binding: t; -*-
|
;;; 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
|
;; Don't complain when these variables are set in file/local vars
|
||||||
(put 'git-commit-major-mode 'safe-local-variable 'symbolp)
|
(put 'git-commit-major-mode 'safe-local-variable 'symbolp)
|
||||||
(put 'git-commit-summary-max-length '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! :when (fboundp 'bug-reference-mode)
|
||||||
:map bug-reference-map
|
:map bug-reference-map
|
||||||
"RET" (cmds! (and (bound-and-true-p evil-mode)
|
"RET" (cmds! (and (bound-and-true-p evil-mode)
|
||||||
(evil-normal-state-p))
|
(evil-normal-state-p))
|
||||||
#'bug-reference-push-button))
|
#'bug-reference-push-button))
|
||||||
|
|
||||||
|
|
||||||
(when IS-WINDOWS
|
|
||||||
(setenv "GIT_ASKPASS" "git-gui--askpass"))
|
|
||||||
|
|
||||||
|
|
||||||
(after! log-view
|
(after! log-view
|
||||||
(set-evil-initial-state!
|
(set-evil-initial-state!
|
||||||
'(log-view-mode
|
'(log-view-mode
|
||||||
|
@ -52,7 +51,7 @@
|
||||||
"Show revision details in the header-line, instead of the minibuffer.
|
"Show revision details in the header-line, instead of the minibuffer.
|
||||||
|
|
||||||
Sometimes I forget `git-timemachine' is enabled in a buffer. Putting revision
|
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
|
:override #'git-timemachine--show-minibuffer-details
|
||||||
(let* ((date-relative (nth 3 revision))
|
(let* ((date-relative (nth 3 revision))
|
||||||
(date-full (nth 4 revision))
|
(date-full (nth 4 revision))
|
||||||
|
@ -65,7 +64,7 @@ info in the `header-line-format' is a good indication."
|
||||||
date-full date-relative))))
|
date-full date-relative))))
|
||||||
|
|
||||||
(after! evil
|
(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))
|
(add-hook 'git-timemachine-mode-hook #'evil-normalize-keymaps))
|
||||||
|
|
||||||
(when (featurep! :tools magit)
|
(when (featurep! :tools magit)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue