diff --git a/lisp/ein-notebook.el b/lisp/ein-notebook.el index ae5ea8d..b56a735 100644 --- a/lisp/ein-notebook.el +++ b/lisp/ein-notebook.el @@ -1107,10 +1107,11 @@ associated with current buffer (if any)." but then describe-minor-mode unhelpfully shows ?? for the keymap commands. Tried add-function: the &rest from :around is an emacs-25 compilation issue." - (let ((km (intern (concat (symbol-name defn) "-km")))) - `(if (functionp (quote ,defn)) + (let ((km (intern (concat (symbol-name defn) "-km"))) + (docstring (and (functionp defn) (ein:get-docstring defn)))) + `(if ,docstring (progn - (fset (quote ,km) (lambda () (interactive) + (fset (quote ,km) (lambda () ,docstring (interactive) (condition-case err (poly-ein-base (call-interactively (function ,defn))) (cl-no-method (message "%s: no applicable method" (quote ,km))) diff --git a/lisp/ein-utils.el b/lisp/ein-utils.el index 8766027..7a6950e 100644 --- a/lisp/ein-utils.el +++ b/lisp/ein-utils.el @@ -659,7 +659,10 @@ Use `ein:log' for debugging and logging." (defun ein:generate-menu (list-name-callback) (mapcar (lambda (name-callback) (destructuring-bind (name callback &rest args) name-callback - `[,name ,callback :help ,(ein:get-docstring callback) ,@args])) + `[,name + ,(let ((km (intern-soft (concat (symbol-name callback) "-km")))) + (if (commandp km) km callback)) + :help ,(ein:get-docstring callback) ,@args])) list-name-callback)) (defcustom ein:enable-gc-adjust t