From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#24801: 25.1; Reverse regexp search highlighting Date: Wed, 26 Oct 2016 18:42:20 -0400 Message-ID: <8737jispf7.fsf@users.sourceforge.net> References: <4efa49bf-c223-4148-a291-12a722db033c@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1477521758 8447 195.159.176.226 (26 Oct 2016 22:42:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 26 Oct 2016 22:42:38 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: 24801@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 27 00:42:34 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bzWtf-0007Aq-9x for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 Oct 2016 00:42:11 +0200 Original-Received: from localhost ([::1]:37907 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzWtg-00051j-S6 for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Oct 2016 18:42:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzWta-00051T-Uz for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2016 18:42:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bzWtW-0001PC-Ul for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2016 18:42:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42567) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bzWtW-0001P4-R9 for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2016 18:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bzWtW-0003sE-Gk for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2016 18:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Oct 2016 22:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24801 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24801-submit@debbugs.gnu.org id=B24801.147752170914867 (code B ref 24801); Wed, 26 Oct 2016 22:42:02 +0000 Original-Received: (at 24801) by debbugs.gnu.org; 26 Oct 2016 22:41:49 +0000 Original-Received: from localhost ([127.0.0.1]:57966 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bzWtI-0003rj-QG for submit@debbugs.gnu.org; Wed, 26 Oct 2016 18:41:49 -0400 Original-Received: from mail-yw0-f179.google.com ([209.85.161.179]:33029) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bzWtH-0003rW-9w for 24801@debbugs.gnu.org; Wed, 26 Oct 2016 18:41:47 -0400 Original-Received: by mail-yw0-f179.google.com with SMTP id p22so9261867ywe.0 for <24801@debbugs.gnu.org>; Wed, 26 Oct 2016 15:41:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=+aMf4B/XII+9f+pEe8XIz8/DH/tBb119KQ4CRqs//3c=; b=MmwPCA56B0uNpvUOmAsp4hbl+EjlwI84MHoSeb79yEFvCRFYc9aQYVQV+sNUxxHGqQ 5+rLoe6AjS6rG1PuG4rhOWSJQKQZEVXWui7e1G0l4okQHqXopefyjwZ7QUrFT8MBN7kN OW6/9Wu9g5FfiMKsMTD9aXtZaljP75QEHGzSMZOgvpe06qGJSYwWwMsNPcDPTvHaIKPG O4Nng1lnR95IcbUYyUHXhy8CHGe/b+0rHERy5CIHN2pEqj2gB9vlHh7Mo8TN6QYeowyy t6sTGhmF8lJBA4WAWd3FE23wP2qdHP+pvIgp7+fQTE4pQST2i70exIY71tPzZueEUz2B 8Slg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=+aMf4B/XII+9f+pEe8XIz8/DH/tBb119KQ4CRqs//3c=; b=TDgwA/pe1qzu2AKMgUofwKxwkR95PAa4kSWDCkXLuv5uv0MCt7WYz/gaoAm5LD/nXR +Rg7jEvnz+kATa04A/+k4MwkygFTHAaotf9uM7NdecW62KJvxp59eFomCbUFaE46PmoJ lQ1N8NiETo1IXDFO5BO5pAMQan/BxwLrE3PHRib3g8EqPpaoPaa2KS8LDnCVkDDETPWA mC3CUhmEUtysktiklINGbD5oCPsgaRPMazZYeAAoTl8C85j1SUReOpzXfw6Wy1Jjn1ba Ms8LbMMU7moooXNW3tbqUOWdAHu5a31uOzbtFfGyoSLLvnB9bST13YUaS273vKy2yVnd EJIA== X-Gm-Message-State: ABUngvczEmCZ/M/ppPSVgNd62wjJ6PG6QZaSGHjFJcZoOHYHWTb3VnBGSMIgCh37JFARpw== X-Received: by 10.36.115.6 with SMTP id y6mr8310726itb.77.1477521701695; Wed, 26 Oct 2016 15:41:41 -0700 (PDT) Original-Received: from zony ([45.2.7.130]) by smtp.googlemail.com with ESMTPSA id j98sm1823758ioo.11.2016.10.26.15.41.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Oct 2016 15:41:41 -0700 (PDT) In-Reply-To: <4efa49bf-c223-4148-a291-12a722db033c@default> (Drew Adams's message of "Wed, 26 Oct 2016 09:24:02 -0700 (PDT)") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:125054 Archived-At: Drew Adams writes: > emacs -Q > > Visit the attached file in text mode. > > `C-M-s aa.*' and repeat. highlighting seems fine, and search moves > forward with one search hit per line, with that search hit including all > of the consecutive a's in the line. > > `C-M-r' and repeat (same search pattern). Search hits are just _pairs_ > of consecutive a's (so more than one hit per line), and lines that have > an odd number of consecutive a's do not include the first a in a search > hit. > > This seems wrong. Am I missing something, or is this a bug? > > I see this behavior in Emacs 23 and later, but not in Emacs 22 and > before, so I'm guessing this change is maybe intentional. But it's not > clear to me why it would be. `(elisp) Regexp Search', under `re-search-backward' says: This function is analogous to `re-search-forward', but they are not simple mirror images. `re-search-forward' finds the match whose beginning is as close as possible to the starting point. If `re-search-backward' were a perfect mirror image, it would find the match whose end is as close as possible. However, in fact it finds the match whose beginning is as close as possible (and yet ends before the starting point). The reason for this is that matching a regular expression at a given spot always works from beginning to end, and starts at a specified beginning position. A true mirror-image of `re-search-forward' would require a special feature for matching regular expressions from end to beginning. It's not worth the trouble of implementing that. And the texi source says the same at tag emacs-22.1; I've only built Emacs back to 23.4 though, so I can't test it.