_deepfire@feelingofgreen.ru writes:
+(defmacro define-slime-dialect (name &optional program hook connhook) "Define a command slime-dialect-NAME to start a specific Lisp. PROGRAM is the command to start the inferior process. HOOK is function which is run before the process is started." (let ((funsym (intern (format "slime-dialect-%s" name))) (hooksym (intern (format "slime-dialect-%s-hook" name)))
`(progn (defvar ,progsym ,program) (defvar ,hooksym ,hook)(connhooksym (intern (format "slime-dialect-%s-connected-hook" name))) (progsym (intern (format "slime-dialect-%s-program" name))))
(defvar ,connhooksym ,connhook)
(add-hook 'slime-connected-hook
(lambda ()
(when (equal *slime-in-dialect* ,name)
(defun ,funsym () ,(format "Start up slime according to `%s'." progsym) (interactive) (let ((inferior-lisp-program ,progsym))(run-hooks ',connhooksym))))
(setq *slime-in-dialect* ,name)
would a let work jsut as well here? (i'd like to avoid a new global if it's only purpose is to choose which hook to run).
(run-hooks ',hooksym) (call-interactively 'slime))))))