From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "FKtPp@Office ;)" Newsgroups: gmane.emacs.help Subject: [elisp]How to ask and provide a Default value? Date: Thu, 04 Mar 2004 14:54:04 +0800 Organization: Bentium Ltd. (CN99) Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1078615529 16635 80.91.224.253 (6 Mar 2004 23:25:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 6 Mar 2004 23:25:29 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Mar 07 00:25:20 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AzlAV-0003lz-00 for ; Sun, 07 Mar 2004 00:25:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1AzlA0-0005F9-A1 for geh-help-gnu-emacs@m.gmane.org; Sat, 06 Mar 2004 18:24:48 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.media.kyoto-u.ac.jp!news.cn99.com!news.yaako.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 49 Original-NNTP-Posting-Host: 218.12.133.47 Original-X-Trace: news.yaako.com 1078383269 28694 218.12.133.47 (4 Mar 2004 06:54:29 GMT) Original-X-Complaints-To: usenet@news.yaako.com Original-NNTP-Posting-Date: Thu, 4 Mar 2004 06:54:29 +0000 (UTC) User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) Cancel-Lock: sha1:R3wpsT62lrjDMmBJfDU3SV0nmMg= Original-Xref: shelby.stanford.edu gnu.emacs.help:121460 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:17437 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:17437 hi all, I wrote a simple function like: (defun sleeve-step-region (beginning end base step column) "Insert a column of increasing numbers in the region. " ;; And here, I want it ask some parameters when invoked. Now the ;; problem is: I want it provide a *Default* value, but don't know how ;; to write the character descriptions -_-!! In "(elisp) Interactive ;; Codes" ;; I find this: ;; ;; ,---- ;; | Default ;; | A default value of some sort is used if the user enters no text in ;; | the minibuffer. The default depends on the code character. ;; `---- ;; ;; Can anyone give me some sample to use this "Default" character ;; description? ;; ;; Somebody have suggested me to use "Lisp expression" in the ;; interactive special form. But I still want to know how to use the ;; character descriptions :P (interactive "r\nnTell me the base Number: \nnTell me the Step: \nnWhich column: ") (let ((step-number (if (numberp step) step (string-to-number step))) (base-number (if (numberp base) base (string-to-number base))) (column-number (if (numberp column) column (string-to-number column)))) (save-excursion (narrow-to-region beginning end) (goto-char (point-min)) (beginning-of-line) (while (< (point) (point-max)) (goto-char (+ (point) column-number)) (insert (number-to-string base-number)) (setq base-number (+ base-number step-number)) (forward-line)) (widen)))) best wishes and thanks for any suggestions!! :) yours FKtPp