summaryrefslogtreecommitdiff
path: root/lisp/progmodes/prog-mode.el
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2013-06-17 03:09:13 +0200
committerJuanma Barranquero <lekktu@gmail.com>2013-06-17 03:09:13 +0200
commitf612933b88509427a690ea1966eac533b8ef80e1 (patch)
treebf052e26b443e3436a27a47e2bb85e6635e5907d /lisp/progmodes/prog-mode.el
parentdb3b7db5474db3fe313e7dd1b9084b70cbf8509a (diff)
downloademacs-f612933b88509427a690ea1966eac533b8ef80e1.tar.gz
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'.
Diffstat (limited to 'lisp/progmodes/prog-mode.el')
-rw-r--r--lisp/progmodes/prog-mode.el13
1 files changed, 8 insertions, 5 deletions
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."
(syntaxes (if (eq (char-syntax (char-after start)) ?w)
'(?w) '(?. ?\\)))
match)
- (if (or (memq (char-syntax (or (char-before start) ?\ )) syntaxes)
- (memq (char-syntax (or (char-after end) ?\ )) syntaxes)
+ (if (or (memq (char-syntax (or (char-before start) ?\s)) syntaxes)
+ (memq (char-syntax (or (char-after end) ?\s)) syntaxes)
;; syntax-ppss could modify the match data (bug#14595)
(progn (setq match (match-string 0)) (nth 8 (syntax-ppss))))
;; No composition for you. Let's actually remove any composition
@@ -106,13 +106,16 @@ ALIST is in the format `((STRING . CHARACTER)...)' like
Internally, `font-lock-add-keywords' is called."
(setq-local prog-prettify-symbols-alist alist)
(let ((keywords (prog-prettify-font-lock-symbols-keywords)))
- (if keywords (font-lock-add-keywords nil keywords))))
+ (when keywords
+ (font-lock-add-keywords nil keywords)
+ (setq-local font-lock-extra-managed-props
+ (cons 'composition font-lock-extra-managed-props)))))
;;;###autoload
(define-derived-mode prog-mode fundamental-mode "Prog"
"Major mode for editing programming language source code."
- (set (make-local-variable 'require-final-newline) mode-require-final-newline)
- (set (make-local-variable 'parse-sexp-ignore-comments) t)
+ (setq-local require-final-newline mode-require-final-newline)
+ (setq-local parse-sexp-ignore-comments t)
;; Any programming language is always written left to right.
(setq bidi-paragraph-direction 'left-to-right))