summaryrefslogtreecommitdiffstats
path: root/emacs-git/0001-Use-a-keyword-not-symbol-to-delete-whitespace.patch
blob: 9a70f4a73c89d4c8c9af745e34410509b801298a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From c9dfaff53b11f6db401d8ed7a7d25e1efb45c461 Mon Sep 17 00:00:00 2001
From: Tom Willemse <tom@ryuslash.org>
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/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