[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [elisp]How to ask and provide a Default value?
From: |
Kevin Rodgers |
Subject: |
Re: [elisp]How to ask and provide a Default value? |
Date: |
Fri, 05 Mar 2004 11:16:38 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 |
FKtPp@Office ;) wrote:
> Kevin Rodgers <ihs_4664@yahoo.com> writes:
>>(defun foo (number)
>> (interactive "nNumber: ")
>> (message "number=%d" number))
>>
>>When I type `M-x foo RET RET' on Emacs 19.34, I get an "End of file
>>during parsing" error. When I type that on Emacs 21.3, I get a
>>transient "Please enter a number." Message, then the prompt is
>>redisplayed.
>
> Thank you. I got it too :)
>
>>So evidently Emacs does not provide a default for the `n' character
>>code.
>
> But, I still don't know how to use the default character description
> :P Would u please give me a sample?
The `b' character code, which is used to return an existing buffer, does
provide a default (the current buffer):
(defun foo (buffer)
(interactive "bBuffer: ")
(message "buffer=%s" buffer))
--
Kevin Rodgers