all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tom Willemse <tom@ryuslash.org>
To: 19505@debbugs.gnu.org
Subject: bug#19505: 25.0.50; Defining a chomp function breaks electric pairing
Date: Sun, 04 Jan 2015 15:53:03 +0100	[thread overview]
Message-ID: <m3sifqd2cw.fsf@ryuslash.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 404 bytes --]


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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Always-treat-chomp-as-a-symbol.patch --]
[-- Type: text/x-diff, Size: 1548 bytes --]

From d7e6e8f2ff3572afb4131ea64966b2a9253f9ac6 Mon Sep 17 00:00:00 2001
From: Tom Willemse <tom@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@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@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


             reply	other threads:[~2015-01-04 14:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-04 14:53 Tom Willemse [this message]
2015-01-04 20:14 ` bug#19505: 25.0.50; Defining a chomp function breaks electric pairing Stefan Monnier
2015-01-04 20:25   ` Tom Willemse
2015-01-06 20:09   ` Tom Willemse
2015-04-19  1:09 ` Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3sifqd2cw.fsf@ryuslash.org \
    --to=tom@ryuslash.org \
    --cc=19505@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.