0
|
1 ;;; ediff-hook.el --- setup for Ediff's menus and autoloads
|
|
2
|
82
|
3 ;; Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
0
|
4
|
|
5 ;; Author: Michael Kifer <kifer@cs.sunysb.edu>
|
|
6
|
|
7 ;; This file is part of GNU Emacs.
|
|
8
|
|
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
|
|
10 ;; it under the terms of the GNU General Public License as published by
|
|
11 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
12 ;; any later version.
|
|
13
|
|
14 ;; GNU Emacs is distributed in the hope that it will be useful,
|
|
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17 ;; GNU General Public License for more details.
|
|
18
|
|
19 ;; You should have received a copy of the GNU General Public License
|
|
20 ;; along with GNU Emacs; see the file COPYING. If not, write to the
|
|
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
22 ;; Boston, MA 02111-1307, USA.
|
|
23
|
|
24 ;;; Code:
|
|
25
|
|
26 ;;; These must be placed in menu-bar.el in Emacs
|
|
27 ;;
|
82
|
28 ;; (define-key menu-bar-tools-menu [ediff-misc]
|
|
29 ;; '("Ediff Miscellanea" . menu-bar-ediff-misc-menu))
|
0
|
30 ;; (define-key menu-bar-tools-menu [epatch]
|
|
31 ;; '("Apply Patch" . menu-bar-epatch-menu))
|
|
32 ;; (define-key menu-bar-tools-menu [ediff-merge]
|
|
33 ;; '("Merge" . menu-bar-ediff-merge-menu))
|
|
34 ;; (define-key menu-bar-tools-menu [ediff]
|
|
35 ;; '("Compare" . menu-bar-ediff-menu))
|
|
36
|
|
37 ;; Compiler pacifier
|
|
38 (defvar ediff-menu)
|
|
39 (defvar ediff-merge-menu)
|
|
40 (defvar epatch-menu)
|
82
|
41 (defvar ediff-misc-menu)
|
0
|
42 ;; end pacifier
|
|
43
|
80
|
44 ;; allow menus to be set up without ediff-wind.el being loaded
|
|
45 (defvar ediff-window-setup-function)
|
|
46
|
78
|
47
|
0
|
48 (defun ediff-xemacs-init-menus ()
|
|
49 (if (featurep 'menubar)
|
|
50 (progn
|
|
51 (add-submenu
|
|
52 '("Tools") ediff-menu "OO-Browser...")
|
|
53 (add-submenu
|
|
54 '("Tools") ediff-merge-menu "OO-Browser...")
|
|
55 (add-submenu
|
|
56 '("Tools") epatch-menu "OO-Browser...")
|
82
|
57 (add-submenu
|
|
58 '("Tools") ediff-misc-menu "OO-Browser...")
|
0
|
59 (add-menu-button
|
80
|
60 '("Tools")
|
|
61 ["-------" nil nil] "OO-Browser...")
|
0
|
62 )))
|
|
63
|
|
64
|
|
65 ;; explicit string-match is needed: ediff-xemacs-p is not defined at build time
|
|
66 (cond ((string-match "XEmacs" emacs-version)
|
|
67 (defvar ediff-menu
|
|
68 '("Compare"
|
|
69 ["Two Files..." ediff-files t]
|
|
70 ["Two Buffers..." ediff-buffers t]
|
|
71 ["Three Files..." ediff-files3 t]
|
|
72 ["Three Buffers..." ediff-buffers3 t]
|
|
73 "---"
|
|
74 ["Two Directories..." ediff-directories t]
|
|
75 ["Three Directories..." ediff-directories3 t]
|
|
76 "---"
|
|
77 ["File with Revision..." ediff-revision t]
|
|
78 ["Directory Revisions..." ediff-directory-revisions t]
|
|
79 "---"
|
|
80 ["Windows Word-by-word..." ediff-windows-wordwise t]
|
|
81 ["Windows Line-by-line..." ediff-windows-linewise t]
|
|
82 "---"
|
|
83 ["Regions Word-by-word..." ediff-regions-wordwise t]
|
|
84 ["Regions Line-by-line..." ediff-regions-linewise t]
|
|
85 ))
|
|
86 (defvar ediff-merge-menu
|
|
87 '("Merge"
|
|
88 ["Files..." ediff-merge-files t]
|
|
89 ["Files with Ancestor..." ediff-merge-files-with-ancestor t]
|
|
90 ["Buffers..." ediff-merge-buffers t]
|
|
91 ["Buffers with Ancestor..."
|
|
92 ediff-merge-buffers-with-ancestor t]
|
|
93 "---"
|
|
94 ["Directories..." ediff-merge-directories t]
|
|
95 ["Directories with Ancestor..."
|
|
96 ediff-merge-directories-with-ancestor t]
|
|
97 "---"
|
|
98 ["Revisions..." ediff-merge-revisions t]
|
|
99 ["Revisions with Ancestor..."
|
|
100 ediff-merge-revisions-with-ancestor t]
|
|
101 ["Directory Revisions..." ediff-merge-directory-revisions t]
|
|
102 ["Directory Revisions with Ancestor..."
|
|
103 ediff-merge-directory-revisions-with-ancestor t]
|
|
104 ))
|
|
105 (defvar epatch-menu
|
|
106 '("Apply Patch"
|
|
107 ["To a file..." ediff-patch-file t]
|
|
108 ["To a buffer..." ediff-patch-buffer t]
|
82
|
109 ))
|
|
110 (defvar ediff-misc-menu
|
|
111 '("Ediff Miscellanea"
|
|
112 ["Ediff Manual..." ediff-documentation t]
|
0
|
113 ["List Ediff Sessions..." ediff-show-registry t]
|
82
|
114 ["Use separate frame for Ediff control buffer..."
|
|
115 ediff-toggle-multiframe
|
|
116 :style toggle
|
|
117 :selected (if (and (featurep 'ediff-util)
|
|
118 (boundp 'ediff-window-setup-function))
|
|
119 (eq ediff-window-setup-function
|
|
120 'ediff-setup-windows-multiframe))]
|
|
121 ["Use a toolbar with Ediff control buffer"
|
|
122 ediff-toggle-use-toolbar
|
|
123 :style toggle
|
|
124 :selected (if (featurep 'ediff-tbar)
|
|
125 (ediff-use-toolbar-p))]
|
0
|
126 ))
|
|
127
|
|
128 ;; put these menus before Object-Oriented-Browser in Tools menu
|
|
129 (add-hook 'before-init-hook 'ediff-xemacs-init-menus)
|
|
130 (if (not purify-flag)
|
|
131 (ediff-xemacs-init-menus))
|
|
132 )
|
|
133
|
|
134 ;; Emacs--only if menu-bar is loaded
|
|
135 ((featurep 'menu-bar)
|
|
136 ;; initialize menu bar keymaps
|
82
|
137 (defvar menu-bar-ediff-misc-menu
|
|
138 (make-sparse-keymap "Ediff Miscellanea"))
|
|
139 (fset 'menu-bar-ediff-misc-menu
|
|
140 (symbol-value 'menu-bar-ediff-misc-menu))
|
0
|
141 (defvar menu-bar-epatch-menu (make-sparse-keymap "Apply Patch"))
|
|
142 (fset 'menu-bar-epatch-menu (symbol-value 'menu-bar-epatch-menu))
|
|
143 (defvar menu-bar-ediff-merge-menu (make-sparse-keymap "Merge"))
|
|
144 (fset 'menu-bar-ediff-merge-menu
|
|
145 (symbol-value 'menu-bar-ediff-merge-menu))
|
|
146 (defvar menu-bar-ediff-menu (make-sparse-keymap "Compare"))
|
|
147 (fset 'menu-bar-ediff-menu (symbol-value 'menu-bar-ediff-menu))
|
|
148
|
|
149 ;; define ediff-menu
|
|
150 (define-key menu-bar-ediff-menu [window]
|
|
151 '("This Window and Next Window" . compare-windows))
|
|
152 (define-key menu-bar-ediff-menu [ediff-windows-linewise]
|
|
153 '("Windows Line-by-line..." . ediff-windows-linewise))
|
|
154 (define-key menu-bar-ediff-menu [ediff-windows-wordwise]
|
|
155 '("Windows Word-by-word..." . ediff-windows-wordwise))
|
|
156 (define-key menu-bar-ediff-menu [separator-ediff-windows] '("--"))
|
|
157 (define-key menu-bar-ediff-menu [ediff-regions-linewise]
|
|
158 '("Regions Line-by-line..." . ediff-regions-linewise))
|
|
159 (define-key menu-bar-ediff-menu [ediff-regions-wordwise]
|
|
160 '("Regions Word-by-word..." . ediff-regions-wordwise))
|
|
161 (define-key menu-bar-ediff-menu [separator-ediff-regions] '("--"))
|
|
162 (define-key menu-bar-ediff-menu [ediff-dir-revision]
|
|
163 '("Directory Revisions..." . ediff-directory-revisions))
|
|
164 (define-key menu-bar-ediff-menu [ediff-revision]
|
|
165 '("File with Revision..." . ediff-revision))
|
|
166 (define-key menu-bar-ediff-menu [separator-ediff-directories] '("--"))
|
|
167 (define-key menu-bar-ediff-menu [ediff-directories3]
|
|
168 '("Three Directories..." . ediff-directories3))
|
|
169 (define-key menu-bar-ediff-menu [ediff-directories]
|
|
170 '("Two Directories..." . ediff-directories))
|
|
171 (define-key menu-bar-ediff-menu [separator-ediff-files] '("--"))
|
|
172 (define-key menu-bar-ediff-menu [ediff-buffers3]
|
|
173 '("Three Buffers..." . ediff-buffers3))
|
|
174 (define-key menu-bar-ediff-menu [ediff-files3]
|
|
175 '("Three Files..." . ediff-files3))
|
|
176 (define-key menu-bar-ediff-menu [ediff-buffers]
|
|
177 '("Two Buffers..." . ediff-buffers))
|
|
178 (define-key menu-bar-ediff-menu [ediff-files]
|
|
179 '("Two Files..." . ediff-files))
|
|
180
|
|
181 ;; define merge menu
|
|
182 (define-key
|
|
183 menu-bar-ediff-merge-menu [ediff-merge-dir-revisions-with-ancestor]
|
|
184 '("Directory Revisions with Ancestor..."
|
|
185 . ediff-merge-directory-revisions-with-ancestor))
|
|
186 (define-key
|
|
187 menu-bar-ediff-merge-menu [ediff-merge-dir-revisions]
|
|
188 '("Directory Revisions..." . ediff-merge-directory-revisions))
|
|
189 (define-key
|
|
190 menu-bar-ediff-merge-menu [ediff-merge-revisions-with-ancestor]
|
|
191 '("Revisions with Ancestor..."
|
|
192 . ediff-merge-revisions-with-ancestor))
|
|
193 (define-key menu-bar-ediff-merge-menu [ediff-merge-revisions]
|
|
194 '("Revisions..." . ediff-merge-revisions))
|
|
195 (define-key menu-bar-ediff-merge-menu [separator-ediff-merge] '("--"))
|
|
196 (define-key
|
|
197 menu-bar-ediff-merge-menu [ediff-merge-directories-with-ancestor]
|
|
198 '("Directories with Ancestor..."
|
|
199 . ediff-merge-directories-with-ancestor))
|
|
200 (define-key menu-bar-ediff-merge-menu [ediff-merge-directories]
|
|
201 '("Directories..." . ediff-merge-directories))
|
|
202 (define-key
|
|
203 menu-bar-ediff-merge-menu [separator-ediff-merge-dirs] '("--"))
|
|
204 (define-key
|
|
205 menu-bar-ediff-merge-menu [ediff-merge-buffers-with-ancestor]
|
|
206 '("Buffers with Ancestor..." . ediff-merge-buffers-with-ancestor))
|
|
207 (define-key menu-bar-ediff-merge-menu [ediff-merge-buffers]
|
|
208 '("Buffers..." . ediff-merge-buffers))
|
|
209 (define-key menu-bar-ediff-merge-menu [ediff-merge-files-with-ancestor]
|
|
210 '("Files with Ancestor..." . ediff-merge-files-with-ancestor))
|
|
211 (define-key menu-bar-ediff-merge-menu [ediff-merge-files]
|
|
212 '("Files..." . ediff-merge-files))
|
|
213
|
|
214 ;; define epatch menu
|
|
215 (define-key menu-bar-epatch-menu [ediff-patch-buffer]
|
|
216 '("To a Buffer..." . ediff-patch-buffer))
|
|
217 (define-key menu-bar-epatch-menu [ediff-patch-file]
|
82
|
218 '("To a File..." . ediff-patch-file))
|
|
219
|
|
220 ;; define ediff miscellanea
|
|
221 (define-key menu-bar-ediff-misc-menu [emultiframe]
|
|
222 '("Toggle use of separate control buffer frame..."
|
|
223 . ediff-toggle-multiframe))
|
|
224 (define-key menu-bar-ediff-misc-menu [eregistry]
|
|
225 '("List Ediff Sessions..." . ediff-show-registry))
|
|
226 (define-key menu-bar-ediff-misc-menu [ediff-doc]
|
|
227 '("Ediff Manual..." . ediff-documentation))
|
|
228 )
|
0
|
229
|
|
230 ) ; cond
|
|
231
|
|
232 ;; arrange for autoloads
|
|
233 (if purify-flag
|
|
234 () ; if dumping, autoloads are set up in loaddefs.el
|
|
235 ;; if the user decides to load this file, set up autoloads
|
|
236 ;; compare files and buffers
|
|
237 (autoload 'ediff "ediff" "Compare two files" t)
|
|
238 (autoload 'ediff-files "ediff" "Compare two files" t)
|
|
239 (autoload 'ediff-buffers "ediff" "Compare two bufers" t)
|
|
240 (autoload 'ebuffers "ediff" "Compare two bufers" t)
|
|
241 (autoload 'ediff3 "ediff" "Compare three files" t)
|
|
242 (autoload 'ediff-files3 "ediff" "Compare three files" t)
|
|
243 (autoload 'ediff-buffers3 "ediff" "Compare three bufers" t)
|
|
244 (autoload 'ebuffers3 "ediff" "Compare three bufers" t)
|
|
245
|
|
246 (autoload 'ediff-revision "ediff" "Compare versions of a file" t)
|
|
247
|
|
248 ;; compare regions and windows
|
|
249 (autoload 'ediff-windows-wordwise
|
|
250 "ediff" "Compare two windows word-by-word." t)
|
|
251 (autoload 'ediff-regions-wordwise
|
|
252 "ediff" "Compare two regions word-by-word." t)
|
|
253 (autoload 'ediff-windows-linewise
|
|
254 "ediff" "Compare two windows line-by-line." t)
|
|
255 (autoload 'ediff-regions-linewise
|
|
256 "ediff" "Compare two regions line-by-line." t)
|
|
257
|
|
258 ;; patch
|
|
259 (autoload 'ediff-patch-file "ediff" "Patch a file." t)
|
|
260 (autoload 'epatch "ediff" "Patch a file." t)
|
|
261 (autoload 'ediff-patch-buffer "ediff" "Patch a buffer.")
|
|
262 (autoload 'epatch-buffer "ediff" "Patch a buffer." t)
|
|
263
|
|
264 ;; merge
|
|
265 (autoload 'ediff-merge "ediff" "Merge two files." t)
|
|
266 (autoload 'ediff-merge-files "ediff" "Merge two files." t)
|
|
267 (autoload 'ediff-merge-files-with-ancestor
|
|
268 "ediff" "Merge two files using a third file as an ancestor." t)
|
|
269 (autoload 'ediff-merge-buffers "ediff" "Merge two buffers." t)
|
|
270 (autoload 'ediff-merge-buffers-with-ancestor
|
|
271 "ediff" "Merge two buffers using a third buffer as an ancestor." t)
|
|
272
|
|
273 (autoload 'ediff-merge-revisions "ediff" "Merge two versions of a file." t)
|
|
274 (autoload 'ediff-merge-revisions-with-ancestor
|
|
275 "ediff" "Merge two versions of a file." t)
|
|
276
|
|
277 ;; compare directories
|
|
278 (autoload 'edirs "ediff" "Compare files in two directories." t)
|
|
279 (autoload 'ediff-directories "ediff" "Compare files in two directories." t)
|
|
280 (autoload 'edirs3 "ediff" "Compare files in three directories." t)
|
|
281 (autoload
|
|
282 'ediff-directories3 "ediff" "Compare files in three directories." t)
|
|
283
|
|
284 (autoload 'edir-revisions
|
|
285 "ediff" "Compare two versions of a file." t)
|
|
286 (autoload 'ediff-directory-revisions
|
|
287 "ediff" "Compare two versions of a file." t)
|
|
288
|
|
289 ;; merge directories
|
|
290 (autoload 'edirs-merge "ediff" "Merge files in two directories." t)
|
|
291 (autoload 'ediff-merge-directories
|
|
292 "ediff" "Merge files in two directories." t)
|
|
293 (autoload 'edirs-merge-with-ancestor
|
|
294 "ediff"
|
|
295 "Merge files in two directories using files in a third dir as ancestors."
|
|
296 t)
|
|
297 (autoload 'ediff-merge-directories-with-ancestor
|
|
298 "ediff"
|
|
299 "Merge files in two directories using files in a third dir as ancestors."
|
|
300 t)
|
|
301
|
|
302 (autoload 'edir-merge-revisions
|
|
303 "ediff" "Merge versions of files in a directory." t)
|
|
304 (autoload 'ediff-merge-directory-revisions
|
|
305 "ediff" "Merge versions of files in a directory." t)
|
|
306 (autoload 'ediff-merge-directory-revisions-with-ancestor
|
|
307 "ediff"
|
|
308 "Merge versions of files in a directory using other versions as ancestors."
|
|
309 t)
|
|
310 (autoload 'edir-merge-revisions-with-ancestor
|
|
311 "ediff"
|
|
312 "Merge versions of files in a directory using other versions as ancestors."
|
|
313 t)
|
|
314
|
|
315 ;; misc
|
|
316 (autoload 'ediff-show-registry
|
78
|
317 "ediff-mult"
|
0
|
318 "Display the registry of active Ediff sessions."
|
|
319 t)
|
|
320 (autoload 'ediff-documentation
|
|
321 "ediff"
|
|
322 "Display Ediff's manual."
|
|
323 t)
|
|
324 (autoload 'ediff-version
|
|
325 "ediff"
|
|
326 "Show Ediff's version and last modification date."
|
|
327 t)
|
78
|
328 (autoload 'ediff-toggle-multiframe
|
|
329 "ediff-util"
|
|
330 "Toggle the use of separate frame for Ediff control buffer."
|
|
331 t)
|
82
|
332 (autoload 'ediff-toggle-use-toolbar
|
|
333 "ediff-util"
|
|
334 "Toggle the use of Ediff toolbar."
|
|
335 t)
|
|
336
|
0
|
337 ) ; if purify-flag
|
|
338
|
|
339
|
|
340 (provide 'ediff-hook)
|
|
341
|
|
342
|
|
343 ;;; ediff-hook.el ends here
|