From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs Subject: Re: log-view-current-tag doesn't return SCCS revision Date: Thu, 26 Jun 2003 16:38:26 -0600 Organization: Information Handling Services, Electronic Systems Development Sender: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <16123.30178.476540.238460@ihs.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1056667743 10945 80.91.224.249 (26 Jun 2003 22:49:03 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 26 Jun 2003 22:49:03 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 27 00:49:00 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19VfX4-0002l1-00 for ; Fri, 27 Jun 2003 00:47:58 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19VfVR-0001NN-IV for gnu-bug-gnu-emacs@m.gmane.org; Thu, 26 Jun 2003 18:46:17 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19VfUW-00014t-TD for bug-gnu-emacs@gnu.org; Thu, 26 Jun 2003 18:45:20 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19VfT2-0000HT-OJ for bug-gnu-emacs@gnu.org; Thu, 26 Jun 2003 18:43:49 -0400 Original-Received: from mail1.ihs.com ([170.207.70.222]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19VfNN-0006N7-BV for bug-gnu-emacs@gnu.org; Thu, 26 Jun 2003 18:37:57 -0400 Original-Received: from briard.ihs.com (esd80.ihs.com [170.207.51.80]) by mail1.ihs.com (8.12.9/8.12.9) with SMTP id h5QMbKg2016878 for ; Thu, 26 Jun 2003 16:37:20 -0600 (MDT) Original-To: bug-gnu-emacs@gnu.org Original-Newsgroups: gnu.emacs.bug In-Reply-To: X-Mailer: VM 7.15 under Emacs 19.34.3 X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:5406 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:5406 I wrote: >>From log-view.el: > > ;; In RCS, a locked revision will look like "revision N.M\tlocked by: FOO". > (defconst log-view-message-re "^\\(revision \\([.0-9]+\\)\\(?:\t.*\\)?\\|rev \\([0-9]+\\): .*\\|D \\([.0-9]+\\) .*\\)$") > > Obviously, the revision may be matched by subexpression 2, 4 (not 3), or > 5 (for SCCS): Oops, I wasn't aware of this (from emacs-21.3/etc/NEWS): | * Lisp changes in Emacs 21.1 (see following page for display-related features) | ... | ** Regular expressions now support intervals \{n,m\} as well as | Perl's shy-groups \(?:...\) and non-greedy *? +? and ?? operators. and this (from emacs-21.3/man/search.texi): | `\(?: ... \)' | specifies a "shy" group that does not record the matched substring; | you can't refer back to it with `\D'. This is useful in | mechanically combining regular expressions, so that you can add | groups for syntactic purposes without interfering with the | numbering of the groups that were written by the user. I'd wondered why (match-string 4) returned the SCCS version but (match-string 5) still returned nil. So the correct patch is: *** emacs-21.3/lisp/log-view.el.orig Mon Jan 20 04:03:30 2003 --- emacs-21.3/lisp/log-view.el Thu Jun 26 16:35:43 2003 *************** *** 144,150 **** (forward-line 1) (let ((pt (point))) (when (re-search-backward log-view-message-re nil t) ! (let ((rev (or (match-string 2) (match-string 3)))) (unless (re-search-forward log-view-file-re pt t) rev)))))) --- 144,150 ---- (forward-line 1) (let ((pt (point))) (when (re-search-backward log-view-message-re nil t) ! (let ((rev (or (match-string 2) (match-string 3) (match-string 4)))) (unless (re-search-forward log-view-file-re pt t) rev)))))) -- Kevin Rodgers