1 ;;; ediff-hook.el --- setup for Ediff's menus and autoloads
3 ;; Copyright (C) 1995, 1996 Free Software Foundation, Inc.
5 ;; Author: Michael Kifer <kifer@cs.sunysb.edu>
7 ;; This file is part of GNU Emacs.
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)
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.
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.
26 ;;; These must be placed in menu-bar.el in Emacs
28 ;; (define-key menu-bar-tools-menu [epatch]
29 ;; '("Apply Patch" . menu-bar-epatch-menu))
30 ;; (define-key menu-bar-tools-menu [ediff-merge]
31 ;; '("Merge" . menu-bar-ediff-merge-menu))
32 ;; (define-key menu-bar-tools-menu [ediff]
33 ;; '("Compare" . menu-bar-ediff-menu))
37 (defvar ediff-merge-menu
)
41 (defun ediff-xemacs-init-menus ()
42 (if (featurep 'menubar
)
45 '("Tools") ediff-menu
"OO-Browser...")
47 '("Tools") ediff-merge-menu
"OO-Browser...")
49 '("Tools") epatch-menu
"OO-Browser...")
52 ["-------" nil nil
] "OO-Browser...")
56 ;; explicit string-match is needed: ediff-xemacs-p is not defined at build time
57 (cond ((string-match "XEmacs" emacs-version
)
60 ["Two Files..." ediff-files t
]
61 ["Two Buffers..." ediff-buffers t
]
62 ["Three Files..." ediff-files3 t
]
63 ["Three Buffers..." ediff-buffers3 t
]
65 ["Two Directories..." ediff-directories t
]
66 ["Three Directories..." ediff-directories3 t
]
68 ["File with Revision..." ediff-revision t
]
69 ["Directory Revisions..." ediff-directory-revisions t
]
71 ["Windows Word-by-word..." ediff-windows-wordwise t
]
72 ["Windows Line-by-line..." ediff-windows-linewise t
]
74 ["Regions Word-by-word..." ediff-regions-wordwise t
]
75 ["Regions Line-by-line..." ediff-regions-linewise t
]
77 ["List Ediff Sessions..." ediff-show-registry t
]
78 ["Ediff Manual..." ediff-documentation t
]
80 (defvar ediff-merge-menu
82 ["Files..." ediff-merge-files t
]
83 ["Files with Ancestor..." ediff-merge-files-with-ancestor t
]
84 ["Buffers..." ediff-merge-buffers t
]
85 ["Buffers with Ancestor..."
86 ediff-merge-buffers-with-ancestor t
]
88 ["Directories..." ediff-merge-directories t
]
89 ["Directories with Ancestor..."
90 ediff-merge-directories-with-ancestor t
]
92 ["Revisions..." ediff-merge-revisions t
]
93 ["Revisions with Ancestor..."
94 ediff-merge-revisions-with-ancestor t
]
95 ["Directory Revisions..." ediff-merge-directory-revisions t
]
96 ["Directory Revisions with Ancestor..."
97 ediff-merge-directory-revisions-with-ancestor t
]
99 ["List Ediff Sessions..." ediff-show-registry t
]
100 ["Ediff Manual..." ediff-documentation t
]
104 ["To a file..." ediff-patch-file t
]
105 ["To a buffer..." ediff-patch-buffer t
]
107 ["List Ediff Sessions..." ediff-show-registry t
]
108 ["Ediff Manual..." ediff-documentation t
]
111 ;; put these menus before Object-Oriented-Browser in Tools menu
112 (add-hook 'before-init-hook
'ediff-xemacs-init-menus
)
113 (if (not purify-flag
)
114 (ediff-xemacs-init-menus))
117 ;; Emacs--only if menu-bar is loaded
118 ((featurep 'menu-bar
)
119 ;; initialize menu bar keymaps
120 (defvar menu-bar-epatch-menu
(make-sparse-keymap "Apply Patch"))
121 (fset 'menu-bar-epatch-menu
(symbol-value 'menu-bar-epatch-menu
))
122 (defvar menu-bar-ediff-merge-menu
(make-sparse-keymap "Merge"))
123 (fset 'menu-bar-ediff-merge-menu
124 (symbol-value 'menu-bar-ediff-merge-menu
))
125 (defvar menu-bar-ediff-menu
(make-sparse-keymap "Compare"))
126 (fset 'menu-bar-ediff-menu
(symbol-value 'menu-bar-ediff-menu
))
129 (define-key menu-bar-ediff-menu
[ediff-doc
]
130 '("Ediff Manual..." . ediff-documentation
))
131 (define-key menu-bar-ediff-menu
[eregistry]
132 '("List Ediff Sessions..." . ediff-show-registry))
133 (define-key menu-bar-ediff-menu [separator-ediff-manual] '("--"))
134 (define-key menu-bar-ediff-menu [window]
135 '("This Window and Next Window" . compare-windows))
136 (define-key menu-bar-ediff-menu [ediff-windows-linewise]
137 '("Windows Line-by-line..." . ediff-windows-linewise))
138 (define-key menu-bar-ediff-menu [ediff-windows-wordwise]
139 '("Windows Word-by-word..." . ediff-windows-wordwise))
140 (define-key menu-bar-ediff-menu [separator-ediff-windows] '("--"))
141 (define-key menu-bar-ediff-menu [ediff-regions-linewise]
142 '("Regions Line-by-line..." . ediff-regions-linewise))
143 (define-key menu-bar-ediff-menu [ediff-regions-wordwise]
144 '("Regions Word-by-word..." . ediff-regions-wordwise))
145 (define-key menu-bar-ediff-menu [separator-ediff-regions] '("--"))
146 (define-key menu-bar-ediff-menu [ediff-dir-revision]
147 '("Directory Revisions..." . ediff-directory-revisions))
148 (define-key menu-bar-ediff-menu [ediff-revision]
149 '("File with Revision..." . ediff-revision))
150 (define-key menu-bar-ediff-menu [separator-ediff-directories] '("--"))
151 (define-key menu-bar-ediff-menu [ediff-directories3]
152 '("Three Directories..." . ediff-directories3))
153 (define-key menu-bar-ediff-menu [ediff-directories]
154 '("Two Directories..." . ediff-directories))
155 (define-key menu-bar-ediff-menu [separator-ediff-files] '("--"))
156 (define-key menu-bar-ediff-menu [ediff-buffers3]
157 '("Three Buffers..." . ediff-buffers3))
158 (define-key menu-bar-ediff-menu [ediff-files3]
159 '("Three Files..." . ediff-files3))
160 (define-key menu-bar-ediff-menu [ediff-buffers]
161 '("Two Buffers..." . ediff-buffers))
162 (define-key menu-bar-ediff-menu [ediff-files]
163 '("Two Files..." . ediff-files))
166 (define-key menu-bar-ediff-merge-menu [ediff-doc2]
167 '("Ediff Manual..." . ediff-documentation))
168 (define-key menu-bar-ediff-merge-menu [eregistry2]
169 '("List Ediff Sessions..." . ediff-show-registry))
171 menu-bar-ediff-merge-menu [separator-ediff-merge-manual] '("--"))
173 menu-bar-ediff-merge-menu [ediff-merge-dir-revisions-with-ancestor]
174 '("Directory Revisions with Ancestor..."
175 . ediff-merge-directory-revisions-with-ancestor))
177 menu-bar-ediff-merge-menu [ediff-merge-dir-revisions]
178 '("Directory Revisions..." . ediff-merge-directory-revisions))
180 menu-bar-ediff-merge-menu [ediff-merge-revisions-with-ancestor]
181 '("Revisions with Ancestor..."
182 . ediff-merge-revisions-with-ancestor))
183 (define-key menu-bar-ediff-merge-menu [ediff-merge-revisions]
184 '("Revisions..." . ediff-merge-revisions))
185 (define-key menu-bar-ediff-merge-menu [separator-ediff-merge] '("--"))
187 menu-bar-ediff-merge-menu [ediff-merge-directories-with-ancestor]
188 '("Directories with Ancestor..."
189 . ediff-merge-directories-with-ancestor))
190 (define-key menu-bar-ediff-merge-menu [ediff-merge-directories]
191 '("Directories..." . ediff-merge-directories))
193 menu-bar-ediff-merge-menu [separator-ediff-merge-dirs] '("--"))
195 menu-bar-ediff-merge-menu [ediff-merge-buffers-with-ancestor]
196 '("Buffers with Ancestor..." . ediff-merge-buffers-with-ancestor))
197 (define-key menu-bar-ediff-merge-menu [ediff-merge-buffers]
198 '("Buffers..." . ediff-merge-buffers))
199 (define-key menu-bar-ediff-merge-menu [ediff-merge-files-with-ancestor]
200 '("Files with Ancestor..." . ediff-merge-files-with-ancestor))
201 (define-key menu-bar-ediff-merge-menu [ediff-merge-files]
202 '("Files..." . ediff-merge-files))
204 ;; define epatch menu
205 (define-key menu-bar-epatch-menu [ediff-doc3]
206 '("Ediff Manual..." . ediff-documentation))
207 (define-key menu-bar-epatch-menu [eregistry3]
208 '("List Ediff Sessions..." . ediff-show-registry))
209 (define-key menu-bar-epatch-menu [separator-epatch] '("--"))
210 (define-key menu-bar-epatch-menu [ediff-patch-buffer]
211 '("To a Buffer..." . ediff-patch-buffer))
212 (define-key menu-bar-epatch-menu [ediff-patch-file]
213 '("To a File..." . ediff-patch-file)))
217 ;; arrange for autoloads
219 () ; if dumping, autoloads are set up in loaddefs.el
220 ;; if the user decides to load this file, set up autoloads
221 ;; compare files and buffers
222 (autoload 'ediff "ediff" "Compare two files" t)
223 (autoload 'ediff-files "ediff" "Compare two files" t)
224 (autoload 'ediff-buffers "ediff" "Compare two bufers" t)
225 (autoload 'ebuffers "ediff" "Compare two bufers" t)
226 (autoload 'ediff3 "ediff" "Compare three files" t)
227 (autoload 'ediff-files3 "ediff" "Compare three files" t)
228 (autoload 'ediff-buffers3 "ediff" "Compare three bufers" t)
229 (autoload 'ebuffers3 "ediff" "Compare three bufers" t)
231 (autoload 'ediff-revision "ediff" "Compare versions of a file" t)
233 ;; compare regions and windows
234 (autoload 'ediff-windows-wordwise
235 "ediff" "Compare two windows word-by-word." t)
236 (autoload 'ediff-regions-wordwise
237 "ediff" "Compare two regions word-by-word." t)
238 (autoload 'ediff-windows-linewise
239 "ediff" "Compare two windows line-by-line." t)
240 (autoload 'ediff-regions-linewise
241 "ediff" "Compare two regions line-by-line." t)
244 (autoload 'ediff-patch-file "ediff" "Patch a file." t)
245 (autoload 'epatch "ediff" "Patch a file." t)
246 (autoload 'ediff-patch-buffer "ediff" "Patch a buffer.")
247 (autoload 'epatch-buffer "ediff" "Patch a buffer." t)
250 (autoload 'ediff-merge "ediff" "Merge two files." t)
251 (autoload 'ediff-merge-files "ediff" "Merge two files." t)
252 (autoload 'ediff-merge-files-with-ancestor
253 "ediff" "Merge two files using a third file as an ancestor." t)
254 (autoload 'ediff-merge-buffers "ediff" "Merge two buffers." t)
255 (autoload 'ediff-merge-buffers-with-ancestor
256 "ediff" "Merge two buffers using a third buffer as an ancestor." t)
258 (autoload 'ediff-merge-revisions "ediff" "Merge two versions of a file." t)
259 (autoload 'ediff-merge-revisions-with-ancestor
260 "ediff" "Merge two versions of a file." t)
262 ;; compare directories
263 (autoload 'edirs "ediff" "Compare files in two directories." t)
264 (autoload 'ediff-directories "ediff" "Compare files in two directories." t)
265 (autoload 'edirs3 "ediff" "Compare files in three directories." t)
267 'ediff-directories3 "ediff" "Compare files in three directories." t)
269 (autoload 'edir-revisions
270 "ediff" "Compare two versions of a file." t)
271 (autoload 'ediff-directory-revisions
272 "ediff" "Compare two versions of a file." t)
275 (autoload 'edirs-merge "ediff" "Merge files in two directories." t)
276 (autoload 'ediff-merge-directories
277 "ediff" "Merge files in two directories." t)
278 (autoload 'edirs-merge-with-ancestor
280 "Merge files in two directories using files in a third dir as ancestors."
282 (autoload 'ediff-merge-directories-with-ancestor
284 "Merge files in two directories using files in a third dir as ancestors."
287 (autoload 'edir-merge-revisions
288 "ediff" "Merge versions of files in a directory." t)
289 (autoload 'ediff-merge-directory-revisions
290 "ediff" "Merge versions of files in a directory." t)
291 (autoload 'ediff-merge-directory-revisions-with-ancestor
293 "Merge versions of files in a directory using other versions as ancestors."
295 (autoload 'edir-merge-revisions-with-ancestor
297 "Merge versions of files in a directory using other versions as ancestors."
301 (autoload 'ediff-show-registry
303 "Display the registry of active Ediff sessions."
305 (autoload 'ediff-documentation
307 "Display Ediff's manual."
309 (autoload 'ediff-version
311 "Show Ediff's version and last modification date."
316 (provide 'ediff-hook)
319 ;;; ediff-hook.el ends here