aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2013-06-17 03:09:13 +0200
committerJuanma Barranquero2013-06-17 03:09:13 +0200
commitf612933b88509427a690ea1966eac533b8ef80e1 (patch)
treebf052e26b443e3436a27a47e2bb85e6635e5907d
parentdb3b7db5474db3fe313e7dd1b9084b70cbf8509a (diff)
downloademacs-f612933b88509427a690ea1966eac533b8ef80e1.tar.gz
emacs-f612933b88509427a690ea1966eac533b8ef80e1.zip
lisp/progmodes/prog-mode.el: Force font-lock to deal with `composition' prop.
(prog-prettify-install): Add `composition' to `font-lock-extra-managed-props' if any prettifying keyword is added. (prog--prettify-font-lock-compose-symbol): Use ?\s instead of ?\ . (prog-mode): Use `setq-local'.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/progmodes/prog-mode.el13
2 files changed, 15 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5d44b897b51..b64bcccacd1 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12013-06-17 Juanma Barranquero <lekktu@gmail.com>
2
3 * progmodes/prog-mode.el (prog-prettify-install): Add `composition' to
4 `font-lock-extra-managed-props' if any prettifying keyword is added.
5 (prog--prettify-font-lock-compose-symbol): Use ?\s instead of ?\ .
6 (prog-mode): Use `setq-local'.
7
12013-06-17 Stefan Monnier <monnier@iro.umontreal.ca> 82013-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
2 9
3 * international/characters.el (standard-case-table): Set syntax of ?» 10 * international/characters.el (standard-case-table): Set syntax of ?»
diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el
index 03505051c1f..6498ba51e45 100644
--- a/lisp/progmodes/prog-mode.el
+++ b/lisp/progmodes/prog-mode.el
@@ -76,8 +76,8 @@ Regexp match data 0 points to the chars."
76 (syntaxes (if (eq (char-syntax (char-after start)) ?w) 76 (syntaxes (if (eq (char-syntax (char-after start)) ?w)
77 '(?w) '(?. ?\\))) 77 '(?w) '(?. ?\\)))
78 match) 78 match)
79 (if (or (memq (char-syntax (or (char-before start) ?\ )) syntaxes) 79 (if (or (memq (char-syntax (or (char-before start) ?\s)) syntaxes)
80 (memq (char-syntax (or (char-after end) ?\ )) syntaxes) 80 (memq (char-syntax (or (char-after end) ?\s)) syntaxes)
81 ;; syntax-ppss could modify the match data (bug#14595) 81 ;; syntax-ppss could modify the match data (bug#14595)
82 (progn (setq match (match-string 0)) (nth 8 (syntax-ppss)))) 82 (progn (setq match (match-string 0)) (nth 8 (syntax-ppss))))
83 ;; No composition for you. Let's actually remove any composition 83 ;; No composition for you. Let's actually remove any composition
@@ -106,13 +106,16 @@ ALIST is in the format `((STRING . CHARACTER)...)' like
106Internally, `font-lock-add-keywords' is called." 106Internally, `font-lock-add-keywords' is called."
107 (setq-local prog-prettify-symbols-alist alist) 107 (setq-local prog-prettify-symbols-alist alist)
108 (let ((keywords (prog-prettify-font-lock-symbols-keywords))) 108 (let ((keywords (prog-prettify-font-lock-symbols-keywords)))
109 (if keywords (font-lock-add-keywords nil keywords)))) 109 (when keywords
110 (font-lock-add-keywords nil keywords)
111 (setq-local font-lock-extra-managed-props
112 (cons 'composition font-lock-extra-managed-props)))))
110 113
111;;;###autoload 114;;;###autoload
112(define-derived-mode prog-mode fundamental-mode "Prog" 115(define-derived-mode prog-mode fundamental-mode "Prog"
113 "Major mode for editing programming language source code." 116 "Major mode for editing programming language source code."
114 (set (make-local-variable 'require-final-newline) mode-require-final-newline) 117 (setq-local require-final-newline mode-require-final-newline)
115 (set (make-local-variable 'parse-sexp-ignore-comments) t) 118 (setq-local parse-sexp-ignore-comments t)
116 ;; Any programming language is always written left to right. 119 ;; Any programming language is always written left to right.
117 (setq bidi-paragraph-direction 'left-to-right)) 120 (setq bidi-paragraph-direction 'left-to-right))
118 121