Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
023045d6
Commit
023045d6
authored
Jan 05, 2001
by
Dave Love
Browse files
butlast, nbutlast.
parent
2d4c9509
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
etc/NEWS
etc/NEWS
+4
-0
lispref/lists.texi
lispref/lists.texi
+14
-0
No files found.
etc/NEWS
View file @
023045d6
...
...
@@ -2105,6 +2105,10 @@ long promised.
*
Lisp changes made after edition 2.6 of the Emacs Lisp Manual,
(Display-related
features are described in a page of their own below.)
+++
**
Functions `butlast' and `nbutlast' for removing trailing elements
from a list are now available without requiring the CL package.
+++
**
The new user-option `even-window-heights' can be set to nil
to prevent `display-buffer' from evening out window heights.
...
...
lispref/lists.texi
View file @
023045d6
...
...
@@ -422,6 +422,20 @@ This is the same as @code{(cdr (cdr @var{cons-cell}))}
or @code{(nthcdr 2 @var{cons-cell})}.
@end defun
@defun butlast x &optional n
This function returns the list @var{x} with the last element,
or the last @var{n} elements, removed. If @var{n} is greater
than zero it makes a copy of the list so as not to damage the
original list. In general, @code{(append (butlast @var{x} @var{n})
(last @var{x} @var{n}))} will return a list equal to @var{x}.
@end defun
@defun nbutlast x &optional n
This is a version of @code{butlast} that works by destructively
modifying the @code{cdr} of the appropriate element, rather than
making a copy of the list.
@end defun
@node Building Lists
@comment node-name, next, previous, up
@section Building Cons Cells and Lists
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment