summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2015-02-26 00:21:53 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2015-02-26 00:21:53 +0100
commit37d2a2d1cfa58c5334eec4f7fbabc4a2f313ab33 (patch)
tree421d9f60b442d440de3869a0d44f77fbe28a452c
parent50a0e712cceeef02c0d6a7c41b619b308ea1b15c (diff)
downloadorg-mode-37d2a2d1cfa58c5334eec4f7fbabc4a2f313ab33.tar.gz
Prevent invisible characters in keywords
* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Forbid invisible characters (e.g. bracket links) in all keywords but TITLE, DATE, AUTHOR, CAPTION and EMAIL. Also remove back-end specific keywords, which are treated just like any other regular keyword. Reported-by: Rasmus <rasmus@gmx.us> <http://permalink.gmane.org/gmane.emacs.orgmode/95415>
-rwxr-xr-xlisp/org.el38
1 files changed, 12 insertions, 26 deletions
diff --git a/lisp/org.el b/lisp/org.el
index fdf349a..17871a5 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5881,17 +5881,6 @@ by a #."
(dc3 (downcase (match-string 3)))
end end1 quoting block-type ovl)
(cond
- ((member dc1 '("+html:" "+ascii:" "+latex:"))
- ;; a single line of backend-specific content
- (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
- (remove-text-properties (match-beginning 0) (match-end 0)
- '(display t invisible t intangible t))
- (add-text-properties (match-beginning 1) (match-end 3)
- '(font-lock-fontified t face org-meta-line))
- (add-text-properties (match-beginning 6) (+ (match-end 6) 1)
- '(font-lock-fontified t face org-block))
- ; for backend-specific code
- t)
((and (match-end 4) (equal dc3 "+begin"))
;; Truly a block
(setq block-type (downcase (match-string 5))
@@ -5943,18 +5932,14 @@ by a #."
(if (string-equal dc1 "+title:")
'(font-lock-fontified t face org-document-title)
'(font-lock-fontified t face org-document-info))))
- ((or (equal dc1 "+results")
- (member dc1 '("+begin:" "+end:" "+caption:" "+label:"
- "+orgtbl:" "+tblfm:" "+tblname:" "+results:"
- "+call:" "+header:" "+headers:" "+name:"))
- (and (match-end 4) (equal dc3 "+attr")))
- (org-remove-flyspell-overlays-in
- (match-beginning 0)
- (if (equal "+caption:" dc1) (match-end 2) (match-end 0)))
- (add-text-properties
- beg (match-end 0)
- '(font-lock-fontified t face org-meta-line))
- t)
+ ((equal dc1 "+caption:")
+ (org-remove-flyspell-overlays-in (match-end 2) (match-end 0))
+ (remove-text-properties (match-beginning 0) (match-end 0)
+ '(display t invisible t intangible t))
+ (add-text-properties (match-beginning 1) (match-end 3)
+ '(font-lock-fontified t face org-meta-line))
+ (add-text-properties (match-beginning 6) (+ (match-end 6) 1)
+ '(font-lock-fontified t face org-block)))
((member dc3 '(" " ""))
(org-remove-flyspell-overlays-in beg (match-end 0))
(add-text-properties
@@ -5962,9 +5947,10 @@ by a #."
'(font-lock-fontified t face font-lock-comment-face)))
(t ;; just any other in-buffer setting, but not indented
(org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
- (add-text-properties
- beg (match-end 0)
- '(font-lock-fontified t face org-meta-line))
+ (remove-text-properties (match-beginning 0) (match-end 0)
+ '(display t invisible t intangible t))
+ (add-text-properties beg (match-end 0)
+ '(font-lock-fontified t face org-meta-line))
t))))))
(defun org-fontify-drawers (limit)