[comp.emacs] question on using "interactive" declaration in GnuEmacs

mayer@hplabsz.HPL.HP.COM (Niels Mayer) (08/02/87)

Consider the following function that prompts for a device file with name
completion: 

(defun frob-device (path)
  (interactive "fEnter device-name: ")
  <body>
  )

How can I fool interactive "f" to give me "/dev/" as the default-directory,
instead of using the buffer-local default-directory?

I can certainly get the needed prompting functionality by using the
read-file-name function, however, if I do so, I will need an
interactive function frob-device of no arguments which calls read-file-name
and then passes the path onto the non-interactive function
frob-device-aux. Frob-device-aux would also be the programmatic interface to
frob-device that people could call from ~/.emacs, for example. --> YUK

Ideally, interactive would provide extended prompt reading functionality by
allowing users to pass it a function to read every argument. In my case,
I'd want something like:
(interactive "(read-file-name \"Enter device-name: \" \"/dev/\")").

-- Niels.
(mayer@hplabs.hp.com)
(hplabs!mayer)