org-cliplink
org-cliplink copied to clipboard
Save marker and use it in callback for insert
Delete unused callback function
Follow-up to commit 666d0cdf0cc6ea120c83b190396d76f0ac32605a.
org-cliplink.el(org-cliplink-insert-org-mode-link-callback): Delete function.test/org-cliplink-test.el(org-cliplink-insert-org-mode-link-callback-test): Delete test.
Save marker and use it in callback for insert
org-cliplink.el(org-cliplink-insert-transformed-title): Save point as a marker, and use it in the callback so that it inserts the link at the position at which theorg-cliplinkcommand was executed.
@rexim, I believe this fixes #22 and obviates #55.
save-excursion works nicely if point has moved since org-cliplink was called, but if point hasn't moved, then the text is inserted after point. Conditionally using save-excursion resolves this issue, but maybe there's a more elegant way?