Subject: bug#16981: closed (Re: bug#16981: 24.3.50; electric-pair-delete-adjacent-pairs broken in c-mode, python-mode, maybe-others)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 07 Apr 2014 00:05:03 +0000

Your bug report

#16981: 24.3.50; electric-pair-delete-adjacent-pairs broken in c-mode, python-mode, maybe-others

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
16981: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16981
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#16981: 24.3.50; electric-pair-delete-adjacent-pairs broken in c-mode, python-mode, maybe-others
From: [email-masked] (João Távora)
To: Stefan Monnier <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked], Alan Mackenzie <[email-masked]>
Date: Mon, 07 Apr 2014 01:04:35 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Stefan Monnier <[email-masked]> writes:

> Just take the corresponding diffs (IIRC you can use
> "bzr merge -r116925..r116926 .../trunk" for that) and commit them into
> emacs-24.
>
> Bzr doesn't really know about cherry picking, but if you put
> "backported" into your commit message, our bzrmerge.el script
> will know that this commit is already in the trunk and will know how to
> avoid the corresponding conflicts when merging emacs-24 back into trunk.
>
>> - Three different fixes (bugs 16981,17192 and 17183) not yet pushed that
>> I think you want me to only push to emacs-24, since that will be merged
>> back to trunk later.
>
> Right.

These three I did successfully, but failed miserably in the
backporting. Oh git where art thou... Now I'm downloading a new repo
(with sharing properly setup hopefully), since I must have done
something that messed up my bzr conf, apparently I shouldn't have moved
my repo dir.

Should be done tomorrow morning, so I'll backport r116926 and r116940
then.

Subject: 24.3.50; electric-pair-delete-adjacent-pairs broken in c-mode, python-mode, maybe-others
From: [email-masked] (João Távora)
To: [email-masked]
Date: Mon, 10 Mar 2014 19:47:39 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

This variable, t by default, acts when `electric-pair-mode' is enabled.

It doesn't work in c-mode, python-mode and maybe other modes in
emacs. In also doesn't work in other modes outside of emacs, such as
markdown-mode.el [1]

All these modes rebind the backspace key to a command that does some
mode-specific action, then calls `backward-delete-char-untabify'.

elec-pair.el does mostly the same through remapping in its
`electric-pair-mode-map' but this binding is overriden by the
major-mode's.

elec-pair.el remaps two other commands similarly. Here's the value of
electric-pair-mode-map

    (keymap
     (remap keymap
            (delete-backward-char . electric-pair-backward-delete-char)
            (backward-delete-char . electric-pair-backward-delete-char)
            (backward-delete-char-untabify
               . electric-pair-backward-delete-char-untabify)))

Perhaps a hook in `backward-delete-char' is in order. Or the other major
modes can find other ways to overload the backspace key.

Thanks,
João

[1]: http://jblevins.org/git/markdown-mode.git/plain/markdown-mode.el