Article View: gnu.emacs.help
Article #189440SUMMARY: Minibuffer-read-char
From: Frank Ritter
Date: Wed, 20 Feb 1991 02:57
Date: Wed, 20 Feb 1991 02:57
38 lines
2140 bytes
2140 bytes
Despite how poorly I requested help:
I'd like a function to read a single char from the minibuffer. I've
tried selecting the minibuffer window, but this appears to only happen
after the command completes. Any help?
I got what I wanted:
(defun minibuffer-read-char (prompt) From: kyle@uunet.uu.net (Kyle Jones)
(let ((cursor-in-echo-area t)
(echo-keystrokes 0))
(message prompt) ; now queries user
(read-char)))
You can snaz this up, and I added a prompt to Kyle's code already.
I've had problems getting this to work on some local machines (i.e.
Dec3100 consoles), but the local guru has not gotten back to me on
why. Based on the manual, it should work, and it does over a dialup
line.
================================================================
Close, but not what I wanted. Included for your general edification,
if you've read so far, you're interested in read-char. Both of these
don't read from the echo area, but otherwise would do what it sounded
like what I wanted no doubt:
read-char: (Raul acevedo@athena.mit.edu)
Read a character from the command input (keyboard or macro).
It is returned as a number.
(defun minibuffer-read-char (arg) eirik@theory.TN.CORNELL.EDU (Eirik Fuller)
(interactive "cType something: ")
arg)
Thanks again,
Frank Ritter@cs.cmu.edu best mail drop
ritter@psy.cmu.edu my real affiliation
fr07@andrew.cmu.edu where the above two point to
Technical Details
Message-ID:
<kbkSKBm00h7VAHMDxr@andrew.cmu.edu>Path:
arc1-ca.pugleaf.net!gmdzi!unido!fauern!ira.uka.de!sol.ctr.columbia.edu!emory!att!linac!pacific.mps.ohio-state.edu!tut.cis.ohio-state.edu!sei!fs7.ece.cmu.edu!o.gp.cs.cmu.edu!andrew.cmu.edu!fr07+Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103b8b,1ddec6d84bdad5f9,start X-Google-Attributes: gid103b8b,public X-Google-ArrivalTime: 1991-02-20 15:07:54 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!fauern!ira.uka.de!sol.ctr.columbia.edu!emory!att!linac!pacific.mps.ohio-state.edu!tut.cis.ohio-state.edu!sei!fs7.ece.cmu.edu!o.gp.cs.cmu.edu!andrew.cmu.edu!fr07+ From: fr07+@andrew.cmu.edu (Frank Ritter) Newsgroups: gnu.emacs.help Subject: SUMMARY: Minibuffer-read-char Message-ID: <kbkSKBm00h7VAHMDxr@andrew.cmu.edu> Date: 20 Feb 91 02:57:17 GMT Organization: Psychology, Carnegie Mellon, Pittsburgh, PA Lines: 38