Is there a package or setting to show an org-mode link (under cursor - without using the mouse) destination in the modeline or other area of Emacs window? It would be nice to have instead of doing C-c C-l to look at it each time.
Try this:
(defun link-message ()
(let ((object (org-element-context)))
(when (eq (car object) 'link)
(message "%s"
(org-element-property :raw-link object)))))
(add-hook 'post-command-hook 'link-message)
-
Yes. I would like one associated with just the cursor as I don't use the mouse much. – Joe May 19 '15 at 16:28
-
-
@JohnKitchin using
post-command-hook
can be a bit messy sometimes. I think using text properties is a better bet here. Apparently there might be even cleaner ways to do this than text properties. Unfortunately my lisp foo is a bit limited. See this thread. – suvayu May 22 '15 at 23:07 -
That is an interesting idea, but it doesn't look less messy to me ;) It means advising or changing org-core code. post-command-hook is pretty clean I think. If there is any problem, the hook function gets kicked out automatically. – John Kitchin May 25 '15 at 18:47