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

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

[elpa] externals/tempel a3b35cf243: Improve tempel-trigger-prefix scanni


From: ELPA Syncer
Subject: [elpa] externals/tempel a3b35cf243: Improve tempel-trigger-prefix scanning (See #50)
Date: Fri, 15 Apr 2022 10:57:49 -0400 (EDT)

branch: externals/tempel
commit a3b35cf2432b4614aeae7c3382a8b1e7bfaf4002
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Improve tempel-trigger-prefix scanning (See #50)
    
    if there is a space after the trigger prefix,
    completion should not set in.
---
 tempel.el | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tempel.el b/tempel.el
index 67eb44133d..4a3ed0ca83 100644
--- a/tempel.el
+++ b/tempel.el
@@ -586,14 +586,14 @@ The completion table specifies the category `tempel'."
 (defun tempel--prefix-bounds ()
   "Return prefix bounds."
   (if tempel-trigger-prefix
-      (save-excursion
-        (let ((end (point))
-              (beg (re-search-backward
-                    (concat (regexp-quote tempel-trigger-prefix) "\\S-*")
-                    (line-beginning-position) 'noerror)))
-          (when beg
-            (cons (+ beg (length tempel-trigger-prefix)) end))))
-      (bounds-of-thing-at-point 'symbol)))
+      (let ((end (point))
+            (beg (save-excursion
+                   (search-backward tempel-trigger-prefix
+                                    (line-beginning-position) 'noerror))))
+        (when (and beg (save-excursion
+                         (not (re-search-backward "\\s-" beg 'noerror))))
+          (cons (+ beg (length tempel-trigger-prefix)) end)))
+    (bounds-of-thing-at-point 'symbol)))
 
 ;;;###autoload
 (defun tempel-expand (&optional interactive)



reply via email to

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