[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: log-view-current-tag doesn't return SCCS revision
From: |
Kevin Rodgers |
Subject: |
Re: log-view-current-tag doesn't return SCCS revision |
Date: |
Thu, 26 Jun 2003 16:38:26 -0600 |
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))))))
--
<a href="mailto:<kevin.rodgers@ihs.com>">Kevin Rodgers</a>