From unknown Wed Jun 18 23:05:22 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#8686 <8686@debbugs.gnu.org> To: bug#8686 <8686@debbugs.gnu.org> Subject: Status: 24.0.50; `re-search-backward' does not respect `search-invisible' Reply-To: bug#8686 <8686@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:05:22 +0000 retitle 8686 24.0.50; `re-search-backward' does not respect `search-invisib= le' reassign 8686 emacs submitter 8686 "Drew Adams" severity 8686 wishlist tag 8686 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Tue May 17 18:09:55 2011 Received: (at submit) by debbugs.gnu.org; 17 May 2011 22:09:55 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QMSSh-0003CF-BB for submit@debbugs.gnu.org; Tue, 17 May 2011 18:09:55 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QMSSg-0003C3-3A for submit@debbugs.gnu.org; Tue, 17 May 2011 18:09:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QMSSZ-00051B-KC for submit@debbugs.gnu.org; Tue, 17 May 2011 18:09:48 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:45979) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMSSZ-000517-IA for submit@debbugs.gnu.org; Tue, 17 May 2011 18:09:47 -0400 Received: from eggs.gnu.org ([140.186.70.92]:38600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMSSY-0002Li-Ly for bug-gnu-emacs@gnu.org; Tue, 17 May 2011 18:09:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QMSSX-00050t-Lr for bug-gnu-emacs@gnu.org; Tue, 17 May 2011 18:09:46 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]:33735) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMSSX-00050k-GV for bug-gnu-emacs@gnu.org; Tue, 17 May 2011 18:09:45 -0400 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id p4HM9cn8025147 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 17 May 2011 22:09:39 GMT Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p4HM9bF9018671 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 17 May 2011 22:09:38 GMT Received: from abhmt020.oracle.com (abhmt020.oracle.com [141.146.116.29]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p4HM9W42004554 for ; Tue, 17 May 2011 17:09:32 -0500 Received: from dradamslap1 (/10.159.53.11) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 17 May 2011 15:09:31 -0700 From: "Drew Adams" To: Subject: 24.0.50; `re-search-backward' does not respect `search-invisible' Date: Tue, 17 May 2011 15:09:28 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcwU3xdIojjPmcqjQoWSjIcBuY6d7g== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6090 X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090208.4DD2F224.002C:SCFMA922111,ss=1,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -6.5 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.5 (------) My impression is that `re-search-backward' and `*-forward' do not respect `search-invisible'. This makes it difficult if not impossible to use them in code to not find matches in hidden text. Why would this variable be respected only in the Isearch Lisp code? What am I missing? My use case at the moment is to make Imenu (conditionally) not count definitions that are commented out, by temporarily hiding commented code. I bind `search-invisible' to nil, but that has no effect on `re-search-backward', which is called by the Imenu code (e.g. `imenu--generic-function'). The code finds commented out definitions, in spite of `search-invisible'. In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600) of 2011-05-16 on 3249CTO Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (4.5) --no-opt --cflags -Ic:/build/include' From debbugs-submit-bounces@debbugs.gnu.org Tue May 17 20:05:47 2011 Received: (at 8686) by debbugs.gnu.org; 18 May 2011 00:05:47 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QMUGp-0005jw-C8 for submit@debbugs.gnu.org; Tue, 17 May 2011 20:05:47 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QMUGn-0005jm-Ms for 8686@debbugs.gnu.org; Tue, 17 May 2011 20:05:46 -0400 Received: from 213-159-126-200.fibertel.com.ar ([200.126.159.213]:43284 helo=ceviche.home) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1QMUGh-0000ac-Tz; Tue, 17 May 2011 20:05:40 -0400 Received: by ceviche.home (Postfix, from userid 20848) id E7D8166131; Tue, 17 May 2011 21:05:37 -0300 (ART) From: Stefan Monnier To: "Drew Adams" Subject: Re: bug#8686: 24.0.50; `re-search-backward' does not respect `search-invisible' Message-ID: References: Date: Tue, 17 May 2011 21:05:37 -0300 In-Reply-To: (Drew Adams's message of "Tue, 17 May 2011 15:09:28 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: 8686 Cc: 8686@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) > My impression is that `re-search-backward' and `*-forward' do not > respect `search-invisible'. These are low-level C functions, whereas search-invisible is implemented on top in Elisp and is a Customization variable rather than a variable for use by Elisp code. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue May 17 20:39:05 2011 Received: (at 8686) by debbugs.gnu.org; 18 May 2011 00:39:05 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QMUn3-0006U1-77 for submit@debbugs.gnu.org; Tue, 17 May 2011 20:39:05 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QMUn0-0006TX-I0 for 8686@debbugs.gnu.org; Tue, 17 May 2011 20:39:03 -0400 Received: from rtcsinet21.oracle.com (rtcsinet21.oracle.com [66.248.204.29]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id p4I0cshC005342 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 18 May 2011 00:38:56 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by rtcsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p4I0cr5A020254 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 18 May 2011 00:38:54 GMT Received: from abhmt020.oracle.com (abhmt020.oracle.com [141.146.116.29]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p4I0clTk001813; Tue, 17 May 2011 19:38:47 -0500 Received: from dradamslap1 (/10.159.53.11) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 17 May 2011 17:38:46 -0700 From: "Drew Adams" To: "'Stefan Monnier'" References: Subject: RE: bug#8686: 24.0.50; `re-search-backward' does not respect `search-invisible' Date: Tue, 17 May 2011 17:38:43 -0700 Message-ID: <8820C074BD1742AB9E87538C601A885D@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: AcwU71hqugtCHFn2SpuTKbDYtD7rqwAAwdcQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6090 X-Source-IP: rtcsinet21.oracle.com [66.248.204.29] X-CT-RefId: str=0001.0A090204.4DD31520.00A8:SCFSTAT5015188,ss=1,fgs=0 X-Spam-Score: -6.5 (------) X-Debbugs-Envelope-To: 8686 Cc: 8686@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.5 (------) > > My impression is that `re-search-backward' and `*-forward' do not > > respect `search-invisible'. > > These are low-level C functions, whereas search-invisible is > implemented on top in Elisp and is a Customization variable > rather than a variable for use by Elisp code. Well, yes. In a sense that is precisely what this bug report is about. There should be a simple way in Lisp to direct the search functions to ignore or see hidden text. It should be enough to bind some variable for the relevant context/duration. And BTW, there is already Lisp code that binds `search-invisible' - in isearch.el itself! It is just as kosher for other Lisp code to act similarly. If lazy highlighting can bind it for its own purposes, so can other code that uses or adapts search functions. Also BTW, the variable is named `search-invisible', not `isearch-invisible' (unlike, e.g., `isearch-open-invisible'). Presumably it is not only for incremental search, or even interactive search. Question: What is the simplest way, from Lisp, to get the "low-level C" search functions to optionally respect/ignore hidden text? Should Lisp programmers be required to reproduce the entire invisibility-respecting scaffolding created in isearch.el (or equivalent)? How about having a single, standard infrastructure provided by Emacs? From debbugs-submit-bounces@debbugs.gnu.org Tue May 17 20:51:41 2011 Received: (at 8686) by debbugs.gnu.org; 18 May 2011 00:51:41 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QMUzE-0006kl-PJ for submit@debbugs.gnu.org; Tue, 17 May 2011 20:51:40 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QMUzC-0006kY-B9 for 8686@debbugs.gnu.org; Tue, 17 May 2011 20:51:38 -0400 Received: from 213-159-126-200.fibertel.com.ar ([200.126.159.213]:54270 helo=ceviche.home) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1QMUz6-0005rb-Jx; Tue, 17 May 2011 20:51:32 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 1FC9D66131; Tue, 17 May 2011 21:51:30 -0300 (ART) From: Stefan Monnier To: "Drew Adams" Subject: Re: bug#8686: 24.0.50; `re-search-backward' does not respect `search-invisible' Message-ID: References: <8820C074BD1742AB9E87538C601A885D@us.oracle.com> Date: Tue, 17 May 2011 21:51:30 -0300 In-Reply-To: <8820C074BD1742AB9E87538C601A885D@us.oracle.com> (Drew Adams's message of "Tue, 17 May 2011 17:38:43 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: 8686 Cc: 8686@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) > Question: What is the simplest way, from Lisp, to get the "low-level > C" search functions to optionally respect/ignore hidden text? Something like (while (and (re-search-forward blabla) (invisible-p (point))) ...) The same idea can be used with syntax-ppss to skip over matches that are inside comments/strings. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue May 17 21:15:51 2011 Received: (at 8686) by debbugs.gnu.org; 18 May 2011 01:15:51 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QMVMd-0007Hu-51 for submit@debbugs.gnu.org; Tue, 17 May 2011 21:15:51 -0400 Received: from mail-ey0-f172.google.com ([209.85.215.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QMVMb-0007Hi-Ds for 8686@debbugs.gnu.org; Tue, 17 May 2011 21:15:50 -0400 Received: by eye13 with SMTP id 13so342455eye.3 for <8686@debbugs.gnu.org>; Tue, 17 May 2011 18:15:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=SaU6AoGV5btaDxtGuqW8OOE1YJgE4Xv0YYOaVz6tOsw=; b=DUNxDwKara8bveMg8hzeGJNWMuboxqbPvk+NVGr+qmpYn5P3lADlf0BrTBMAWhnzDa qE//pvNtVnIuv7+jDHX9Sg+AQXceiML44oVMNMByppS9j+luOdLzkIb78yqU24wr3Gpn bGN5GN1tMZEnIn5ujSETkjLuDkEyu68z0vK6Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=AwKkwIooM+pwbgjcT7eqDDIYRchz03w3pw4zyFLvcx/OPL6lbmiuuNDT/rbi13sYMm u8gOhYbQIJRB21KILGmkG73Ux3Ra3TEccMBnZTv36PMqf/NfeJoOvn90k+2+4ldGb62B HJtpy8FXT2ExShDp5tSO43SpMYeLR+M+b/L3A= Received: by 10.213.7.220 with SMTP id e28mr465018ebe.105.1305681343500; Tue, 17 May 2011 18:15:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.213.7.6 with HTTP; Tue, 17 May 2011 18:15:23 -0700 (PDT) In-Reply-To: References: <8820C074BD1742AB9E87538C601A885D@us.oracle.com> From: Lennart Borgman Date: Wed, 18 May 2011 03:15:23 +0200 Message-ID: Subject: Re: bug#8686: 24.0.50; `re-search-backward' does not respect `search-invisible' To: Stefan Monnier Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -3.6 (---) X-Debbugs-Envelope-To: 8686 Cc: 8686@debbugs.gnu.org, Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.6 (---) On Wed, May 18, 2011 at 2:51 AM, Stefan Monnier wrote: >> Question: What is the simplest way, from Lisp, to get the "low-level >> C" search functions to optionally respect/ignore hidden text? > > Something like > > =C2=A0(while (and (re-search-forward blabla) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(invisible-p (point))) > =C2=A0 =C2=A0...) > > The same idea can be used with syntax-ppss to skip over matches that are > inside comments/strings. Maybe implement this as minor modes for isearch, occur etc? From debbugs-submit-bounces@debbugs.gnu.org Tue May 17 22:18:52 2011 Received: (at 8686) by debbugs.gnu.org; 18 May 2011 02:18:52 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QMWLb-0000MH-Hc for submit@debbugs.gnu.org; Tue, 17 May 2011 22:18:52 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QMWLa-0000M6-6W for 8686@debbugs.gnu.org; Tue, 17 May 2011 22:18:50 -0400 Received: from rtcsinet22.oracle.com (rtcsinet22.oracle.com [66.248.204.30]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id p4I2Iffe019867 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 18 May 2011 02:18:43 GMT Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by rtcsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p4I2Ieaw025029 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 18 May 2011 02:18:41 GMT Received: from abhmt001.oracle.com (abhmt001.oracle.com [141.146.116.10]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p4I2IYcQ020945; Tue, 17 May 2011 21:18:35 -0500 Received: from dradamslap1 (/10.159.53.11) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 17 May 2011 19:18:34 -0700 From: "Drew Adams" To: "'Stefan Monnier'" References: <8820C074BD1742AB9E87538C601A885D@us.oracle.com> Subject: RE: bug#8686: 24.0.50; `re-search-backward' does not respect `search-invisible' Date: Tue, 17 May 2011 19:18:31 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: AcwU9cFUP2K1zMDrR6CowpglolUnrQAC6M+w X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6090 X-Source-IP: rtcsinet22.oracle.com [66.248.204.30] X-CT-RefId: str=0001.0A090203.4DD32C84.0035:SCFSTAT5015188,ss=1,fgs=0 X-Spam-Score: -6.5 (------) X-Debbugs-Envelope-To: 8686 Cc: 8686@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.5 (------) > > Question: What is the simplest way, from Lisp, to get the "low-level > > C" search functions to optionally respect/ignore hidden text? > > Something like > > (while (and (re-search-forward blabla) > (invisible-p (point))) > ...) > > The same idea can be used with syntax-ppss to skip over > matches that are inside comments/strings. Yes, but why not have this built into the search functions themselves, just as is done for isearch? That was the point/suggestion. From debbugs-submit-bounces@debbugs.gnu.org Wed May 18 05:57:51 2011 Received: (at 8686) by debbugs.gnu.org; 18 May 2011 09:57:52 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QMdVn-0002y7-74 for submit@debbugs.gnu.org; Wed, 18 May 2011 05:57:51 -0400 Received: from mail-ew0-f44.google.com ([209.85.215.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QMdVl-0002xv-9y for 8686@debbugs.gnu.org; Wed, 18 May 2011 05:57:49 -0400 Received: by ewy19 with SMTP id 19so440810ewy.3 for <8686@debbugs.gnu.org>; Wed, 18 May 2011 02:57:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=g4pYw77n0RstO+eXft4uc07RiC0MxuShzDAo5kiv0U4=; b=pC9RGn3taChhvgqkeWdMnVOy6CnmAqc4YJZsSA2O9fceGcMMBDRC1p9PyZubVxceRr PckHulM25Jpjiw+8r33bXeTR2JoEyp8rnbPeQn3BBKiDP+P+A+fJ5q97POMwNnDA0S0F TGnO/Xy+Tec667mj8NbaSvt1ryanp+YHs7ipM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=hjLvHH9hBR7BXACw9Bm7aQbTxwcinQgXJQHQYTuoi7nOVP8gi7aqkZoR1BiZaCru3U TBC41lDmK+mVEPcaXFA/+RmfI1BEv8icwlZM5YQX6O1OXjLgrnEbh5O/eeESLyMOno7/ uas/202H1ghudcXenKPLS6I5GXrgx2ig8iHYc= Received: by 10.213.107.147 with SMTP id b19mr624587ebp.143.1305712663319; Wed, 18 May 2011 02:57:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.213.7.6 with HTTP; Wed, 18 May 2011 02:57:23 -0700 (PDT) In-Reply-To: References: <8820C074BD1742AB9E87538C601A885D@us.oracle.com> From: Lennart Borgman Date: Wed, 18 May 2011 11:57:23 +0200 Message-ID: Subject: Re: bug#8686: 24.0.50; `re-search-backward' does not respect `search-invisible' To: Drew Adams Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -3.6 (---) X-Debbugs-Envelope-To: 8686 Cc: Stefan Monnier , 8686@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.6 (---) On Wed, May 18, 2011 at 4:18 AM, Drew Adams wrote: >> > Question: What is the simplest way, from Lisp, to get the "low-level >> > C" search functions to optionally respect/ignore hidden text? >> >> Something like >> >> =C2=A0 (while (and (re-search-forward blabla) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (invisible-p (point))) >> =C2=A0 =C2=A0 ...) >> >> The same idea can be used with syntax-ppss to skip over >> matches that are inside comments/strings. > > Yes, but why not have this built into the search functions themselves, ju= st as > is done for isearch? =C2=A0That was the point/suggestion. Which also was the point of my suggestions... From debbugs-submit-bounces@debbugs.gnu.org Wed May 18 08:13:39 2011 Received: (at 8686) by debbugs.gnu.org; 18 May 2011 12:13:39 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QMfdC-00072E-FK for submit@debbugs.gnu.org; Wed, 18 May 2011 08:13:39 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QMfdB-000723-FR for 8686@debbugs.gnu.org; Wed, 18 May 2011 08:13:38 -0400 Received: from 213-159-126-200.fibertel.com.ar ([200.126.159.213]:53694 helo=ceviche.home) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1QMfd5-0001lp-U2; Wed, 18 May 2011 08:13:32 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 46ADC66131; Wed, 18 May 2011 09:13:28 -0300 (ART) From: Stefan Monnier To: "Drew Adams" Subject: Re: bug#8686: 24.0.50; `re-search-backward' does not respect `search-invisible' Message-ID: References: <8820C074BD1742AB9E87538C601A885D@us.oracle.com> Date: Wed, 18 May 2011 09:13:28 -0300 In-Reply-To: (Drew Adams's message of "Tue, 17 May 2011 19:18:31 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: 8686 Cc: 8686@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) >> > Question: What is the simplest way, from Lisp, to get the "low-level >> > C" search functions to optionally respect/ignore hidden text? >> >> Something like >> >> (while (and (re-search-forward blabla) >> (invisible-p (point))) >> ...) >> >> The same idea can be used with syntax-ppss to skip over >> matches that are inside comments/strings. > Yes, but why not have this built into the search functions themselves, > just as is done for isearch? Because I'd rather that the low-level functions do one thing and one thing well. Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed May 18 09:12:33 2011 Received: (at 8686) by debbugs.gnu.org; 18 May 2011 13:12:33 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QMgYD-0008Uh-0P for submit@debbugs.gnu.org; Wed, 18 May 2011 09:12:33 -0400 Received: from mail-ey0-f172.google.com ([209.85.215.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QMgYA-0008UP-6I for 8686@debbugs.gnu.org; Wed, 18 May 2011 09:12:30 -0400 Received: by eye13 with SMTP id 13so491405eye.3 for <8686@debbugs.gnu.org>; Wed, 18 May 2011 06:12:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=G+ryZhcrmlVeI9DttSKbQxPzixHeZVkYOrpLdbFrIF0=; b=FGfIYyOU3iREEC/BOLzDdxzpoffGeGgazDSx7Kpu1E55Unu9E7m8ETgVDYUCK38VbL Ch5y82WNLAPaozXsidFHNVlqlR2J6iY9P7+Lp1a9oQRNFGM0mzT4Jt7P/rqL9HLQKwLU eTtAw2rmuKO6UA5GIMyUSGkPegvyEoMRrRqEQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=AseCeH303GwNrtCCNa7WQ7/yRsMrz+X3KJ7DefvBAfahCKXxTQjVDzlvwIFk98KCMV VLg4bGu2gc+9uFobWvtOorQkDUhpIVMSOFb+oN3PIYTG+arledI7d5be0+4axQt2OxoD Q9NBSRu3cupmWnRT3kicETylgQdvKTf86gV84= Received: by 10.213.106.200 with SMTP id y8mr666001ebo.67.1305724344142; Wed, 18 May 2011 06:12:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.213.7.6 with HTTP; Wed, 18 May 2011 06:12:04 -0700 (PDT) In-Reply-To: References: <8820C074BD1742AB9E87538C601A885D@us.oracle.com> From: Lennart Borgman Date: Wed, 18 May 2011 15:12:04 +0200 Message-ID: Subject: Re: bug#8686: 24.0.50; `re-search-backward' does not respect `search-invisible' To: Stefan Monnier Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -3.6 (---) X-Debbugs-Envelope-To: 8686 Cc: 8686@debbugs.gnu.org, Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.6 (---) On Wed, May 18, 2011 at 2:13 PM, Stefan Monnier wrote: >>> > Question: What is the simplest way, from Lisp, to get the "low-level >>> > C" search functions to optionally respect/ignore hidden text? >>> >>> Something like >>> >>> (while (and (re-search-forward blabla) >>> (invisible-p (point))) >>> ...) >>> >>> The same idea can be used with syntax-ppss to skip over >>> matches that are inside comments/strings. > >> Yes, but why not have this built into the search functions themselves, >> just as is done for isearch? > > Because I'd rather that the low-level functions do one thing and one > thing well. (Of course my suggestion with minor modes was not for the low level functions.) From debbugs-submit-bounces@debbugs.gnu.org Wed May 18 10:32:23 2011 Received: (at 8686) by debbugs.gnu.org; 18 May 2011 14:32:23 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QMhnT-00025K-7C for submit@debbugs.gnu.org; Wed, 18 May 2011 10:32:23 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QMhnQ-000253-Fd for 8686@debbugs.gnu.org; Wed, 18 May 2011 10:32:21 -0400 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id p4IEWCvt022484 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 18 May 2011 14:32:14 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p4IEWBFe016726 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 18 May 2011 14:32:12 GMT Received: from abhmt013.oracle.com (abhmt013.oracle.com [141.146.116.22]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p4IEW6IB026178; Wed, 18 May 2011 09:32:06 -0500 Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 18 May 2011 07:32:05 -0700 From: "Drew Adams" To: "'Stefan Monnier'" References: <8820C074BD1742AB9E87538C601A885D@us.oracle.com> Subject: RE: bug#8686: 24.0.50; `re-search-backward' does not respect `search-invisible' Date: Wed, 18 May 2011 07:32:04 -0700 Message-ID: <8DBD557E665A462A9E36E735F9AF446D@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: AcwVVQb0BfFnHvxMTOWqnDUJu92bAAAEuCog X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6090 X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090209.4DD3D86E.00DE:SCFMA922111,ss=1,fgs=0 X-Spam-Score: -6.5 (------) X-Debbugs-Envelope-To: 8686 Cc: 8686@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.5 (------) > >> The same idea can be used with syntax-ppss to skip over > >> matches that are inside comments/strings. > > > Yes, but why not have this built into the search functions > > themselves, just as is done for isearch? > > Because I'd rather that the low-level functions do one thing and one > thing well. Sure. Define `re-search-forward' & compagnie in Lisp. Have them call C functions that each do one simple thing well. That way, existing code that uses these long-standing functions can benefit from this feature (or can ignore it) just by binding a variable. From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 28 06:48:18 2016 Received: (at 8686) by debbugs.gnu.org; 28 Apr 2016 10:48:18 +0000 Received: from localhost ([127.0.0.1]:51277 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1avjUY-0003VC-CO for submit@debbugs.gnu.org; Thu, 28 Apr 2016 06:48:18 -0400 Received: from hermes.netfonds.no ([80.91.224.195]:35098) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1avjUX-0003V3-7R for 8686@debbugs.gnu.org; Thu, 28 Apr 2016 06:48:17 -0400 Received: from cm-84.215.1.64.getinternet.no ([84.215.1.64] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1avjUM-0000wq-Mf; Thu, 28 Apr 2016 12:48:11 +0200 From: Lars Ingebrigtsen To: "Drew Adams" Subject: Re: bug#8686: 24.0.50; `re-search-backward' does not respect `search-invisible' References: Date: Thu, 28 Apr 2016 12:48:05 +0200 In-Reply-To: (Drew Adams's message of "Tue, 17 May 2011 15:09:28 -0700") Message-ID: <87k2jiovq2.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 8686 Cc: 8686@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.0 (/) "Drew Adams" writes: > My impression is that `re-search-backward' and `*-forward' do not > respect `search-invisible'. This makes it difficult if not impossible > to use them in code to not find matches in hidden text. Why would this > variable be respected only in the Isearch Lisp code? What am I missing? Well, `search-invisible' is documented as only applying to interactive searches: ---- search-invisible is a variable defined in =91isearch.el=92. Its value is =91open=92 Documentation: If t incremental search/query-replace can match hidden text. A nil value means don=92t match invisible text. ---- If you want code not to match invisible text, you have to make your code check for the visibility. Closing. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 28 06:48:21 2016 Received: (at control) by debbugs.gnu.org; 28 Apr 2016 10:48:21 +0000 Received: from localhost ([127.0.0.1]:51280 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1avjUb-0003VS-IX for submit@debbugs.gnu.org; Thu, 28 Apr 2016 06:48:21 -0400 Received: from hermes.netfonds.no ([80.91.224.195]:35100) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1avjUa-0003VK-2q for control@debbugs.gnu.org; Thu, 28 Apr 2016 06:48:20 -0400 Received: from cm-84.215.1.64.getinternet.no ([84.215.1.64] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1avjUT-0000xT-L9 for control@debbugs.gnu.org; Thu, 28 Apr 2016 12:48:15 +0200 Date: Thu, 28 Apr 2016 12:48:13 +0200 Message-Id: <87inz2ovpu.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #8686 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.0 (/) tags 8686 notabug close 8686 From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 28 09:52:05 2016 Received: (at 8686) by debbugs.gnu.org; 28 Apr 2016 13:52:05 +0000 Received: from localhost ([127.0.0.1]:51721 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1avmMP-0006HU-Ba for submit@debbugs.gnu.org; Thu, 28 Apr 2016 09:52:05 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:48073) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1avmMN-0006Gz-D9 for 8686@debbugs.gnu.org; Thu, 28 Apr 2016 09:52:03 -0400 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u3SDpuR2018951 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 28 Apr 2016 13:51:57 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u3SDpsSB020938 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 28 Apr 2016 13:51:56 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u3SDprNR020449; Thu, 28 Apr 2016 13:51:53 GMT MIME-Version: 1.0 Message-ID: Date: Thu, 28 Apr 2016 06:51:51 -0700 (PDT) From: Drew Adams To: Lars Ingebrigtsen Subject: RE: bug#8686: 24.0.50; `re-search-backward' does not respect `search-invisible' References: <87k2jiovq2.fsf@gnus.org> In-Reply-To: <87k2jiovq2.fsf@gnus.org> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6744.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Spam-Score: -3.3 (---) X-Debbugs-Envelope-To: 8686 Cc: 8686@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -3.3 (---) > > My impression is that `re-search-backward' and `*-forward' do not > > respect `search-invisible'. This makes it difficult if not impossible > > to use them in code to not find matches in hidden text. Why would this > > variable be respected only in the Isearch Lisp code? What am I missing= ? >=20 > Well, `search-invisible' is documented as only applying to interactive > searches: >=20 > ---- >=20 > search-invisible is a variable defined in 'isearch.el'. > Its value is 'open' >=20 > Documentation: > If t incremental search/query-replace can match hidden text. > A nil value means don't match invisible text. >=20 > ---- >=20 > If you want code not to match invisible text, you have to make your code > check for the visibility. Closing. I don't think this is correct. Did you check whether it truly works only for interactive use? It is a general test, used in multiple places now (including `perform-replace'). From unknown Wed Jun 18 23:05:22 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 27 May 2016 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator