Subject: bug#21167: closed (Re: bug#21167: 24.5; tags-search should ignore buffer restriction)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 01 Aug 2015 11:44:02 +0000

Your bug report

#21167: 24.5; tags-search should ignore buffer restriction

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
21167: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21167
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#21167: 24.5; tags-search should ignore buffer restriction
From: Dmitry Gutov <[email-masked]>
To: phs <[email-masked]>, [email-masked]
Date: Sat, 1 Aug 2015 14:43:10 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 25.1

On 07/31/2015 12:43 PM, phs wrote:

> I call this a bug. E.g., it can cause a global renaming of variables
> miss some occurrences. It seems that a minimal fix is for tags-search to
> warn the user that the buffer has been narrowed and offer to widen for
> the search (and maybe reinstall the restriction after the search???).

Thanks for the report. This is now performed automatically, without 
warning, in tags-loop-continue.

Subject: 24.5; tags-search should ignore buffer restriction
From: phs <[email-masked]>
To: [email-masked]
Date: Fri, 31 Jul 2015 11:43:39 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Description: tags-search when going through all files listed in the 
current tags table, tags-search searches inside existing buffers for 
files that are currently visited (this is where the latest version can 
be found).

But when the visiting buffer has been restricted by a narrow-to-region, 
tags-search will not look outside the narrowed-to scope.

I call this a bug. E.g., it can cause a global renaming of variables 
miss some occurrences. It seems that a minimal fix is for tags-search to 
warn the user that the buffer has been narrowed and offer to widen for 
the search (and maybe reinstall the restriction after the search???).

I looked at the source code. It appears that the problem is located 
within function next-file (in progmodes/etags.el). When it is found that 
there already is a buffer visiting the file to be searched for tags, 
next-file just uses it without checking for restrictions.

BTW, I don't understand why next-file passes the novisit flag to find-file?

-- 
Philippe SCHNOEBELEN,       	                  www.lsv.ens-cachan.fr/~phs
LSV, CNRS UMR 8643 & ENS de Cachan   		  Tel: (+33/0) 147 407 530
"Algebraic symbols are used when you do not know what you are talking about"