From unknown Mon Jun 23 10:34:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21167: 24.5; tags-search should ignore buffer restriction Resent-From: phs Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 31 Jul 2015 15:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 21167 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 21167@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.143835626524192 (code B ref -1); Fri, 31 Jul 2015 15:25:02 +0000 Received: (at submit) by debbugs.gnu.org; 31 Jul 2015 15:24:25 +0000 Received: from localhost ([127.0.0.1]:35945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZLCAb-0006I7-0K for submit@debbugs.gnu.org; Fri, 31 Jul 2015 11:24:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50534) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZL7Dk-0005nt-Cj for submit@debbugs.gnu.org; Fri, 31 Jul 2015 06:07:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZL7De-0001WK-VQ for submit@debbugs.gnu.org; Fri, 31 Jul 2015 06:07:20 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:51559) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZL7De-0001WG-SW for submit@debbugs.gnu.org; Fri, 31 Jul 2015 06:07:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZL7DZ-0004id-OQ for bug-gnu-emacs@gnu.org; Fri, 31 Jul 2015 06:07:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZL7DU-0001Tb-La for bug-gnu-emacs@gnu.org; Fri, 31 Jul 2015 06:07:09 -0400 Received: from olive.lsv.fr ([138.231.81.248]:47817 helo=olive.lsv.ens-cachan.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZL7DU-0001Gc-Fk for bug-gnu-emacs@gnu.org; Fri, 31 Jul 2015 06:07:04 -0400 Received: from phs-air-2.local (gwvisitors.lsv.fr [138.231.81.8]) by olive.lsv.ens-cachan.fr (Postfix) with ESMTP id 6F1004C01A4 for ; Fri, 31 Jul 2015 11:43:39 +0200 (CEST) Message-ID: <55BB434B.7020004@lsv.ens-cachan.fr> Date: Fri, 31 Jul 2015 11:43:39 +0200 From: phs User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.0 (----) X-Mailman-Approved-At: Fri, 31 Jul 2015 11:24:24 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) 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" From unknown Mon Jun 23 10:34:09 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: phs Subject: bug#21167: closed (Re: bug#21167: 24.5; tags-search should ignore buffer restriction) Message-ID: References: <55BCB0CE.5000704@yandex.ru> <55BB434B.7020004@lsv.ens-cachan.fr> X-Gnu-PR-Message: they-closed 21167 X-Gnu-PR-Package: emacs Reply-To: 21167@debbugs.gnu.org Date: Sat, 01 Aug 2015 11:44:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1438429442-27328-1" This is a multi-part message in MIME format... ------------=_1438429442-27328-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 21167@debbugs.gnu.org. --=20 21167: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D21167 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1438429442-27328-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 21167-done) by debbugs.gnu.org; 1 Aug 2015 11:43:16 +0000 Received: from localhost ([127.0.0.1]:36306 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZLVC8-00075c-0z for submit@debbugs.gnu.org; Sat, 01 Aug 2015 07:43:16 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:35145) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZLVC6-00075U-5c for 21167-done@debbugs.gnu.org; Sat, 01 Aug 2015 07:43:14 -0400 Received: by wibxm9 with SMTP id xm9so64518517wib.0 for <21167-done@debbugs.gnu.org>; Sat, 01 Aug 2015 04:43:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=8xyObMd6ru32AFB+Wfh+2YCLr2n18sbymK4fRru6zHY=; b=qqDwcwXkXda39eBcQ8veDCB64Gsz0vuEtaedH3g2yZ7RDtRZ7Go9oHPWPQA/BkMhuj rcKU47ngR2Spz9x9wFTkBxYcr3YX7B8QYaVvwdkfoU5v023WbFAk4PzymhiMOZlJcDMX Vi0epec9IMZRCcdZOs+ZUIchNRRwqH125J3vlqv8KgmD0pFpokTLa2rg/XmhoWQ3H/db 5UKedi7aIi1/9bQtCs4Iv5AX+VbeV/0rDVRxvXpz36f2l5zXqM+4cEIMwN+71FxV3lFa wJPV43NeINxvhzI6FwUsZTZChAofTdcUXN75bPDtT66t/PuMf8+sYZdKoh/llPSh6O6s gu9Q== X-Received: by 10.181.13.195 with SMTP id fa3mr15948181wid.7.1438429393549; Sat, 01 Aug 2015 04:43:13 -0700 (PDT) Received: from [192.168.1.2] ([185.105.175.24]) by smtp.googlemail.com with ESMTPSA id c11sm2775664wib.1.2015.08.01.04.43.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 01 Aug 2015 04:43:12 -0700 (PDT) Subject: Re: bug#21167: 24.5; tags-search should ignore buffer restriction To: phs , 21167-done@debbugs.gnu.org References: <55BB434B.7020004@lsv.ens-cachan.fr> From: Dmitry Gutov Message-ID: <55BCB0CE.5000704@yandex.ru> Date: Sat, 1 Aug 2015 14:43:10 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:40.0) Gecko/20100101 Thunderbird/40.0 MIME-Version: 1.0 In-Reply-To: <55BB434B.7020004@lsv.ens-cachan.fr> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 21167-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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. ------------=_1438429442-27328-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 31 Jul 2015 15:24:25 +0000 Received: from localhost ([127.0.0.1]:35945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZLCAb-0006I7-0K for submit@debbugs.gnu.org; Fri, 31 Jul 2015 11:24:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50534) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZL7Dk-0005nt-Cj for submit@debbugs.gnu.org; Fri, 31 Jul 2015 06:07:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZL7De-0001WK-VQ for submit@debbugs.gnu.org; Fri, 31 Jul 2015 06:07:20 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:51559) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZL7De-0001WG-SW for submit@debbugs.gnu.org; Fri, 31 Jul 2015 06:07:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZL7DZ-0004id-OQ for bug-gnu-emacs@gnu.org; Fri, 31 Jul 2015 06:07:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZL7DU-0001Tb-La for bug-gnu-emacs@gnu.org; Fri, 31 Jul 2015 06:07:09 -0400 Received: from olive.lsv.fr ([138.231.81.248]:47817 helo=olive.lsv.ens-cachan.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZL7DU-0001Gc-Fk for bug-gnu-emacs@gnu.org; Fri, 31 Jul 2015 06:07:04 -0400 Received: from phs-air-2.local (gwvisitors.lsv.fr [138.231.81.8]) by olive.lsv.ens-cachan.fr (Postfix) with ESMTP id 6F1004C01A4 for ; Fri, 31 Jul 2015 11:43:39 +0200 (CEST) Message-ID: <55BB434B.7020004@lsv.ens-cachan.fr> Date: Fri, 31 Jul 2015 11:43:39 +0200 From: phs User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: 24.5; tags-search should ignore buffer restriction Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 31 Jul 2015 11:24:24 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) 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" ------------=_1438429442-27328-1--