From: Lars Ingebrigtsen Date: Sat, 1 Feb 2014 07:54:29 +0000 (-0800) Subject: * subr.el (butlast): Document what an omitted N means. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~209 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=79278d031316b704b56b7990b0c127874787252b;p=emacs.git * subr.el (butlast): Document what an omitted N means. * subr.el (butlast): Document what an omitted N means. (nbutlast): Ditto. Fixes: debbugs:13437 --- diff --git a/lisp/subr.el b/lisp/subr.el index e3cc4b05f3f..3101cc8b6f0 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -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)