From: morioka Date: Thu, 25 Sep 1997 16:46:25 +0000 (+0000) Subject: (butlast, nbutlast): Don't use `defun-maybe' for cl functions. X-Git-Tag: semi-0_115~5 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=aa3cdc59ad018e5b849d8837b6bd34938fdb4895;p=elisp%2Fsemi.git (butlast, nbutlast): Don't use `defun-maybe' for cl functions. --- diff --git a/mime-def.el b/mime-def.el index b2df95e..296b8f8 100644 --- a/mime-def.el +++ b/mime-def.el @@ -3,7 +3,7 @@ ;; Copyright (C) 1995,1996,1997 Free Software Foundation, Inc. ;; Author: MORIOKA Tomohiko -;; Version: $Id: mime-def.el,v 0.65 1997-09-25 16:36:10 morioka Exp $ +;; Version: $Id: mime-def.el,v 0.66 1997-09-25 16:46:25 morioka Exp $ ;; Keywords: definition, MIME, multimedia, mail, news ;; This file is part of SEMI (SEMI is Emacs MIME Interfaces). @@ -27,19 +27,21 @@ (require 'emu) -(defun-maybe butlast (x &optional n) - "Returns a copy of LIST with the last N elements removed." - (if (and n (<= n 0)) x - (nbutlast (copy-sequence x) n))) - -(defun-maybe nbutlast (x &optional n) - "Modifies LIST to remove the last N elements." - (let ((m (length x))) - (or n (setq n 1)) - (and (< n m) - (progn - (if (> n 0) (setcdr (nthcdr (- (1- m) n) x) nil)) - x)))) +(unless (fboundp 'butlast) + (defun butlast (x &optional n) + "Returns a copy of LIST with the last N elements removed." + (if (and n (<= n 0)) x + (nbutlast (copy-sequence x) n))) + + (defun nbutlast (x &optional n) + "Modifies LIST to remove the last N elements." + (let ((m (length x))) + (or n (setq n 1)) + (and (< n m) + (progn + (if (> n 0) (setcdr (nthcdr (- (1- m) n) x) nil)) + x)))) + ) (defconst semi-version-name "Hinomiko")