Mercurial > emacs
annotate lisp/log-view.el @ 78383:f97cdcfcf9ee
Adjust load-path
author | Vinicius Jose Latorre <viniciusjl@ig.com.br> |
---|---|
date | Wed, 01 Aug 2007 21:43:46 +0000 |
parents | 9355f9b7bbff |
children | 33690fc4e175 b98604865ea0 |
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 |
68651
3bd95f4f2941
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
68370
diff
changeset
|
3 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, |
75347 | 4 ;; 2006, 2007 Free Software Foundation, Inc. |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
5 |
70292
2b77fa42947f
Update my email address.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68651
diff
changeset
|
6 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca> |
29041
49e8918cab44
Fix file description.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28861
diff
changeset
|
7 ;; Keywords: rcs sccs cvs log version-control |
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 |
78236
9355f9b7bbff
Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents:
78077
diff
changeset
|
13 ;; the Free Software Foundation; either version 3, or (at your option) |
28088
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 |
64091 | 23 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
24 ;; Boston, MA 02110-1301, USA. | |
28088
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 |
67709
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
28 ;; Major mode to browse revision log histories. |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
29 ;; Currently supports the format output by: |
68098
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
30 ;; RCS, SCCS, CVS, Subversion, and DaRCS. |
67709
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
31 |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
32 ;; Examples of log output: |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
33 |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
34 ;;;; RCS/CVS: |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
35 |
67709
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
36 ;; ---------------------------- |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
37 ;; revision 1.35 locked by: turlutut |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
38 ;; date: 2005-03-22 18:48:38 +0000; author: monnier; state: Exp; lines: +6 -8 |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
39 ;; (gnus-display-time-event-handler): |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
40 ;; Check display-time-timer at runtime rather than only at load time |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
41 ;; in case display-time-mode is turned off in the mean time. |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
42 ;; ---------------------------- |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
43 ;; revision 1.34 |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
44 ;; date: 2005-02-09 15:50:38 +0000; author: kfstorm; state: Exp; lines: +7 -7 |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
45 ;; branches: 1.34.2; |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
46 ;; Change release version from 21.4 to 22.1 throughout. |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
47 ;; Change development version from 21.3.50 to 22.0.50. |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
48 |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
49 ;;;; SCCS: |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
50 |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
51 ;;;; Subversion: |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
52 |
68098
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
53 ;;;; Darcs: |
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
54 |
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
55 ;; Changes to darcsum.el: |
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
56 ;; |
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
57 ;; Mon Nov 28 15:19:38 GMT 2005 Dave Love <fx@gnu.org> |
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
58 ;; * Abstract process startup into darcsum-start-process. Use TERM=dumb. |
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
59 ;; TERM=dumb avoids escape characters, at least, for any old darcs that |
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
60 ;; doesn't understand DARCS_DONT_COLOR & al. |
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
61 ;; |
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
62 ;; Thu Nov 24 15:20:45 GMT 2005 Dave Love <fx@gnu.org> |
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
63 ;; * darcsum-mode-related changes. |
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
64 ;; Don't call font-lock-mode (unnecessary) or use-local-map (redundant). |
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
65 ;; Use mode-class 'special. Add :group. |
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
66 ;; Add trailing-whitespace option to mode hook and fix |
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
67 ;; darcsum-display-changeset not to use trailing whitespace. |
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
68 |
67709
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
69 ;;; Todo: |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
70 |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
71 ;; - 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
|
72 ;; - remove references to cvs-* |
67709
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
73 ;; - make it easier to add support for new backends without changing the code. |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
74 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
75 ;;; Code: |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
76 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
77 (eval-when-compile (require 'cl)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
78 (require 'pcvs-util) |
67775
0a80642ab161
Call autoload for vc-find-version.
Juri Linkov <juri@jurta.org>
parents:
67709
diff
changeset
|
79 (autoload 'vc-find-version "vc") |
40958
4b4504c5aa56
* vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents:
40954
diff
changeset
|
80 (autoload 'vc-version-diff "vc") |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
81 |
65293
f3b1607acf96
(cvs-minor-wrap-function): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
64762
diff
changeset
|
82 (defvar cvs-minor-wrap-function) |
f3b1607acf96
(cvs-minor-wrap-function): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
64762
diff
changeset
|
83 |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
84 (defgroup log-view nil |
29041
49e8918cab44
Fix file description.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28861
diff
changeset
|
85 "Major mode for browsing log output of RCS/CVS/SCCS." |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
86 :group 'pcl-cvs |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
87 :prefix "log-view-") |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
88 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
89 (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
|
90 '(("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
|
91 ("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
|
92 ("m" . set-mark-command) |
49236
8df2e5ef3962
(log-view-message-re): The rev might be locked.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42456
diff
changeset
|
93 ;; ("e" . cvs-mode-edit-log) |
40958
4b4504c5aa56
* vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents:
40954
diff
changeset
|
94 ("d" . log-view-diff) |
41557
be985e4c1430
(log-view-find-version): New function.
André Spiegel <spiegel@gnu.org>
parents:
41137
diff
changeset
|
95 ("f" . log-view-find-version) |
40958
4b4504c5aa56
* vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents:
40954
diff
changeset
|
96 ("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
|
97 ("p" . log-view-msg-prev) |
21d27711125f
(log-view-(msg|file)-(prev|next)): Rename from
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28088
diff
changeset
|
98 ("N" . log-view-file-next) |
21d27711125f
(log-view-(msg|file)-(prev|next)): Rename from
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28088
diff
changeset
|
99 ("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
|
100 ("\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
|
101 ("\M-p" . log-view-file-prev)) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
102 "Log-View's keymap." |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
103 :group 'log-view |
29041
49e8918cab44
Fix file description.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28861
diff
changeset
|
104 ;; Here I really need either buffer-local keymap-inheritance |
49e8918cab44
Fix file description.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28861
diff
changeset
|
105 ;; 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
|
106 :inherit (if (boundp 'cvs-mode-map) cvs-mode-map)) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
107 |
78077
442f874e0b22
(log-view-mode-menu): New menu.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
75347
diff
changeset
|
108 (easy-menu-define log-view-mode-menu log-view-mode-map |
442f874e0b22
(log-view-mode-menu): New menu.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
75347
diff
changeset
|
109 "Log-View Display Menu" |
442f874e0b22
(log-view-mode-menu): New menu.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
75347
diff
changeset
|
110 `("Log-View" |
442f874e0b22
(log-view-mode-menu): New menu.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
75347
diff
changeset
|
111 ;; XXX Do we need menu entries for these? |
442f874e0b22
(log-view-mode-menu): New menu.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
75347
diff
changeset
|
112 ;; ["Quit" quit-window] |
442f874e0b22
(log-view-mode-menu): New menu.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
75347
diff
changeset
|
113 ;; ["Kill This Buffer" kill-this-buffer] |
442f874e0b22
(log-view-mode-menu): New menu.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
75347
diff
changeset
|
114 ["Mark Log Entry for Diff" set-mark-command] |
442f874e0b22
(log-view-mode-menu): New menu.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
75347
diff
changeset
|
115 ["Diff Revisions" log-view-diff] |
442f874e0b22
(log-view-mode-menu): New menu.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
75347
diff
changeset
|
116 ["Visit Version" log-view-find-version] |
442f874e0b22
(log-view-mode-menu): New menu.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
75347
diff
changeset
|
117 ["Next Log Entry" log-view-msg-next] |
442f874e0b22
(log-view-mode-menu): New menu.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
75347
diff
changeset
|
118 ["Previous Log Entry" log-view-msg-prev] |
442f874e0b22
(log-view-mode-menu): New menu.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
75347
diff
changeset
|
119 ["Next File" log-view-file-next] |
442f874e0b22
(log-view-mode-menu): New menu.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
75347
diff
changeset
|
120 ["Previous File" log-view-file-prev])) |
442f874e0b22
(log-view-mode-menu): New menu.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
75347
diff
changeset
|
121 |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
122 (defvar log-view-mode-hook nil |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
123 "Hook run at the end of `log-view-mode'.") |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
124 |
63203
ecbe83adff58
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-374
Miles Bader <miles@gnu.org>
parents:
60145
diff
changeset
|
125 (defface log-view-file |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
126 '((((class color) (background light)) |
42456
8a4077ab418c
(various face definitions): Use :weight, not :bold.
Richard M. Stallman <rms@gnu.org>
parents:
42074
diff
changeset
|
127 (:background "grey70" :weight bold)) |
8a4077ab418c
(various face definitions): Use :weight, not :bold.
Richard M. Stallman <rms@gnu.org>
parents:
42074
diff
changeset
|
128 (t (:weight bold))) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
129 "Face for the file header line in `log-view-mode'." |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
130 :group 'log-view) |
63203
ecbe83adff58
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-374
Miles Bader <miles@gnu.org>
parents:
60145
diff
changeset
|
131 ;; backward-compatibility alias |
ecbe83adff58
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-374
Miles Bader <miles@gnu.org>
parents:
60145
diff
changeset
|
132 (put 'log-view-file-face 'face-alias 'log-view-file) |
ecbe83adff58
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-374
Miles Bader <miles@gnu.org>
parents:
60145
diff
changeset
|
133 (defvar log-view-file-face 'log-view-file) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
134 |
63203
ecbe83adff58
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-374
Miles Bader <miles@gnu.org>
parents:
60145
diff
changeset
|
135 (defface log-view-message |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
136 '((((class color) (background light)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
137 (:background "grey85")) |
42456
8a4077ab418c
(various face definitions): Use :weight, not :bold.
Richard M. Stallman <rms@gnu.org>
parents:
42074
diff
changeset
|
138 (t (:weight bold))) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
139 "Face for the message header line in `log-view-mode'." |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
140 :group 'log-view) |
63203
ecbe83adff58
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-374
Miles Bader <miles@gnu.org>
parents:
60145
diff
changeset
|
141 ;; backward-compatibility alias |
ecbe83adff58
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-374
Miles Bader <miles@gnu.org>
parents:
60145
diff
changeset
|
142 (put 'log-view-message-face 'face-alias 'log-view-message) |
ecbe83adff58
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-374
Miles Bader <miles@gnu.org>
parents:
60145
diff
changeset
|
143 (defvar log-view-message-face 'log-view-message) |
28088
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 (defconst log-view-file-re |
67709
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
146 (concat "^\\(?:Working file: \\(.+\\)" ;RCS and CVS. |
68098
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
147 "\\|\\(?:SCCS/s\\.\\|Changes to \\)\\(.+\\):" ;SCCS and Darcs. |
67709
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
148 "\\)\n")) ;Include the \n for font-lock reasons. |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
149 |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
150 (defconst log-view-message-re |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
151 (concat "^\\(?:revision \\([.0-9]+\\)\\(?:\t.*\\)?" ; RCS and CVS. |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
152 "\\|r\\([0-9]+\\) | .* | .*" ; Subversion. |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
153 "\\|D \\([.0-9]+\\) .*" ; SCCS. |
68098
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
154 ;; Darcs doesn't have revision names. VC-darcs uses patch names |
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
155 ;; instead. Darcs patch names are hashcodes, which do not appear |
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
156 ;; in the log output :-(, but darcs accepts any prefix of the log |
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
157 ;; message as a patch name, so we match the first line of the log |
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
158 ;; message. |
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
159 ;; First loosely match the date format. |
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
160 (concat "\\|[^ \n].*[^0-9\n][0-9][0-9]:[0-9][0-9][^0-9\n].*[^ \n]" |
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
161 ;;Email of user and finally Msg, used as revision name. |
150225f41e97
(log-view-file-re, log-view-message-re): Add support for DaRCS output.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67775
diff
changeset
|
162 " .*@.*\n\\(?: \\* \\(.*\\)\\)?") |
67709
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
163 "\\)$")) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
164 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
165 (defconst log-view-font-lock-keywords |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
166 `((,log-view-file-re |
67709
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
167 (1 (if (boundp 'cvs-filename-face) cvs-filename-face) nil t) |
29041
49e8918cab44
Fix file description.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28861
diff
changeset
|
168 (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
|
169 (0 log-view-file-face append)) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
170 (,log-view-message-re . log-view-message-face))) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
171 (defconst log-view-font-lock-defaults |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
172 '(log-view-font-lock-keywords t nil nil nil)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
173 |
40954 | 174 ;;;; |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
175 ;;;; Actual code |
40954 | 176 ;;;; |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
177 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
178 ;;;###autoload |
28251
21d27711125f
(log-view-(msg|file)-(prev|next)): Rename from
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28088
diff
changeset
|
179 (define-derived-mode log-view-mode fundamental-mode "Log-View" |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
180 "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
|
181 (setq buffer-read-only t) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
182 (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
|
183 (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
|
184 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
185 ;;;; |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
186 ;;;; Navigation |
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 |
28251
21d27711125f
(log-view-(msg|file)-(prev|next)): Rename from
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28088
diff
changeset
|
189 ;; 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
|
190 (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
|
191 (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
|
192 |
28861
bab7620d1466
(log-view-goto-rev): New function for the new VC.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28251
diff
changeset
|
193 (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
|
194 (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
|
195 (ignore-errors |
bab7620d1466
(log-view-goto-rev): New function for the new VC.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28251
diff
changeset
|
196 (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
|
197 (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
|
198 t)) |
bab7620d1466
(log-view-goto-rev): New function for the new VC.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28251
diff
changeset
|
199 |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
200 ;;;; |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
201 ;;;; Linkage to PCL-CVS (mostly copied from cvs-status.el) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
202 ;;;; |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
203 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
204 (defconst log-view-dir-re "^cvs[.ex]* [a-z]+: Logging \\(.+\\)$") |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
205 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
206 (defun log-view-current-file () |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
207 (save-excursion |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
208 (forward-line 1) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
209 (or (re-search-backward log-view-file-re nil t) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
210 (re-search-forward log-view-file-re)) |
67775
0a80642ab161
Call autoload for vc-find-version.
Juri Linkov <juri@jurta.org>
parents:
67709
diff
changeset
|
211 (let* ((file (or (match-string 1) (match-string 2))) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
212 (cvsdir (and (re-search-backward log-view-dir-re nil t) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
213 (match-string 1))) |
29041
49e8918cab44
Fix file description.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28861
diff
changeset
|
214 (pcldir (and (boundp 'cvs-pcl-cvs-dirchange-re) |
49e8918cab44
Fix file description.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28861
diff
changeset
|
215 (re-search-backward cvs-pcl-cvs-dirchange-re nil t) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
216 (match-string 1))) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
217 (dir "")) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
218 (let ((default-directory "")) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
219 (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
|
220 (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
|
221 (expand-file-name file dir)))) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
222 |
40958
4b4504c5aa56
* vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents:
40954
diff
changeset
|
223 (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
|
224 (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
|
225 (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
|
226 (forward-line 1) |
21d27711125f
(log-view-(msg|file)-(prev|next)): Rename from
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28088
diff
changeset
|
227 (let ((pt (point))) |
21d27711125f
(log-view-(msg|file)-(prev|next)): Rename from
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28088
diff
changeset
|
228 (when (re-search-backward log-view-message-re nil t) |
67709
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
229 (let (rev) |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
230 ;; Find the subgroup that matched. |
67775
0a80642ab161
Call autoload for vc-find-version.
Juri Linkov <juri@jurta.org>
parents:
67709
diff
changeset
|
231 (dotimes (i (/ (length (match-data 'integers)) 2)) |
67709
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
232 (setq rev (or rev (match-string (1+ i))))) |
28251
21d27711125f
(log-view-(msg|file)-(prev|next)): Rename from
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28088
diff
changeset
|
233 (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
|
234 rev)))))) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
235 |
67709
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
236 (defvar cvs-minor-current-files) |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
237 (defvar cvs-branch-prefix) |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
238 (defvar cvs-secondary-branch-prefix) |
6f549652480e
(log-view-file-re, log-view-message-re): Use shy groups.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67569
diff
changeset
|
239 |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
240 (defun log-view-minor-wrap (buf f) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
241 (let ((data (with-current-buffer buf |
68370
89e7eb7d165b
(log-view-minor-wrap): First rev is the one at point.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68221
diff
changeset
|
242 (let* ((beg (point)) |
89e7eb7d165b
(log-view-minor-wrap): First rev is the one at point.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68221
diff
changeset
|
243 (end (if mark-active (mark) (point))) |
68221
4804f7b39bfe
(log-view-minor-wrap): Use the same logic to get revisions as `log-view-diff'.
Juri Linkov <juri@jurta.org>
parents:
68098
diff
changeset
|
244 (fr (log-view-current-tag beg)) |
4804f7b39bfe
(log-view-minor-wrap): Use the same logic to get revisions as `log-view-diff'.
Juri Linkov <juri@jurta.org>
parents:
68098
diff
changeset
|
245 (to (log-view-current-tag end))) |
4804f7b39bfe
(log-view-minor-wrap): Use the same logic to get revisions as `log-view-diff'.
Juri Linkov <juri@jurta.org>
parents:
68098
diff
changeset
|
246 (when (string-equal fr to) |
4804f7b39bfe
(log-view-minor-wrap): Use the same logic to get revisions as `log-view-diff'.
Juri Linkov <juri@jurta.org>
parents:
68098
diff
changeset
|
247 (save-excursion |
4804f7b39bfe
(log-view-minor-wrap): Use the same logic to get revisions as `log-view-diff'.
Juri Linkov <juri@jurta.org>
parents:
68098
diff
changeset
|
248 (goto-char end) |
4804f7b39bfe
(log-view-minor-wrap): Use the same logic to get revisions as `log-view-diff'.
Juri Linkov <juri@jurta.org>
parents:
68098
diff
changeset
|
249 (log-view-msg-next) |
4804f7b39bfe
(log-view-minor-wrap): Use the same logic to get revisions as `log-view-diff'.
Juri Linkov <juri@jurta.org>
parents:
68098
diff
changeset
|
250 (setq to (log-view-current-tag)))) |
4804f7b39bfe
(log-view-minor-wrap): Use the same logic to get revisions as `log-view-diff'.
Juri Linkov <juri@jurta.org>
parents:
68098
diff
changeset
|
251 (cons |
68370
89e7eb7d165b
(log-view-minor-wrap): First rev is the one at point.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68221
diff
changeset
|
252 ;; The first revision has to be the one at point, for |
89e7eb7d165b
(log-view-minor-wrap): First rev is the one at point.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68221
diff
changeset
|
253 ;; operations that only take one revision |
89e7eb7d165b
(log-view-minor-wrap): First rev is the one at point.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68221
diff
changeset
|
254 ;; (e.g. cvs-mode-edit). |
89e7eb7d165b
(log-view-minor-wrap): First rev is the one at point.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68221
diff
changeset
|
255 (cons (log-view-current-file) fr) |
89e7eb7d165b
(log-view-minor-wrap): First rev is the one at point.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68221
diff
changeset
|
256 (cons (log-view-current-file) to)))))) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
257 (let ((cvs-branch-prefix (cdar data)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
258 (cvs-secondary-branch-prefix (and (cdar data) (cddr data))) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
259 (cvs-minor-current-files |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
260 (cons (caar data) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
261 (when (and (cadr data) (not (equal (caar data) (cadr data)))) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
262 (list (cadr data))))) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
263 ;; FIXME: I need to force because the fileinfos are UNKNOWN |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
264 (cvs-force-command "/F")) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
265 (funcall f)))) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
266 |
41557
be985e4c1430
(log-view-find-version): New function.
André Spiegel <spiegel@gnu.org>
parents:
41137
diff
changeset
|
267 (defun log-view-find-version (pos) |
be985e4c1430
(log-view-find-version): New function.
André Spiegel <spiegel@gnu.org>
parents:
41137
diff
changeset
|
268 "Visit the version at point." |
be985e4c1430
(log-view-find-version): New function.
André Spiegel <spiegel@gnu.org>
parents:
41137
diff
changeset
|
269 (interactive "d") |
be985e4c1430
(log-view-find-version): New function.
André Spiegel <spiegel@gnu.org>
parents:
41137
diff
changeset
|
270 (save-excursion |
be985e4c1430
(log-view-find-version): New function.
André Spiegel <spiegel@gnu.org>
parents:
41137
diff
changeset
|
271 (goto-char pos) |
49597
e88404e8f2cf
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49236
diff
changeset
|
272 (switch-to-buffer (vc-find-version (log-view-current-file) |
41557
be985e4c1430
(log-view-find-version): New function.
André Spiegel <spiegel@gnu.org>
parents:
41137
diff
changeset
|
273 (log-view-current-tag))))) |
be985e4c1430
(log-view-find-version): New function.
André Spiegel <spiegel@gnu.org>
parents:
41137
diff
changeset
|
274 |
42074
fdee0c7c3bf1
(log-view-message-re, log-view-current-tag):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
41557
diff
changeset
|
275 ;; |
fdee0c7c3bf1
(log-view-message-re, log-view-current-tag):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
41557
diff
changeset
|
276 ;; diff |
fdee0c7c3bf1
(log-view-message-re, log-view-current-tag):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
41557
diff
changeset
|
277 ;; |
40958
4b4504c5aa56
* vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents:
40954
diff
changeset
|
278 |
4b4504c5aa56
* vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents:
40954
diff
changeset
|
279 (defun log-view-diff (beg end) |
67569 | 280 "Get the diff between two revisions. |
281 If the mark is not active or the mark is on the revision at point, | |
282 get the diff between the revision at point and its previous revision. | |
283 Otherwise, get the diff between the revisions where the region starts | |
284 and ends." | |
55175
e7a5be902830
(log-view-diff): Replace interactive code "r"
Juri Linkov <juri@jurta.org>
parents:
52401
diff
changeset
|
285 (interactive |
e7a5be902830
(log-view-diff): Replace interactive code "r"
Juri Linkov <juri@jurta.org>
parents:
52401
diff
changeset
|
286 (list (if mark-active (region-beginning) (point)) |
e7a5be902830
(log-view-diff): Replace interactive code "r"
Juri Linkov <juri@jurta.org>
parents:
52401
diff
changeset
|
287 (if mark-active (region-end) (point)))) |
40958
4b4504c5aa56
* vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents:
40954
diff
changeset
|
288 (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
|
289 (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
|
290 (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
|
291 (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
|
292 (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
|
293 (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
|
294 (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
|
295 (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
|
296 |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
297 (provide 'log-view) |
28251
21d27711125f
(log-view-(msg|file)-(prev|next)): Rename from
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28088
diff
changeset
|
298 |
60145
e7ec1f80fc80
(log-view-message-re): Fix up Subversion regexp.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55175
diff
changeset
|
299 ;; arch-tag: 0d64220b-ce7e-4f62-9c2a-6b04c2f81f4f |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
300 ;;; log-view.el ends here |