[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master f7b4937 04/13: Refactor whitespace detection
From: |
Artur Malabarba |
Subject: |
[elpa] master f7b4937 04/13: Refactor whitespace detection |
Date: |
Wed, 05 Aug 2015 21:54:09 +0000 |
branch: master
commit f7b49370dc7edf3759fc9e513eb36c4524d604a4
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>
Refactor whitespace detection
---
sotlisp.el | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/sotlisp.el b/sotlisp.el
index d1a34b9..dbdd03b 100644
--- a/sotlisp.el
+++ b/sotlisp.el
@@ -122,8 +122,13 @@ non-nil."
(defun sotlisp--whitespace-p ()
"Non-nil if current `self-insert'ed char is whitespace."
+ (sotlisp--whitespace-char-p last-command-event))
+(make-obsolete 'sotlisp--whitespace-p 'sotlisp--whitespace-char-p "1.2")
+
+(defun sotlisp--whitespace-char-p (char)
+ "Non-nil if CHAR is has whitespace syntax."
(ignore-errors
- (string-match (rx space) (string last-command-event))))
+ (string-match (rx space) (string char))))
;;; Expansion logic
@@ -159,14 +164,14 @@ If it ended in a space and there's a space ahead, delete
the
space ahead."
;; Inform `expand-abbrev' that `self-insert-command' should not
;; trigger, by returning non-nil on SPC.
- (when (sotlisp--whitespace-p)
+ (when (sotlisp--whitespace-char-p last-command-event)
;; And maybe move out of closing paren if expansion ends with $.
(if (eq (char-before) ?$)
(progn (delete-char -1)
(setq sotlisp--needs-moving nil)
(sotlisp--maybe-skip-closing-paren))
- (when (and (string-match (rx space) (string (char-after)))
- (string-match (rx space) (string (char-before))))
+ (when (and (sotlisp--whitespace-char-p (char-after))
+ (sotlisp--whitespace-char-p (char-before)))
(delete-char 1)))
t))
- [elpa] master updated (e18833b -> 0bb0ee6), Artur Malabarba, 2015/08/05
- [elpa] master 785d35c 01/13: After expanding, eat up space ahead if convenient, Artur Malabarba, 2015/08/05
- [elpa] master 960ea2f 02/13: Avoid errors on false positives, Artur Malabarba, 2015/08/05
- [elpa] master f7b4937 04/13: Refactor whitespace detection,
Artur Malabarba <=
- [elpa] master c1deb05 03/13: Don't use looking-back, Artur Malabarba, 2015/08/05
- [elpa] master 7f38383 05/13: Don't expand in strings or comments, Artur Malabarba, 2015/08/05
- [elpa] master b957752 07/13: Don't indent if the user is starting to type a comment. Fix #51, Artur Malabarba, 2015/08/05
- [elpa] master 1e6676a 06/13: Version bump, Artur Malabarba, 2015/08/05
- [elpa] master f2c0fe9 08/13: Don't indent if undo-in-progress, Artur Malabarba, 2015/08/05
- [elpa] master 6ccb05d 10/13: More abbrevs, Artur Malabarba, 2015/08/05
- [elpa] master 3557254 09/13: Version bump, Artur Malabarba, 2015/08/05
- [elpa] master 98fe00f 11/13: Version bump, Artur Malabarba, 2015/08/05
- [elpa] master 0bb0ee6 13/13: Merge commit '3557254c6873aeb0b5070248aa0faf2ff0d29d04', Artur Malabarba, 2015/08/05
- [elpa] master 5b702fc 12/13: Merge commit '98fe00fbd6a71ba1e79cf616f22c026c9d84adc7', Artur Malabarba, 2015/08/05