Subject: bug#21443: 24.5; etags' complete-tag changes the global value of tags-file-name

From: Eli Zaretskii <[email-masked]>
Date: Thu, 10 Sep 2015 22:06:03 +0300

> From: HuangMario <[email-masked]>
> Date: Wed, 09 Sep 2015 21:18:04 +0800
> 
> Step 0. Set the 'tags-file-name' as buffer local to a specified TAGS file, and the global value is nil.
> 
> Step 1. Press M-. to find tags.
> 
> Step 2. Input some characters in the mini-buffer and press the TAB key for completion, then the mini-buffer will display "Making tags completion table for ...done".
> 
> After that, the global value of 'tags-file-name' is set to the same as its local value.
> 
> How can I keep the global value nil ?

According to this doc string:

  (defun visit-tags-table (file &optional local)
    "Tell tags commands to use tags table file FILE.
  FILE should be the name of a file created with the `etags' program.
  A directory name is ok too; it means file TAGS in that directory.

  Normally \\[visit-tags-table] sets the global value of `tags-file-name'.
  With a prefix arg, set the buffer-local value instead.

you are supposed to invoke visit-tags-table manually with a numeric
argument, if you want the local value of tags-file-name set.