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#73688: [PATCH] electric-pair-mode - preserve balance in conservative mode Date: Sat, 12 Oct 2024 21:36:47 +0100 Message-ID: References: <86iktxwlyv.fsf@gnu.org> 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="34408"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Marc Soda , 73688@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 12 22:37:12 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 1szirP-0008nb-Kk for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 12 Oct 2024 22:37:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1szir3-0006xy-2v; Sat, 12 Oct 2024 16:36:49 -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 1szir2-0006xo-6I for bug-gnu-emacs@gnu.org; Sat, 12 Oct 2024 16:36:48 -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 1szir1-0003RD-Tb for bug-gnu-emacs@gnu.org; Sat, 12 Oct 2024 16:36:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=7UoZISaMTiMpJwCYNA3cExwueHW52NCfGmwj4+/pRZ4=; b=bZXJAOmKUQ7wil8X/kYcjdMSJQGPUcV1+5loGOWNYVBjT4WUOpTI9Ub8yKEnb+85pu2mFLm5gGb8MOZHxrTP+CQcgxE6g1EjrhESgQV/E2CNIE+eckWyHAxtJbzv/Zu+HIy3NqUoXkNtQf9oCySY0OrGWhOqSohMR3DBsJJtDimWhQ7jP9XckYev9yARXs1r5emYddcRCa4PpDnTa2QR3Ar5B190YY5Mxg7XAadXs5EoAeeYcZ0PghJb9uVn+3JVGs5GpCx9N0b2Ud3DYT9FAtF2vLuIYUfowKKeixnr7Upnj5JyolPu7hxM4H4Ikt/PzegJllQdRJlkM3k+Ec1p+w==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1szirG-0001na-C1 for bug-gnu-emacs@gnu.org; Sat, 12 Oct 2024 16:37: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: Sat, 12 Oct 2024 20:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73688 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 73688-submit@debbugs.gnu.org id=B73688.17287653976846 (code B ref 73688); Sat, 12 Oct 2024 20:37:02 +0000 Original-Received: (at 73688) by debbugs.gnu.org; 12 Oct 2024 20:36:37 +0000 Original-Received: from localhost ([127.0.0.1]:34031 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sziqr-0001mL-3k for submit@debbugs.gnu.org; Sat, 12 Oct 2024 16:36:37 -0400 Original-Received: from mail-oo1-f51.google.com ([209.85.161.51]:49188) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sziqp-0001lx-19 for 73688@debbugs.gnu.org; Sat, 12 Oct 2024 16:36:35 -0400 Original-Received: by mail-oo1-f51.google.com with SMTP id 006d021491bc7-5e98ea02c9dso1290919eaf.2 for <73688@debbugs.gnu.org>; Sat, 12 Oct 2024 13:36:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728765315; x=1729370115; 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=7UoZISaMTiMpJwCYNA3cExwueHW52NCfGmwj4+/pRZ4=; b=DRmkI+mcjVNcaAgIA223tyyEgt11jIG7/e4LWrUQzEsyQF8PngYRjWxaDXfkmeiS8Q GLHLxKwg2ZZC+4viCmTfG7wLDeuJUsMuHy3+2OPrg0opzBl1xWY0PSGdkPdSHeBFznjt yE0P0Pwc+0kLiq/S7b5GkTZRIVd9gCDgIYIBqrDyE93xahQPu4YST6lXsJCdO1IYCTDl 2YMgFwD/+XofRT2wyHLNZNryE4RX38ny52GJAV/6IBJ6uyYQvCtEKNul41UCFgIK1Kl1 H4yMnMhCFkRZNwEy+USv1T82WJA+865f2hnpWk93W/GDW0UiqIEGXeCl7mNhhdfvkJ60 lSxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728765315; x=1729370115; 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=7UoZISaMTiMpJwCYNA3cExwueHW52NCfGmwj4+/pRZ4=; b=jFoGrw652H/w96XBIELkwcWYqtQrYYPvX+bvfbR+voguLShDVh7xp1Soerh4y8OuvZ QJQ2AHsb1Xja2tm+WIgD+fXuEUrsCM004LUqTaRFq580qnGEgZZ7iMLyEi/CeIuvlBV+ 53ycSkFd7od3cmbGeNfMXWQE5GUvDYwSArSWscKYYFgCqH6jXjRm2IGDa0AM6BsbLEEF KTovLgjLEave9d4e9LTB82WXUtR72/GCURsuqfvJ6UCzZBBe9UVVje01eOfkwuF1oRP7 6Jda7NwMOoHwEXGSta3WCdS2wudXgoeU94Kn2Eq2jZ7syLDVoysQZzm1YPkW1uDVOq4c MPtQ== X-Forwarded-Encrypted: i=1; AJvYcCVH4mLZdFUnOuKx1J4M5sDscUjU8tNvUGYR6lEdMsnZUi2mky/PEXGDIWNtzEnDsBkihyxDKQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyHoiRG0htbPALW/b4Oj0eTyRSL6AZS9yjLtEjTNIZkYCox4aAH 5kbokYwiiiB/1RJd5maJxwsl19d7cGiPVscOe51GBWpxZE8wiRyy+8kUUwnmWY1ft21LRFdwUZ+ ib4SYOZxnI1TIzTj9CCtgKobNLfxzeA== X-Google-Smtp-Source: AGHT+IFALWAWtRAzwOa4JpI1YHtg5fVL7I3M06eqCz9ztKU9Djuk6D5uZ3HBWY9X+Grk/cQiGaFBCc/YPCwziMmJbIE= X-Received: by 2002:a05:6820:812:b0:5e1:c19d:3f4e with SMTP id 006d021491bc7-5eb1a2fe5fcmr3841135eaf.8.1728765315031; Sat, 12 Oct 2024 13:35:15 -0700 (PDT) In-Reply-To: <86iktxwlyv.fsf@gnu.org> 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:293478 Archived-At: On Sat, Oct 12, 2024 at 1:21=E2=80=AFPM Eli Zaretskii wrote: > > > Date: Tue, 08 Oct 2024 03:10:54 +0000 > > From: Marc Soda > > > > When using electric-pair-mode, electric-pair-conservative-inhibit > > doesn't respect electric-pair-preserve-balance. For example, type out a > > string, go to the beginning of the line, type ", go to the end of the > > line, and type ". You are left with "foo"". (Exact keys from the start > > of a line are fooC-a"C-e", if that's more clear.) I would expect to be > > left with "foo" instead. > > > > This is easy to resolve in your init file (after some digging), but I > > think the current behavior is non-intuitive. > > > > Please consider the attached patch. > > Jo=C3=A3o, do you have any comments? This is not reproducible here, but then again this isn't an Emacs -Q recipe. What major-mode? In my *scratch* buffer, if I type f o o C-a " C-e " , as Marc seems to suggest, I am left with ""foo"" as the contents, which is a balanced situation. I do not expect to have: "foo" To get that, I would need to have typed " with the region active. Jo=C3=A3o