all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* tags mode completion table doesn't work with multiple tables
@ 2003-04-25 22:18 frederik
  2003-04-26 13:45 ` Richard Stallman
  0 siblings, 1 reply; 5+ messages in thread
From: frederik @ 2003-04-25 22:18 UTC (permalink / raw)


This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
and to the gnu.emacs.bug news group.

In GNU Emacs 21.3.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2003-04-25 on julius
configured using `configure  --with-x --prefix=/home/user/frederik'
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

The completion functionality in etags.el (emacs/21.3/lisp/progmodes/)
only works with one tags table at a time. To trigger bug, load two
different tags tables with visit-tags-table. M-. TAB TAB will only
show completions for one of the two tables. A workaround is to create
a TAGS file with "etags -i" which includes all of the other TAGS files
that the user wants to search.


Recent input:
ESC DEL m a e TAB / j TAB / s r TAB RET ESC x ESC p 
RET ESC DEL ESC DEL ESC DEL ESC DEL ESC DEL ESC DEL 
j c TAB 0 TAB / j TAB DEL ESC p ESC DEL ESC DEL ESC 
DEL j c TAB 0 TAB j TAB a v TAB DEL DEL DEL s r c TAB 
RET y ESC . X 8 TAB TAB TAB T e s t C a s e RET ESC 
x ESC p ESC p ESC p ESC p ESC p ESC n ESC p RET

Recent messages:
Mark set
Making completion list...
list: Quit
call-interactively: Quit
Making completion list...
Starting a new list of tags tables
Loading ange-ftp...done
Making completion list...
Mark set
next-history-element: Beginning of history; no preceding item

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: tags mode completion table doesn't work with multiple tables
  2003-04-25 22:18 tags mode completion table doesn't work with multiple tables frederik
@ 2003-04-26 13:45 ` Richard Stallman
  2003-04-28  7:32   ` Francesco Potorti`
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Stallman @ 2003-04-26 13:45 UTC (permalink / raw)
  Cc: emacs-devel

I am not quite sure how etags.el handles multiple tags tables nowadays.
Will it search for your tag in all of them, or do you have to choose
one with visit-tags-table?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: tags mode completion table doesn't work with multiple tables
  2003-04-26 13:45 ` Richard Stallman
@ 2003-04-28  7:32   ` Francesco Potorti`
  2003-04-29  5:38     ` Richard Stallman
  0 siblings, 1 reply; 5+ messages in thread
From: Francesco Potorti` @ 2003-04-28  7:32 UTC (permalink / raw)
  Cc: emacs-devel

>I am not quite sure how etags.el handles multiple tags tables nowadays.
>Will it search for your tag in all of them, or do you have to choose
>one with visit-tags-table?

I append the docs about this.  In short, you choose one table, but if
one is already chosen, you can add one more to the list.

================================================================

Selecting a Tags Table
----------------------

   Emacs has at any time one "selected" tags table, and all the commands
for working with tags tables use the selected one.  To select a tags
table, type `M-x visit-tags-table', which reads the tags table file
name as an argument.  The name `TAGS' in the default directory is used
as the default file name.

   All this command does is store the file name in the variable
`tags-file-name'.  Emacs does not actually read in the tags table
contents until you try to use them.  Setting this variable yourself is
just as good as using `visit-tags-table'.  The variable's initial value
is `nil'; that value tells all the commands for working with tags tables
that they must ask for a tags table file name to use.

   Using `visit-tags-table' when a tags table is already loaded gives
you a choice: you can add the new tags table to the current list of
tags tables, or start a new list.  The tags commands use all the tags
tables in the current list.  If you start a new list, the new tags table
is used _instead_ of others.  If you add the new table to the current
list, it is used _as well as_ the others.  When the tags commands scan
the list of tags tables, they don't always start at the beginning of
the list; they start with the first tags table (if any) that describes
the current file, proceed from there to the end of the list, and then
scan from the beginning of the list until they have covered all the
tables in the list.

   You can specify a precise list of tags tables by setting the variable
`tags-table-list' to a list of strings, like this:

     (setq tags-table-list
           '("~/emacs" "/usr/local/lib/emacs/src"))

This tells the tags commands to look at the `TAGS' files in your
`~/emacs' directory and in the `/usr/local/lib/emacs/src' directory.
The order depends on which file you are in and which tags table
mentions that file, as explained above.

   Do not set both `tags-file-name' and `tags-table-list'.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: tags mode completion table doesn't work with multiple tables
  2003-04-28  7:32   ` Francesco Potorti`
@ 2003-04-29  5:38     ` Richard Stallman
  2003-04-29 10:15       ` Francesco Potorti`
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Stallman @ 2003-04-29  5:38 UTC (permalink / raw)
  Cc: emacs-devel

    >I am not quite sure how etags.el handles multiple tags tables nowadays.
    >Will it search for your tag in all of them, or do you have to choose
    >one with visit-tags-table?

    I append the docs about this.  In short, you choose one table, but if
    one is already chosen, you can add one more to the list.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: tags mode completion table doesn't work with multiple tables
  2003-04-29  5:38     ` Richard Stallman
@ 2003-04-29 10:15       ` Francesco Potorti`
  0 siblings, 0 replies; 5+ messages in thread
From: Francesco Potorti` @ 2003-04-29 10:15 UTC (permalink / raw)
  Cc: emacs-devel

>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)))))

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-04-29 10:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-25 22:18 tags mode completion table doesn't work with multiple tables frederik
2003-04-26 13:45 ` Richard Stallman
2003-04-28  7:32   ` Francesco Potorti`
2003-04-29  5:38     ` Richard Stallman
2003-04-29 10:15       ` Francesco Potorti`

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.