annotate lisp/log-view.el @ 40983:c767a5ebe4cd

(Fif): Reindent. (Fand): Likewise.
author Pavel Janík <Pavel@Janik.cz>
date Tue, 13 Nov 2001 07:00:21 +0000
parents 4b4504c5aa56
children 98cd2e32a438
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
29041
49e8918cab44 Fix file description.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28861
diff changeset
1 ;;; log-view.el --- Major mode for browsing RCS/CVS/SCCS log output
28088
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
2
40954
5eb998b7a74c updated (C)
Sam Steingold <sds@gnu.org>
parents: 40450
diff changeset
3 ;; Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
28088
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
4
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
5 ;; Author: Stefan Monnier <monnier@cs.yale.edu>
29041
49e8918cab44 Fix file description.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28861
diff changeset
6 ;; Keywords: rcs sccs cvs log version-control
40958
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
7 ;; Revision: $Id: log-view.el,v 1.8 2001/11/12 20:34:45 sds Exp $
28088
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
8
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
9 ;; This file is part of GNU Emacs.
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
10
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
12 ;; it under the terms of the GNU General Public License as published by
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
14 ;; any later version.
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
15
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
16 ;; GNU Emacs is distributed in the hope that it will be useful,
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
19 ;; GNU General Public License for more details.
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
20
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
24 ;; Boston, MA 02111-1307, USA.
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
25
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
26 ;;; Commentary:
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
27
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
28 ;; Todo:
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
29
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
30 ;; - add compatibility with cvs-log.el
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
31 ;; - add ability to modify a log-entry (via cvs-mode-admin ;-)
29041
49e8918cab44 Fix file description.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28861
diff changeset
32 ;; - remove references to cvs-*
28088
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
33
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
34 ;;; Code:
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
35
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
36 (eval-when-compile (require 'cl))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
37 (require 'pcvs-util)
40958
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
38 (autoload 'vc-version-diff "vc")
28088
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
39
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
40 (defgroup log-view nil
29041
49e8918cab44 Fix file description.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28861
diff changeset
41 "Major mode for browsing log output of RCS/CVS/SCCS."
28088
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
42 :group 'pcl-cvs
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
43 :prefix "log-view-")
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
44
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
45 (easy-mmode-defmap log-view-mode-map
40958
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
46 '(("q" . quit-window)
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
47 ("z" . kill-this-buffer)
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
48 ("m" . set-mark-command)
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
49 ("d" . log-view-diff)
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
50 ("n" . log-view-msg-next)
28251
21d27711125f (log-view-(msg|file)-(prev|next)): Rename from
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28088
diff changeset
51 ("p" . log-view-msg-prev)
21d27711125f (log-view-(msg|file)-(prev|next)): Rename from
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28088
diff changeset
52 ("N" . log-view-file-next)
21d27711125f (log-view-(msg|file)-(prev|next)): Rename from
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28088
diff changeset
53 ("P" . log-view-file-prev)
40450
d29fac587062 (log-view-mode-map): Bind `M-n' and `M-p', not `M n'
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 34652
diff changeset
54 ("\M-n" . log-view-file-next)
d29fac587062 (log-view-mode-map): Bind `M-n' and `M-p', not `M n'
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 34652
diff changeset
55 ("\M-p" . log-view-file-prev))
28088
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
56 "Log-View's keymap."
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
57 :group 'log-view
29041
49e8918cab44 Fix file description.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28861
diff changeset
58 ;; Here I really need either buffer-local keymap-inheritance
49e8918cab44 Fix file description.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28861
diff changeset
59 ;; or a minor-mode-map with lower precedence than the local map.
49e8918cab44 Fix file description.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28861
diff changeset
60 :inherit (if (boundp 'cvs-mode-map) cvs-mode-map))
28088
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
61
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
62 (defvar log-view-mode-hook nil
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
63 "Hook run at the end of `log-view-mode'.")
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
64
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
65 (defface log-view-file-face
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
66 '((((class color) (background light))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
67 (:background "grey70" :bold t))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
68 (t (:bold t)))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
69 "Face for the file header line in `log-view-mode'."
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
70 :group 'log-view)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
71 (defvar log-view-file-face 'log-view-file-face)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
72
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
73 (defface log-view-message-face
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
74 '((((class color) (background light))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
75 (:background "grey85"))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
76 (t (:bold t)))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
77 "Face for the message header line in `log-view-mode'."
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
78 :group 'log-view)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
79 (defvar log-view-message-face 'log-view-message-face)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
80
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
81 (defconst log-view-file-re
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
82 (concat "^\\("
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
83 "Working file: \\(.+\\)"
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
84 "\\|SCCS/s\\.\\(.+\\):"
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
85 "\\)\n"))
28251
21d27711125f (log-view-(msg|file)-(prev|next)): Rename from
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28088
diff changeset
86 (defconst log-view-message-re "^\\(revision \\([.0-9]+\\)\\|D \\([.0-9]+\\) .*\\)$")
28088
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
87
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
88 (defconst log-view-font-lock-keywords
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
89 `((,log-view-file-re
29041
49e8918cab44 Fix file description.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28861
diff changeset
90 (2 (if (boundp 'cvs-filename-face) cvs-filename-face) nil t)
49e8918cab44 Fix file description.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28861
diff changeset
91 (3 (if (boundp 'cvs-filename-face) cvs-filename-face) nil t)
49e8918cab44 Fix file description.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28861
diff changeset
92 (0 log-view-file-face append))
28088
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
93 (,log-view-message-re . log-view-message-face)))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
94 (defconst log-view-font-lock-defaults
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
95 '(log-view-font-lock-keywords t nil nil nil))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
96
40954
5eb998b7a74c updated (C)
Sam Steingold <sds@gnu.org>
parents: 40450
diff changeset
97 ;;;;
28088
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
98 ;;;; Actual code
40954
5eb998b7a74c updated (C)
Sam Steingold <sds@gnu.org>
parents: 40450
diff changeset
99 ;;;;
28088
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
100
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
101 ;;;###autoload
28251
21d27711125f (log-view-(msg|file)-(prev|next)): Rename from
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28088
diff changeset
102 (define-derived-mode log-view-mode fundamental-mode "Log-View"
28088
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
103 "Major mode for browsing CVS log output."
40958
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
104 (set-buffer-modified-p nil)
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
105 (setq buffer-read-only t)
28088
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
106 (set (make-local-variable 'font-lock-defaults) log-view-font-lock-defaults)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
107 (set (make-local-variable 'cvs-minor-wrap-function) 'log-view-minor-wrap))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
108
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
109 ;;;;
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
110 ;;;; Navigation
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
111 ;;;;
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
112
28251
21d27711125f (log-view-(msg|file)-(prev|next)): Rename from
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28088
diff changeset
113 ;; define log-view-{msg,file}-{next,prev}
21d27711125f (log-view-(msg|file)-(prev|next)): Rename from
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28088
diff changeset
114 (easy-mmode-define-navigation log-view-msg log-view-message-re "log message")
21d27711125f (log-view-(msg|file)-(prev|next)): Rename from
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28088
diff changeset
115 (easy-mmode-define-navigation log-view-file log-view-file-re "file")
28088
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
116
28861
bab7620d1466 (log-view-goto-rev): New function for the new VC.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28251
diff changeset
117 (defun log-view-goto-rev (rev)
bab7620d1466 (log-view-goto-rev): New function for the new VC.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28251
diff changeset
118 (goto-char (point-min))
bab7620d1466 (log-view-goto-rev): New function for the new VC.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28251
diff changeset
119 (ignore-errors
bab7620d1466 (log-view-goto-rev): New function for the new VC.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28251
diff changeset
120 (while (not (equal rev (log-view-current-tag)))
bab7620d1466 (log-view-goto-rev): New function for the new VC.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28251
diff changeset
121 (log-view-msg-next))
bab7620d1466 (log-view-goto-rev): New function for the new VC.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28251
diff changeset
122 t))
bab7620d1466 (log-view-goto-rev): New function for the new VC.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28251
diff changeset
123
28088
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
124 ;;;;
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
125 ;;;; Linkage to PCL-CVS (mostly copied from cvs-status.el)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
126 ;;;;
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
127
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
128 (defconst log-view-dir-re "^cvs[.ex]* [a-z]+: Logging \\(.+\\)$")
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
129
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
130 (defun log-view-current-file ()
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
131 (save-excursion
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
132 (forward-line 1)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
133 (or (re-search-backward log-view-file-re nil t)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
134 (re-search-forward log-view-file-re))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
135 (let* ((file (or (match-string 2) (match-string 3)))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
136 (cvsdir (and (re-search-backward log-view-dir-re nil t)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
137 (match-string 1)))
29041
49e8918cab44 Fix file description.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28861
diff changeset
138 (pcldir (and (boundp 'cvs-pcl-cvs-dirchange-re)
49e8918cab44 Fix file description.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28861
diff changeset
139 (re-search-backward cvs-pcl-cvs-dirchange-re nil t)
28088
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
140 (match-string 1)))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
141 (dir ""))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
142 (let ((default-directory ""))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
143 (when pcldir (setq dir (expand-file-name pcldir dir)))
40958
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
144 (when cvsdir (setq dir (expand-file-name cvsdir dir))))
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
145 (expand-file-name file dir))))
28088
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
146
40958
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
147 (defun log-view-current-tag (&optional where)
28251
21d27711125f (log-view-(msg|file)-(prev|next)): Rename from
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28088
diff changeset
148 (save-excursion
40958
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
149 (when where (goto-char where))
28251
21d27711125f (log-view-(msg|file)-(prev|next)): Rename from
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28088
diff changeset
150 (forward-line 1)
21d27711125f (log-view-(msg|file)-(prev|next)): Rename from
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28088
diff changeset
151 (let ((pt (point)))
21d27711125f (log-view-(msg|file)-(prev|next)): Rename from
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28088
diff changeset
152 (when (re-search-backward log-view-message-re nil t)
21d27711125f (log-view-(msg|file)-(prev|next)): Rename from
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28088
diff changeset
153 (let ((rev (or (match-string 2) (match-string 3))))
21d27711125f (log-view-(msg|file)-(prev|next)): Rename from
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28088
diff changeset
154 (unless (re-search-forward log-view-file-re pt t)
21d27711125f (log-view-(msg|file)-(prev|next)): Rename from
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28088
diff changeset
155 rev))))))
28088
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
156
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
157 (defun log-view-minor-wrap (buf f)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
158 (let ((data (with-current-buffer buf
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
159 (cons
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
160 (cons (log-view-current-file)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
161 (log-view-current-tag))
28861
bab7620d1466 (log-view-goto-rev): New function for the new VC.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28251
diff changeset
162 (when mark-active
28088
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
163 (save-excursion
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
164 (goto-char (mark))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
165 (cons (log-view-current-file)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
166 (log-view-current-tag))))))))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
167 (let ((cvs-branch-prefix (cdar data))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
168 (cvs-secondary-branch-prefix (and (cdar data) (cddr data)))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
169 (cvs-minor-current-files
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
170 (cons (caar data)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
171 (when (and (cadr data) (not (equal (caar data) (cadr data))))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
172 (list (cadr data)))))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
173 ;; FIXME: I need to force because the fileinfos are UNKNOWN
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
174 (cvs-force-command "/F"))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
175 (funcall f))))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
176
40958
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
177 ;;;
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
178 ;;; diff
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
179 ;;;
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
180
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
181 (defun log-view-diff (beg end)
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
182 "Get the diff for several revisions.
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
183 If the point is the same as the mark, get the diff for this revision.
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
184 Otherwise, get the diff between the revisions
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
185 were the region starts and ends."
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
186 (interactive "r")
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
187 (let ((fr (log-view-current-tag beg))
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
188 (to (log-view-current-tag end)))
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
189 (when (string-equal fr to)
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
190 (save-excursion
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
191 (goto-char end)
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
192 (log-view-msg-next)
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
193 (setq to (log-view-current-tag))))
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
194 (vc-version-diff (log-view-current-file) to fr)))
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
195
28088
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
196 (provide 'log-view)
28251
21d27711125f (log-view-(msg|file)-(prev|next)): Rename from
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28088
diff changeset
197
21d27711125f (log-view-(msg|file)-(prev|next)): Rename from
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28088
diff changeset
198 ;;; Change Log:
28861
bab7620d1466 (log-view-goto-rev): New function for the new VC.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28251
diff changeset
199 ;; $Log: log-view.el,v $
40958
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
200 ;; Revision 1.8 2001/11/12 20:34:45 sds
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
201 ;; updated (C)
4b4504c5aa56 * vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents: 40954
diff changeset
202 ;;
40954
5eb998b7a74c updated (C)
Sam Steingold <sds@gnu.org>
parents: 40450
diff changeset
203 ;; Revision 1.7 2001/10/29 15:46:46 kai
5eb998b7a74c updated (C)
Sam Steingold <sds@gnu.org>
parents: 40450
diff changeset
204 ;; (log-view-mode-map): Bind `M-n' and `M-p', not `M n'
5eb998b7a74c updated (C)
Sam Steingold <sds@gnu.org>
parents: 40450
diff changeset
205 ;; and `M p'.
5eb998b7a74c updated (C)
Sam Steingold <sds@gnu.org>
parents: 40450
diff changeset
206 ;;
40450
d29fac587062 (log-view-mode-map): Bind `M-n' and `M-p', not `M n'
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 34652
diff changeset
207 ;; Revision 1.6 2000/12/18 03:17:31 monnier
d29fac587062 (log-view-mode-map): Bind `M-n' and `M-p', not `M n'
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 34652
diff changeset
208 ;; Remove useless Version.
d29fac587062 (log-view-mode-map): Bind `M-n' and `M-p', not `M n'
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 34652
diff changeset
209 ;;
34652
45a589a4c480 Remove useless Version.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 34304
diff changeset
210 ;; Revision 1.5 2000/12/06 19:49:40 fx
45a589a4c480 Remove useless Version.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 34304
diff changeset
211 ;; Fix copyright years.
45a589a4c480 Remove useless Version.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 34304
diff changeset
212 ;;
34304
dd613770eb0f Fix copyright years.
Dave Love <fx@gnu.org>
parents: 29041
diff changeset
213 ;; Revision 1.4 2000/05/21 02:12:34 monnier
dd613770eb0f Fix copyright years.
Dave Love <fx@gnu.org>
parents: 29041
diff changeset
214 ;; Fix file description.
dd613770eb0f Fix copyright years.
Dave Love <fx@gnu.org>
parents: 29041
diff changeset
215 ;; (log-view-mode-map): Unsatisfying fix for when cvs-mode-map is not
dd613770eb0f Fix copyright years.
Dave Love <fx@gnu.org>
parents: 29041
diff changeset
216 ;; available.
dd613770eb0f Fix copyright years.
Dave Love <fx@gnu.org>
parents: 29041
diff changeset
217 ;; (log-view-font-lock-keywords): Only use cvs-filename-face if present.
dd613770eb0f Fix copyright years.
Dave Love <fx@gnu.org>
parents: 29041
diff changeset
218 ;; (log-view-current-file): Only use cvs-pcl-cvs-dirchange-re if present.
dd613770eb0f Fix copyright years.
Dave Love <fx@gnu.org>
parents: 29041
diff changeset
219 ;;
29041
49e8918cab44 Fix file description.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28861
diff changeset
220 ;; Revision 1.3 2000/05/10 22:22:21 monnier
49e8918cab44 Fix file description.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28861
diff changeset
221 ;; (log-view-goto-rev): New function for the new VC.
49e8918cab44 Fix file description.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28861
diff changeset
222 ;; (log-view-minor-wrap): Use mark-active.
49e8918cab44 Fix file description.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28861
diff changeset
223 ;;
28861
bab7620d1466 (log-view-goto-rev): New function for the new VC.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28251
diff changeset
224 ;; Revision 1.2 2000/03/22 01:10:09 monnier
bab7620d1466 (log-view-goto-rev): New function for the new VC.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28251
diff changeset
225 ;; (log-view-(msg|file)-(prev|next)): Rename from
bab7620d1466 (log-view-goto-rev): New function for the new VC.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28251
diff changeset
226 ;; log-view-*-(message|file) and use easy-mmode-define-navigation.
bab7620d1466 (log-view-goto-rev): New function for the new VC.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28251
diff changeset
227 ;; (log-view-message-re): Match SCCS format as well.
bab7620d1466 (log-view-goto-rev): New function for the new VC.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28251
diff changeset
228 ;; And match the revision line rather than the dashed separator line.
bab7620d1466 (log-view-goto-rev): New function for the new VC.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28251
diff changeset
229 ;; (log-view-mode): Use the new define-derived-mode.
bab7620d1466 (log-view-goto-rev): New function for the new VC.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28251
diff changeset
230 ;; (log-view-current-tag): Fill in with an actual implementation.
bab7620d1466 (log-view-goto-rev): New function for the new VC.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28251
diff changeset
231 ;;
28251
21d27711125f (log-view-(msg|file)-(prev|next)): Rename from
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28088
diff changeset
232
28088
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
233 ;;; log-view.el ends here