]> git.eshelyaron.com Git - emacs.git/commit
Make CC Mode and electric-pair-mode work together. This fixes bug #33794
authorAlan Mackenzie <acm@muc.de>
Tue, 15 Jan 2019 15:54:02 +0000 (15:54 +0000)
committerAlan Mackenzie <acm@muc.de>
Tue, 15 Jan 2019 15:54:02 +0000 (15:54 +0000)
commit223e7b87872d4a010ae1c9a6f09a9c15aee46692
tree609573333dd10bdce35efc2cfff7ca7b4ea643df
parent9530108fbc8bbf1ad5c1debe4b4f21da1238325b
Make CC Mode and electric-pair-mode work together.  This fixes bug #33794

* lisp/progmodes/cc-cmds.el (c-electric-pound, c-electric-slash)
(c-electric-star, c-electric-semi&comma, c-electric-colon, c-electric-lt-gt):
Bind post-self-insert-hook to nil around calls to self-insert-command to
protect against arbitrary functionality confusing CC Mode.
(c-do-brace-electrics): New function, extracted from c-electric-brace and
enhanced.
(c-electric-brace): Bind post-self-insert-hook to nil around the call to
self-insert-command.  When electric-pair-mode is configured, call
electric-pair-post-self-insert-function.  Handle any deletion done by this
function.  Call c-do-brace-electrics for the inserted brace, and perhaps for a
brace inserted by electric-pair-self-insert-function.
(c-electric-paren): Bind post-self-insert-hook to nil around the call to
self-insert-command.  When electric-pair-mode is configured, call
electric-pair-post-self-insert-function.
lisp/progmodes/cc-cmds.el