]> git.eshelyaron.com Git - emacs.git/commit
Adjust previous electric.el and elec-pair.el change
authorJoão Távora <joaotavora@gmail.com>
Fri, 25 Jan 2019 13:04:13 +0000 (13:04 +0000)
committerJoão Távora <joaotavora@gmail.com>
Fri, 25 Jan 2019 17:32:18 +0000 (17:32 +0000)
commit682ab5d92a6922694a92fcde029811bccf98d700
tree8ae6bace81652a4feff7e5abdb14890e1665f028
parentf845f8a279cfc2acd1051b4cd4924e2aede54017
Adjust previous electric.el and elec-pair.el change

This fixes a serious bug introduced previously
electric-pair-inhibit-if-helps-balance and
electric-pair-skip-if-helps-balance, whereby "innocent" markers were
being pushed by those function's new save-change-and-restore
semantics.  The fix can probably still be improved.

It also adds comments to parts of the code, where deemed necessary.

* lisp/elec-pair.el (electric-pair--insert): Add comment.
(electric-pair--save-literal-point-excursion): New helper macro.
(electric-pair-inhibit-if-helps-balance)
(electric-pair-skip-if-helps-balance): Don't use
insert-before-markers since it may hurt other markers that have
nothing to do with the 'save-excursion'.
(electric-pair-post-self-insert-function): Use
electric-pair--save-literal-point-excursion.

* lisp/electric.el (electric-indent-post-self-insert-function):
Remove lexical variable.
lisp/elec-pair.el
lisp/electric.el