comparison lisp/progmodes/etags.el @ 108166:15deb8699a13

* minibuffer.el (tags-completion-at-point-function): New function. (completion-at-point-functions): Use it. * cedet/semantic.el (semantic-completion-at-point-function): New function. (semantic-mode): Use semantic-completion-at-point-function for completion-at-point-functions instead. * progmodes/etags.el (complete-tag): Revert last change.
author Chong Yidong <cyd@stupidchicken.com>
date Thu, 29 Apr 2010 11:32:11 -0400
parents 56d11bda8235
children 8bcf1c901e9a
comparison
equal deleted inserted replaced
108165:5f43377338a0 108166:15deb8699a13
2025 (defun select-tags-table-quit () 2025 (defun select-tags-table-quit ()
2026 "Kill the buffer and delete the selected window." 2026 "Kill the buffer and delete the selected window."
2027 (interactive) 2027 (interactive)
2028 (quit-window t (selected-window))) 2028 (quit-window t (selected-window)))
2029 2029
2030 ;;;###autoload
2031 (defun complete-tag ()
2032 "Perform tags completion on the text around point.
2033 Completes to the set of names listed in the current tags table.
2034 The string to complete is chosen in the same way as the default
2035 for \\[find-tag] (which see)."
2036 (interactive)
2037 (or tags-table-list
2038 tags-file-name
2039 (error "%s"
2040 (substitute-command-keys
2041 "No tags table loaded; try \\[visit-tags-table]")))
2042 (let ((completion-ignore-case (if (memq tags-case-fold-search '(t nil))
2043 tags-case-fold-search
2044 case-fold-search))
2045 (pattern (funcall (or find-tag-default-function
2046 (get major-mode 'find-tag-default-function)
2047 'find-tag-default)))
2048 (comp-table (tags-lazy-completion-table))
2049 beg)
2050 (or pattern
2051 (error "Nothing to complete"))
2052 (search-backward pattern)
2053 (setq beg (point))
2054 (forward-char (length pattern))
2055 (completion-in-region beg (point) comp-table)))
2056
2030 (dolist (x '("^No tags table in use; use .* to select one$" 2057 (dolist (x '("^No tags table in use; use .* to select one$"
2031 "^There is no default tag$" 2058 "^There is no default tag$"
2032 "^No previous tag locations$" 2059 "^No previous tag locations$"
2033 "^File .* is not a valid tags table$" 2060 "^File .* is not a valid tags table$"
2034 "^No \\(more \\|\\)tags \\(matching\\|containing\\) " 2061 "^No \\(more \\|\\)tags \\(matching\\|containing\\) "