lang/org: add full link at point display to eldoc

This commit is contained in:
Henrik Lissner 2019-02-22 02:07:44 -05:00
parent e3f338b934
commit 024f383a08
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 9 additions and 0 deletions

View file

@ -463,3 +463,10 @@ an effect when `evil-org-special-o/O' has `item' in it (not the default)."
(backward-char 1) (backward-char 1)
(evil-append nil)))) (evil-append nil))))
(funcall orig-fn count))) (funcall orig-fn count)))
;;;###autoload
(defun +org*display-link-in-eldoc (orig-fn &rest args)
"Display the link at point in eldoc."
(or (when-let* ((link (org-element-property :raw-link (org-element-context))))
(format "Link: %s" link))
(apply orig-fn args)))

View file

@ -287,6 +287,8 @@ unfold to point on startup."
org-preview-latex-image-directory (concat doom-cache-dir "org-latex/") org-preview-latex-image-directory (concat doom-cache-dir "org-latex/")
org-format-latex-options (plist-put org-format-latex-options :scale 1.5)) org-format-latex-options (plist-put org-format-latex-options :scale 1.5))
(advice-add #'org-eldoc-documentation-function :around #'+org*display-link-in-eldoc)
;; Don't do automatic indent detection in org files ;; Don't do automatic indent detection in org files
(add-to-list 'doom-detect-indentation-excluded-modes 'org-mode nil #'eq) (add-to-list 'doom-detect-indentation-excluded-modes 'org-mode nil #'eq)