From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "WJ" Newsgroups: gmane.emacs.help Subject: Re: basic help evaluating function in an alist Date: 2 Dec 2012 01:06:07 GMT Organization: NewsGuy - Unlimited Usenet $19.95 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Trace: ger.gmane.org 1354410618 21809 80.91.229.3 (2 Dec 2012 01:10:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Dec 2012 01:10:18 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Dec 02 02:10:31 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tey4e-0007fv-P3 for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Dec 2012 02:10:24 +0100 Original-Received: from localhost ([::1]:49887 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tey4S-0007rz-Qj for geh-help-gnu-emacs@m.gmane.org; Sat, 01 Dec 2012 20:10:12 -0500 Original-Path: usenet.stanford.edu!news.glorb.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!spln!extra.newsguy.com!newsp.newsguy.com!enews2 Original-Newsgroups: gnu.emacs.help Original-Lines: 35 Original-NNTP-Posting-Host: p6f07f4b66599ab06bfd21b38bfb91a36d66d24f6823c1a490de341bb28128aab.newsdawg.com User-Agent: XanaNews/1.18.1.6 X-Antivirus: avast! (VPS 121130-1, 11/30/2012), Outbound message X-Antivirus-Status: Clean X-Received-Bytes: 1762 Original-Xref: usenet.stanford.edu gnu.emacs.help:195689 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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 Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:88010 Archived-At: WJ wrote: > Matt Price wrote: > > > Hi, > > > > i'm trying to figure out what's wrong with this simple code: > > > > (add-to-list 'my-winlist > > '(guide . (selected-window) ) > > ) > > (windmove-right) > > (select-window(cdr(assoc 'guide my-winlist)) ) > > > > So, what I would hope happens here is that I add an element (guide . > > (selected-window)) to an alist, but that the second element would be > > the actual window object in question, not the text string > > "(selected-window)". Lisp puzzles me pretty thoroughly so I know I'm > > missing a very basic feature, but I can't figure it out by flipping > > through the info pages... Thanks everyone! > > Matt > > : (setq mylist '((b . 2))) > ((b . 2)) > : (add-to-list 'mylist (cons 'c (sqrt 3))) > ((c . 1.7320508075688772) (b . 2)) Another way: : (require 'cl) cl : (setq mylist '((b . 2))) ((b . 2)) : (setq mylist (acons 'c (sqrt 3) mylist)) ((c . 1.7320508075688772) (b . 2))