1 ;;; Ilisp-easy-menu.el --- (easy)menu's on Emacs for Ilisp
3 ;;; Copyright (C) 1996 Holger Schauer
5 ;;; This file is part of ILISP.
6 ;;; Please refer to the file COPYING for copyrights and licensing
8 ;;; Please refer to the file ACKNOWLEGDEMENTS for an (incomplete) list
9 ;;; of present and past contributors.
11 ;;; $Id: ilisp-cl-easy-menu.el,v 1.3 2002-06-03 23:36:59 wbd Exp $
13 ;; Author: Holger Schauer <Holger.Schauer@gmd.de>
14 ;; Maintainer: Holger.Schauer@gmd.de
15 ;; Keywords: lisp ilisp extensions menu easymenu
17 ;; Status: Should work with any Emacs and easymenu.el (as by Per Abrahamsen)
18 ;; Created: 1996-10-08
19 ;; Last modified: 1996-10-15 (that's 15th October 1996, folks)
21 ;; Where to get it: http://www.uni-koblenz.de/~schauer/uniemacs.html
23 ;; This program is free software; you can redistribute it and/or modify
24 ;; it under the terms of the GNU General Public License as published by
25 ;; the Free Software Foundation; either version 2, or (at your option)
28 ;; This program is distributed in the hope that it will be useful,
29 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
30 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 ;; GNU General Public License for more details.
33 ;; You should have received a copy of the GNU General Public License
34 ;; along with this program; if not, you can either send email to this
35 ;; program's maintainer or write to: The Free Software Foundation,
36 ;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
40 ;; This file and it's extensions have been named ilisp-xemacs-menu before.
41 ;; As it is ensured now to work with any Emacs with easymenu the file
42 ;; itself and all relevant names (of commands and variables) are renamed.
44 ;; Use this file as an extension to Ilisp 5.7/5.8
45 ;; (seee http://www.cs.cmu.edu/~campbell/ilisp/index.html)
46 ;; Put it in a place where (X)Emacs can find it and augment your
47 ;; .emacs like the following to use it.
48 ;; (load-library "ilisp-easy-menu")
49 ;; This needs to be loaded prior to Ilisp !
50 ;; This should give you the menu in any source code buffer and any inferior
51 ;; ilisp buffer. Be careful: the menu is initialized with add-hook
52 ;; on ilisp-mode-hook and lisp-mode-hook, so if you setq these two
53 ;; hooks afterwards you won't get the menu.
55 ;; If you want to use it with Emacs (not XEmacs) you will want to get rid
56 ;; of the old menu. You can do so by applying the following patches (to
57 ;; Ilisp 5.8 - for 5.7 check for ilisp-update-menu and the loading of the
58 ;; menu, i.e. ilisp-menu and ilisp-mnb)
61 ;< (if (not (member +ilisp-emacs-version-id+ '(xemacs lucid-19 lucid-19-new)))
64 ;> (not (member +ilisp-emacs-version-id+ '(xemacs lucid-19 lucid-19-new)))
65 ;> (not (featurep 'ilisp-easy-menu)))
68 ;< (if (not (member +ilisp-emacs-version-id+ '(xemacs lucid-19 lucid-19-new)))
71 ;> (member +ilisp-emacs-version-id+ '(xemacs lucid-19 lucid-19-new)))
72 ;> (not (featurep 'ilisp-easy-menu)))
76 (eval-when (load compile eval)
77 (when (and ilisp-*use-hyperspec-interface-p*
78 (not (featurep 'hyperspec)))
79 (load-library "extra/hyperspec")))
81 (defvar ilisp-cl-easy-menu
83 [ "Load File" load-file-lisp t ]
84 [ "Run Ilisp" run-ilisp t ]
87 [ "Eval region" eval-region-lisp t ]
88 [ "Eval defun" eval-defun-lisp t ]
89 [ "Eval next sexp" eval-next-sexp-lisp t ]
90 ;; [ "Eval last sexp" eval-last-sexp-lisp t ]
91 [ "Eval changes" eval-changes-lisp t ]
94 [ "Eval region" eval-region-and-go-lisp t ]
95 [ "Eval defun" eval-defun-and-go-lisp t ]
96 [ "Eval next sexp" eval-next-sexp-and-go-lisp t ]
97 ;; [ "Eval last sexp" eval-last-sexp-and-go-lisp t ]
100 [ "File" compile-file-lisp t ]
101 [ "Defun" compile-defun-lisp t ]
102 [ "Defun and go" compile-defun-and-go-lisp t ]
103 [ "Region" compile-region-lisp t ]
104 [ "Region and go" compile-region-and-go-lisp t ]
105 [ "Compile changes" compile-changes-lisp t ]
109 [ "Edit definitions" edit-definitions-lisp t ]
110 [ "Edit next def." next-definition-lisp t ]
111 [ "Edit callers" edit-callers-lisp t ]
112 [ "Edit next caller" next-caller-lisp t ]
113 [ "Insert arguments" arglist-lisp t ]
115 [ "Find unbalanced paren" find-unbalanced-lisp t ]
116 [ "Close all parens" close-all-lisp t ]
117 [ "Close and send lisp" close-and-send-lisp t ]
119 [ "Reindent" reindent-lisp t ]
120 [ "Indent sexp" indent-sexp-ilisp t ]
121 [ "Indent for comment" lisp-indent-for-comment t ]
122 [ "Comment region" comment-region-lisp t ]
124 [ "Search in Files" search-lisp t ]
126 [ "Kill sexp" kill-sexp t ]
127 [ "Kill last sexp" backward-kill-sexp t ]
129 [ "Macroexpand" macroexpand-lisp t ]
130 [ "Macroexpand-1" macroexpand-1-lisp t ]
132 [ "Begin of def" beginning-of-defun-lisp t ]
133 [ "End of defun" end-of-defun-lisp t ]
136 [ "Documentation" documentation-lisp t ]
137 [ "Describe" describe-lisp t ]
138 [ "Inspect" inspect-lisp t ]
139 [ "Argument List" arglist-lisp t ] ; Just a test.
141 ;; With which var can I test if 'fi' is really loaded? Can I just
143 [ "Clman-apropos" fi:clman-apropos nil ]
144 [ "Hyperspec - apropos"
146 ,ilisp-*use-hyperspec-interface-p* ]
151 [ "Package" package-lisp t ]
152 [ "Set Lisp Package" set-package-lisp t ]
153 [ "Set Buffer Package" set-buffer-package-lisp t ]
157 ;; [ "Reset Ilisp" reset-ilisp t ]
158 [ "Select Ilisp" select-ilisp t ]
159 [ "Switch to lisp" switch-to-lisp t ]
160 [ "Abort commands" abort-commands-lisp t ]
161 [ "Status of Lisp" status-lisp t ]
163 [ "Mark change" mark-change-lisp t ]
164 [ "List changes" list-changes-lisp t ]
165 [ "Clear changes" clear-changes-lisp t ]
167 [ "Trace defun" trace-defun-lisp t ]
170 [ "Reset Ilisp Connection" reset-ilisp t ]
171 [ "Repair Ilisp Connection" repair-ilisp t ]
175 ;;; insert "Debug" Menu if ilisp-*enable-ild-support-p*
176 ;;; enable the commands only if inside the debugging loop
178 ;;; 2000-10-10 17:34:05 rurban
179 (defconst ilisp-ild-easy-menu
181 [ "Abort" ild-abort (ilisp-ild-p) ]
182 [ "Continue" ild-continue (ilisp-ild-p) ]
183 [ "Next" ild-next (ilisp-ild-p) ]
184 [ "Previous" ild-previous (ilisp-ild-p) ]
185 [ "Top" ild-top (ilisp-ild-p) ]
186 [ "Bottom" ild-bottom (ilisp-ild-p) ]
187 [ "Backtrace" ild-backtrace (ilisp-ild-p) ]
188 [ "Locals" ild-locals (ilisp-ild-p) ]
189 [ "Local" ild-local (ilisp-ild-p) ]
190 [ "Return" ild-return (ilisp-ild-p) ]
191 [ "Retry" ild-retry (ilisp-ild-p) ]
192 [ "Trap on exit" ild-trap-on-exit (ilisp-ild-p) ]
194 [ "Fast lisp" fast-lisp t ]
195 [ "Slow lisp" slow-lisp t ]
199 (defun ilisp-ild-p ()
202 (defun ilisp-insert-menu (menu where what)
203 "Insert WHAT into MENU after WHERE"
204 (if (position what menu)
206 (let ((i (position (assoc where menu) menu)))
208 menu (append (butlast menu (- (length menu) i))
212 (if ilisp-*enable-ild-support-p*
213 (setq ilisp-cl-easy-menu
214 (ilisp-insert-menu ilisp-cl-easy-menu "Misc" ilisp-ild-easy-menu)))
216 ;;; ilisp-update-menu
218 ;;; 19990818 Marco Antoniotti
220 (defun ilisp-update-menu (status)
221 ;; Backward compatibility with old keymap based menus.
222 ;; A no-op for the time being.
225 (defun ilisp-redefine-menu ()
226 (easy-menu-remove ilisp-cl-easy-menu)
227 (easy-menu-define menubar-ilisp ilisp-mode-map
230 (easy-menu-add ilisp-cl-easy-menu 'ilisp-mode-map)
233 (provide 'ilisp-cl-easy-menu)
235 ;;; Hooks to add the menu.
238 ;;; 19990818 Marco Antoniotti
239 ;;; Since I could have installed a Scheme menu before a CL one, I
240 ;;; could be forced to remove the previous menu. Now the code does not do
241 ;;; this, but it should.
243 (add-hook 'ilisp-mode-hook
245 (when (featurep 'easymenu)
246 (easy-menu-define menubar-ilisp
250 (easy-menu-add ilisp-cl-easy-menu 'ilisp-mode-map)
254 (add-hook 'lisp-mode-hook
256 (when (featurep 'easymenu)
257 (easy-menu-define menubar-lisp-ilisp
261 (when (boundp 'lisp-menu)
262 (easy-menu-remove lisp-menu))
263 (easy-menu-add ilisp-cl-easy-menu 'lisp-mode-map)
266 ;;; end of file-- ilisp-cl-easy-menu.el --