diff options
| author | Stefan Monnier | 2015-05-23 12:05:21 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2015-05-23 12:05:21 -0400 |
| commit | 669e01b5f630b74f417f12ebebed76c9553dae9b (patch) | |
| tree | c041e459b55eea9b523e0c3dc2e105ceac7b0ee0 /lisp | |
| parent | 2219134940a18ba7a3cafa07382f4767bb511fa9 (diff) | |
| download | emacs-669e01b5f630b74f417f12ebebed76c9553dae9b.tar.gz emacs-669e01b5f630b74f417f12ebebed76c9553dae9b.zip | |
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.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/progmodes/etags.el | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 7a87377503d..60ea456d57c 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el | |||
| @@ -805,15 +805,16 @@ If no tags table is loaded, do nothing and return nil." | |||
| 805 | case-fold-search)) | 805 | case-fold-search)) |
| 806 | (pattern (funcall (or find-tag-default-function | 806 | (pattern (funcall (or find-tag-default-function |
| 807 | (get major-mode 'find-tag-default-function) | 807 | (get major-mode 'find-tag-default-function) |
| 808 | 'find-tag-default))) | 808 | #'find-tag-default))) |
| 809 | beg) | 809 | beg) |
| 810 | (when pattern | 810 | (when pattern |
| 811 | (save-excursion | 811 | (save-excursion |
| 812 | (forward-char (1- (length pattern))) | 812 | (forward-char (1- (length pattern))) |
| 813 | (search-backward pattern) | 813 | ;; The find-tag function might be overly optimistic. |
| 814 | (setq beg (point)) | 814 | (when (search-backward pattern nil t) |
| 815 | (forward-char (length pattern)) | 815 | (setq beg (point)) |
| 816 | (list beg (point) (tags-lazy-completion-table) :exclusive 'no)))))) | 816 | (forward-char (length pattern)) |
| 817 | (list beg (point) (tags-lazy-completion-table) :exclusive 'no))))))) | ||
| 817 | 818 | ||
| 818 | (defun find-tag-tag (string) | 819 | (defun find-tag-tag (string) |
| 819 | "Read a tag name, with defaulting and completion." | 820 | "Read a tag name, with defaulting and completion." |