emacs-devel
[Top][All Lists]
Advanced

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

Re: tags mode completion table doesn't work with multiple tables


From: Francesco Potorti`
Subject: Re: tags mode completion table doesn't work with multiple tables
Date: Tue, 29 Apr 2003 12:15:02 +0200

>Is the problem that, if you have put multiple tags tables in the
>current list, completion fails to search them all?

By reading the source, apparently yes.

In fact, this function:


;; Completion function for tags.  Does normal try-completion,
;; but builds tags-completion-table on demand.
(defun tags-complete-tag (string predicate what)
  (save-excursion
    ;; If we need to ask for the tag table, allow that.
    (let ((enable-recursive-minibuffers t))
      (visit-tags-table-buffer))
    (if (eq what t)
        (all-completions string (tags-completion-table) predicate)
      (try-completion string (tags-completion-table) predicate))))

which is the one that builds the completion table when necessary,
completely ignores tags-table-list.  

If tags-table-list is set, in fact, the above function ignores it
because it calls visit-tags-table-buffer, which sets the current buffer
to the first buffer in tags-table-list, ignoring the others.

Maybe the following substitution function will do the trick.  Frederik,
would you please try it?  To try it, put point (the cursor) after the
last close parenthesis, then hit C-x C-e.

(defun tags-complete-tag (string predicate what)
  (save-excursion
    ;; If we need to ask for the tag table, allow that.
    (let ((enable-recursive-minibuffers t))
      (visit-tags-table-buffer))
    (let ((table (tags-completion-table)))
      ;; Consider all possible tag tables in tags-table-list.
      (while (visit-tags-table-buffer t)
        (setq table (tags-completion-table)))
      (if (eq what t)
          (all-completions string table predicate)
        (try-completion string table predicate)))))




reply via email to

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