From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Hattuari Newsgroups: gmane.emacs.help Subject: What is the type of user input? Date: Wed, 27 Oct 2004 06:51:11 -0400 Organization: Asii 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 Content-Transfer-Encoding: 7Bit X-Trace: sea.gmane.org 1098874654 4112 80.91.229.6 (27 Oct 2004 10:57:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 27 Oct 2004 10:57:34 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 27 12:57:26 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CMlUb-0000qd-00 for ; Wed, 27 Oct 2004 12:57:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CMlcL-0006wz-2R for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Oct 2004 07:05:25 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!news-feed01.roc.ny.frontiernet.net!nntp.frontiernet.net!nntp.giganews.com.MISMATCH!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.speakeasy.net!news.speakeasy.net.POSTED!not-for-mail Original-NNTP-Posting-Date: Wed, 27 Oct 2004 05:53:17 -0500 Original-Newsgroups: gnu.emacs.help User-Agent: KNode/0.8.1 Original-Lines: 48 Original-NNTP-Posting-Host: 66.92.149.152 Original-X-Trace: sv3-gjmZ+AGl/4hWjoHnEP+aMlyZtDaRZs6apfK+G0piD0oyMP4iF6WUhyCVojqsYuNgq6VRoqHpYge16Kr!HlBCXryYptr/TW+sphVOnlO8YEw3M+VAO4VOZs2bq5y3scYcUch72y4YypglBR8GzPJItiI7QWHV!EnQYSn9gGZ5dnImluM0= Original-X-Complaints-To: abuse@speakeasy.net X-DMCA-Complaints-To: abuse@speakeasy.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.20 Original-Xref: shelby.stanford.edu gnu.emacs.help:126115 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 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:21495 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:21495 The following code demonstrates the problem I'm having: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; create a property list and use it to map long strings ;; to short strings (setq paste-gl-type-map ()) (setq paste-gl-type-map (plist-put paste-gl-type-map 'GLbyte 'b)) (setq paste-gl-type-map (plist-put paste-gl-type-map 'GLshort 's)) (setq paste-gl-type-map (plist-put paste-gl-type-map 'GLint 'i)) ;;... (plist-get paste-gl-type-map 'GLbyte) ;; test function call (defun paste-gl-array(gl-type gl-components gl-vector) "Map OpenGL types to corresponding sufixes.(GL\'type\' )" (interactive "sType: \nnNumber 1 to 4: \nsVector: ") (message " gl-type=%s, gl-components=%d, gl-vector=%s , suffix=%s" gl-type gl-components gl-vector (plist-get paste-gl-type-map gl-type)) ) ;; end of application code ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; When I use the code by first `M-x eval-buffer' and then `M-x paste-gl-arrayGLbyte4v', the result is a message displayed in the echo area as follows: gl-type=GLbyte, gl-components=4, gl-vector=v , suffix=nil Notice that gl-type is displayed with the value I entered in the minibuffer when it is passed to the first %s in the message string. It seems not to be treated as a string when passed to plist-get, hence the 'suffix=nil'. OTOH, when I evaluate this expression in an emacs-lisp buffer (paste-gl-array 'GLbyte 4 'v), I see the following in the echo area: gl-type=GLbyte, gl-components=4, gl-vector=v , suffix=b That is the desired result. Why is this not the result of calling the function as an interactive command as described above? I will continue to look for an answer in the documentation, but any help from someone who knows the answer would be appreciated. -- p->m == (*p).m == p[0].m