diff options
| author | Stefan Monnier | 2007-06-12 18:52:05 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-06-12 18:52:05 +0000 |
| commit | 95588f91ba16f4f74902cf2a95980770d181f7f9 (patch) | |
| tree | 820f9528b990bcf25578bb085a9ad5bf4fbeae0e | |
| parent | c69b0314526d0b618be1af27b8b6330065401e61 (diff) | |
| download | emacs-95588f91ba16f4f74902cf2a95980770d181f7f9.tar.gz emacs-95588f91ba16f4f74902cf2a95980770d181f7f9.zip | |
(log-view-file-re, log-view-message-re): Use \(?1:...\).
(log-view-font-lock-keywords): Simplify.
(log-view-current-file, log-view-current-tag): Simplify.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/log-view.el | 23 |
2 files changed, 16 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index db8fca98edc..11397368f6d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2007-06-12 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * log-view.el (log-view-file-re, log-view-message-re): Use \(?1:...\). | ||
| 4 | (log-view-font-lock-keywords): Simplify. | ||
| 5 | (log-view-current-file, log-view-current-tag): Simplify. | ||
| 6 | |||
| 1 | 2007-06-12 Sam Steingold <sds@gnu.org> | 7 | 2007-06-12 Sam Steingold <sds@gnu.org> |
| 2 | 8 | ||
| 3 | * vc-arch.el (vc-arch-command): Also try "baz" and "bzr". | 9 | * vc-arch.el (vc-arch-command): Also try "baz" and "bzr". |
diff --git a/lisp/log-view.el b/lisp/log-view.el index e4f50c15351..bf029045a8c 100644 --- a/lisp/log-view.el +++ b/lisp/log-view.el | |||
| @@ -129,14 +129,15 @@ | |||
| 129 | (defvar log-view-message-face 'log-view-message) | 129 | (defvar log-view-message-face 'log-view-message) |
| 130 | 130 | ||
| 131 | (defconst log-view-file-re | 131 | (defconst log-view-file-re |
| 132 | (concat "^\\(?:Working file: \\(.+\\)" ;RCS and CVS. | 132 | (concat "^\\(?:Working file: \\(?1:.+\\)" ;RCS and CVS. |
| 133 | "\\|\\(?:SCCS/s\\.\\|Changes to \\)\\(.+\\):" ;SCCS and Darcs. | 133 | ;; Subversion has no such thing?? |
| 134 | "\\|\\(?:SCCS/s\\.\\|Changes to \\)\\(?1:.+\\):" ;SCCS and Darcs. | ||
| 134 | "\\)\n")) ;Include the \n for font-lock reasons. | 135 | "\\)\n")) ;Include the \n for font-lock reasons. |
| 135 | 136 | ||
| 136 | (defconst log-view-message-re | 137 | (defconst log-view-message-re |
| 137 | (concat "^\\(?:revision \\([.0-9]+\\)\\(?:\t.*\\)?" ; RCS and CVS. | 138 | (concat "^\\(?:revision \\(?1:[.0-9]+\\)\\(?:\t.*\\)?" ; RCS and CVS. |
| 138 | "\\|r\\([0-9]+\\) | .* | .*" ; Subversion. | 139 | "\\|r\\(?1:[0-9]+\\) | .* | .*" ; Subversion. |
| 139 | "\\|D \\([.0-9]+\\) .*" ; SCCS. | 140 | "\\|D \\(?1:[.0-9]+\\) .*" ; SCCS. |
| 140 | ;; Darcs doesn't have revision names. VC-darcs uses patch names | 141 | ;; Darcs doesn't have revision names. VC-darcs uses patch names |
| 141 | ;; instead. Darcs patch names are hashcodes, which do not appear | 142 | ;; instead. Darcs patch names are hashcodes, which do not appear |
| 142 | ;; in the log output :-(, but darcs accepts any prefix of the log | 143 | ;; in the log output :-(, but darcs accepts any prefix of the log |
| @@ -145,13 +146,12 @@ | |||
| 145 | ;; First loosely match the date format. | 146 | ;; First loosely match the date format. |
| 146 | (concat "\\|[^ \n].*[^0-9\n][0-9][0-9]:[0-9][0-9][^0-9\n].*[^ \n]" | 147 | (concat "\\|[^ \n].*[^0-9\n][0-9][0-9]:[0-9][0-9][^0-9\n].*[^ \n]" |
| 147 | ;;Email of user and finally Msg, used as revision name. | 148 | ;;Email of user and finally Msg, used as revision name. |
| 148 | " .*@.*\n\\(?: \\* \\(.*\\)\\)?") | 149 | " .*@.*\n\\(?: \\* \\(?1:.*\\)\\)?") |
| 149 | "\\)$")) | 150 | "\\)$")) |
| 150 | 151 | ||
| 151 | (defconst log-view-font-lock-keywords | 152 | (defconst log-view-font-lock-keywords |
| 152 | `((,log-view-file-re | 153 | `((,log-view-file-re |
| 153 | (1 (if (boundp 'cvs-filename-face) cvs-filename-face) nil t) | 154 | (1 (if (boundp 'cvs-filename-face) cvs-filename-face)) |
| 154 | (2 (if (boundp 'cvs-filename-face) cvs-filename-face) nil t) | ||
| 155 | (0 log-view-file-face append)) | 155 | (0 log-view-file-face append)) |
| 156 | (,log-view-message-re . log-view-message-face))) | 156 | (,log-view-message-re . log-view-message-face))) |
| 157 | (defconst log-view-font-lock-defaults | 157 | (defconst log-view-font-lock-defaults |
| @@ -194,7 +194,7 @@ | |||
| 194 | (forward-line 1) | 194 | (forward-line 1) |
| 195 | (or (re-search-backward log-view-file-re nil t) | 195 | (or (re-search-backward log-view-file-re nil t) |
| 196 | (re-search-forward log-view-file-re)) | 196 | (re-search-forward log-view-file-re)) |
| 197 | (let* ((file (or (match-string 1) (match-string 2))) | 197 | (let* ((file (match-string 1)) |
| 198 | (cvsdir (and (re-search-backward log-view-dir-re nil t) | 198 | (cvsdir (and (re-search-backward log-view-dir-re nil t) |
| 199 | (match-string 1))) | 199 | (match-string 1))) |
| 200 | (pcldir (and (boundp 'cvs-pcl-cvs-dirchange-re) | 200 | (pcldir (and (boundp 'cvs-pcl-cvs-dirchange-re) |
| @@ -212,10 +212,7 @@ | |||
| 212 | (forward-line 1) | 212 | (forward-line 1) |
| 213 | (let ((pt (point))) | 213 | (let ((pt (point))) |
| 214 | (when (re-search-backward log-view-message-re nil t) | 214 | (when (re-search-backward log-view-message-re nil t) |
| 215 | (let (rev) | 215 | (let ((rev (match-string 1))) |
| 216 | ;; Find the subgroup that matched. | ||
| 217 | (dotimes (i (/ (length (match-data 'integers)) 2)) | ||
| 218 | (setq rev (or rev (match-string (1+ i))))) | ||
| 219 | (unless (re-search-forward log-view-file-re pt t) | 216 | (unless (re-search-forward log-view-file-re pt t) |
| 220 | rev)))))) | 217 | rev)))))) |
| 221 | 218 | ||