Introduce letf! convenience macro

A more succinct cl-letf, which allows for local functions and macros.
This commit is contained in:
Henrik Lissner 2020-04-29 21:08:17 -04:00
parent c3a84f0fbf
commit d12752324a
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
12 changed files with 113 additions and 115 deletions

View file

@ -539,11 +539,9 @@ current workspace (and clean them up)."
;; upstream (if ever).
(defadvice! +org--fix-inline-images-for-imagemagick-users-a (orig-fn &rest args)
:around #'org-display-inline-images
(cl-letf* ((old-create-image (symbol-function #'create-image))
((symbol-function #'create-image)
(lambda (file-or-data &optional type data-p &rest props)
(let ((type (if (plist-get props :width) type)))
(apply old-create-image file-or-data type data-p props)))))
(letf! (defun create-image (file-or-data &optional type data-p &rest props)
(let ((type (if (plist-get props :width) type)))
(apply create-image file-or-data type data-p props)))
(apply orig-fn args)))
(defadvice! +org--fix-inconsistent-uuidgen-case-a (uuid)