GNU bug report logs - #44245
27.1; electric-pair-mode may interfere with delete-selection-mode

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Dale Sedivec <dale@HIDDEN>; dated Mon, 26 Oct 2020 20:02:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at submit <at>

Received: (at submit) by; 26 Oct 2020 20:01:46 +0000
From debbugs-submit-bounces <at> Mon Oct 26 16:01:46 2020
Received: from localhost ([]:41469
	by with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at>>)
	id 1kX8gb-0000G6-Sa
	for submit <at>; Mon, 26 Oct 2020 16:01:46 -0400
Received: from ([]:34704)
 by with esmtp (Exim 4.84_2)
 (envelope-from <dale@HIDDEN>) id 1kX8gZ-0000Fy-LN
 for submit <at>; Mon, 26 Oct 2020 16:01:44 -0400
Received: from ([2001:470:142:3::10]:37788)
 by with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <dale@HIDDEN>) id 1kX8gZ-00029r-8g
 for bug-gnu-emacs@HIDDEN; Mon, 26 Oct 2020 16:01:43 -0400
Received: from ([2607:f8b0:4864:20::22a]:38960)
 by with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <dale@HIDDEN>) id 1kX8gW-0005bm-Uo
 for bug-gnu-emacs@HIDDEN; Mon, 26 Oct 2020 16:01:42 -0400
Received: by with SMTP id u127so11726782oib.6
 for <bug-gnu-emacs@HIDDEN>; Mon, 26 Oct 2020 13:01:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20150623;
 :to; bh=JULs8oL3cCNnmqoXpjxe8Tn7KWtrG2C+rlZSjo2srro=;
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025;
X-Gm-Message-State: AOAM532G+3gHNNScDfn69PoMBcWc032SJWTpdBzq7JoUyU1FHyytU4Wu
X-Google-Smtp-Source: ABdhPJzplDlEk/tSstVsAu0zn02MK5XW7+Xz3X6dwZkBxzgTIqNdaub8RRazVhoIyOaeKIQOaAoKLA==
X-Received: by 2002:aca:af8f:: with SMTP id y137mr9909148oie.170.1603742499027; 
 Mon, 26 Oct 2020 13:01:39 -0700 (PDT)
Received: from (
 by with ESMTPSA id l23sm4105761otk.68.2020.
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 26 Oct 2020 13:01:38 -0700 (PDT)
From: Dale Sedivec <dale@HIDDEN>
Content-Type: text/plain;
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\))
Subject: 27.1; electric-pair-mode may interfere with delete-selection-mode
Message-Id: <6EA183A7-44B8-4CA4-9BD8-A2E94FBD8E54@HIDDEN>
Date: Mon, 26 Oct 2020 15:01:36 -0500
To: bug-gnu-emacs@HIDDEN
X-Mailer: Apple Mail (2.3445.104.17)
Received-SPF: none client-ip=2607:f8b0:4864:20::22a;
X-detected-operating-system: by No matching host in p0f cache.
 That's all we know.
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 SPF_NONE=0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at>
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <>
List-Unsubscribe: <>, 
 <mailto:debbugs-submit-request <at>>
List-Archive: <>
List-Post: <mailto:debbugs-submit <at>>
List-Help: <mailto:debbugs-submit-request <at>>
List-Subscribe: <>, 
 <mailto:debbugs-submit-request <at>>
Errors-To: debbugs-submit-bounces <at>
Sender: "Debbugs-submit" <debbugs-submit-bounces <at>>
X-Spam-Score: -3.3 (---)

Steps to reproduce:

1. emacs -Q

2. Enter *scratch*

3. Enable `delete-selection-mode': M-x delete-selection-mode RET

4. Enable `electric-pair-local-mode': M-x electric-pair-local-mode RET

5. Disable `electric-pair-local-mode': M-x electric-pair-local-mode RET

Note that this has left `electric-pair-will-use-region' in

6. Make some text and select it: foo C-SPC C-a

7. Type (

Expected behavior: "foo" is replaced by "("

Observed behavior: "(" is inserted, "foo" remains, region is deactivated

My ideas for fixing this are to either (1) make
`electric-pair-will-use-region' check the value of `electric-pair-mode';
or (2) add `electric-pair-will-use-region' to
`self-insert-uses-region-functions' as a buffer-local value, and then
remove it when elec-pair is turned off in the buffer.

In GNU Emacs 27.1 (build 1, x86_64-apple-darwin19.6.0, NS appkit-1894.60 =
Version 10.15.6 (Build 19G2021))
of 2020-09-14 built on
Windowing system distributor 'Apple', version 10.3.1894
System Description:  Mac OS X 10.15.7

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Mark set
Delete-Selection mode enabled
Mark set
Electric-Pair-Local mode enabled in current buffer
execute-extended-command: =E2=80=98=E2=80=99 is not a valid command name
Electric-Pair-Local mode disabled in current buffer
Mark set

Configured using:
'configure --prefix=3D/opt/local --without-dbus --without-gconf
--without-libotf --without-m17n-flt --with-gmp --with-gnutls
--with-json --with-xml2 --with-modules --infodir
/opt/local/share/info/emacs --with-ns --with-lcms2 --without-harfbuzz
--without-imagemagick --without-xaw3d --with-rsvg 'CFLAGS=3D-pipe -Os
-isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch
x86_64' 'CPPFLAGS=3D-I/opt/local/include
'LDFLAGS=3D-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-no_pie
-arch x86_64''

Configured features:

Important settings:
  value of $LC_COLLATE: C
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  delete-selection-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
format-spec rfc822 mml mml-sec epa derived epg epg-config gnus-util
rmail rmail-loaddefs text-property-search time-date mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils elec-pair
cus-start cus-load delsel finder-inf package easymenu browse-url
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv
bytecomp byte-compile cconv cl-loaddefs cl-lib tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win
ucs-normalize mule-util term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
timer select scroll-bar mouse jit-lock font-lock syntax facemenu
font-core term/tty-colors frame minibuffer cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads kqueue cocoa ns
lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 200100 10989)
(symbols 48 13283 1)
(strings 32 66300 2365)
(string-bytes 1 1661608)
(vectors 16 18294)
(vector-slots 8 250505 8722)
(floats 8 22 25)
(intervals 56 241 0)
(buffers 1000 12))

Dale Sedivec

Acknowledgement sent to Dale Sedivec <dale@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#44245; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 26 Oct 2020 20:15:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.