I know quite a few keystrokes under XEmacs but with every new mode a lot more are suddendly there ;-) Now I can not remember all those keystrokes in any of the modes so I'm sometimes quite happy to have some menu. I did not find one for slime so I wrote one. Feel free to use and comment on it. I assume I will polish it over time, so you can see it as Version 0.1 ;-)
It is not really tested and I have just used it under Debian/Linux XEmacs 21.4 somewhat
Hope that at least some of you will like it.
Regards Friedrich
;;;; Generated header ;;;; $Id$: ;;;; $Log$: ;;;; Author: Friedrich Dominicus ;;;; Created: 2003-12-06 13:47:04 frido ;;;; License: Do whatever you like with it but do not sue me for anything related to it ;;; Initial version for a menu for SLIME ;;; Just a rough try to get something which might be useful ;;;; TODO ;;; This list ought be be quit a bit longer ;-) ;;; - Check all the entries ;;; - see what other commands might be useful ;;; - thinking about a sensible menu for the inferior slime buffer ;;; - a useful context menu (menu are quite a bit away on a large screen ;;; - other things (feel free to add) (require 'easymenu) (require 'slime)
(eval-when (load compile eval) (unless (featurep 'hyperspec) (load-library "hyperspec")))
;;; (setf slime-cl-easy-menu nil)
(defvar slime-cl-easy-menu `("Slime" [ "Complete Function" slime-complete-symbol t] [ "Eval Defun" slime-eval-defun t] [ "Eval Last Expression" slime-eval-last-expression t] [ "Eval and Print" slime-pprint-eval-last-expression t ] "--" ("Compilation" [ "Compile Defun" slime-compile-defun t] [ "Compile/Load File" slime-compile-and-load-file t ] [ "Compile File" slime-compile-file t]) "--" ("Compiler Messages" [ "Next" slime-next-note t ] [ "Previous" slime-previous-note t ] [ "Remove Notes" slime-remove-notes t]) "--" ("Definitions" [ "Edit Funtion" slime-edit-function t ] [ "Go back" slime-pop-find-definition-stack t]) ; not a good name reall ; any one with a better name? "--" ("Cross Ref" [ "Who Calls" slime-who-calls t ] [ "Who References " slime-who-references t ] [ "Who Sets" slime-who-sets t ] [ "Who Binds" slime-who-binds t ] [ "Who Macroexpands" slime-who-macroexpands t ] [ "Next Location" slime-next-location t ]) "--" ("Documentation" [ "Describe Symbol" slime-describe-symbol t ] [ "Apropos" slime-apropos t] [ "Hyperspec" hyperspec-lookup t]) ))
;; (slime-lisp-mode-hook-fun)
(add-hook 'lisp-mode-hook #'slime-register-menu)
(defun slime-register-menu () (interactive) (if (and (featurep 'easymenu) (featurep 'slime)) (progn (easy-menu-define menubar-slime slime-mode-map "Slime" slime-cl-easy-menu) (easy-menu-add slime-cl-easy-menu 'slime-mode-map)) (message "Could not register menu")))
(defun slime-unregister-menu () (interactive) (easy-menu-remove slime-cl-easy-menu)) (provide 'slime-menu) ;;;; Generated header ;;;; $Id$: ;;;; $Log$: ;;;; Author: Friedrich Dominicus ;;;; Created: 2003-12-06 13:47:04 frido ;;;; License: Do whatever you like with it but do not sue me for anything related to it
(require 'easymenu) (require 'slime) (require 'cl) ; want to be able to use the common lisp stuff ; not all Emacs do understand even 'unless' ;(
;;; no lisp mode without the hyperspec (eval-when (load compile eval) (unless (featurep 'hyperspec) (load-library "hyperspec")))
;;; Initial Menu version. A lot of questions still remain ;;; do the categories make sense. The order is arbitrary but should ;;; better reflect hwo often an entry will get used. Long mouse moves ;;; otherwise needed that's not really desirable (defvar slime-cl-easy-menu `("Slime" [ "Complete Function" slime-complete-symbol t] [ "Eval Defun" slime-eval-defun t] [ "Eval Last Expression" slime-eval-last-expression t] [ "Eval and Print" slime-pprint-eval-last-expression t ] "--" ("Compilation" [ "Compile Defun" slime-compile-defun t] [ "Compile/Load File" slime-compile-and-load-file t ] [ "Compile File" slime-compile-file t]) "--" ("Compiler Messages" [ "Next" slime-next-note t ] [ "Previous" slime-previous-note t ] [ "Remove Notes" slime-remove-notes t]) "--" ("Definitions" [ "Edit Funtion" slime-edit-function t ] [ "Go back" slime-pop-find-definition-stack t]) ; not a good name suggestions welcome
"--" ("Cross Ref" [ "Who Calls" slime-who-calls t ] [ "Who References " slime-who-references t ] [ "Who Sets" slime-who-sets t ] [ "Who Binds" slime-who-binds t ] [ "Who Macroexpands" slime-who-macroexpands t ] [ "Next Location" slime-next-location t ]) "--" ("Documentation" [ "Describe Symbol" slime-describe-symbol t ] [ "Apropos" slime-apropos t] [ "Hyperspec" hyperspec-lookup t]) ))
;; (slime-lisp-mode-hook-fun)
(add-hook 'lisp-mode-hook #'slime-register-menu)
(defun slime-register-menu () "Register a menu for SMILE. Initial version probably with typos and definitly not complete. I will improve on it over time." (interactive) (if (and (featurep 'easymenu) (featurep 'slime)) (progn (easy-menu-define menubar-slime slime-mode-map "Slime" slime-cl-easy-menu) (easy-menu-add slime-cl-easy-menu 'slime-mode-map)) (message "Could not register menu for Slime")))
(defun slime-unregister-menu () "Clean up the menu for SMILE. Good guy clean up their stuff themselves ;-)" (interactive) (easy-menu-remove slime-cl-easy-menu)) (provide 'slime-menu)
Friedrich Dominicus frido@q-software-solutions.com writes:
I know quite a few keystrokes under XEmacs but with every new mode a lot more are suddendly there ;-) Now I can not remember all those keystrokes in any of the modes so I'm sometimes quite happy to have some menu. I did not find one for slime so I wrote one. Feel free to use and comment on it. I assume I will polish it over time, so you can see it as Version 0.1 ;-)
It's very cool, I'd like to add it to SLIME.
One bother is that XEmacs doesn't seem to have `easy-menu'. Does anyone know what the done thing is for doing menu-bar extensions portably?
-Luke
Luke Gorrie wrote:
[...]
One bother is that XEmacs doesn't seem to have `easy-menu'. Does anyone know what the done thing is for doing menu-bar extensions portably?
AFAIUI, easymenu /is/ the portable way of defining menu-bar extensions, I believe it's an add-on package for XEmacs though, rather than being in the core.
lawrence mitchell wrote:
Luke Gorrie wrote:
[...]
One bother is that XEmacs doesn't seem to have `easy-menu'. Does anyone know what the done thing is for doing menu-bar extensions portably?
AFAIUI, easymenu /is/ the portable way of defining menu-bar extensions, I believe it's an add-on package for XEmacs though, rather than being in the core.
In 21.5.16, easymenu is part of XEmacs. Don't have earlier versions around to check.
Raymond Toy rtoy@earthlink.net writes:
In 21.5.16, easymenu is part of XEmacs. Don't have earlier versions around to check.
Oops, yeah, that's the version I'm using too. `C-h l' says I looked for `easy-menu' instead by accident :-).
I also have this in XEmacs 21.4 and Emacs 20.7.2 from Debian woody so it looks pretty portable. I'll check this menu stuff in, thanks all!
Luke Gorrie luke@bluetail.com writes:
Friedrich Dominicus frido@q-software-solutions.com writes:
I know quite a few keystrokes under XEmacs but with every new mode a lot more are suddendly there ;-) Now I can not remember all those keystrokes in any of the modes so I'm sometimes quite happy to have some menu. I did not find one for slime so I wrote one. Feel free to use and comment on it. I assume I will polish it over time, so you can see it as Version 0.1 ;-)
It's very cool, I'd like to add it to SLIME.
Well that's what I hoped someone would do ;-)
One bother is that XEmacs doesn't seem to have `easy-menu'. Does anyone know what the done thing is for doing menu-bar extensions portably?
Well I looked for a portable solution and the comments in easymenu.el told me that I'm on the right track. BTW it was developed under XEmacs here, just in case I forgot to mention that.
As said I will check it out and see what might should be included. And a nice context menu would be appriciated (at least by me ;-)
Regards Friedrich