From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: basic help evaluating function in an alist Date: Sat, 1 Dec 2012 15:12:02 -0800 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1354403545 5837 80.91.229.3 (1 Dec 2012 23:12:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 1 Dec 2012 23:12:25 +0000 (UTC) To: "'Matt Price'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Dec 02 00:12:37 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 1TewEa-0001Yy-7V for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Dec 2012 00:12:32 +0100 Original-Received: from localhost ([::1]:36328 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TewEO-0006RQ-Dg for geh-help-gnu-emacs@m.gmane.org; Sat, 01 Dec 2012 18:12:20 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:42487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TewEJ-0006RL-N1 for help-gnu-emacs@gnu.org; Sat, 01 Dec 2012 18:12:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TewEI-0005T2-Jw for help-gnu-emacs@gnu.org; Sat, 01 Dec 2012 18:12:15 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:45200) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TewEI-0005Sf-Ct for help-gnu-emacs@gnu.org; Sat, 01 Dec 2012 18:12:14 -0500 Original-Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id qB1NCAUj022931 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 1 Dec 2012 23:12:11 GMT Original-Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id qB1NCAN5028357 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 1 Dec 2012 23:12:10 GMT Original-Received: from abhmt111.oracle.com (abhmt111.oracle.com [141.146.116.63]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id qB1NC97i016743; Sat, 1 Dec 2012 17:12:09 -0600 Original-Received: from dradamslap1 (/71.202.147.44) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 01 Dec 2012 15:12:09 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: Ac3QFzjWj1z16BAYSfGYazZLyYiOgwAAIyAQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 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:88006 Archived-At: > 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)) ) Break it down. Forget about `windmove-right'. Just check the value of `my-winlist' after you added the element. (setq my-winlist ()) (add-to-list 'my-winlist '(guide . (selected-window))) `C-h v my-winlist' shows: ((guide selected-window)) That's the same as ((guide . (selected-window))) Already you can see the problem: no window, just a list with the symbol `selected-window' as its sole element. If you want, try `M-: (cdr (assoc 'guide my-winlist))', to see that element: (selected-window). You need to evaluate `(selected-window)', not just use that list as the cdr of your element. Here's what you need: (setq my-winlist ()) (add-to-list 'my-winlist (cons 'guide (selected-window))) `C-h v my-winlist' shows a list with one element, which is a dotted pair (aka cons cell), whose cdr is a window: ((guide . #)) With backquote syntax you can express the same thing this way: (setq my-winlist ()) (add-to-list 'my-winlist `(guide ,(selected-window))) I recommend that you read this manual that comes with Emacs (use `C-h i'): `Emacs Lisp Intro'. HTH.