Ihor Radchenko writes:
> Tor-björn Claesson writes:
>
>> I feel that the guard option does the right thing by directly fixing
>> the pattern matching - but what approach do you prefer?
>
> I provided the guard example just for your reference.
> The preference for actual code is more readable cod
Tor-björn Claesson writes:
> I feel that the guard option does the right thing by directly fixing
> the pattern matching - but what approach do you prefer?
I provided the guard example just for your reference.
The preference for actual code is more readable code.
IMHO, my second variant with (an
Ihor Radchenko writes:
> AFIU, you need to match against lambda simply to avoid the next clause
> matching it.
Exactly.
> If so, you can change the clause to match all ,fn, except
> lambda like the following:
>
> `(,key
> ,desc
> (,(and fn (guard (not (eq fn 'lambda
>. ,fn-args)
>
Tor-björn Claesson writes:
> Clever! I had to put the let inside the lambda for it to work.
You probably do not have to once you use lexical binding (that is - not
C-x C-e ad-hoc, but put things into actual byte-compiled file)
But let inside the lambda body is perfectly fine.
> (defun org-cite
Ihor Radchenko writes:
> Rather than going into recursive replacements, simply let-bind
> !citation, !prefix, and anything else we may want to provide around the
> lambda/function call.
Clever! I had to put the let inside the lambda for it to work.
(defun org-cite-basic-follow--parse-suffix-spec
Tor-björn Claesson writes:
> But that was not good enough - we do not cover the case of specifying
> a lambda in org-cite-basic-follow-actions,
> or passing other arguments to the function than citation, prefix or
> citation key.
>
> This updated version fixes this, so the action can be either
>
But that was not good enough - we do not cover the case of specifying
a lambda in org-cite-basic-follow-actions,
or passing other arguments to the function than citation, prefix or
citation key.
This updated version fixes this, so the action can be either
1. a suffix (as in transient-define-suffix
Thanks!
Here is another take=)
(defcustom org-cite-basic-follow-actions
'[["Open"
("b" "bibliography entry" (org-cite-basic-goto !citation !prefix))]
["Copy"
("d" "DOI" org-cite-basic-follow.copy-doi)]
["Browse"
("u" "url" org-cite-basic-follow.browse-url)]]
"Hepp"
Tor-björn Claesson writes:
> (defun org-cite-basic-follow--setup (_)
> (transient-parse-suffixes
>'org-cite-basic-follow
>(cl-map 'vector (lambda (group)
> (cl-map 'vector (lambda (suffix-spec)
This is getting complex enough that you can split out this lambda into a
dedicated
Good ideas!
(transient-define-prefix org-cite-basic-follow (citation &optional prefix)
[:class transient-columns
:setup-children org-cite-basic-follow--setup
:pad-keys t]
(interactive)
(if (or org-cite-basic-follow-ask
(eq prefix '(-4)))
(transient-setup 'org-cite-basic
Tor-björn Claesson writes:
> (defcustom org-cite-basic-follow-actions
> '[["Open"
> ("b" "bibliography entry" org-cite-basic-goto (list (transient-scope)
> 0))]
> ["Copy"
> ("d" "DOI" org-cite-basic-follow.copy-doi)]
> ["Browse"
> ("u" "url" org-cite-basic-follow.bro
This is a great learning experience, thank you Ihor and Jonas for the
friendly feedback!
(defcustom org-cite-basic-follow-actions
'[["Open"
("b" "bibliography entry" org-cite-basic-goto (list (transient-scope) 0))]
["Copy"
("d" "DOI" org-cite-basic-follow.copy-doi)]
["Brow
Tor-björn Claesson writes:
> ...
>>(mapcar (pcase-lambda (`(,key ,desc ,fn ,transform))
>>(list ,key ,desc
>> (lambda ()
>>(interactive)
>>(apply fn (eval transform)
>>org-cite-basic-follow-ac
Hi again!
Den lör 26 okt. 2024 kl 14:45 skrev Jonas Bernoulli :
> [Obviously completely untested:]
>
> (defcustom org-cite-basic-follow-actions
> '[["Open"
> ("b" "bibliography entry" org-cite-basic-follow.open-bibliography (...))]
> ["Copy"
> ("d" "DOI" org-cite-basic-follow.copy-
Hi and thanks for these suggestions! I have some time away from the family
tomorrow evening, and will try to make a new prototype along those lines:)
Getting back!
Cheers/Tor-björn
Den sön 27 okt. 2024 10.07Ihor Radchenko skrev:
> Jonas Bernoulli writes:
>
> > ...
> > But the approach I used
Jonas Bernoulli writes:
> ...
> But the approach I used for `notmuch-tag-transient' is more applicable
> here. Hm, that actually also adds a new class, which we *might* be able
> to avoid here, let's look at the simpler `notmuch-search-transient'
> for inspiration.
>
> [Obviously completely unte
Ihor Radchenko writes:
> Jonas Bernoulli writes:
>
>>> :set (lambda (option-name new-value)
>>> (eval
>>> `(transient-define-prefix org-cite-basic-follow (citation
>>> &optional prefix)
>>> "Follow a citation reference.
>> ...
>>
>> (transient-define-prefix org
Jonas Bernoulli writes:
>> :set (lambda (option-name new-value)
>> (eval
>> `(transient-define-prefix org-cite-basic-follow (citation
>> &optional prefix)
>> "Follow a citation reference.
> ...
>
> (transient-define-prefix org-cite-basic-follow (citation &option
> (defcustom org-cite-basic-follow-actions
> '[["Open"
> ("b" "bibliography entry" org-cite-basic-follow.open-bibliography)]
>["Copy"
> ("d" "DOI" org-cite-basic-follow.copy-doi)]
>["Browse"
> ("u" "url" org-cite-basic-follow.browse-url)]]
> "Contents of the org-cite-basic-f
[ CCing emacs-devel and the author of transient; maybe we can have some
more suggestions this way ]
For some context, we are trying to create a customizeable transient menu
with items configured via user option.
We are also trying to pass additional arguments from prefix to suffix
commands in a
Ihor Radchenko writes:
> Thanks! This looks much more clean.
> Even better would be having a defcustom that defines the transient
> layout. The idea is to avoid hard-coding [["Open" ... ] ["Copy" ...]
> ...] and instead make it defcustom.
Here is a solution that works for me. Is this an OK use of
Tor-björn Claesson writes:
>> Is there an easier way to access transient prefix command arguments from
>> suffixes? Maybe something provided by transient itself?
>
> Yes it was way to complicated, thanks! A better way can be found reading
> transient.el and magit sources. Together with your other
Ihor Radchenko writes:
> Tor-björn Claesson writes:
>
>>> I do think that having extended menus for org-open-at-point could be
>>> useful. Not by default, but, for example, with a prefix argument.
>>>
>> This is a good point, but of much larger scope than just replacing the
>> follower of the ba
Tor-björn Claesson writes:
>> I do think that having extended menus for org-open-at-point could be
>> useful. Not by default, but, for example, with a prefix argument.
>>
> This is a good point, but of much larger scope than just replacing the
> follower of the basic citation-processor.
No probl
Hi and thanks for replying!
Ihor Radchenko writes:
>
> I do think that having extended menus for org-open-at-point could be
> useful. Not by default, but, for example, with a prefix argument.
>
This is a good point, but of much larger scope than just replacing the
follower of the basic citation-
Tor-björn Claesson writes:
> Since I use org-roam-ref, I initially went with citar and installed
> vertico, marginalia and embark, but this felt a bit invasive,
> so I went back to the built in basic processors,
> which fill all my needs except for the follow-processor.
>
> To improve following,
Hello!
I recently switched from org-ref to org-cite, and would like to thank
eveyone who has worked on citation handling in org-mode!
Your work is of incredible value to my research productivity!
Since I use org-roam-ref, I initially went with citar and installed
vertico, marginalia and embark, b
27 matches
Mail list logo