1 ;;; ediff-hook.el --- setup for Ediff's menus and autoloads
3 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
4 ;; 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
6 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
8 ;; This file is part of GNU Emacs.
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 3, or (at your option)
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 ;; Boston, MA 02110-1301, USA.
29 ;;; These must be placed in menu-bar.el in Emacs
31 ;; (define-key menu-bar-tools-menu [ediff-misc]
32 ;; '("Ediff Miscellanea" . menu-bar-ediff-misc-menu))
33 ;; (define-key menu-bar-tools-menu [epatch]
34 ;; '("Apply Patch" . menu-bar-epatch-menu))
35 ;; (define-key menu-bar-tools-menu [ediff-merge]
36 ;; '("Merge" . menu-bar-ediff-merge-menu))
37 ;; (define-key menu-bar-tools-menu [ediff]
38 ;; '("Compare" . menu-bar-ediff-menu))
42 (defvar ediff-merge-menu
)
44 (defvar ediff-misc-menu
)
47 ;; allow menus to be set up without ediff-wind.el being loaded
48 (defvar ediff-window-setup-function
)
50 ;; This autoload is useless in Emacs because ediff-hook.el is dumped with
51 ;; emacs, but it is needed in XEmacs
53 (if (featurep 'xemacs
)
55 (defun ediff-xemacs-init-menus ()
56 (when (featurep 'menubar
)
58 '("Tools") ediff-menu
"OO-Browser...")
60 '("Tools") ediff-merge-menu
"OO-Browser...")
62 '("Tools") epatch-menu
"OO-Browser...")
64 '("Tools") ediff-misc-menu
"OO-Browser...")
66 '("Tools") "-------" "OO-Browser...")
70 ;; This autoload is useless in Emacs because ediff-hook.el is dumped with
71 ;; emacs, but it is needed in XEmacs
73 (if (featurep 'xemacs
)
77 ["Two Files..." ediff-files t
]
78 ["Two Buffers..." ediff-buffers t
]
79 ["Three Files..." ediff-files3 t
]
80 ["Three Buffers..." ediff-buffers3 t
]
82 ["Two Directories..." ediff-directories t
]
83 ["Three Directories..." ediff-directories3 t
]
85 ["File with Revision..." ediff-revision t
]
86 ["Directory Revisions..." ediff-directory-revisions t
]
88 ["Windows Word-by-word..." ediff-windows-wordwise t
]
89 ["Windows Line-by-line..." ediff-windows-linewise t
]
91 ["Regions Word-by-word..." ediff-regions-wordwise t
]
92 ["Regions Line-by-line..." ediff-regions-linewise t
]
94 (defvar ediff-merge-menu
96 ["Files..." ediff-merge-files t
]
97 ["Files with Ancestor..." ediff-merge-files-with-ancestor t
]
98 ["Buffers..." ediff-merge-buffers t
]
99 ["Buffers with Ancestor..."
100 ediff-merge-buffers-with-ancestor t
]
102 ["Directories..." ediff-merge-directories t
]
103 ["Directories with Ancestor..."
104 ediff-merge-directories-with-ancestor t
]
106 ["Revisions..." ediff-merge-revisions t
]
107 ["Revisions with Ancestor..."
108 ediff-merge-revisions-with-ancestor t
]
109 ["Directory Revisions..." ediff-merge-directory-revisions t
]
110 ["Directory Revisions with Ancestor..."
111 ediff-merge-directory-revisions-with-ancestor t
]
115 ["To a file..." ediff-patch-file t
]
116 ["To a buffer..." ediff-patch-buffer t
]
118 (defvar ediff-misc-menu
119 '("Ediff Miscellanea"
120 ["Ediff Manual" ediff-documentation t
]
121 ["Customize Ediff" ediff-customize t
]
122 ["List Ediff Sessions" ediff-show-registry t
]
123 ["Use separate frame for Ediff control buffer"
124 ediff-toggle-multiframe
126 :selected
(if (and (featurep 'ediff-util
)
127 (boundp 'ediff-window-setup-function
))
128 (eq ediff-window-setup-function
129 'ediff-setup-windows-multiframe
))]
130 ["Use a toolbar with Ediff control buffer"
131 ediff-toggle-use-toolbar
133 :selected
(if (featurep 'ediff-tbar
)
134 (ediff-use-toolbar-p))]))
136 ;; put these menus before Object-Oriented-Browser in Tools menu
137 (if (and (featurep 'menubar
) (not (featurep 'infodock
))
138 (not (featurep 'ediff-hook
)))
139 (ediff-xemacs-init-menus)))
141 ;; initialize menu bar keymaps
142 (defvar menu-bar-ediff-misc-menu
143 (make-sparse-keymap "Ediff Miscellanea"))
144 (fset 'menu-bar-ediff-misc-menu
145 (symbol-value 'menu-bar-ediff-misc-menu
))
146 (defvar menu-bar-epatch-menu
(make-sparse-keymap "Apply Patch"))
147 (fset 'menu-bar-epatch-menu
(symbol-value 'menu-bar-epatch-menu
))
148 (defvar menu-bar-ediff-merge-menu
(make-sparse-keymap "Merge"))
149 (fset 'menu-bar-ediff-merge-menu
150 (symbol-value 'menu-bar-ediff-merge-menu
))
151 (defvar menu-bar-ediff-menu
(make-sparse-keymap "Compare"))
152 (fset 'menu-bar-ediff-menu
(symbol-value 'menu-bar-ediff-menu
))
155 (define-key menu-bar-ediff-menu
[window]
156 '("This Window and Next Window" . compare-windows))
157 (define-key menu-bar-ediff-menu [ediff-windows-linewise]
158 '("Windows Line-by-line..." . ediff-windows-linewise))
159 (define-key menu-bar-ediff-menu [ediff-windows-wordwise]
160 '("Windows Word-by-word..." . ediff-windows-wordwise))
161 (define-key menu-bar-ediff-menu [separator-ediff-windows] '("--"))
162 (define-key menu-bar-ediff-menu [ediff-regions-linewise]
163 '("Regions Line-by-line..." . ediff-regions-linewise))
164 (define-key menu-bar-ediff-menu [ediff-regions-wordwise]
165 '("Regions Word-by-word..." . ediff-regions-wordwise))
166 (define-key menu-bar-ediff-menu [separator-ediff-regions] '("--"))
167 (define-key menu-bar-ediff-menu [ediff-dir-revision]
168 '("Directory Revisions..." . ediff-directory-revisions))
169 (define-key menu-bar-ediff-menu [ediff-revision]
170 '("File with Revision..." . ediff-revision))
171 (define-key menu-bar-ediff-menu [separator-ediff-directories] '("--"))
172 (define-key menu-bar-ediff-menu [ediff-directories3]
173 '("Three Directories..." . ediff-directories3))
174 (define-key menu-bar-ediff-menu [ediff-directories]
175 '("Two Directories..." . ediff-directories))
176 (define-key menu-bar-ediff-menu [separator-ediff-files] '("--"))
177 (define-key menu-bar-ediff-menu [ediff-buffers3]
178 '("Three Buffers..." . ediff-buffers3))
179 (define-key menu-bar-ediff-menu [ediff-files3]
180 '("Three Files..." . ediff-files3))
181 (define-key menu-bar-ediff-menu [ediff-buffers]
182 '("Two Buffers..." . ediff-buffers))
183 (define-key menu-bar-ediff-menu [ediff-files]
184 '("Two Files..." . ediff-files))
188 menu-bar-ediff-merge-menu [ediff-merge-dir-revisions-with-ancestor]
189 '("Directory Revisions with Ancestor..."
190 . ediff-merge-directory-revisions-with-ancestor))
192 menu-bar-ediff-merge-menu [ediff-merge-dir-revisions]
193 '("Directory Revisions..." . ediff-merge-directory-revisions))
195 menu-bar-ediff-merge-menu [ediff-merge-revisions-with-ancestor]
196 '("Revisions with Ancestor..."
197 . ediff-merge-revisions-with-ancestor))
198 (define-key menu-bar-ediff-merge-menu [ediff-merge-revisions]
199 '("Revisions..." . ediff-merge-revisions))
200 (define-key menu-bar-ediff-merge-menu [separator-ediff-merge] '("--"))
202 menu-bar-ediff-merge-menu [ediff-merge-directories-with-ancestor]
203 '("Directories with Ancestor..."
204 . ediff-merge-directories-with-ancestor))
205 (define-key menu-bar-ediff-merge-menu [ediff-merge-directories]
206 '("Directories..." . ediff-merge-directories))
208 menu-bar-ediff-merge-menu [separator-ediff-merge-dirs] '("--"))
210 menu-bar-ediff-merge-menu [ediff-merge-buffers-with-ancestor]
211 '("Buffers with Ancestor..." . ediff-merge-buffers-with-ancestor))
212 (define-key menu-bar-ediff-merge-menu [ediff-merge-buffers]
213 '("Buffers..." . ediff-merge-buffers))
214 (define-key menu-bar-ediff-merge-menu [ediff-merge-files-with-ancestor]
215 '("Files with Ancestor..." . ediff-merge-files-with-ancestor))
216 (define-key menu-bar-ediff-merge-menu [ediff-merge-files]
217 '("Files..." . ediff-merge-files))
219 ;; define epatch menu
220 (define-key menu-bar-epatch-menu [ediff-patch-buffer]
221 '("To a Buffer..." . ediff-patch-buffer))
222 (define-key menu-bar-epatch-menu [ediff-patch-file]
223 '("To a File..." . ediff-patch-file))
225 ;; define ediff miscellanea
226 (define-key menu-bar-ediff-misc-menu [emultiframe]
227 '("Toggle use of separate control buffer frame"
228 . ediff-toggle-multiframe))
229 (define-key menu-bar-ediff-misc-menu [eregistry]
230 '("List Ediff Sessions" . ediff-show-registry))
231 (define-key menu-bar-ediff-misc-menu [ediff-cust]
232 '("Customize Ediff" . ediff-customize))
233 (define-key menu-bar-ediff-misc-menu [ediff-doc]
234 '("Ediff Manual" . ediff-documentation)))
236 ;; arrange for autoloads
238 () ; if dumping, autoloads are set up in loaddefs.el
239 ;; if the user decides to load this file, set up autoloads
240 ;; compare files and buffers
241 (autoload 'ediff "ediff" "Compare two files." t)
242 (autoload 'ediff-files "ediff" "Compare two files." t)
243 (autoload 'ediff-buffers "ediff" "Compare two buffers." t)
244 (autoload 'ebuffers "ediff" "Compare two buffers." t)
245 (autoload 'ediff3 "ediff" "Compare three files." t)
246 (autoload 'ediff-files3 "ediff" "Compare three files." t)
247 (autoload 'ediff-buffers3 "ediff" "Compare three buffers." t)
248 (autoload 'ebuffers3 "ediff" "Compare three buffers." t)
250 (autoload 'erevision "ediff" "Compare versions of a file." t)
251 (autoload 'ediff-revision "ediff" "Compare versions of a file." t)
253 ;; compare regions and windows
254 (autoload 'ediff-windows-wordwise
255 "ediff" "Compare two windows word-by-word." t)
256 (autoload 'ediff-regions-wordwise
257 "ediff" "Compare two regions word-by-word." t)
258 (autoload 'ediff-windows-linewise
259 "ediff" "Compare two windows line-by-line." t)
260 (autoload 'ediff-regions-linewise
261 "ediff" "Compare two regions line-by-line." t)
264 (autoload 'ediff-patch-file "ediff" "Patch a file." t)
265 (autoload 'epatch "ediff" "Patch a file." t)
266 (autoload 'ediff-patch-buffer "ediff" "Patch a buffer.")
267 (autoload 'epatch-buffer "ediff" "Patch a buffer." t)
270 (autoload 'ediff-merge "ediff" "Merge two files." t)
271 (autoload 'ediff-merge-files "ediff" "Merge two files." t)
272 (autoload 'ediff-merge-files-with-ancestor
273 "ediff" "Merge two files using a third file as an ancestor." t)
274 (autoload 'ediff-merge-buffers "ediff" "Merge two buffers." t)
275 (autoload 'ediff-merge-buffers-with-ancestor
276 "ediff" "Merge two buffers using a third buffer as an ancestor." t)
278 (autoload 'ediff-merge-revisions "ediff" "Merge two versions of a file." t)
279 (autoload 'ediff-merge-revisions-with-ancestor
280 "ediff" "Merge two versions of a file." t)
282 ;; compare directories
283 (autoload 'edirs "ediff" "Compare files in two directories." t)
284 (autoload 'ediff-directories "ediff" "Compare files in two directories." t)
285 (autoload 'edirs3 "ediff" "Compare files in three directories." t)
287 'ediff-directories3 "ediff" "Compare files in three directories." t)
289 (autoload 'edir-revisions
290 "ediff" "Compare two versions of a file." t)
291 (autoload 'ediff-directory-revisions
292 "ediff" "Compare two versions of a file." t)
295 (autoload 'edirs-merge "ediff" "Merge files in two directories." t)
296 (autoload 'ediff-merge-directories
297 "ediff" "Merge files in two directories." t)
298 (autoload 'edirs-merge-with-ancestor
300 "Merge files in two directories using files in a third dir as ancestors."
302 (autoload 'ediff-merge-directories-with-ancestor
304 "Merge files in two directories using files in a third dir as ancestors."
307 (autoload 'edir-merge-revisions
308 "ediff" "Merge versions of files in a directory." t)
309 (autoload 'ediff-merge-directory-revisions
310 "ediff" "Merge versions of files in a directory." t)
311 (autoload 'ediff-merge-directory-revisions-with-ancestor
313 "Merge versions of files in a directory using other versions as ancestors."
315 (autoload 'edir-merge-revisions-with-ancestor
317 "Merge versions of files in a directory using other versions as ancestors."
321 (autoload 'ediff-show-registry
323 "Display the registry of active Ediff sessions."
327 "Display the registry of active Ediff sessions."
329 (autoload 'ediff-documentation
331 "Display Ediff's manual."
333 (autoload 'ediff-version
335 "Show Ediff's version and last modification date."
337 (autoload 'ediff-toggle-multiframe
339 "Toggle the use of separate frame for Ediff control buffer."
341 (autoload 'ediff-toggle-use-toolbar
343 "Toggle the use of Ediff toolbar."
349 (provide 'ediff-hook)
352 ;;; arch-tag: 512f8656-8a4b-4789-af5d-5c6144498df3
353 ;;; ediff-hook.el ends here