[Misc] Enable lispy in ‘eval-expression’ and the like only if loaded beforehand
This commit is contained in:
parent
14e84f92f5
commit
62ae309381
12
init.el
12
init.el
|
@ -613,7 +613,8 @@ _h_ _l_ _o_k _y_ank
|
|||
db/run-or-hide-eshell
|
||||
db/run-or-hide-ansi-term
|
||||
db/helm-shortcuts
|
||||
db/hex-to-ascii))
|
||||
db/hex-to-ascii
|
||||
conditionally-enable-lispy))
|
||||
|
||||
(use-package db-emacsclient)
|
||||
|
||||
|
@ -1046,13 +1047,8 @@ Certificates are assumed to be of the form *.crt."
|
|||
;; General Stuff first
|
||||
|
||||
(use-package lispy
|
||||
:commands (lispy-mode conditionally-enable-lispy)
|
||||
:diminish lispy-mode
|
||||
:config (progn
|
||||
(defun conditionally-enable-lispy ()
|
||||
(when (or (eq this-command 'eval-expression)
|
||||
(eq this-command 'pp-eval-expression))
|
||||
(lispy-mode 1)))))
|
||||
:commands (lispy-mode)
|
||||
:diminish lispy-mode)
|
||||
|
||||
(use-package eldoc
|
||||
:commands (eldoc-mode)
|
||||
|
|
|
@ -189,6 +189,16 @@ If not given, FORMAT-STRING defaults to some ISO 8601-like format."
|
|||
(format-time-string (or format-string "%Y-%m-%dT%H:%M:%S.%9NZ")
|
||||
(list h l u p)))))
|
||||
|
||||
(defun conditionally-enable-lispy ()
|
||||
"Enable lispy-mode when in `eval-expression’ or in
|
||||
`pp-eval-expression’. lispy must have been loaded for this
|
||||
first, i.e., this function will not automatically load
|
||||
lispy."
|
||||
(when (and (featurep 'lispy)
|
||||
(or (eq this-command 'eval-expression)
|
||||
(eq this-command 'pp-eval-expression)))
|
||||
(lispy-mode 1)))
|
||||
|
||||
|
||||
;;; dired
|
||||
|
||||
|
|
Loading…
Reference in New Issue