]> git.eshelyaron.com Git - emacs.git/commitdiff
* subr.el (butlast): Document what an omitted N means.
authorLars Ingebrigtsen <larsi@gnus.org>
Sat, 1 Feb 2014 07:54:29 +0000 (23:54 -0800)
committerLars Ingebrigtsen <larsi@gnus.org>
Sat, 1 Feb 2014 07:54:29 +0000 (23:54 -0800)
* subr.el (butlast): Document what an omitted N means.
(nbutlast): Ditto.

Fixes: debbugs:13437
lisp/subr.el

index e3cc4b05f3f5db60b639940f81b256325ba19317..3101cc8b6f09f3746e5526ba54ce7e7f6b70fc15 100644 (file)
@@ -364,12 +364,15 @@ If N is bigger than the length of LIST, return LIST."
          (nthcdr (1- (safe-length list)) list))))
 
 (defun butlast (list &optional n)
-  "Return a copy of LIST with the last N elements removed."
+  "Return a copy of LIST with the last N elements removed.
+If N is omitted or nil, the last element is removed from the
+copy."
   (if (and n (<= n 0)) list
     (nbutlast (copy-sequence list) n)))
 
 (defun nbutlast (list &optional n)
-  "Modifies LIST to remove the last N elements."
+  "Modifies LIST to remove the last N elements.
+If N is omitted or nil, remove the last element."
   (let ((m (length list)))
     (or n (setq n 1))
     (and (< n m)