Move doom-file-cookie-p to core-dispatcher
And rename it to doom--file-cookie-p
This commit is contained in:
parent
c22b3da9f9
commit
3c7c5d5120
2 changed files with 12 additions and 12 deletions
|
@ -381,6 +381,16 @@ even if it doesn't need reloading!"
|
||||||
;; Doom autoloads
|
;; Doom autoloads
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
(defun doom--file-cookie-p (file)
|
||||||
|
"Returns the return value of the ;;;###if predicate form in FILE."
|
||||||
|
(with-temp-buffer
|
||||||
|
(insert-file-contents-literally file nil 0 256)
|
||||||
|
(if (and (re-search-forward "^;;;###if " nil t)
|
||||||
|
(<= (line-number-at-pos) 3))
|
||||||
|
(let ((load-file-name file))
|
||||||
|
(eval (sexp-at-point)))
|
||||||
|
t)))
|
||||||
|
|
||||||
(defun doom--generate-header (func)
|
(defun doom--generate-header (func)
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(insert ";; -*- lexical-binding:t -*-\n"
|
(insert ";; -*- lexical-binding:t -*-\n"
|
||||||
|
@ -395,7 +405,7 @@ even if it doesn't need reloading!"
|
||||||
(noninteractive (not doom-debug-mode))
|
(noninteractive (not doom-debug-mode))
|
||||||
autoload-timestamps)
|
autoload-timestamps)
|
||||||
(print!
|
(print!
|
||||||
(cond ((not (doom-file-cookie-p file))
|
(cond ((not (doom--file-cookie-p file))
|
||||||
"⚠ Ignoring %s")
|
"⚠ Ignoring %s")
|
||||||
((autoload-generate-file-autoloads file (current-buffer))
|
((autoload-generate-file-autoloads file (current-buffer))
|
||||||
(yellow "✕ Nothing in %%s"))
|
(yellow "✕ Nothing in %%s"))
|
||||||
|
@ -717,7 +727,7 @@ If RECOMPILE-P is non-nil, only recompile out-of-date files."
|
||||||
(and (file-exists-p elc-file)
|
(and (file-exists-p elc-file)
|
||||||
(file-newer-than-file-p target elc-file))))
|
(file-newer-than-file-p target elc-file))))
|
||||||
(let ((result (if (or (string-match-p "/\\(?:packages\\|doctor\\)\\.el$" target)
|
(let ((result (if (or (string-match-p "/\\(?:packages\\|doctor\\)\\.el$" target)
|
||||||
(not (doom-file-cookie-p target)))
|
(not (doom--file-cookie-p target)))
|
||||||
'no-byte-compile
|
'no-byte-compile
|
||||||
(byte-compile-file target)))
|
(byte-compile-file target)))
|
||||||
(short-name (if (file-in-directory-p target doom-emacs-dir)
|
(short-name (if (file-in-directory-p target doom-emacs-dir)
|
||||||
|
|
|
@ -90,16 +90,6 @@ This is used by `associate!', `file-exists-p!' and `project-file-exists-p!'."
|
||||||
"Return EXP wrapped in a list, or as-is if already a list."
|
"Return EXP wrapped in a list, or as-is if already a list."
|
||||||
(if (listp exp) exp (list exp)))
|
(if (listp exp) exp (list exp)))
|
||||||
|
|
||||||
(defun doom-file-cookie-p (file)
|
|
||||||
"Returns the return value of the ;;;###if predicate form in FILE."
|
|
||||||
(with-temp-buffer
|
|
||||||
(insert-file-contents-literally file nil 0 256)
|
|
||||||
(if (and (re-search-forward "^;;;###if " nil t)
|
|
||||||
(<= (line-number-at-pos) 3))
|
|
||||||
(let ((load-file-name file))
|
|
||||||
(eval (sexp-at-point)))
|
|
||||||
t)))
|
|
||||||
|
|
||||||
(defun doom-keyword-intern (str)
|
(defun doom-keyword-intern (str)
|
||||||
"Converts STR (a string) into a keyword (`keywordp')."
|
"Converts STR (a string) into a keyword (`keywordp')."
|
||||||
(or (stringp str)
|
(or (stringp str)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue