-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
General org target finder #250
Comments
Per my comment over there, just wanted to make sure you're aware of the native That includes new At |
To repeat my opinion regarding this generic org target finder and org actions in general:
|
Good question. I guess it's only valuable if you want to add access to additional contextual actions beyond those provided in org. It makes sense for the new org-cite, for example. |
Daniel Mendler ***@***.***> writes:
To repeat my opinion regarding this generic org target finder and org actions in general:
I guess I'll repeat my response too (I think my opinion has changed but whatever). :P
1. I prefer to have a flat list of finders, not something nested. While one saves the parsing effort with the nesting, the advantages are marginal. Embark target finders are not really performance critical.
I can agree with this. Instead I propose to just have the org link target finder. The code that would be added to embark would look something like this:
```
(defvar my/embark-org-link-type-alist nil
"An (LINK-TYPE . ACTION-TYPE) alist to determine which link types has its own embark actions.
See `my/embark-target-org-link'.
LINK-TYPE is a string of the part before the colon in an org link.
ACTION-TYPE is a symbol and should be a key in embark-keymap-alist.")
(defun my/embark-org-link-finder ()
(when-let ((context (org-element-context)))
(when (eq (car context)
'link)
(let ((type (plist-get (cl-second context)
:type))
(path (plist-get (cl-second context)
:path)))
(if-let ((matched-type (alist-get type my/embark-org-link-type-alist
nil
nil
#'string=)))
(cons matched-type path)
(cons 'url path))))))
```
It is one target finder for org links, but the user can customize which keybindings corresponds to which link types by adding a cons cell to the `my/embark-org-link-type-alist` variable (e.g. `(cite . org-ref-cite-link)` for org-ref style cite links).
|
It can also help with discoverability, to see what operations are available at point without needing to know the existing functionality |
See also, the new |
As things turned out, I wound up implementing a slightly different org target finder in the embark-org library. I still don't have key bindings for all the actions that @sheijk's org-menu package provides in its transient menus, but I already find embark-org useful. I definitely welcome any suggestions for embark-org on either new org elements to target (which is as easy as uncommenting them in the definition of |
Separate issue for continuation on discussions from here and here.
tl;dr; I have written a target finder for org that uses org's own parser which atm can be found here. It is easy to extend for users.
I have signed the copyright papers for Emacs if this ends up becoming a PR.
The text was updated successfully, but these errors were encountered: