From 795e6b100126de11c2343ed3dc539c3cd4b17bad Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Fri, 26 Jun 2020 09:16:19 +0100 Subject: bog--with-search-lprops: Simplify using cl-letf --- bog.el | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'bog.el') diff --git a/bog.el b/bog.el index 719002a..16def76 100644 --- a/bog.el +++ b/bog.el @@ -1198,17 +1198,13 @@ Restore the `org-lprops' property value for (declare (indent 0) (debug t)) (let ((bog-lprops '((org-agenda-buffer-name "*Bog search*") (org-agenda-files (bog-notes)) - org-agenda-text-search-extra-files - org-agenda-sticky)) - (org-lprops (make-symbol "org-lprops"))) - `(let ((,org-lprops (get 'org-agenda-redo-command 'org-lprops))) - (unwind-protect - (let ,bog-lprops - (put 'org-agenda-redo-command 'org-lprops ',bog-lprops) - (put 'org-agenda-files 'org-restrict nil) - ,@body - (use-local-map bog--agenda-map)) - (put 'org-agenda-redo-command 'org-lprops ,org-lprops))))) + (org-agenda-text-search-extra-files ()) + (org-agenda-sticky nil)))) + `(cl-letf (((get 'org-agenda-redo-command 'org-lprops) ',bog-lprops) + ,@bog-lprops) + (put 'org-agenda-files 'org-restrict nil) + ,@body + (use-local-map bog--agenda-map)))) ;;;###autoload (defun bog-search-notes (&optional todo-only string) -- cgit v1.2.3