From aa230d94e5c9b99020740d2d36432e8a2b81789e Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 20 Dec 2005 21:58:14 +0000 Subject: [PATCH] (log-view-file-re, log-view-message-re): Use shy groups. (log-view-font-lock-keywords): Ajust subgroup numbers. (log-view-current-tag): Don't hard code the number of subgroups. --- lisp/ChangeLog | 21 ++++++++++-------- lisp/log-view.el | 55 +++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 57 insertions(+), 19 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b601cd036f1..b3b1757b2e4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2005-12-20 Stefan Monnier + + * log-view.el (log-view-file-re, log-view-message-re): Use shy groups. + (log-view-font-lock-keywords): Ajust subgroup numbers. + (log-view-current-tag): Don't hard code the number of subgroups. + 2005-12-20 Juri Linkov * tooltip.el (tooltip): Move defgroup before define-minor-mode. @@ -29,8 +35,7 @@ (org-set-tags): Efficiency improvements. (org-auto-align-tags): New option. (org-todo, org-demote, org-promote): Realign tags. - (org-tags-completion-function): Use also "&" and "|" as - separators. + (org-tags-completion-function): Use also "&" and "|" as separators. (org-org-menu): Agenda commands simplified. 2005-12-19 Luc Teirlinck @@ -7292,7 +7297,7 @@ 2005-08-26 Kim F. Storm * subr.el (version-list-<, version-list-<=, version-list-=): - Renamed from integer-list-*. + Rename from integer-list-*. (version-list-not-zero): Likewise. Fix while loop. (version=): Use version-list-= instead of string-equal. @@ -12439,8 +12444,7 @@ (multiple-value-bind, multiple-value-setq, shiftf): Improve argument/docstring consistency. - * subr.el (focus-frame, unfocus-frame): - Revert deletion on 2005-05-01. + * subr.el (focus-frame, unfocus-frame): Revert deletion on 2005-05-01. 2005-05-22 Andre Spiegel @@ -12573,8 +12577,7 @@ (subst-if-not, nsubst, nsubst-if, nsubst-if-not, sublis) (nsublis, tree-equal): Improve argument/docstring consistency. - * subr.el (send-string, send-region): - Remove obsolescence declaration. + * subr.el (send-string, send-region): Remove obsolescence declaration. (window-dot, set-window-dot, read-input, show-buffer) (eval-current-buffer, string-to-int): Add release number to obsolescence declarations. @@ -12651,8 +12654,8 @@ * emacs-lisp/byte-run.el (eval-when-compile): Doc fix. * emacs-lisp/bytecomp.el - (byte-compile-file-form-custom-declare-variable): Call - byte-compile-nogroup-warn if appropriate. + (byte-compile-file-form-custom-declare-variable): + Call byte-compile-nogroup-warn if appropriate. * progmodes/compile.el (compilation-finish-function): Mark obsolete. (compilation-set-window): Don't call left-fringe-p; do it directly. diff --git a/lisp/log-view.el b/lisp/log-view.el index 6a9464005fb..9249531129b 100644 --- a/lisp/log-view.el +++ b/lisp/log-view.el @@ -25,11 +25,36 @@ ;;; Commentary: -;; Todo: +;; Major mode to browse revision log histories. +;; Currently supports the format output by: +;; RCS, SCCS, CVS, Subversion. + +;; Examples of log output: + +;;;; RCS/CVS: + +;; ---------------------------- +;; revision 1.35 locked by: turlutut +;; date: 2005-03-22 18:48:38 +0000; author: monnier; state: Exp; lines: +6 -8 +;; (gnus-display-time-event-handler): +;; Check display-time-timer at runtime rather than only at load time +;; in case display-time-mode is turned off in the mean time. +;; ---------------------------- +;; revision 1.34 +;; date: 2005-02-09 15:50:38 +0000; author: kfstorm; state: Exp; lines: +7 -7 +;; branches: 1.34.2; +;; Change release version from 21.4 to 22.1 throughout. +;; Change development version from 21.3.50 to 22.0.50. + +;;;; SCCS: + +;;;; Subversion: + +;;; Todo: -;; - add compatibility with cvs-log.el ;; - add ability to modify a log-entry (via cvs-mode-admin ;-) ;; - remove references to cvs-* +;; - make it easier to add support for new backends without changing the code. ;;; Code: @@ -87,17 +112,20 @@ (defvar log-view-message-face 'log-view-message) (defconst log-view-file-re - (concat "^\\(" - "Working file: \\(.+\\)" - "\\|SCCS/s\\.\\(.+\\):" - "\\)\n")) -;; In RCS, a locked revision will look like "revision N.M\tlocked by: FOO". -(defconst log-view-message-re "^\\(revision \\([.0-9]+\\)\\(?:\t.*\\)?\\|r\\([0-9]+\\) | .* | .*\\|D \\([.0-9]+\\) .*\\)$") + (concat "^\\(?:Working file: \\(.+\\)" ;RCS and CVS. + "\\|SCCS/s\\.\\(.+\\):" ;SCCS. + "\\)\n")) ;Include the \n for font-lock reasons. + +(defconst log-view-message-re + (concat "^\\(?:revision \\([.0-9]+\\)\\(?:\t.*\\)?" ; RCS and CVS. + "\\|r\\([0-9]+\\) | .* | .*" ; Subversion. + "\\|D \\([.0-9]+\\) .*" ; SCCS. + "\\)$")) (defconst log-view-font-lock-keywords `((,log-view-file-re + (1 (if (boundp 'cvs-filename-face) cvs-filename-face) nil t) (2 (if (boundp 'cvs-filename-face) cvs-filename-face) nil t) - (3 (if (boundp 'cvs-filename-face) cvs-filename-face) nil t) (0 log-view-file-face append)) (,log-view-message-re . log-view-message-face))) (defconst log-view-font-lock-defaults @@ -158,10 +186,17 @@ (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)))) + (let (rev) + ;; Find the subgroup that matched. + (dotimes (i (/ (match-data 'integers) 2)) + (setq rev (or rev (match-string (1+ i))))) (unless (re-search-forward log-view-file-re pt t) rev)))))) +(defvar cvs-minor-current-files) +(defvar cvs-branch-prefix) +(defvar cvs-secondary-branch-prefix) + (defun log-view-minor-wrap (buf f) (let ((data (with-current-buffer buf (cons -- 2.39.2