edit of link before inserting, something like org-insert-link
I use org-cliplink everyday, but I often wish that it had one enhancement: a way to edit the link description before it's inserted into the org buffer.
The link descriptions org-cliplink derives from the URL are sometimes perfectly usable, but often, I have to edit them because they include odd information (for this page, the description is "Sign in to GitHub..."), or information I don't want to see, for example, the name of the website in addition to the web page article.
Of course, I could edit the the link once it's in the org-buffer, but then I have to be careful about certain keys, for example, C-k to delete the tail of the description (it will mess up the link syntax by deleting the closing ']]').
So, I'd like an option allowing the link to be edited in the minibuffer, the same way as links are editable byorg-insert-link. At least the description, but possibly the URL too, since I'm already hardwired to handle link insertion this way.
@notuntoward thanks for filing this issue! Did you know that org-insert-link also edits the links? :) Just put your cursor over an org-mode links and invoke org-insert-link again. It will prompt you to modify the link and the description. That way you can safely edit your links without breaking the org-mode syntax.
As for the feature you are proposing, it sounds interesting, but I'm strongly against implementing it by modifying the default behaviour of org-cliplink function. org-cliplink function will always just insert the link, because I believe at this point everybody who uses org-cliplink (including me) expects it to behave like that. I also value UX backward compatibility. :)
I see two options here:
- Make a separate command. Something like
org-cliplink-edit-description. We already did that fororg-cliplink-capture(this is a function that behaves just likeorg-cliplinkbut integrates with org-capture better #74) - Alter the default
org-cliplinkbehaviour if a prefix command provided. For example:M-x org-cliplinkjust inserts the links as usualC-u M-x org-cliplinkprompts the user to modify the description before inserting the link
I personally like the idea with the prefix command. Please, let me know what you think.
I didn't know that org-insert-link could also edit, but now I do -- thanks for the tip!
I slightly favor the option for org-cliplink-edit-description because I never know ahead of time whether or not I'll want to edit a link. With straight-up org-insert-link behavior, keeping the link as is would be pretty easy and already semi-automatic --two hits of the return key. Or, it could be only one return if there's no opportunity to edit the URL (maybe additional URL editing could be the org-cliplink-edit-description prefix command).
But I'd be happy with either or both options.
@notuntoward got it, thanks! I will try to do something once I have spare time.