From 79278d031316b704b56b7990b0c127874787252b Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 31 Jan 2014 23:54:29 -0800 Subject: [PATCH] * subr.el (butlast): Document what an omitted N means. * subr.el (butlast): Document what an omitted N means. (nbutlast): Ditto. Fixes: debbugs:13437 --- lisp/subr.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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) -- 2.39.2