From unknown Sat Aug 16 21:02:14 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#19505 <19505@debbugs.gnu.org> To: bug#19505 <19505@debbugs.gnu.org> Subject: Status: 25.0.50; Defining a chomp function breaks electric pairing Reply-To: bug#19505 <19505@debbugs.gnu.org> Date: Sun, 17 Aug 2025 04:02:14 +0000 retitle 19505 25.0.50; Defining a chomp function breaks electric pairing reassign 19505 emacs submitter 19505 Tom Willemse severity 19505 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 04 09:53:24 2015 Received: (at submit) by debbugs.gnu.org; 4 Jan 2015 14:53:24 +0000 Received: from localhost ([127.0.0.1]:36082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y7mYV-0007Ut-DL for submit@debbugs.gnu.org; Sun, 04 Jan 2015 09:53:23 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56864) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y7mYT-0007Ul-0f for submit@debbugs.gnu.org; Sun, 04 Jan 2015 09:53:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y7mYS-0002av-1D for submit@debbugs.gnu.org; Sun, 04 Jan 2015 09:53:20 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36626) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y7mYR-0002ar-U3 for submit@debbugs.gnu.org; Sun, 04 Jan 2015 09:53:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y7mYN-00053z-JT for bug-gnu-emacs@gnu.org; Sun, 04 Jan 2015 09:53:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y7mYJ-0002Yy-AZ for bug-gnu-emacs@gnu.org; Sun, 04 Jan 2015 09:53:15 -0500 Received: from r0.smtpout1.alwaysdata.com ([176.31.58.0]:46045) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y7mYI-0002Ys-Sa for bug-gnu-emacs@gnu.org; Sun, 04 Jan 2015 09:53:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=alwaysdata.net; s=ryuslash; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From; bh=SeXOvt8OhtwTgR81WhH+7QOFwooi849OgisDl2vzzP4=; b=FfwhHrzTjFqu5uSn5yyvZgisDdspZ7sdTePJN1zNl6Ar1A+nkyxB6YC6e5zOZ+TfmHSp+f6m0GpcukZFmJuLvUFTJn/L3kmFNY0MoiIMGYAdSE93Xs+V8uH58pDVduS50KJEoqa+5NILYD5tqKcLowAEAQJGlCFEsjilXeNCb2g=; Received: from [2a02:1812:2518:ce00:f24d:a2ff:fede:451c] (helo=localhost) by smtpout1.alwaysdata.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.77) (envelope-from ) id 1Y7mYD-0007t9-0A for bug-gnu-emacs@gnu.org; Sun, 04 Jan 2015 15:53:05 +0100 From: Tom Willemse To: bug-gnu-emacs@gnu.org Subject: 25.0.50; Defining a chomp function breaks electric pairing Date: Sun, 04 Jan 2015 15:53:03 +0100 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-alwaysdata-ID: 42717841 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/plain The attached patch fixes the situation where a function `chomp' exists and `electric-pair-skip-whitespace' has the value `chomp'. Since that specific symbol is mentioned as a special case for this variable, it seems that it shouldn't try to call a function named as such. Basically, defining a function named `chomp' will break electric pairing if the `electric-pair-skip-whitespace' is set to chomp. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Always-treat-chomp-as-a-symbol.patch >From d7e6e8f2ff3572afb4131ea64966b2a9253f9ac6 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sun, 4 Jan 2015 05:37:02 +0100 Subject: [PATCH] Always treat chomp as a symbol --- lisp/ChangeLog | 5 +++++ lisp/elec-pair.el | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index aa79a8d..b031f25 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-01-04 Tom Willemse + + * elec-pair.el (electric-pair-post-self-insert-function): Make + sure chomp isn't used as a function. + 2015-01-04 Paul Eggert Less 'make' chatter for lisp dir diff --git a/lisp/elec-pair.el b/lisp/elec-pair.el index 2cede62..65c3dbf 100644 --- a/lisp/elec-pair.el +++ b/lisp/elec-pair.el @@ -475,7 +475,8 @@ (defun electric-pair-post-self-insert-function (when (and (not (and unconditional (eq syntax ?\"))) (setq skip-whitespace-info - (if (functionp electric-pair-skip-whitespace) + (if (and (not (eq electric-pair-skip-whitespace 'chomp)) + (functionp electric-pair-skip-whitespace)) (funcall electric-pair-skip-whitespace) electric-pair-skip-whitespace))) (electric-pair--skip-whitespace)) -- 2.2.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 04 15:14:11 2015 Received: (at 19505) by debbugs.gnu.org; 4 Jan 2015 20:14:11 +0000 Received: from localhost ([127.0.0.1]:36620 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y7rYx-0007D8-24 for submit@debbugs.gnu.org; Sun, 04 Jan 2015 15:14:11 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:54925) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y7rYv-0007Cz-Qm for 19505@debbugs.gnu.org; Sun, 04 Jan 2015 15:14:10 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj8PAOwQflRFpY0B/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIwULCzQSFBgNJIhKCdZZAQEBAQEBBAEBAQEekG8HhEgFiwGkLoF4hBkhgncBAQE X-IPAS-Result: Aj8PAOwQflRFpY0B/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIwULCzQSFBgNJIhKCdZZAQEBAQEBBAEBAQEekG8HhEgFiwGkLoF4hBkhgncBAQE X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="106534165" Received: from 69-165-141-1.dsl.teksavvy.com (HELO ceviche.home) ([69.165.141.1]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 04 Jan 2015 15:14:09 -0500 Received: by ceviche.home (Postfix, from userid 20848) id F13D166100; Sun, 4 Jan 2015 15:14:08 -0500 (EST) From: Stefan Monnier To: Tom Willemse Subject: Re: bug#19505: 25.0.50; Defining a chomp function breaks electric pairing Message-ID: References: Date: Sun, 04 Jan 2015 15:14:08 -0500 In-Reply-To: (Tom Willemse's message of "Sun, 04 Jan 2015 15:53:03 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 19505 Cc: 19505@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > The attached patch fixes the situation where a function `chomp' exists > and `electric-pair-skip-whitespace' has the value `chomp'. Since that > specific symbol is mentioned as a special case for this variable, it > seems that it shouldn't try to call a function named as such. Maybe a better option is to use the value `:chomp' instead of `chomp', since defining a function `:chomp' should be considered an error anyway, Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 04 15:25:45 2015 Received: (at 19505) by debbugs.gnu.org; 4 Jan 2015 20:25:45 +0000 Received: from localhost ([127.0.0.1]:36626 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y7rk9-0007UM-7B for submit@debbugs.gnu.org; Sun, 04 Jan 2015 15:25:45 -0500 Received: from r0.smtpout1.alwaysdata.com ([176.31.58.0]:60351) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y7rk6-0007UB-IS for 19505@debbugs.gnu.org; Sun, 04 Jan 2015 15:25:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=alwaysdata.net; s=ryuslash; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=8DntZsjxLvBiDx77YH9a/JitFRzLOA4a6VUGB+BXemU=; b=S7sMx8kjOvpqOeewJCU30w3AHJqYpdJLtqhjOFLc3XdbbD5VJzfAg+v9hWHN5EqdTLGCo0T/yTnlEDlbis0yEnNbZiRXIsNAZJ69PZzZ3ijHJ5000wLHTbn32F3GCTRzGqfTpwtCav1eEB2s3RHGakT1by2ISAShsk3C1RIy9jY=; Received: from [2a02:1812:2518:ce00:f24d:a2ff:fede:451c] (helo=localhost) by smtpout1.alwaysdata.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.77) (envelope-from ) id 1Y7rk1-0002rH-ED; Sun, 04 Jan 2015 21:25:37 +0100 From: Tom Willemse To: Stefan Monnier Subject: Re: bug#19505: 25.0.50; Defining a chomp function breaks electric pairing References: Date: Sun, 04 Jan 2015 21:25:37 +0100 In-Reply-To: (Stefan Monnier's message of "Sun, 04 Jan 2015 15:14:08 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-alwaysdata-ID: 42780237 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19505 Cc: 19505@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Stefan Monnier writes: >> The attached patch fixes the situation where a function `chomp' exists >> and `electric-pair-skip-whitespace' has the value `chomp'. Since that >> specific symbol is mentioned as a special case for this variable, it >> seems that it shouldn't try to call a function named as such. > > Maybe a better option is to use the value `:chomp' instead of `chomp', > since defining a function `:chomp' should be considered an error anyway, Certainly an option, but wouldn't that break people's configuration in an annoying way? From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 06 15:09:32 2015 Received: (at 19505) by debbugs.gnu.org; 6 Jan 2015 20:09:32 +0000 Received: from localhost ([127.0.0.1]:38919 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y8aRX-0008Vu-8l for submit@debbugs.gnu.org; Tue, 06 Jan 2015 15:09:31 -0500 Received: from r0.smtpout1.alwaysdata.com ([176.31.58.0]:49992) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y8aRU-0008Vl-8i for 19505@debbugs.gnu.org; Tue, 06 Jan 2015 15:09:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=alwaysdata.net; s=ryuslash; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=44n1Y3e29fNpNErVOUQSF8ODJd6nvgve9FPuyFquc8k=; b=ZtOKv74sGpXZ985FU4nDQRRs0EwVoRd57fwN0/myPyV9K4IQRTOEXFgHKwrmO7ZYbu1pD3+QVFhNyzHRmysHx7rcfAQdununktnUzagYsMCaOZqQSqSMwSySEo32eQK2nRg7vmQ3lcVgsu6pEtaWXV/ihSqNsq0ToEpuPgJDwX0=; Received: from [2a02:1812:2518:ce00:f24d:a2ff:fede:451c] (helo=localhost) by smtpout1.alwaysdata.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.77) (envelope-from ) id 1Y8aRM-00079N-Uw; Tue, 06 Jan 2015 21:09:20 +0100 From: Tom Willemse To: Stefan Monnier Subject: Re: bug#19505: 25.0.50; Defining a chomp function breaks electric pairing References: Date: Tue, 06 Jan 2015 21:09:20 +0100 In-Reply-To: (Stefan Monnier's message of "Sun, 04 Jan 2015 15:14:08 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-alwaysdata-ID: 43271617 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19505 Cc: 19505@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --=-=-= Content-Type: text/plain Stefan Monnier writes: >> The attached patch fixes the situation where a function `chomp' exists >> and `electric-pair-skip-whitespace' has the value `chomp'. Since that >> specific symbol is mentioned as a special case for this variable, it >> seems that it shouldn't try to call a function named as such. > > Maybe a better option is to use the value `:chomp' instead of `chomp', > since defining a function `:chomp' should be considered an error anyway, I've attached a patch with the change as you suggested. It seems to me this change might need an entry in the NEWS file, since it changes the value of `electric-pair-skip-whitespace' from a symbol to a keyword, people might be confused that their configuration suddenly stopped working. I just had no idea how to describe this in a NEWS-friendly way. Perhaps a test should be written for this as well? If someone could suggest where to put such a test I would happily (try to) write it. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Use-a-keyword-not-symbol-to-delete-whitespace.patch >From c9dfaff53b11f6db401d8ed7a7d25e1efb45c461 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Tue, 6 Jan 2015 20:37:29 +0100 Subject: [PATCH] Use a keyword, not symbol, to delete whitespace * elec-pair.el (electric-pair-skip-whitespace): Use `:chomp' instead of `chomp'. (electric-pair-post-self-insert-function): Check for a keyword `:chomp' instead of the symbol `chomp' to prevent naming conflicts. --- lisp/ChangeLog | 8 ++++++++ lisp/elec-pair.el | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 76ba2cd..cd7cd2a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2015-01-06 Tom Willemse + + * elec-pair.el (electric-pair-skip-whitespace): Use `:chomp' + instead of `chomp'. + (electric-pair-post-self-insert-function): Check for a keyword + `:chomp' instead of the symbol `chomp' to prevent naming + conflicts. + 2015-01-05 Dmitry Gutov * progmodes/xref.el (xref--insert-xrefs): Add `help-echo' property diff --git a/lisp/elec-pair.el b/lisp/elec-pair.el index 2cede62..270f4a3 100644 --- a/lisp/elec-pair.el +++ b/lisp/elec-pair.el @@ -129,7 +129,7 @@ (defcustom electric-pair-skip-whitespace The specific kind of whitespace skipped is given by the variable `electric-pair-skip-whitespace-chars'. -The symbol `chomp' specifies that the skipped-over whitespace +The keyword `:chomp' specifies that the skipped-over whitespace should be deleted. Can also be a function of no arguments, in which case that function's @@ -138,7 +138,7 @@ (defcustom electric-pair-skip-whitespace :group 'electricity :type '(choice (const :tag "Yes, jump over whitespace" t) - (const :tag "Yes, and delete whitespace" chomp) + (const :tag "Yes, and delete whitespace" :chomp) (const :tag "No, no whitespace skipping" nil) function)) @@ -487,7 +487,7 @@ (defun electric-pair-post-self-insert-function ;; live with it for now. (when skip-whitespace-info (electric-pair--skip-whitespace)) - (delete-region (1- pos) (if (eq skip-whitespace-info 'chomp) + (delete-region (1- pos) (if (eq skip-whitespace-info :chomp) (point) pos)) (forward-char)) -- 2.2.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 18 21:09:55 2015 Received: (at 19505-done) by debbugs.gnu.org; 19 Apr 2015 01:09:55 +0000 Received: from localhost ([127.0.0.1]:60296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YjdkA-00015f-MW for submit@debbugs.gnu.org; Sat, 18 Apr 2015 21:09:54 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:46570 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yjdk9-00015W-Kp for 19505-done@debbugs.gnu.org; Sat, 18 Apr 2015 21:09:54 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1Yjdk8-0005a1-55; Sat, 18 Apr 2015 21:09:52 -0400 From: Glenn Morris To: 19505-done@debbugs.gnu.org Subject: Re: bug#19505: 25.0.50; Defining a chomp function breaks electric pairing References: X-Spook: militia Ruby Ridge Bosnia JFK Uzi Audiotel broadside X-Ran: O5Rp`%4Dqnh*Af\CBhZ`h>SNAn{kRXR (Tom Willemse's message of "Sun, 04 Jan 2015 15:53:03 +0100") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 19505-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Version: 25.1 Tom Willemse wrote: > The attached patch fixes the situation where a function `chomp' exists > and `electric-pair-skip-whitespace' has the value `chomp'. Since that > specific symbol is mentioned as a special case for this variable, it > seems that it shouldn't try to call a function named as such. Thanks; applied. (While it might have been nicer to use :chomp, it doesn't seem worth an incompatible change to me.) BTW, you have a few "tiny changes" installed in Emacs now. If you expect to contribute more, please consider completing the form at http://git.savannah.gnu.org/cgit/gnulib.git/plain/doc/Copyright/request-assign.future From unknown Sat Aug 16 21:02:14 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 17 May 2015 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator