From f3f7acc5927b825870db93447efb2efb2ac4c6d5 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Sat, 1 Nov 2014 15:56:16 +0000 Subject: [PATCH] Make blink-parens work with a closing template delimiter. progmodes/cc-cmds.el (c-electric-lt-gt): Cause a redisplay before calling blink-paren-function, so as to apply syntax-table properties to the ">". --- lisp/ChangeLog | 7 +++++++ lisp/progmodes/cc-cmds.el | 11 ++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 11c789a9625..22972401cb1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2014-11-01 Alan Mackenzie + + Make blink-parens work with a closing template delimiter. + * progmodes/cc-cmds.el (c-electric-lt-gt): Cause a redisplay + before calling blink-paren-function, so as to apply syntax-table + properties to the ">". + 2014-11-01 Jan Djärv * select.el (gui-get-selection): Comment: data-type ignored on NS. diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index afbd577b10d..5fa3b25401e 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el @@ -1155,11 +1155,12 @@ numeric argument is supplied, or the point is inside a literal." (when (and (eq (char-before) ?>) (not executing-kbd-macro) blink-paren-function) - ;; Note: Most paren blink functions, such as the standard - ;; `blink-matching-open', currently doesn't handle paren chars - ;; marked with text properties very well. Maybe we should avoid - ;; this call for the time being? - (funcall blink-paren-function))))) + ;; Currently (2014-10-19), the syntax-table text properties on < and > + ;; are only applied in code called during Emacs redisplay. We thus + ;; explicitly cause a redisplay so that these properties have been + ;; applied when `blink-paren-function' gets called. + (sit-for 0) + (funcall blink-paren-function))))) (defun c-electric-paren (arg) "Insert a parenthesis. -- 2.39.5