refactor(lib): sharp-quote & minor refactors
This commit is contained in:
parent
0a151f4f13
commit
3333eee466
1 changed files with 9 additions and 11 deletions
|
@ -222,9 +222,8 @@ TRIGGER-HOOK is a list of quoted hooks and/or sharp-quoted functions."
|
||||||
"Lexically bind ENVVARS in BODY, like `let' but for `process-environment'."
|
"Lexically bind ENVVARS in BODY, like `let' but for `process-environment'."
|
||||||
(declare (indent 1))
|
(declare (indent 1))
|
||||||
`(let ((process-environment (copy-sequence process-environment)))
|
`(let ((process-environment (copy-sequence process-environment)))
|
||||||
(dolist (var (list ,@(cl-loop for (var val) in envvars
|
,@(cl-loop for (var val) in envvars
|
||||||
collect `(cons ,var ,val))))
|
collect `(setenv ,var ,val))
|
||||||
(setenv (car var) (cdr var)))
|
|
||||||
,@body))
|
,@body))
|
||||||
|
|
||||||
(defmacro letf! (bindings &rest body)
|
(defmacro letf! (bindings &rest body)
|
||||||
|
@ -451,11 +450,11 @@ See `general-key-dispatch' for what other arguments it accepts in BRANCHES."
|
||||||
defs)
|
defs)
|
||||||
(t ,fallback))))))))
|
(t ,fallback))))))))
|
||||||
|
|
||||||
(defalias 'kbd! 'general-simulate-key)
|
(defalias 'kbd! #'general-simulate-key)
|
||||||
|
|
||||||
;; For backwards compatibility
|
;; For backwards compatibility
|
||||||
(defalias 'λ! 'cmd!)
|
(defalias 'λ! #'cmd!)
|
||||||
(defalias 'λ!! 'cmd!!)
|
(defalias 'λ!! #'cmd!!)
|
||||||
|
|
||||||
|
|
||||||
;;; Mutation
|
;;; Mutation
|
||||||
|
@ -478,8 +477,7 @@ This triggers setters. `setq' does not."
|
||||||
"`delq' ELT from LIST in-place.
|
"`delq' ELT from LIST in-place.
|
||||||
|
|
||||||
If FETCHER is a function, ELT is used as the key in LIST (an alist)."
|
If FETCHER is a function, ELT is used as the key in LIST (an alist)."
|
||||||
`(setq ,list
|
`(setq ,list (delq ,(if fetcher
|
||||||
(delq ,(if fetcher
|
|
||||||
`(funcall ,fetcher ,elt ,list)
|
`(funcall ,fetcher ,elt ,list)
|
||||||
elt)
|
elt)
|
||||||
,list)))
|
,list)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue