emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/xr 74cc24c 1/3: Simplify: use preceding-char instead of


From: Mattias Engdegård
Subject: [elpa] externals/xr 74cc24c 1/3: Simplify: use preceding-char instead of buffer-substring
Date: Wed, 20 Feb 2019 06:30:43 -0500 (EST)

branch: externals/xr
commit 74cc24ca64016316ed669c4a42e4a76a05c6a2de
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>

    Simplify: use preceding-char instead of buffer-substring
---
 xr.el | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/xr.el b/xr.el
index 2a3570d..6e56172 100644
--- a/xr.el
+++ b/xr.el
@@ -287,9 +287,7 @@
        ;; - not special at beginning of sequence or after ^
        ((and (looking-at (rx (any "*?+") (opt "?")))
              sequence
-             (not (and (eq (car sequence) 'bol)
-                       (string-equal (buffer-substring (1- (point)) (point))
-                                     "^"))))
+             (not (and (eq (car sequence) 'bol) (eq (preceding-char) ?^))))
         (let ((operator (match-string 0)))
           (goto-char (match-end 0))
           (setq sequence (cons (xr--postfix operator (car sequence))
@@ -298,9 +296,7 @@
        ;; \{..\} - not special at beginning of sequence or after ^
        ((and (looking-at (rx "\\{"))
              sequence
-             (not (and (eq (car sequence) 'bol)
-                       (string-equal (buffer-substring (1- (point)) (point))
-                                     "^"))))
+             (not (and (eq (car sequence) 'bol) (eq (preceding-char) ?^))))
         (forward-char 2)
         (if (looking-at (rx (opt (group (one-or-more digit)))
                             (opt (group ",")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]