From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#71337: 30.0.50; `electric-pair-mode' and custom keybinding Date: Tue, 4 Jun 2024 09:08:51 +0100 Message-ID: References: <87frtu9lts.fsf@gmx.net> <877cf52mib.fsf@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26041"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Arash Esbati , 71337@debbugs.gnu.org To: Stephen Berman , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 04 10:11:34 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sEPGW-0006aD-V9 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 04 Jun 2024 10:11:32 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEPFs-0005DY-CI; Tue, 04 Jun 2024 04:10:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sEPFp-0005CD-Dk for bug-gnu-emacs@gnu.org; Tue, 04 Jun 2024 04:10:49 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEPFp-0000ib-5b for bug-gnu-emacs@gnu.org; Tue, 04 Jun 2024 04:10:49 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sEPG2-0001pf-Di for bug-gnu-emacs@gnu.org; Tue, 04 Jun 2024 04:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 04 Jun 2024 08:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71337 X-GNU-PR-Package: emacs Original-Received: via spool by 71337-submit@debbugs.gnu.org id=B71337.17174886266994 (code B ref 71337); Tue, 04 Jun 2024 08:11:02 +0000 Original-Received: (at 71337) by debbugs.gnu.org; 4 Jun 2024 08:10:26 +0000 Original-Received: from localhost ([127.0.0.1]:56281 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEPFR-0001ok-Pi for submit@debbugs.gnu.org; Tue, 04 Jun 2024 04:10:26 -0400 Original-Received: from mail-lj1-f171.google.com ([209.85.208.171]:43405) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEPFO-0001oH-Hg for 71337@debbugs.gnu.org; Tue, 04 Jun 2024 04:10:23 -0400 Original-Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2eaa5cd9f0bso23057621fa.1 for <71337@debbugs.gnu.org>; Tue, 04 Jun 2024 01:10:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717488543; x=1718093343; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=xSA3RTCLb01ge/2Wmfnjoym1kGqVh7nv3niC95OL/ng=; b=K7ifSH55HnLUWO/ur+rxknGDD9TRqmyQ8YK+uB7c154m2k7jKL2Tbi4d8h1DPQ8Ydx YiXbt+JCGVWM8VRX1ShETFKjRkC+0OcqkZ5HJsFNf81x5koCWTHplnOuTxGI65e1qteX Iu7uZowjua6fSwqaGsThEKmsJxvdFE6NnO+FZ9inmTLWMDq8oGIYG2KFzNHlmqSAVu/m AXXYthfars23nuqymDE//VKJJNsNo+mt8zTo8feSuNxOj+4FSyVJl45ajQZmL96uaP2c faMvvkvkQ1OgYcDFvcjAXRfTJfxggtTNJQkKuT2sKWkHFLlr+8DU9SQnIm8mKTUEiS35 xExA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717488543; x=1718093343; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xSA3RTCLb01ge/2Wmfnjoym1kGqVh7nv3niC95OL/ng=; b=seV6646RefymN/1WBUtUW85ByeCufjuobTHIoiuccW1njAd5NyUGa3IxLV1WWq1iaf iOEe1YOV7CsZD8BEVFkX06X+ywuoQgCXFik4Oqf158EhkYN/uW+jCu38IVVqSs5Uuz+d ZSRusUHTFZU4m3H5aecNEumEDwyWr3XRL4r9Sv0cZr6LeQAgCTSsc1RJx9hwLijM6gLJ gITAZ19ImLuv21l8QVu8y9kUeW/Td80LSqaRhOcV0OMiUEYodZ3T6L3lVi9wxj0Yuo7t NTHKCxUcAWzIcdgPf6ZXpmw3waf2J0iwKfZeQ40v9ZTjGU2ixdfEZAeK+VgRHM/feNRW b3Vw== X-Forwarded-Encrypted: i=1; AJvYcCVOMfBXtx7I4DVc1PsiIGBGcKRqQENcq17G06nR+Q0b+EdLo9a/a0KuGtIqD+effnWVew1ArUSZVRWCHR3H80Om4u3Qw1M= X-Gm-Message-State: AOJu0YzCfELHjo/8rAy8x3hA7il2zFqpUBvOkM/hQgBjrums+M9vXsqu UDocOX21Ri1xI1Od5UBtk42ltwODs17B/FtpUcPCEu9K84SsEmLf55TEutma52c7lbaa0oqChSJ uEuTMXo/ArGwUMEPPL5XroT265JM= X-Google-Smtp-Source: AGHT+IGP3WSMZvYVFlrpjItQnAsXkBSVaqcAStkUOqJ4L8ukBsj6qARhSy9/L2YP5uWGlgH5umCcNO60hGF4kg0ajL4= X-Received: by 2002:a05:6512:3b83:b0:52b:909e:c0d5 with SMTP id 2adb3069b0e04-52ba229b344mr685805e87.21.1717488542719; Tue, 04 Jun 2024 01:09:02 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:286523 Archived-At: On Tue, Jun 4, 2024 at 8:37=E2=80=AFAM Jo=C3=A3o T=C3=A1vora wrote: > > On Tue, Jun 4, 2024 at 8:30=E2=80=AFAM Stephen Berman wrote: > > > > On Tue, 04 Jun 2024 07:53:16 +0200 Arash Esbati wrote: > > > > > Stephen Berman writes: > > > > > >> If the pairing in electric-pair-mode should only be triggered by > > >> self-inserting characters (as the current code seems to require), th= en > > >> the attached patch appears to avoid the above problem. > > > > > > Thanks for your response. Yes, your patch fixes the issue. Do you w= ant > > > to install it? > > > > I think it would be prudent to wait for someone familiar with the > > electric-pair-mode implementation (e.g. its author Jo=C3=A3o T=C3=A1vor= a, Cc'd), > > or failing that, an Emacs maintainer, to ok the patch. > > I will have a look if I can. It would also be prudent to make sure > the unit tests all pass, like they presumably do before the patch. I've had a look. it looks like the problems is e-p-mode's assumption that last-command-event is the thing to be inserted. The fact that it isn't here (somehow an innocent 92 is now a monstrous 8388643), triggers the problem (8388643 isn't a representation of a character, apparently). But according to the docstring of post-self-insert-hook, the assumption seems sane, and I probably coded for it. post-self-insert-hook is a variable defined in `src/cmds.c'. ... The hook can access the inserted character via `last-command-event'. ... I don't think the patch is fully correct. I think Stefan is the right person to call here. I've had an even briefer look at cmds.c and I don't understand how that hook's promise is honoured. Jo=C3=A3o