[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Disabling automatic links for timestamps and tags
From: |
Kyle Meyer |
Subject: |
Re: Disabling automatic links for timestamps and tags |
Date: |
Sun, 18 Oct 2020 15:27:34 -0400 |
Peter Bienstman writes:
> Thanks! Is there a way to achieve this while still keeping the syntax
> highlighting intact?
I'm not aware of a built-in option to do that. If you want to come up
with a custom solution, the code to study is org-set-font-lock-defaults,
which in turn calls org-activate-tags and org-activate-dates. You could
override -activate-tags and -activate-dates to not apply the mouse-face
and keymap properties. Or perhaps just remove them afterwards:
(defun my/org-discard-mouse (&rest _)
(remove-text-properties (match-beginning 1) (match-end 1)
'(mouse-face nil keymap nil))
t)
(advice-add 'org-activate-tags :after-while #'my/org-discard-mouse)
(advice-add 'org-activate-dates :after-while #'my/org-discard-mouse)