From f983cf172939c1885e4808fe695785eb7dd763d6 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Thu, 20 Dec 2012 15:42:53 +0100 Subject: [PATCH] org.el (org-set-font-lock-defaults): Don't activate links in source code blocks and fixed-width regions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * org.el (org-set-font-lock-defaults): Don't activate links in source code blocks and fixed-width regions. Thanks to Sébastien Vauban for reporting an error related to this. --- lisp/org.el | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 23b72c864..000079830 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5753,13 +5753,14 @@ needs to be inserted at a specific position in the font-lock sequence.") '(1 'org-special-keyword t) '(3 'org-property-value t)) ;; Links - (if (memq 'tag lk) '(org-activate-tags (1 'org-tag prepend))) - (if (memq 'angle lk) '(org-activate-angle-links (0 'org-link t))) - (if (memq 'plain lk) '(org-activate-plain-links)) - (if (memq 'bracket lk) '(org-activate-bracket-links (0 'org-link t))) - (if (memq 'radio lk) '(org-activate-target-links (0 'org-link t))) - (if (memq 'date lk) '(org-activate-dates (0 'org-date t))) - (if (memq 'footnote lk) '(org-activate-footnote-links)) + (unless (or (org-in-src-block-p t) (org-in-fixed-width-region-p)) + (if (memq 'tag lk) '(org-activate-tags (1 'org-tag prepend))) + (if (memq 'angle lk) '(org-activate-angle-links (0 'org-link t))) + (if (memq 'plain lk) '(org-activate-plain-links)) + (if (memq 'bracket lk) '(org-activate-bracket-links (0 'org-link t))) + (if (memq 'radio lk) '(org-activate-target-links (0 'org-link t))) + (if (memq 'date lk) '(org-activate-dates (0 'org-date t))) + (if (memq 'footnote lk) '(org-activate-footnote-links))) '("^&?%%(.*\\|<%%([^>\n]*?>" (0 'org-sexp-date t)) '(org-hide-wide-columns (0 nil append)) ;; TODO keyword