emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 6924320: Take care of a FIXME in cus-edit-tests.el


From: Mauro Aranda
Subject: Re: master 6924320: Take care of a FIXME in cus-edit-tests.el
Date: Fri, 20 Nov 2020 19:16:43 -0300

> > -    (customize-saved)
> > -    (should (search-forward cus-edit-tests--obsolete-option-tag nil t))))
> > +    (unwind-protect
> > +        (progn
> > +          (put 'cus-edit-tests--obsolete-option-tag 'saved-value '(t))
> > +          (customize-saved)
> > +          (should (search-forward cus-edit-tests--obsolete-option-tag nil t)))
> > +      (put 'cus-edit-tests--obsolete-option-tag 'saved-value nil))))
>
> These are (fairly rare) good use-cases for `cl-letf`:
>
>     (cl-letf (((get 'cus-edit-tests--obsolete-option-tag 'saved-value) '(t)))
>       (customize-saved)
>       (should (search-forward cus-edit-tests--obsolete-option-tag nil t)))

Indeed.  I didn't know about cl-letf, thanks.

BTW, C-h f cl-letf RET
shows a link to the info node (cl) Function Bindings.  Maybe a better
link is (cl) Modify Macros.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]