Skip to content

Fixes #1974: Correct C-h behavior to ensure electric-pair deletes adjacent pairs #1975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jamescherti
Copy link
Contributor

@jamescherti jamescherti commented Apr 30, 2025

When using electric-pair-mode, the expected behavior when pressing C-h near a pair of adjacent delimiters (e.g., () [] {} "") is that both the opening and closing delimiters should be deleted together if they were inserted as a pair.

This pull request fixes #1974.

This pull request corrects C-h behavior to ensure electric-pair deletes adjacent pairs. It calls the same function as DEL (code 127) in electric-pair-mode-map:

electric-pair-mode-map is a variable defined in ‘elec-pair.el’.

Its value is
(keymap 
 (127 menu-item "" electric-pair-delete-pair :filter
  #f(compiled-function (cmd) #<bytecode 0x115035a9952592b3>)))

This pull request could be improved. Please don't hesitate to comment it if you have any suggestions.

@jamescherti jamescherti force-pushed the jc-fix-elec-pair-C-h branch from 90bbfe5 to ef49df9 Compare April 30, 2025 15:57
@jamescherti jamescherti force-pushed the jc-fix-elec-pair-C-h branch from ef49df9 to cbb8c9a Compare April 30, 2025 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

C-h does not ensure electric-pair deletes adjacent pairs
1 participant