I have two elisp functions:
$ cat ~/myelisp/myoptions.el
(defun get-my-name (arg)
"Prompt user to enter a string, with input history support."
(interactive
(list
(read-string "Enter your name: ")))
(message "Your name is %s." arg))
(defun get-my-directory (arg)
"Prompt user to enter a file path, with file name completion
and input history support."
(interactive
(list
(read-file-name "Enter your directory: ")))
(message "Path is: %s" arg))
I'd like to organize these functions into a menu. Ideally, I would like to be able to issue something like M-x my-info
and have a buffer pop up displaying something like
Press key for command:
----------------------
n Get user's name
d Get user's directory
q quit
Of course, pressing n
should call get-my-name
and pressing d
should call get-my-directory
. I've seen similar menus in many emacs packages (like org-agenda
, for example). Is this menu easy to code in elisp
?