From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bojohan+news@dd.chalmers.se (Johan =?utf-8?Q?Bockg=C3=A5rd?=) Newsgroups: gmane.emacs.help Subject: Re: undo custom delete Date: Wed, 05 Oct 2005 19:49:09 +0200 Organization: Chalmers University of Technology, Sweden Message-ID: References: <1128441829.624442.144850@o13g2000cwo.googlegroups.com> <1128446941.952911.272060@g49g2000cwa.googlegroups.com> <1128503329.733223.304600@g14g2000cwa.googlegroups.com> <1128522198.322768.196970@o13g2000cwo.googlegroups.com> <1128523014.943427.204090@g49g2000cwa.googlegroups.com> <1128530820.718199.143450@g49g2000cwa.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1128535097 3612 80.91.229.2 (5 Oct 2005 17:58:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 5 Oct 2005 17:58:17 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 05 19:58:13 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ENDU8-0008CP-S3 for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Oct 2005 19:55:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ENDU8-0000Qp-4b for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Oct 2005 13:55:20 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!t-online.de!195.92.193.196.MISMATCH!nntp.theplanet.net!inewsm1.nntp.theplanet.net!newsfeed1.swip.net!swipnet!newsfeed.sunet.se!news01.sunet.se!129.16.116.9.MISMATCH!dd.chalmers.se!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 63 Original-NNTP-Posting-Host: linus003.dd.chalmers.se Mail-Copies-To: never User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:EunQ3dM/zyZOnfLP8nKdBFJH+Hk= Original-Xref: shelby.stanford.edu gnu.emacs.help:134378 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: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:29953 Archived-At: "Shug Boabby" writes: > how can i get the first element from the list, and once i have it > test which type it is, reference it's components and delete it from > the list if need be. All of this is thoroughly explained in the "Emacs Lisp Reference Manual". Lists are constructed from "cons cells". The expression (cons 1 (cons 2 (cons 3 nil))) builds the list (1 2 3) which can also be represented as (1 . (2 . (3 . nil))). `car' picks out the left half (the "car") of a pair / the first element of a list `cdr' picks out the right half (the "cdr") of a pair / the rest of a list (car '(1 2 3)) => 1 (car '(1 . (2 . (3 . nil)))) => 1 ; this is exactly the same as above (car '("text" . position)) => "text" (cdr '("text" . position)) => position `stringp' is used to test an object for being a string. (stringp "text") => t (stringp 0) => nil Maybe you should start with "Introduction to Programming in Emacs Lisp", http://www.gnu.org/software/emacs/emacs-lisp-intro/ If you use the CVS version of emacs then the Emacs manual, Elisp manual, and Elisp Intro manual are all included. You can use `M-x ielm RET' to practice evaluating simple Lisp expressions: *** Welcome to IELM *** Type (describe-mode) for help. ELISP> (+ 1 2) 3 ELISP> (list 'a 'b 'c) (a b c) ELISP> (cons 'a 'b) (a . b) You can use C-x C-e (eval-last-sexp) to evaluate Lisp expressions anywhere. > it doesn't seem to record the operation that was performed Correct. Only changes to the text are recorded, not which command was used. -- Johan Bockgård