org-open-at-mouse: Fix regression when opening links outside Org mode
* lisp/org.el (org-open-at-mouse): Suppress parser warning when attempting to open fontified Org links outside Org mode (for example, in agenda buffers). This is not a real fix - parser may still fail in buffers where the surrounding link contents makes parser use Org-specific local variables; but we at least recover from deterioration of the behaviour when opening links worked _most of the time_ without issues. Reported-by: Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com> Link: https://orgmode.org/list/a864b26f-433e-49a8-8d58-74c9210e0fbd@gmail.com
This commit is contained in:
parent
8566bc8b45
commit
dfd6cc51f5
14
lisp/org.el
14
lisp/org.el
|
@ -8269,7 +8269,19 @@ See the docstring of `org-open-file' for details."
|
|||
(mouse-set-point ev)
|
||||
(when (eq major-mode 'org-agenda-mode)
|
||||
(org-agenda-copy-local-variable 'org-link-abbrev-alist-local))
|
||||
(org-open-at-point))
|
||||
;; FIXME: This feature is actually unreliable - if we are in non-Org
|
||||
;; buffer and the link happens to be inside what Org parser
|
||||
;; recognizes as verbarim (for exampe, src block),
|
||||
;; `org-open-at-point' will do nothing.
|
||||
;; We might have used `org-open-at-point-global' instead, but it is
|
||||
;; not exactly the same. For example, it will have no way to open
|
||||
;; link abbreviations. So, suppressing parser complains about
|
||||
;; non-Org buffer to keep the feature working at least to the extent
|
||||
;; it did before.
|
||||
(let ((warning-suppress-types
|
||||
(cons '(org-element org-element-parser)
|
||||
warning-suppress-types)))
|
||||
(org-open-at-point)))
|
||||
|
||||
(defvar org-window-config-before-follow-link nil
|
||||
"The window configuration before following a link.
|
||||
|
|
Loading…
Reference in New Issue