* core: eval-and-compile the functions used in eager macro expansion

This commit is contained in:
Lin Sun 2022-12-12 00:00:03 +00:00 committed by Maxi Wolff
parent 866a2d5ae1
commit 7b738c2b0b
2 changed files with 21 additions and 19 deletions

View File

@ -890,17 +890,18 @@ Called with `C-u C-u' skips `dotspacemacs/user-config' _and_ preliminary tests."
(when (configuration-layer/package-used-p 'spaceline)
(spacemacs//restore-buffers-powerline)))
(defun dotspacemacs/get-variable-string-list ()
"Return a list of all the dotspacemacs variables as strings."
(all-completions "dotspacemacs" obarray
(lambda (x)
(and (boundp x)
;; avoid private variables to show up
(not (string-match-p "--" (symbol-name x)))))))
(eval-and-compile
(defun dotspacemacs/get-variable-string-list ()
"Return a list of all the dotspacemacs variables as strings."
(all-completions "dotspacemacs" obarray
(lambda (x)
(and (boundp x)
;; avoid private variables to show up
(not (string-match-p "--" (symbol-name x)))))))
(defun dotspacemacs/get-variable-list ()
"Return a list of all dotspacemacs variable symbols."
(mapcar 'intern (dotspacemacs/get-variable-string-list)))
(defun dotspacemacs/get-variable-list ()
"Return a list of all dotspacemacs variable symbols."
(mapcar 'intern (dotspacemacs/get-variable-string-list))))
(defmacro dotspacemacs|symbol-value (symbol)
"Return the value of SYMBOL corresponding to a dotspacemacs variable.

View File

@ -805,19 +805,20 @@ If MESSAGEBUF is not nil then MSG is also written in message buffer."
(when messagebuf
(message "(Spacemacs) %s" msg)))))
(defun spacemacs-buffer//startup-list-jump-func-name (str)
"Given a string, return a spacemacs-buffer function name.
(eval-and-compile
(defun spacemacs-buffer//startup-list-jump-func-name (str)
"Given a string, return a spacemacs-buffer function name.
Given: Return:
\"[?]\" \"spacemacs-buffer/jump-to-[?]\"
\"Recent Files:\" \"spacemacs-buffer/jump-to-recent-files\""
(let ((s (downcase str)))
;; remove last char if it's a colon
(when (string-match ":$" s)
(setq s (substring s nil (1- (length s)))))
;; replace any spaces with a dash
(setq s (replace-regexp-in-string " " "-" s))
(concat "spacemacs-buffer/jump-to-" s)))
(let ((s (downcase str)))
;; remove last char if it's a colon
(when (string-match ":$" s)
(setq s (substring s nil (1- (length s)))))
;; replace any spaces with a dash
(setq s (replace-regexp-in-string " " "-" s))
(concat "spacemacs-buffer/jump-to-" s))))
(defmacro spacemacs-buffer||add-shortcut
(shortcut-char search-label &optional no-next-line)