Tor-björn Claesson <tclaes...@gmail.com> writes:

>> 1. I am looking at C-- C-u prefix, and I am not sure if it is ideal
>>    What I think might be better is:
>>    - make a short C-- ('- argument) the switch
>>    - make the switch customizable (if users do not like C--)
>>
>
> I tried simply changing the switch from "-4" to "'", but this does not
> work.
> My google skills fail me here, and I would be grateful for some advice on
> how to proceed.

Try this toy example:

(defun yant/test (arg)
  (interactive "P")
  (if (eq arg '-)
      (message "Detected C-- !")
    (message "other arg: %S" arg)))

>> 4. Moving towards my item (2) in the plan, we need to generalize
>>    (transient-define-prefix org-cite-basic-follow ...) into a macro that
>>    can work for arbitrary command; not just for `org-cite-basic-follow'.
>>    Let me know if you want my help on how to write such a macro.
>
> I'm trying to make this work. Is it OK to use (eval
> `(transient-define-prefix ...)) here?
> Also, I find it a bit easier to write this as a function rather than a
> macro, but this makes calling it a bit uglier.
> Should I try define this as a macro, or is a function acceptable?

Macro will be better, but you can write is as a function first. We can
easily change it into a macro later.

If you have troubles understanding macro expansion, I recommend playing
around with macrostep package.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to