Mercurial > emacs
changeset 19492:892a09772457
(last): New function.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 23 Aug 1997 19:10:42 +0000 |
parents | f5fd22f3462c |
children | 8d840c4548c0 |
files | lisp/subr.el |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/subr.el Sat Aug 23 18:55:52 1997 +0000 +++ b/lisp/subr.el Sat Aug 23 19:10:42 1997 +0000 @@ -78,6 +78,13 @@ (defsubst cddr (x) "Return the cdr of the cdr of X." (cdr (cdr x))) + +(defun last (x) + "Return the last element of the list X. +If X is nil, return nil." + (while (cdr x) + (setq x (cdr x))) + x) ;;;; Keymap support.