all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "WJ" <w_a_x_man@yahoo.com>
To: help-gnu-emacs@gnu.org
Subject: Re: basic help evaluating function in an alist
Date: 2 Dec 2012 01:06:07 GMT	[thread overview]
Message-ID: <k9e9hv01clg@enews2.newsguy.com> (raw)
In-Reply-To: k9e2ss01cqt@enews1.newsguy.com

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))


  reply	other threads:[~2012-12-02  1:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.14266.1354402640.855.help-gnu-emacs@gnu.org>
2012-12-01 23:12 ` basic help evaluating function in an alist WJ
2012-12-02  1:06   ` WJ [this message]
2012-12-01 22:57 Matt Price
2012-12-01 23:12 ` Drew Adams
2012-12-02  2:40   ` Matt Price
2012-12-02  3:44     ` Drew Adams
2012-12-04 14:41       ` Matt Price

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=k9e9hv01clg@enews2.newsguy.com \
    --to=w_a_x_man@yahoo.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.