]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/etags.el (tags-completion-at-point-function):
authorSam Steingold <sds@gnu.org>
Wed, 21 Mar 2012 17:17:23 +0000 (13:17 -0400)
committerSam Steingold <sds@gnu.org>
Wed, 21 Mar 2012 17:17:23 +0000 (13:17 -0400)
Avoid the error when point is inside the pattern.

lisp/ChangeLog
lisp/progmodes/etags.el

index 5a82dd4758d3a87d48a8d724b2b9e36e91fa3ee2..801d0ac6a3cc1fd018e230813b4c5786372a4054 100644 (file)
@@ -1,3 +1,8 @@
+2012-03-21  Sam Steingold  <sds@gnu.org>
+
+       * progmodes/etags.el (tags-completion-at-point-function):
+       Avoid the error when point is inside the pattern.
+
 2012-03-21  John Yates  <john@yates-sheets.org>  (tiny change)
 
        * progmodes/hideshow.el (hs-inside-comment-p): Fix hiding of first
index cc5f0fef93467d2d1e3d7aaba37b5ef9cc8010b4..3a36410884f10f6fe2fb69691e16f0ffc2b5b9ec 100644 (file)
@@ -809,10 +809,10 @@ If no tags table is loaded, do nothing and return nil."
          beg)
       (when pattern
        (save-excursion
-         (search-backward pattern) ;FIXME: will fail if we're inside pattern.
-         (setq beg (point))
-         (forward-char (length pattern))
-         (list beg (point) (tags-lazy-completion-table) :exclusive 'no))))))
+         (when (search-backward pattern nil t) ; will fail inside pattern
+            (setq beg (point))
+            (forward-char (length pattern))
+            (list beg (point) (tags-lazy-completion-table) :exclusive 'no)))))))
 \f
 (defun find-tag-tag (string)
   "Read a tag name, with defaulting and completion."