annotate lisp/ediff/ediff-tbar.el @ 142:1856695b1fa9 r20-2b5

Import from CVS: tag r20-2b5
author cvs
date Mon, 13 Aug 2007 09:33:18 +0200
parents 0293115a14e9
children bfd6434d15b3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1 ;;; ediff-tbar.el --- A toolbar for Ediff control buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3 ;; Copyright (C) 1996, 1997 Free Software Foundation, Inc.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5 ;; Author: Marc Paquette <marcpa@cam.org>
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7 ;; This file is part of GNU Emacs.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
10 ;; it under the terms of the GNU General Public License as published by
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
11 ;; the Free Software Foundation; either version 2, or (at your option)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
12 ;; any later version.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
13
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
14 ;; GNU Emacs is distributed in the hope that it will be useful,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
17 ;; GNU General Public License for more details.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
18
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
20 ;; along with GNU Emacs; see the file COPYING. If not, write to the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
22 ;; Boston, MA 02111-1307, USA.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
23
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
24 ;;; Code:
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
25
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
26 (provide 'ediff-tbar)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
27
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
28 ;; compiler pacifier
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
29 (defvar toolbar-icon-directory)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
30
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
31 (eval-when-compile
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
32 (let ((load-path (cons (expand-file-name ".") load-path)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
33 (or (featurep 'ediff-init)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
34 (load "ediff-init.el" nil nil 'nosuffix))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
35 (or (featurep 'ediff-util)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
36 (load "ediff-util.el" nil nil 'nosuffix))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
37 ))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
38 ;; end pacifier
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
39
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
40 (require 'ediff-init)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
41
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
42 (defvar ediff-use-toolbar-p nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
43 "If t, Ediff will use a toolbar for the control frame.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
44 This has an effect only if your emacs supports Toolbars.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
45 Currently, XEmacs does, but not Emacs.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
46 Do not change the value of this variable interactively.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
47 This should be done only via the menu bar or by executing
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
48 `ediff-toggle-use-toolbar'.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
49
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
50 (defvar ediff-toolbar-height 21
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
51 "The height of the Ediff toolbar.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
52 The value must match the actual size of the toolbar icons.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
53
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
54 (defvar ediff-toolbar-width 200.0
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
55 "The width of the Ediff toolbar.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
56 The value must match the actual width of the toolbar.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
57 Here's an example:
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
58 There are 10 buttons, each 15 pixels large, and the shadows occupy 2
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
59 pixels each side, and the last button is right-justified (so we reserve
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
60 about 30 pixels for fill space) = 200 pixels.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
61
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
62 (defun ediff-has-toolbar-support-p ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
63 (and ediff-xemacs-p
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
64 (featurep 'toolbar)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
65 (console-on-window-system-p)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
66
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
67 (defun ediff-use-toolbar-p ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
68 (and (ediff-has-toolbar-support-p) ;Can it do it ?
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
69 ediff-use-toolbar-p)) ;Does the user want it ?
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
70
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
71 ;; Here the toolbar width is not the same width talked about in XEmacs
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
72 ;; lispref info documentation : it is the minimal width needed by
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
73 ;; ediff's toolbar to display all buttons, for an horizontal toolbar.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
74 ;; Ideally, we would query the toolbar for the width of each button
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
75 ;; and add them, but I didn't find query functions in the doc on
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
76 ;; toolbars. Therefore, I use a static number of pixels that should
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
77 ;; be adjusted if the toolbar gets more or loses some buttons. --marcpa
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
78 (defun ediff-compute-toolbar-width ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
79 (if (not (ediff-use-toolbar-p))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
80 0
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
81 (ceiling (/ ediff-toolbar-width (font-instance-width (face-font-instance 'default))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
82
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
83 (defvar ediff-toolbar-next-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
84 (if (featurep 'toolbar)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
85 (toolbar-make-button-list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
86 (expand-file-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
87 (if (featurep 'xpm) "ediff-next.xpm" "ediff-next.xbm")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
88 toolbar-icon-directory)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
89 "Next difference icon in toolbar.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
90
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
91 (defvar ediff-toolbar-previous-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
92 (if (featurep 'toolbar)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
93 (toolbar-make-button-list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
94 (expand-file-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
95 (if (featurep 'xpm) "ediff-prev.xpm" "ediff-prev.xbm")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
96 toolbar-icon-directory)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
97 "Previous difference icon in toolbar.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
98
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
99 (defvar ediff-toolbar-A-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
100 (if (featurep 'toolbar)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
101 (toolbar-make-button-list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
102 (expand-file-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
103 ;; UP
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
104 (if (featurep 'xpm) "ediff-A-up.xpm" "ediff-A-up.xbm")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
105 toolbar-icon-directory)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
106 (expand-file-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
107 ;; DOWN
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
108 (if (featurep 'xpm) "ediff-A-up.xpm" "ediff-A-up.xbm")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
109 toolbar-icon-directory)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
110 (expand-file-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
111 ;; DISABLED
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
112 (if (featurep 'xpm) "ediff-A-xx.xpm" "ediff-A-up.xbm")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
113 toolbar-icon-directory)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
114 ))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
115 "Select diff A icon in toolbar.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
116
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
117 (defvar ediff-toolbar-B-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
118 (if (featurep 'toolbar)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
119 (toolbar-make-button-list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
120 (expand-file-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
121 ;; UP
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
122 (if (featurep 'xpm) "ediff-B-up.xpm" "ediff-B-up.xbm")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
123 toolbar-icon-directory)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
124 (expand-file-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
125 ;; DOWN
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
126 (if (featurep 'xpm) "ediff-B-up.xpm" "ediff-B-up.xbm")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
127 toolbar-icon-directory)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
128 (expand-file-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
129 ;; DISABLED
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
130 (if (featurep 'xpm) "ediff-B-xx.xpm" "ediff-B-up.xbm")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
131 toolbar-icon-directory)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
132 ))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
133 "Select diff B icon in toolbar.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
134
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
135 (defvar ediff-toolbar-toggle-split-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
136 (if (featurep 'toolbar)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
137 (toolbar-make-button-list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
138 (expand-file-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
139 ;; UP
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
140 (if (featurep 'xpm)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
141 "ediff-toggle-split-up.xpm" "ediff-toggle-split-up.xbm")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
142 toolbar-icon-directory)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
143 ))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
144 "Toggle split mode between side-to-side and one-on-top-of-another.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
145
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
146 (defvar ediff-toolbar-save-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
147 (if (featurep 'toolbar)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
148 (toolbar-make-button-list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
149 (expand-file-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
150 ;; UP
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
151 (if (featurep 'xpm) "ediff-save.xpm" "ediff-save.xbm")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
152 toolbar-icon-directory)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
153 (expand-file-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
154 ;; DOWN
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
155 (if (featurep 'xpm) "ediff-save.xpm" "ediff-save.xbm")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
156 toolbar-icon-directory)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
157 (expand-file-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
158 ;; DISABLED
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
159 (if (featurep 'xpm) "ediff-save-xx.xpm" "ediff-save-xx.xbm")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
160 toolbar-icon-directory)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
161 ))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
162 "Save merge buffer.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
163
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
164 (defvar ediff-toolbar-quit-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
165 (if (featurep 'toolbar)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
166 (toolbar-make-button-list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
167 (expand-file-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
168 (if (featurep 'xpm) "ediff-quit.xpm" "ediff-quit.xbm")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
169 toolbar-icon-directory)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
170 "Exit Ediff session.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
171
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
172 (defvar ediff-toolbar-help-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
173 (if (featurep 'toolbar)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
174 (toolbar-make-button-list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
175 (expand-file-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
176 (if (featurep 'xpm) "ediff-help.xpm" "ediff-help.xbm")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
177 toolbar-icon-directory)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
178 "Show Ediff help.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
179
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
180 (defvar ediff-toolbar-refresh-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
181 (if (featurep 'toolbar)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
182 (toolbar-make-button-list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
183 (expand-file-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
184 (if (featurep 'xpm) "ediff-update.xpm" "ediff-update.xbm")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
185 toolbar-icon-directory)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
186 "Refresh Ediff display (aka recenter).")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
187
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
188 (defvar ediff-toolbar-refine-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
189 (if (featurep 'toolbar)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
190 (toolbar-make-button-list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
191 (expand-file-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
192 ;; UP
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
193 (if (featurep 'xpm) "ediff-refine.xpm" "ediff-refine.xbm")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
194 toolbar-icon-directory)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
195 ))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
196 "Refine current difference region by computing fine diffs.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
197
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
198 (defun ediff-toolbar-previous-difference ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
199 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
200 (let ((ediff-grab-mouse nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
201 (ediff-previous-difference 1)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
202
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
203 (defun ediff-toolbar-next-difference ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
204 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
205 (let ((ediff-grab-mouse nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
206 (ediff-next-difference 1)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
207
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
208 (defun ediff-toolbar-select/copy-A ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
209 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
210 (let ((ediff-grab-mouse nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
211 (cond ((or (ediff-merge-job)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
212 (ediff-merge-with-ancestor-job))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
213 (ediff-copy-A-to-C nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
214 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
215 (ediff-copy-A-to-B nil)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
216
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
217 (defun ediff-toolbar-select/copy-B ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
218 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
219 (let ((ediff-grab-mouse nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
220 (cond ((or (ediff-merge-job)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
221 (ediff-merge-with-ancestor-job))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
222 (ediff-copy-B-to-C nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
223 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
224 (ediff-copy-B-to-A nil)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
225
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
226 (defun ediff-toolbar-toggle-split ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
227 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
228 (let ((ediff-grab-mouse nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
229 (ediff-toggle-split)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
230
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
231
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
232 (defun ediff-toolbar-save ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
233 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
234 (ediff-barf-if-not-control-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
235 (if (ediff-merge-job)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
236 (ediff-maybe-save-and-delete-merge 'save-and-continue)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
237 ;; 2-way or 3-way compare: save modified buffers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
238 (mapcar (function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
239 (lambda (type)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
240 (let ((ebuf (ediff-get-buffer type)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
241 (and (ediff-buffer-live-p ebuf)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
242 (ediff-eval-in-buffer ebuf
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
243 (and (buffer-modified-p)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
244 (save-buffer)))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
245 '(A B C))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
246
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
247
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
248 (defun ediff-toolbar-quit ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
249 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
250 (let ((ediff-grab-mouse nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
251 (ediff-quit nil)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
252
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
253 (defun ediff-toolbar-help ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
254 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
255 (ediff-toggle-help))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
256
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
257 (defun ediff-toolbar-refresh ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
258 "Recenter"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
259 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
260 (let ((ediff-grab-mouse nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
261 (ediff-recenter)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
262
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
263 (defun ediff-toolbar-refine ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
264 "Refine current difference region by computing fine diffs."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
265 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
266 (let ((ediff-grab-mouse nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
267 (ediff-make-or-kill-fine-diffs 'make-them)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
268
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
269 (defun ediff-toolbar-refine-needed-p ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
270 (and (> ediff-current-difference 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
271 (> ediff-auto-refine-limit
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
272 (- (ediff-get-diff-posn 'A 'end ediff-current-difference)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
273 (ediff-get-diff-posn 'A 'beg ediff-current-difference)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
274
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
275 (defvar ediff-toolbar
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
276 (if (featurep 'toolbar)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
277 '([ediff-toolbar-refine-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
278 ediff-toolbar-refine
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
279 t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
280 ;;; The toolbar is not automatically refreshed (in 19.14)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
281 ;;; when :activep changes state.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
282 ;;(ediff-toolbar-refine-needed-p)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
283 "Refine current difference region by computing fine diffs."]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
284 [ediff-toolbar-previous-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
285 ediff-toolbar-previous-difference
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
286 t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
287 "Go to the previous difference."]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
288 [ediff-toolbar-next-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
289 ediff-toolbar-next-difference
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
290 t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
291 "Advance to the next difference."]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
292 [ediff-toolbar-A-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
293 ediff-toolbar-select/copy-A
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
294 (not (ediff-3way-comparison-job))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
295 "Select/Copy difference A."]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
296 [ediff-toolbar-B-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
297 ediff-toolbar-select/copy-B
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
298 (not (ediff-3way-comparison-job))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
299 "Select/Copy difference B."]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
300 [ediff-toolbar-save-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
301 ediff-toolbar-save
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
302 t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
303 "Save buffers modified in this session."]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
304 [ediff-toolbar-refresh-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
305 ediff-toolbar-refresh
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
306 t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
307 "Refresh Ediff display (aka recenter)."]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
308 [ediff-toolbar-toggle-split-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
309 ediff-toolbar-toggle-split
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
310 t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
311 "Toggle split mode between side-to-side and one-on-top-of-another."]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
312 [ediff-toolbar-help-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
313 ediff-toolbar-help
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
314 t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
315 "Toggle short/long help."]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
316 nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
317 [ediff-toolbar-quit-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
318 ediff-toolbar-quit
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
319 t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
320 "Quit this ediff session."]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
321 )))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
322
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
323 (defvar ediff-toolbar-3way
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
324 (if (featurep 'toolbar)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
325 '([ediff-toolbar-refine-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
326 ediff-toolbar-refine
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
327 t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
328 ;;; The toolbar is not automatically refreshed (in 19.14)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
329 ;;; when :activep changes state.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
330 ;;(ediff-toolbar-refine-needed-p)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
331 "Refine current difference region by computing fine diffs."]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
332 [ediff-toolbar-previous-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
333 ediff-toolbar-previous-difference
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
334 t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
335 "Go to the previous difference."]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
336 [ediff-toolbar-next-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
337 ediff-toolbar-next-difference
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
338 t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
339 "Advance to the next difference."]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
340 [ediff-toolbar-save-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
341 ediff-toolbar-save
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
342 t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
343 "Save buffers modified in this session."]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
344 [ediff-toolbar-refresh-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
345 ediff-toolbar-refresh
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
346 t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
347 "Refresh Ediff display (aka recenter)."]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
348 [ediff-toolbar-toggle-split-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
349 ediff-toolbar-toggle-split
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
350 t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
351 "Toggle split mode between side-to-side and one-on-top-of-another."]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
352 [ediff-toolbar-help-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
353 ediff-toolbar-help
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
354 t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
355 "Toggle short/long help."]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
356 nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
357 [ediff-toolbar-quit-icon
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
358 ediff-toolbar-quit
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
359 t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
360 "Quit this ediff session."]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
361 )))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
362
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
363
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
364
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
365 ;;; Local Variables:
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
366 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
367 ;;; eval: (put 'ediff-eval-in-buffer 'lisp-indent-hook 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
368 ;;; eval: (put 'ediff-eval-in-buffer 'edebug-form-spec '(form body))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
369 ;;; End:
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
370
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
371 ;;; ediff-tbar.el ends here