1 ;;; ediff-hook.el --- setup for Ediff's menus and autoloads
2 ;;; Copyright (C) 1995 Free Software Foundation, Inc.
4 ;; Author: Michael Kifer <kifer@cs.sunysb.edu>
6 ;; This file is part of GNU Emacs.
8 ;; GNU Emacs is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; GNU Emacs is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with GNU Emacs; see the file COPYING. If not, write to
20 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
23 ;;; These must be placed in menu-bar.el in Emacs
25 ;; (define-key menu-bar-tools-menu [eregistry]
26 ;; '("List Ediff Sessions" . ediff-show-registry))
27 ;; (define-key menu-bar-tools-menu [epatch]
28 ;; '("Apply Patch" . menu-bar-epatch-menu))
29 ;; (define-key menu-bar-tools-menu [ediff-merge]
30 ;; '("Merge" . menu-bar-ediff-merge-menu))
31 ;; (define-key menu-bar-tools-menu [ediff]
32 ;; '("Compare" . menu-bar-ediff-menu))
35 (defun ediff-xemacs-init-menus ()
36 (if (featurep 'menubar
)
39 '("Tools") ediff-menu
"OO-Browser...")
41 '("Tools") ediff-merge-menu
"OO-Browser...")
43 '("Tools") epatch-menu
"OO-Browser...")
46 ["List Ediff Sessions" ediff-show-registry t
] "OO-Browser...")
49 ["---" nil nil
] "OO-Browser...")
54 ;; explicit string-match is needed: ediff-xemacs-p is not defined at build time
55 (cond ((string-match "XEmacs" emacs-version
)
58 ["Two Files..." ediff-files t
]
59 ["Two Buffers..." ediff-buffers t
]
60 ["Three Files..." ediff-files3 t
]
61 ["Three Buffers..." ediff-buffers3 t
]
63 ["Two Directories..." ediff-directories t
]
64 ["Three Directories..." ediff-directories3 t
]
66 ["File with Revision..." ediff-revision t
]
67 ["Directory Revisions..." ediff-directory-revisions t
]
69 ["Windows Word-by-word..." ediff-windows-wordwise t
]
70 ["Windows Line-by-line..." ediff-windows-linewise t
]
72 ["Regions Word-by-word..." ediff-regions-wordwise t
]
73 ["Regions Line-by-line..." ediff-regions-linewise t
]))
74 (defvar ediff-merge-menu
76 ["Files..." ediff-merge-files t
]
77 ["Files with Ancestor..." ediff-merge-files-with-ancestor t
]
78 ["Buffers..." ediff-merge-buffers t
]
79 ["Buffers with Ancestor..."
80 ediff-merge-buffers-with-ancestor t
]
82 ["Directories..." ediff-merge-directories t
]
83 ["Directories with Ancestor..."
84 ediff-merge-directories-with-ancestor t
]
86 ["Revisions..." ediff-merge-revisions t
]
87 ["Revisions with Ancestor..."
88 ediff-merge-revisions-with-ancestor t
]
89 ["Directory Revisions..." ediff-merge-directory-revisions t
]
90 ["Directory Revisions with Ancestor..."
91 ediff-merge-directory-revisions-with-ancestor t
]))
94 ["To a file..." ediff-patch-file t
]
95 ["To a buffer..." ediff-patch-buffer t
]))
97 ;; put these menus before Object-Oriented-Browser in Tools menu
98 (add-hook 'before-init-hook
'ediff-xemacs-init-menus
)
99 ;; this `if' is to be deleted before going into distribution
100 (if (not purify-flag
)
101 (ediff-xemacs-init-menus))
104 ;; Emacs--only if menu-bar is loaded
105 ((featurep 'menu-bar
)
106 ;; initialize menu bar keymaps
107 (defvar menu-bar-epatch-menu
(make-sparse-keymap "Apply Patch"))
108 (fset 'menu-bar-epatch-menu
(symbol-value 'menu-bar-epatch-menu
))
109 (defvar menu-bar-ediff-merge-menu
(make-sparse-keymap "Merge"))
110 (fset 'menu-bar-ediff-merge-menu
111 (symbol-value 'menu-bar-ediff-merge-menu
))
112 (defvar menu-bar-ediff-menu
(make-sparse-keymap "Compare"))
113 (fset 'menu-bar-ediff-menu
(symbol-value 'menu-bar-ediff-menu
))
116 (define-key menu-bar-ediff-menu
[window]
117 '("This Window And Next Window" . compare-windows))
118 (define-key menu-bar-ediff-menu [ediff-dir-revision]
119 '("Directory Revisions..." . ediff-directory-revisions))
120 (define-key menu-bar-ediff-menu [ediff-revision]
121 '("File with Revision..." . ediff-revision))
122 (define-key menu-bar-ediff-menu [separator-ediff-directories] '("--"))
123 (define-key menu-bar-ediff-menu [ediff-directories3]
124 '("Three Directories..." . ediff-directories3))
125 (define-key menu-bar-ediff-menu [ediff-directories]
126 '("Two Directories..." . ediff-directories))
127 (define-key menu-bar-ediff-menu [separator-ediff-files] '("--"))
128 (define-key menu-bar-ediff-menu [ediff-buffers3]
129 '("Three Buffers..." . ediff-buffers3))
130 (define-key menu-bar-ediff-menu [ediff-files3]
131 '("Three Files..." . ediff-files3))
132 (define-key menu-bar-ediff-menu [ediff-buffers]
133 '("Two Buffers..." . ediff-buffers))
134 (define-key menu-bar-ediff-menu [ediff-files]
135 '("Two Files..." . ediff-files))
136 (define-key menu-bar-ediff-menu [separator-ediff-regions] '("--"))
137 (define-key menu-bar-ediff-menu [ediff-regions-linewise]
138 '("Regions Line-by-line..." . ediff-regions-linewise))
139 (define-key menu-bar-ediff-menu [ediff-regions-wordwise]
140 '("Regions Word-by-word..." . ediff-regions-wordwise))
141 (define-key menu-bar-ediff-menu [separator-ediff-windows] '("--"))
142 (define-key menu-bar-ediff-menu [ediff-windows-linewise]
143 '("Windows Line-by-line..." . ediff-windows-linewise))
144 (define-key menu-bar-ediff-menu [ediff-windows-wordwise]
145 '("Windows Word-by-word..." . ediff-windows-wordwise))
149 menu-bar-ediff-merge-menu [ediff-merge-dir-revisions-with-ancestor]
150 '("Directory Revisions with Ancestor..."
151 . ediff-merge-directory-revisions-with-ancestor))
153 menu-bar-ediff-merge-menu [ediff-merge-dir-revisions]
154 '("Directory Revisions..." . ediff-merge-directory-revisions))
156 menu-bar-ediff-merge-menu [ediff-merge-revisions-with-ancestor]
157 '("Revisions with Ancestor..."
158 . ediff-merge-revisions-with-ancestor))
159 (define-key menu-bar-ediff-merge-menu [ediff-merge-revisions]
160 '("Revisions..." . ediff-merge-revisions))
161 (define-key menu-bar-ediff-merge-menu [separator-ediff-merge] '("--"))
163 menu-bar-ediff-merge-menu [ediff-merge-directories-with-ancestor]
164 '("Directories with Ancestor..."
165 . ediff-merge-directories-with-ancestor))
166 (define-key menu-bar-ediff-merge-menu [ediff-merge-directories]
167 '("Directories..." . ediff-merge-directories))
169 menu-bar-ediff-merge-menu [separator-ediff-merge-dirs] '("--"))
171 menu-bar-ediff-merge-menu [ediff-merge-buffers-with-ancestor]
172 '("Buffers with Ancestor..." . ediff-merge-buffers-with-ancestor))
173 (define-key menu-bar-ediff-merge-menu [ediff-merge-buffers]
174 '("Buffers..." . ediff-merge-buffers))
175 (define-key menu-bar-ediff-merge-menu [ediff-merge-files-with-ancestor]
176 '("Files with Ancestor..." . ediff-merge-files-with-ancestor))
177 (define-key menu-bar-ediff-merge-menu [ediff-merge-files]
178 '("Files..." . ediff-merge-files))
180 ;; define epatch menu
181 (define-key menu-bar-epatch-menu [ediff-patch-buffer]
182 '("To a Buffer..." . ediff-patch-buffer))
183 (define-key menu-bar-epatch-menu [ediff-patch-file]
184 '("To a File..." . ediff-patch-file)))
188 ;; arrange for autoloads
190 () ; if dumping, autoloads are set up in loaddefs.el
191 ;; if the user decides to load this file, set up autoloads
192 ;; compare files and buffers
193 (autoload 'ediff "ediff" "Compare two files" t)
194 (autoload 'ediff-files "ediff" "Compare two files" t)
195 (autoload 'ediff-buffers "ediff" "Compare two bufers" t)
196 (autoload 'ediff3 "ediff" "Compare three files" t)
197 (autoload 'ediff-files3 "ediff" "Compare three files" t)
198 (autoload 'ediff-buffers3 "ediff" "Compare three bufers" t)
200 (autoload 'ediff-revision "ediff" "Compare versions of a file" t)
202 ;; compare regions and windows
203 (autoload 'ediff-windows-wordwise
204 "ediff" "Compare two windows word-by-word" t)
205 (autoload 'ediff-regions-wordwise
206 "ediff" "Compare two regions word-by-word" t)
207 (autoload 'ediff-windows-linewise
208 "ediff" "Compare two windows line-by-line" t)
209 (autoload 'ediff-regions-linewise
210 "ediff" "Compare two regions line-by-line" t)
213 (autoload 'ediff-patch-file "ediff" "Patch a file" t)
214 (autoload 'epatch "ediff" "Patch a file" t)
215 (autoload 'ediff-patch-buffer "ediff" "Patch a buffer")
216 (autoload 'epatch-buffer "ediff" "Patch a buffer" t)
219 (autoload 'ediff-merge "ediff" "Merge two files" t)
220 (autoload 'ediff-merge-files "ediff" "Merge two files" t)
221 (autoload 'ediff-merge-files-with-ancestor
222 "ediff" "Merge two files using a third file as an ancestor" t)
223 (autoload 'ediff-merge-buffers "ediff" "Merge two buffers" t)
224 (autoload 'ediff-merge-buffers-with-ancestor
225 "ediff" "Merge two buffers using a third buffer as an ancestor" t)
227 (autoload 'ediff-merge-revisions "ediff" "Merge two versions of a file" t)
228 (autoload 'ediff-merge-revisions-with-ancestor
229 "ediff" "Merge two versions of a file" t)
231 ;; compare directories
232 (autoload 'edirs "ediff" "Compare files in two directories" t)
233 (autoload 'ediff-directories "ediff" "Compare files in two directories" t)
234 (autoload 'edirs3 "ediff" "Compare files in three directories" t)
235 (autoload 'ediff-directories3 "ediff" "Compare files in three directories" t)
237 (autoload 'edir-revisions
238 "ediff" "Compare two versions of a file" t)
239 (autoload 'ediff-directory-revisions
240 "ediff" "Compare two versions of a file" t)
243 (autoload 'edirs-merge "ediff" "Merge files in two directories" t)
244 (autoload 'ediff-merge-directories
245 "ediff" "Merge files in two directories" t)
246 (autoload 'edirs-merge-with-ancestor
248 "Merge files in two directories using files in a third dir as ancestors" t)
249 (autoload 'ediff-merge-directories-with-ancestor
251 "Merge files in two directories using files in a third dir as ancestors" t)
253 (autoload 'edir-merge-revisions
254 "ediff" "Merge versions of files in a directory" t)
255 (autoload 'ediff-merge-directory-revisions
256 "ediff" "Merge versions of files in a directory" t)
257 (autoload 'ediff-merge-directory-revisions-with-ancestor
259 "Merge versions of files in a directory using other versions as ancestors"
261 (autoload 'edir-merge-revisions-with-ancestor
263 "Merge versions of files in a directory using other versions as ancestors"
267 (autoload 'ediff-show-registry
269 "Display the registry of active Ediff sessions"
271 (autoload 'ediff-version
273 "Show Ediff's version and last modification date"
278 (provide 'ediff-hook)
281 ;;; ediff-hook.el ends here