emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r100083: * minibuffer.el (tags-co


From: Stefan Monnier
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r100083: * minibuffer.el (tags-completion-at-point-function): New function.
Date: Thu, 29 Apr 2010 18:55:45 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> +(defun semantic-completion-at-point-function ()
> +  'semantic-ia-complete-symbol)

Yes, it's probably the best we can do for now.  Hopefully we can make it
return a completion table rather than perform the completion itself.

> -(declare-function tags-lazy-completion-table "etags.el" ())
> -
> -(defun complete-tag ()
> -  "Perform tags completion on the text around point.
> -If no tags table is loaded, do nothing and return nil.
> -Otherwise, complete to the set of names listed in the tags table.
> -The string to complete is chosen in the same way as the default
> -for `find-tag'."
> +(defun tags-completion-at-point-function ()
> +  "Using tags, return a completion table for the text around point.
> +If no tags table is loaded, do nothing and return nil."
>    (interactive)
>    (when (or tags-table-list tags-file-name)
>      (require 'etags)
> @@ -1185,14 +1180,11 @@
>                                   case-fold-search))
>         (pattern (funcall (or find-tag-default-function
>                               (get major-mode 'find-tag-default-function)
> -                             'find-tag-default)))
> -       (comp-table (tags-lazy-completion-table))
> -       beg)
> +                             'find-tag-default))))
>        (when pattern
> -     (search-backward pattern)
> -     (setq beg (point))
> -     (forward-char (length pattern))
> -     (completion-in-region beg (point) comp-table)))))
> +     (tags-lazy-completion-table)))))
> +
> +(declare-function tags-lazy-completion-table "etags.el" ())

tags-completion-at-point-function really should be in etags.el, don't
you think?
Also the above still looks wrong: it seems to just return a plain
completion table whereas it should return a value of the form (START END
COLLECTION &rest PROPS), as explained in the docstring of
completion-at-point-functions.
 

        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]