Minor refactors & comment revision

This commit is contained in:
Henrik Lissner 2020-11-29 14:37:32 -05:00
parent 0285dd5e0e
commit b49c40bbb3
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
5 changed files with 20 additions and 18 deletions

View file

@ -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)

View file

@ -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