annotate lisp/log-view.el @ 28174:5ae185b91e69

*** empty log message ***
author Dave Love <fx@gnu.org>
date Thu, 16 Mar 2000 22:18:59 +0000
parents b442dfc3cef0
children 21d27711125f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
28088
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
1 ;;; log-view.el --- Major mode for browsing CVS log output
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
2
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
3 ;; Copyright (C) 1999-2000 Free Software Foundation, Inc.
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>
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
6 ;; Keywords: pcl-cvs cvs log
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
7 ;; Version: $Name: $
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
8 ;; Revision: $Id: log-view.el,v 1.2 2000/03/03 20:58:09 monnier Exp $
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
9
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
10 ;; This file is part of GNU Emacs.
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
11
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
12 ;; 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
13 ;; 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
14 ;; the Free Software Foundation; either version 2, or (at your option)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
15 ;; any later version.
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
16
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
17 ;; 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
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
20 ;; GNU General Public License for more details.
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
21
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
22 ;; 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
23 ;; 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
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
25 ;; Boston, MA 02111-1307, USA.
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
26
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
27 ;;; Commentary:
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
28
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
29 ;; Todo:
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
30
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
31 ;; - extract version info in log-view-current-tag
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
32 ;; - add support for SCCS' output format
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
33 ;; - add compatibility with cvs-log.el
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
34 ;; - add ability to modify a log-entry (via cvs-mode-admin ;-)
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 ;;; Code:
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
37
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
38 (eval-when-compile (require 'cl))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
39 ;;(require 'pcvs-defs)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
40 (require 'pcvs-util)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
41
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
42
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
43 (defgroup log-view nil
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
44 "Major mode for browsing log output for PCL-CVS."
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
45 :group 'pcl-cvs
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
46 :prefix "log-view-")
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
47
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
48 (easy-mmode-defmap log-view-mode-map
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
49 '(("n" . log-view-next-message)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
50 ("N" . log-view-next-file)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
51 ("M-n" . log-view-next-file)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
52 ("p" . log-view-prev-message)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
53 ("P" . log-view-prev-file)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
54 ("M-p" . log-view-prev-file))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
55 "Log-View's keymap."
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
56 :group 'log-view
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
57 :inherit 'cvs-mode-map)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
58
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
59 (defvar log-view-mode-hook nil
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
60 "Hook run at the end of `log-view-mode'.")
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 (defface log-view-file-face
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
63 '((((class color) (background light))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
64 (:background "grey70" :bold t))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
65 (t (:bold t)))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
66 "Face for the file header line in `log-view-mode'."
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
67 :group 'log-view)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
68 (defvar log-view-file-face 'log-view-file-face)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
69
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
70 (defface log-view-message-face
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
71 '((((class color) (background light))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
72 (:background "grey85"))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
73 (t (:bold t)))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
74 "Face for the message header line in `log-view-mode'."
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
75 :group 'log-view)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
76 (defvar log-view-message-face 'log-view-message-face)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
77
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
78 (defconst log-view-file-re
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
79 (concat "^\\("
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
80 "Working file: \\(.+\\)"
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
81 "\\|SCCS/s\\.\\(.+\\):"
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
82 "\\)\n"))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
83 (defconst log-view-message-re "^----------------------------$")
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
84
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
85 (defconst log-view-font-lock-keywords
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
86 `((,log-view-file-re
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
87 (2 'cvs-filename-face nil t)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
88 (3 'cvs-filename-face nil t)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
89 (0 'log-view-file-face append))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
90 (,log-view-message-re . log-view-message-face)))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
91 (defconst log-view-font-lock-defaults
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
92 '(log-view-font-lock-keywords t nil nil nil))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
93
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
94 ;;;;
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
95 ;;;; Actual code
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
96 ;;;;
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
97
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
98 ;;;###autoload
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
99 (autoload 'log-view-mode "log-view" "Major mode for browsing CVS log output." t)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
100 (eval-when-compile (autoload 'easy-mmode-define-derived-mode "easy-mmode"))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
101 (easy-mmode-define-derived-mode log-view-mode fundamental-mode "Log-View"
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
102 "Major mode for browsing CVS log output."
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
103 (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
104 (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
105
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
106 ;;;;
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
107 ;;;; Navigation
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 (defun log-view-next-message (&optional count)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
111 "Move to next (COUNT'th) log message."
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
112 (interactive "p")
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
113 (unless count (setq count 1))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
114 (if (< count 0) (log-view-prev-message (- count))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
115 (when (looking-at log-view-message-re) (incf count))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
116 (re-search-forward log-view-message-re nil nil count)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
117 (goto-char (match-beginning 0))))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
118
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
119 (defun log-view-next-file (&optional count)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
120 "Move to next (COUNT'th) file."
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
121 (interactive "p")
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
122 (unless count (setq count 1))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
123 (if (< count 0) (log-view-prev-file (- count))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
124 (when (looking-at log-view-file-re) (incf count))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
125 (re-search-forward log-view-file-re nil nil count)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
126 (goto-char (match-beginning 0))))
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 (defun log-view-prev-message (&optional count)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
129 "Move to previous (COUNT'th) log message."
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
130 (interactive "p")
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
131 (unless count (setq count 1))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
132 (if (< count 0) (log-view-next-message (- count))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
133 (re-search-backward log-view-message-re nil nil count)))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
134
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
135 (defun log-view-prev-file (&optional count)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
136 "Move to previous (COUNT'th) file."
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
137 (interactive "p")
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
138 (unless count (setq count 1))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
139 (if (< count 0) (log-view-next-file (- count))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
140 (re-search-backward log-view-file-re nil nil count)))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
141
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
142 ;;;;
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
143 ;;;; Linkage to PCL-CVS (mostly copied from cvs-status.el)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
144 ;;;;
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
145
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
146 (defconst log-view-dir-re "^cvs[.ex]* [a-z]+: Logging \\(.+\\)$")
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
147
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
148 (defun log-view-current-file ()
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
149 (save-excursion
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
150 (forward-line 1)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
151 (or (re-search-backward log-view-file-re nil t)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
152 (re-search-forward log-view-file-re))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
153 (let* ((file (or (match-string 2) (match-string 3)))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
154 (cvsdir (and (re-search-backward log-view-dir-re nil t)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
155 (match-string 1)))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
156 (pcldir (and (re-search-backward cvs-pcl-cvs-dirchange-re nil t)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
157 (match-string 1)))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
158 (dir ""))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
159 (let ((default-directory ""))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
160 (when pcldir (setq dir (expand-file-name pcldir dir)))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
161 (when cvsdir (setq dir (expand-file-name cvsdir dir)))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
162 (expand-file-name file dir)))))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
163
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
164 (defun log-view-current-tag ()
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
165 nil);; FIXME
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
166
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
167 (defun log-view-minor-wrap (buf f)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
168 (let ((data (with-current-buffer buf
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
169 (cons
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
170 (cons (log-view-current-file)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
171 (log-view-current-tag))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
172 (when (ignore-errors (mark))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
173 ;; `mark-active' is not provided by XEmacs :-(
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
174 (save-excursion
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
175 (goto-char (mark))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
176 (cons (log-view-current-file)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
177 (log-view-current-tag))))))))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
178 (let ((cvs-branch-prefix (cdar data))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
179 (cvs-secondary-branch-prefix (and (cdar data) (cddr data)))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
180 (cvs-minor-current-files
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
181 (cons (caar data)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
182 (when (and (cadr data) (not (equal (caar data) (cadr data))))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
183 (list (cadr data)))))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
184 ;; FIXME: I need to force because the fileinfos are UNKNOWN
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
185 (cvs-force-command "/F"))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
186 (funcall f))))
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
187
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
188 (provide 'log-view)
b442dfc3cef0 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
189 ;;; log-view.el ends here