[slime-devel] Maybe someone likes menues too

Friedrich Dominicus frido at q-software-solutions.com
Sat Dec 6 16:56:05 UTC 2003


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)




More information about the slime-devel mailing list