]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/tempo.el (tempo-find-match-string): Simplify
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 8 Sep 2023 23:24:53 +0000 (19:24 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 8 Sep 2023 23:24:53 +0000 (19:24 -0400)
lisp/tempo.el

index 7d8d17cfebc540c58fce82bb9f8d7d8ea8b81771..98521c54eb9618cb7f7333d6305fae328ff93d75 100644 (file)
@@ -643,16 +643,10 @@ If `tempo-dirty-collection' is nil, the old collection is reused."
 FINDER is a function or a string.  Returns (STRING . POS), or nil
 if no reasonable string is found."
   (cond ((stringp finder)
-        (let (successful)
-          (save-excursion
-            (or (setq successful (re-search-backward finder nil t))
-                0))
-          (if successful
-              (cons (buffer-substring (match-beginning 1)
-                                      (match-end 1)) ; This seems to be a
-                                       ; bug in emacs
-                    (match-beginning 1))
-            nil)))
+        (if (save-excursion (re-search-backward finder nil t))
+            (cons (match-string 1)   ; This seems to be a bug in Emacs (?)
+                  (match-beginning 1))
+          nil))
        (t
         (funcall finder))))