Only recenter following a file or internal org link

Rather than browser or external links.
This commit is contained in:
Henrik Lissner 2020-06-05 03:20:51 -04:00
parent b2919ee5d6
commit 3e3f35a67d
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -497,11 +497,13 @@ the exported output (i.e. formatters)."
;; to be performant. ;; to be performant.
(setq-hook! 'org-mode-hook gcmh-high-cons-threshold (* 2 gcmh-high-cons-threshold)) (setq-hook! 'org-mode-hook gcmh-high-cons-threshold (* 2 gcmh-high-cons-threshold))
(add-hook! 'org-follow-link-hook (defadvice! +org--recenter-after-follow-link-a (&rest _args)
(defun +org-delayed-recenter-h () "Recenter after following a link, but only internal or file links."
"`recenter', but after a tiny delay. Necessary to prevent certain race :after '(org-footnote-action
conditions where a window's buffer hasn't changed at the time this hook is run." org-follow-timestamp-link
(run-at-time 0.1 nil #'recenter))) org-link-open-as-file
org-link-search)
(recenter))
(defadvice! +org--strip-properties-from-outline-a (orig-fn path &optional width prefix separator) (defadvice! +org--strip-properties-from-outline-a (orig-fn path &optional width prefix separator)
"Remove link syntax and fix variable height text (e.g. org headings) in the "Remove link syntax and fix variable height text (e.g. org headings) in the