GNU bug report logs - #19505
25.0.50; Defining a chomp function breaks electric pairing

Previous Next

Package: emacs;

Reported by: Tom Willemse <tom <at> ryuslash.org>

Date: Sun, 4 Jan 2015 14:54:02 UTC

Severity: normal

Found in version 25.0.50

Fixed in version 25.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Tom Willemse <tom <at> ryuslash.org>
Subject: bug#19505: closed (Re: bug#19505: 25.0.50; Defining a chomp
 function breaks electric pairing)
Date: Sun, 19 Apr 2015 01:10:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#19505: 25.0.50; Defining a chomp function breaks electric pairing

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 19505 <at> debbugs.gnu.org.

-- 
19505: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19505
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Glenn Morris <rgm <at> gnu.org>
To: 19505-done <at> debbugs.gnu.org
Subject: Re: bug#19505: 25.0.50;
 Defining a chomp function breaks electric pairing
Date: Sat, 18 Apr 2015 21:09:49 -0400
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

[Message part 3 (message/rfc822, inline)]
From: Tom Willemse <tom <at> ryuslash.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.50; Defining a chomp function breaks electric pairing
Date: Sun, 04 Jan 2015 15:53:03 +0100
[Message part 4 (text/plain, inline)]
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.

[0001-Always-treat-chomp-as-a-symbol.patch (text/x-diff, inline)]
From d7e6e8f2ff3572afb4131ea64966b2a9253f9ac6 Mon Sep 17 00:00:00 2001
From: Tom Willemse <tom <at> ryuslash.org>
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  <tom <at> ryuslash.org>
+
+	* elec-pair.el (electric-pair-post-self-insert-function): Make
+	sure chomp isn't used as a function.
+
 2015-01-04  Paul Eggert  <eggert <at> cs.ucla.edu>
 
 	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


This bug report was last modified 10 years and 37 days ago.

Previous Next


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