From d797e6435badf75e2cf01cb4cb9f4c4566c075c6 Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Fri, 22 Jun 2007 02:11:59 +0000 Subject: [PATCH] (vc-hg-log-view-mode): New mode. --- lisp/ChangeLog | 4 ++++ lisp/vc-hg.el | 27 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0725b9d3451..fdb128b6abe 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2007-06-22 Dan Nicolaescu + + * vc-hg.el (vc-hg-log-view-mode): New mode. + 2007-06-21 Jay Belanger * calc/calc.el (math-read-number-simple): New function. diff --git a/lisp/vc-hg.el b/lisp/vc-hg.el index c7bcda7ebc5..1c1c47fcf03 100644 --- a/lisp/vc-hg.el +++ b/lisp/vc-hg.el @@ -111,6 +111,33 @@ (if (and (vc-stay-local-p file) (fboundp 'start-process)) 'async 0) file "log")) +(defvar log-view-message-re) +(defvar log-view-file-re) +(defvar log-view-font-lock-keywords) +(defvar log-view-current-tag-function) + +(define-derived-mode vc-hg-log-view-mode log-view-mode "HG-Log-View" + (require 'add-log) ;; we need the faces add-log + ;; Don't have file markers, so use impossible regexp. + (set (make-local-variable 'log-view-file-re) "\\'\\`") + (set (make-local-variable 'log-view-message-re) + "^changeset:[ \t]*\\([0-9]+\\):\\(.+\\)") + (set (make-local-variable 'log-view-font-lock-keywords) + (append + ;; XXX maybe use a different face for the version number + `((,log-view-message-re (1 'change-log-acknowledgement))) + ;; Handle the case: + ;; user: foo@bar + '(("^user:[ \t]+\\([A-Za-z0-9_.+-]+@[A-Za-z0-9_.-]+\\)" + (1 'change-log-email)) + ;; Handle the case: + ;; user: FirstName LastName + ("^user:[ \t]+\\([^<(]+?\\)[ \t]*[(<]\\([A-Za-z0-9_.+-]+@[A-Za-z0-9_.-]+\\)[>)]" + (1 'change-log-name) + (2 'change-log-email)) + ("^date: \\(.+\\)" (1 'change-log-date)) + ("^summary:[ \t]+\\(.+\\)" (1 'log-view-message)))))) + (defun vc-hg-diff (file &optional oldvers newvers buffer) "Get a difference report using hg between two versions of FILE." (let ((working (vc-workfile-version file))) -- 2.39.2