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.
Showing with 28 additions and 10 deletions