]> git.eshelyaron.com Git - esy-publish.git/commitdiff
Update 26 YO Bug post
authorEshel Yaron <me@eshelyaron.com>
Sun, 11 Feb 2024 06:47:04 +0000 (07:47 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sun, 11 Feb 2024 06:47:04 +0000 (07:47 +0100)
source/posts/2024-02-10-fixing-a-twenty-six-years-old-emacs-bug.org

index 528d79cc3c4cd448db8123be0d139ba8a2a2ca19..9245d45a5702f9bc9ba086b2e0bfbaf49f14824e 100644 (file)
@@ -216,7 +216,7 @@ Probably eating paste or some such.
 Indeed the bug was hiding there all these years, until finally the
 change from last February---namely, the "disallow '.' at the start"
 part---brought it to light.  It's a simple matter of orientation: just
-like the comments suggests, ~thing-at-point-looking-at~ would search
+like the comments suggest, ~thing-at-point-looking-at~ would search
 forward from point, and then start searching backward.  But since
 Emacs doesn't really have a backward-regexp-matching capability, its
 ~re-search-backward~ works by /moving backward/ and /searching
@@ -258,6 +258,7 @@ without breaking a sweat.  This leads to the following implementation:
         (while (and (setq prev (point)
                           match (re-search-forward regexp end t))
                     (< (match-end 0) old))
+          (goto-char (match-beginning 0))
           ;; Avoid inflooping when `regexp' matches the empty string.
           (unless (< prev (point)) (forward-char))))
       (and match (<= (match-beginning 0) old (match-end 0)))))