emacs-orgmode
[Top][All Lists]
Advanced

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

Re: Custom Bulk Functions With Prompt


From: Ihor Radchenko
Subject: Re: Custom Bulk Functions With Prompt
Date: Mon, 18 Jan 2021 16:50:48 +0800

Kevin Foley <kevin@kevinjfoley.me> writes:

> +        (`(,_ ,f)
> +            (when (listp f)
> +              (let ((args (funcall (nth 1 f)))
> +                    (func (nth 0 f)))
> +                (setq f (apply #'apply-partially func args))))
> +            (setq cmd f) (setq redo-at-end t))

That will not work. pcase will not even match list of 3+ elements using
`(,_ ,f):

(pcase '(a b c)
  (`(,_ ,f)
   (if (listp f)
       "List!"
     "Not list!"))
  (_ "No match!")) => "No match!"

You need to add extra matcher `(,_ ,argf ,f).

Best,
Ihor



reply via email to

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