-
Notifications
You must be signed in to change notification settings - Fork 23
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
Select action/sub-action after running generic command #14
Comments
an obvious thing I find myself wanting is opening github patch links from my email client. right now it opens my browser, it would be great if I could just open it in a buffer. |
I've started working on rewriting link-hint for #12 and am rethinking how I want to handle this issue. For one, I can't think of a circumstance in which a user would only want to select the action after selecting a link. Allowing the user to select the action is useful because there could potentially be a lot of actions or combinations of actions/# of links to open, so it makes sense to be able to do this all from one command. That said, selecting before would allow selecting from all actions and then only putting overlays on supported links. As for what interface I'm going to use, there is Using
After #12 is done, you'll be able to change the |
my hacky solution to run a generic command that opens a link inside emacs. please excuse my noobish elisp, wasn't sure how to detect when copy-link was cancelled. This seems to work though. (url-handler-mode 1)
(defun link-hint-download ()
(interactive)
(let ((before (current-kill 0)))
(link-hint-copy-link)
(let ((after (current-kill 0)))
(if (not (eq after before))
(find-file after))))) |
To do that, you can create a new open command that always opens inside emacs (e.g. |
- Add a generic selection helper for which avy and completing-read link selectors are built on top of - Allow customizing completing-read functions so different ones can be used for selecting an action, selecting one link, and selecting multiple links - Allow various ways of selecting actions after running a command (before with completing-read, during with avy-dispatch-alist or ivy actions, or after with completing-read); see updated readme Fixes #38 and #14. Also - Remove useless :group from defcustoms - Rename type valid and valid types functions do better clarify their purposes - Fix typo for markdown links (:parser -> :parse)
Some links are straightforward and only have one way to act on them. Others may have a way to open, copy, or take some other action on them, and some may have multiple ways to open them (e.g. paradox: open package info, view homepage, and view commit list).
Link hint should support adding actions for specific link types and have a generic command for selecting a link (and then choosing the action). If only 1 action is available for the selected link, it should be taken. Otherwise there would be some way for the user to select the action afterwards. The reason I wouldn't want to use a link hint version of
avy-dispatch-alist
for this is because the link type isn't necessarily known until it is selected. It could maybe be used for selecting the type of action (copy or open).The main new command would be
link-hint-select-link
, a generic command to select a link then select the type of action and specific action (all actions would be available from one prompt grouped under the types; the type could maybe selected in a manner similar to howavy-dispatch-alist
works). It would also be possible to have a commandlink-hint-open-link
that would only consider open type actions built on top of this new command.I'll have to think about what the best interface for choosing the action would be.
I'll work on this after #12.
The text was updated successfully, but these errors were encountered: