From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Hattuari Newsgroups: gmane.emacs.help Subject: Re: What is the type of user input? Date: Thu, 28 Oct 2004 08:34:54 -0400 Organization: Asii Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <2uaf6cF28g520U1@uni-berlin.de> 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 1098967349 20102 80.91.229.6 (28 Oct 2004 12:42:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 28 Oct 2004 12:42:29 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 28 14:42:17 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 1CN9bc-0003Az-00 for ; Thu, 28 Oct 2004 14:42:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CN9jP-0008Bm-NQ for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Oct 2004 08:50:19 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!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: Thu, 28 Oct 2004 07:37:03 -0500 Original-Newsgroups: gnu.emacs.help User-Agent: KNode/0.8.1 Original-Lines: 69 Original-NNTP-Posting-Host: 66.92.149.152 Original-X-Trace: sv3-WOz/3JRmZ5tmo8/gzPjv/0LM4ncfGVpLhlccZuOoam4O6vNzTFKn5y6gxB3epBHmtAaOpRMkEAoxsrA!Sc0FizaG8J3mlap4ZBumIejMdbBCRwDDALjkj72wKUaCy83Tv6HVfHCTO1uLeMv6If4nT+j4rwx0!ts5f2GxuMVp2MpH9Uv4= 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:126163 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:21543 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:21543 Kevin Rodgers wrote: > Hattuari wrote: > > 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-ty ... > gl-type is a string. Since the paste-gl-type-map property list is keyed > by symbols, plist-get returns nil. That's what I was missing. I was assuming that 'symbol-name implicitly meant symbol would evaluate to a string. Now that I've read the first several chapters of the Elisp Reference Manual, I have a better idea of what's going on. > The %s message specifier can be > applied to any Lisp object, and symbols and strings are formatted the > same. > > The solution is to either (1) read gl-type with the %S code or (2) call > plist-get with (intern gl-type). I opted for trying an association array, which also worked. I will try your suggestion of using (intern gl-type). As for reading gl-type with %S, I'm not sure what that would do for me. The only use I know for that is to use it in a string format. > > 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. > > It's not that hard to find: > > `C-h f message' has a link to the doc string for `format', which has a > link to the doc string for `princ' in its description of %s: > > ,----[ C-h f princ RET ] > | princ is a built-in function. > | (princ OBJECT &optional PRINTCHARFUN) > | > | Output the printed representation of OBJECT, any Lisp object. > | No quoting characters are used; no delimiters are printed around > | the contents of strings. > | > | OBJECT is any of the Lisp data types: a number, a string, a symbol, > | a list, a buffer, a window, a frame, etc. > | > | A printed representation of an object is text which describes that > | object. > ...`---- That doesn't tell me anything that I see as addressing my problem. Can you explain how that answers my question as to why the two symbols were not comparing as I had expected? (type-of gl-type) was what showed me what I was doing wrong. I tried to post back to the newsgroup, but my ISP was down. -- p->m == (*p).m == p[0].m