Commit 669e01b5 authored by Stefan Monnier's avatar Stefan Monnier

tags-completion-at-point-function: Don't trust the find-tag function

* lisp/progmodes/etags.el (tags-completion-at-point-function):
Don't trust the find-tag function.
parent 22191349
......@@ -805,15 +805,16 @@ If no tags table is loaded, do nothing and return nil."
(pattern (funcall (or find-tag-default-function
(get major-mode 'find-tag-default-function)
(when pattern
(forward-char (1- (length pattern)))
(search-backward pattern)
(setq beg (point))
(forward-char (length pattern))
(list beg (point) (tags-lazy-completion-table) :exclusive 'no))))))
;; The find-tag function might be overly optimistic.
(when (search-backward pattern nil t)
(setq beg (point))
(forward-char (length pattern))
(list beg (point) (tags-lazy-completion-table) :exclusive 'no)))))))
(defun find-tag-tag (string)
"Read a tag name, with defaulting and completion."
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment