comparison lisp/ediff-hook.el @ 13130:c43bacb1bd0a

Initial revision
author Michael Kifer <kifer@cs.stonybrook.edu>
date Fri, 06 Oct 1995 00:57:20 +0000
parents
children e0ee1eaaabc5
comparison
equal deleted inserted replaced
13129:9d432c26c3a7 13130:c43bacb1bd0a
1 ;;; ediff-hook.el --- setup for Ediff's menus and autoloads
2 ;;; Copyright (C) 1995 Free Software Foundation, Inc.
3
4 ;; Author: Michael Kifer <kifer@cs.sunysb.edu>
5
6 ;; This file is part of GNU Emacs.
7
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)
11 ;; any later version.
12
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.
17
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.
21
22
23 ;;; These must be placed in menu-bar.el in Emacs
24 ;;
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))
33
34
35 (defun ediff-xemacs-init-menus ()
36 (if (featurep 'menubar)
37 (progn
38 (add-submenu
39 '("Tools") ediff-menu "OO-Browser...")
40 (add-submenu
41 '("Tools") ediff-merge-menu "OO-Browser...")
42 (add-submenu
43 '("Tools") epatch-menu "OO-Browser...")
44 (add-menu-button
45 '("Tools")
46 ["List Ediff Sessions" ediff-show-registry t] "OO-Browser...")
47 (add-menu-button
48 '("Tools")
49 ["---" nil nil] "OO-Browser...")
50 )))
51
52
53
54 ;; explicit string-match is needed: ediff-xemacs-p is not defined at build time
55 (cond ((string-match "XEmacs" emacs-version)
56 (defvar ediff-menu
57 '("Compare"
58 ["Two Files ..." ediff-files t]
59 ["Two Buffers ..." ediff-buffers t]
60 ["Three Files ..." ediff-files3 t]
61 ["Three Buffers ..." ediff-buffers3 t]
62 "---"
63 ["Two Directories ..." ediff-directories t]
64 ["Three Directories ..." ediff-directories3 t]
65 "---"
66 ["File with Revision ..." ediff-revision t]
67 ["Directory Revisions ..." ediff-directory-revisions t]
68 "---"
69 ["Windows Word-by-word ..." ediff-windows-wordwise t]
70 ["Windows Line-by-line ..." ediff-windows-linewise t]
71 "---"
72 ["Regions Word-by-word ..." ediff-regions-wordwise t]
73 ["Regions Line-by-line ..." ediff-regions-linewise t]))
74 (defvar ediff-merge-menu
75 '("Merge"
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]
81 "---"
82 ["Directories ..." ediff-merge-directories t]
83 ["Directories with Ancestor ..."
84 ediff-merge-directories-with-ancestor t]
85 "---"
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]))
92 (defvar epatch-menu
93 '("Apply Patch"
94 ["To a file ..." ediff-patch-file t]
95 ["To a buffer ..." ediff-patch-buffer t]))
96
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))
102 )
103
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))
108 (fset 'menu-bar-epatch-menu (symbol-value 'menu-bar-epatch-menu))
109 (defvar menu-bar-ediff-merge-menu (make-sparse-keymap))
110 (fset 'menu-bar-ediff-merge-menu
111 (symbol-value 'menu-bar-ediff-merge-menu))
112 (defvar menu-bar-ediff-menu (make-sparse-keymap))
113 (fset 'menu-bar-ediff-menu (symbol-value 'menu-bar-ediff-menu))
114
115 ;; define ediff-menu
116 (define-key menu-bar-ediff-menu [ediff-dir-revision]
117 '("Directory Revisions ..." . ediff-directory-revisions))
118 (define-key menu-bar-ediff-menu [ediff-revision]
119 '("File with Revision ..." . ediff-revision))
120 (define-key menu-bar-ediff-menu [separator-ediff-directories] '("--"))
121 (define-key menu-bar-ediff-menu [ediff-directories3]
122 '("Three Directories ..." . ediff-directories3))
123 (define-key menu-bar-ediff-menu [ediff-directories]
124 '("Two Directories ..." . ediff-directories))
125 (define-key menu-bar-ediff-menu [separator-ediff-files] '("--"))
126 (define-key menu-bar-ediff-menu [ediff-buffers3]
127 '("Three Buffers ..." . ediff-buffers3))
128 (define-key menu-bar-ediff-menu [ediff-files3]
129 '("Three Files ..." . ediff-files3))
130 (define-key menu-bar-ediff-menu [ediff-buffers]
131 '("Two Buffers ..." . ediff-buffers))
132 (define-key menu-bar-ediff-menu [ediff-files]
133 '("Two Files ..." . ediff-files))
134 (define-key menu-bar-ediff-menu [separator-ediff-regions] '("--"))
135 (define-key menu-bar-ediff-menu [ediff-regions-linewise]
136 '("Regions Line-by-line ..." . ediff-regions-linewise))
137 (define-key menu-bar-ediff-menu [ediff-regions-wordwise]
138 '("Regions Word-by-word ..." . ediff-regions-wordwise))
139 (define-key menu-bar-ediff-menu [separator-ediff-windows] '("--"))
140 (define-key menu-bar-ediff-menu [ediff-windows-linewise]
141 '("Windows Line-by-line ..." . ediff-windows-linewise))
142 (define-key menu-bar-ediff-menu [ediff-windows-wordwise]
143 '("Windows Word-by-word ..." . ediff-windows-wordwise))
144
145 ;; define merge menu
146 (define-key
147 menu-bar-ediff-merge-menu [ediff-merge-dir-revisions-with-ancestor]
148 '("Directory Revisions with Ancestor ..."
149 . ediff-merge-directory-revisions-with-ancestor))
150 (define-key
151 menu-bar-ediff-merge-menu [ediff-merge-dir-revisions]
152 '("Directory Revisions ..." . ediff-merge-directory-revisions))
153 (define-key
154 menu-bar-ediff-merge-menu [ediff-merge-revisions-with-ancestor]
155 '("Revisions with Ancestor ..."
156 . ediff-merge-revisions-with-ancestor))
157 (define-key menu-bar-ediff-merge-menu [ediff-merge-revisions]
158 '("Revisions ..." . ediff-merge-revisions))
159 (define-key menu-bar-ediff-merge-menu [separator-ediff-merge] '("--"))
160 (define-key
161 menu-bar-ediff-merge-menu [ediff-merge-directories-with-ancestor]
162 '("Directories with Ancestor ..."
163 . ediff-merge-directories-with-ancestor))
164 (define-key menu-bar-ediff-merge-menu [ediff-merge-directories]
165 '("Directories ..." . ediff-merge-directories))
166 (define-key
167 menu-bar-ediff-merge-menu [separator-ediff-merge-dirs] '("--"))
168 (define-key
169 menu-bar-ediff-merge-menu [ediff-merge-buffers-with-ancestor]
170 '("Buffers with Ancestor ..." . ediff-merge-buffers-with-ancestor))
171 (define-key menu-bar-ediff-merge-menu [ediff-merge-buffers]
172 '("Buffers ..." . ediff-merge-buffers))
173 (define-key menu-bar-ediff-merge-menu [ediff-merge-files-with-ancestor]
174 '("Files with Ancestor ..." . ediff-merge-files-with-ancestor))
175 (define-key menu-bar-ediff-merge-menu [ediff-merge-files]
176 '("Files ..." . ediff-merge-files))
177
178 ;; define epatch menu
179 (define-key menu-bar-epatch-menu [ediff-patch-buffer]
180 '("To a Buffer ..." . ediff-patch-buffer))
181 (define-key menu-bar-epatch-menu [ediff-patch-file]
182 '("To a File ..." . ediff-patch-file)))
183
184 ) ; cond
185
186 ;; arrange foe autoloads
187 (if purify-flag
188 () ; if dumping, autoloads are set up in loaddefs.el
189 ;; if the user decides to load this file, set up autoloads
190 ;; compare files and buffers
191 (autoload 'ediff "ediff" "Compare two files" t)
192 (autoload 'ediff-files "ediff" "Compare two files" t)
193 (autoload 'ediff-buffers "ediff" "Compare two bufers" t)
194 (autoload 'ediff3 "ediff" "Compare three files" t)
195 (autoload 'ediff-files3 "ediff" "Compare three files" t)
196 (autoload 'ediff-buffers3 "ediff" "Compare three bufers" t)
197
198 (autoload 'ediff-revision "ediff" "Compare versions of a file" t)
199
200 ;; compare regions and windows
201 (autoload 'ediff-windows-wordwise
202 "ediff" "Compare two windows word-by-word" t)
203 (autoload 'ediff-regions-wordwise
204 "ediff" "Compare two regions word-by-word" t)
205 (autoload 'ediff-windows-linewise
206 "ediff" "Compare two windows line-by-line" t)
207 (autoload 'ediff-regions-linewise
208 "ediff" "Compare two regions line-by-line" t)
209
210 ;; patch
211 (autoload 'ediff-patch-file "ediff" "Patch a file" t)
212 (autoload 'epatch "ediff" "Patch a file" t)
213 (autoload 'ediff-patch-buffer "ediff" "Patch a buffer")
214 (autoload 'epatch-buffer "ediff" "Patch a buffer" t)
215
216 ;; merge
217 (autoload 'ediff-merge "ediff" "Merge two files" t)
218 (autoload 'ediff-merge-files "ediff" "Merge two files" t)
219 (autoload 'ediff-merge-files-with-ancestor
220 "ediff" "Merge two files using a third file as an ancestor" t)
221 (autoload 'ediff-merge-buffers "ediff" "Merge two buffers" t)
222 (autoload 'ediff-merge-buffers-with-ancestor
223 "ediff" "Merge two buffers using a third buffer as an ancestor" t)
224
225 (autoload 'ediff-merge-revisions "ediff" "Merge two versions of a file" t)
226 (autoload 'ediff-merge-revisions-with-ancestor
227 "ediff" "Merge two versions of a file" t)
228
229 ;; compare directories
230 (autoload 'edirs "ediff" "Compare files in two directories" t)
231 (autoload 'ediff-directories "ediff" "Compare files in two directories" t)
232 (autoload 'edirs3 "ediff" "Compare files in three directories" t)
233 (autoload 'ediff-directories3 "ediff" "Compare files in three directories" t)
234
235 (autoload 'edir-revisions
236 "ediff" "Compare two versions of a file" t)
237 (autoload 'ediff-directory-revisions
238 "ediff" "Compare two versions of a file" t)
239
240 ;; merge directories
241 (autoload 'edirs-merge "ediff" "Merge files in two directories" t)
242 (autoload 'ediff-merge-directories
243 "ediff" "Merge files in two directories" t)
244 (autoload 'edirs-merge-with-ancestor
245 "ediff"
246 "Merge files in two directories using files in a third dir as ancestors" t)
247 (autoload 'ediff-merge-directories-with-ancestor
248 "ediff"
249 "Merge files in two directories using files in a third dir as ancestors" t)
250
251 (autoload 'edir-merge-revisions
252 "ediff" "Merge versions of files in a directory" t)
253 (autoload 'ediff-merge-directory-revisions
254 "ediff" "Merge versions of files in a directory" t)
255 (autoload 'ediff-merge-directory-revisions-with-ancestor
256 "ediff"
257 "Merge versions of files in a directory using other versions as ancestors"
258 t)
259 (autoload 'edir-merge-revisions-with-ancestor
260 "ediff"
261 "Merge versions of files in a directory using other versions as ancestors"
262 t)
263 (autoload 'ediff-show-registry
264 "ediff-meta"
265 "Display the registry of active Ediff sessions"
266 t)
267 ) ; if purify-flag
268
269
270 (provide 'ediff-hook)
271
272
273 ;;; ediff-hook.el ends here