X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/fcd737693e8e320acd70f91ec8e0728563244805..66db4b5b2a1a2ff5a68de1b3ca93cbeb11132566:/lisp/emacs-lisp/cl.el diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el index 41f0baaa6f..6f115f4c4e 100644 --- a/lisp/emacs-lisp/cl.el +++ b/lisp/emacs-lisp/cl.el @@ -1,4 +1,4 @@ -;; cl.el --- Common Lisp extensions for GNU Emacs Lisp +;;; cl.el --- Common Lisp extensions for GNU Emacs Lisp ;; Copyright (C) 1993 Free Software Foundation, Inc. @@ -10,7 +10,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 1, or (at your option) +;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, @@ -19,10 +19,11 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to -;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. -;; Commentary: +;;; Commentary: ;; These are extensions to Emacs Lisp that provide a degree of ;; Common Lisp compatibility, beyond what is already built-in @@ -39,14 +40,14 @@ ;; package which should always be present. -;; Future notes: +;;; Future notes: ;; Once Emacs 19 becomes standard, many things in this package which are ;; messy for reasons of compatibility can be greatly simplified. For now, ;; I prefer to maintain one unified version. -;; Change Log: +;;; Change Log: ;; Version 2.02 (30 Jul 93): ;; * Added "cl-compat.el" file, extra compatibility with old package. @@ -92,7 +93,7 @@ ;; * First public release of this package. -;; Code: +;;; Code: (defvar cl-emacs-type (cond ((or (and (fboundp 'epoch::version) (symbol-value 'epoch::version)) @@ -254,6 +255,13 @@ Keywords supported: :test :test-not :key" (defalias 'macroexpand 'cl-macroexpand))) (defun cl-macroexpand (cl-macro &optional cl-env) + "Return result of expanding macros at top level of FORM. +If FORM is not a macro call, it is returned unchanged. +Otherwise, the macro is expanded and the expansion is considered +in place of FORM. When a non-macro-call results, it is returned. + +The second optional arg ENVIRONMENT species an environment of macro +definitions to shadow the loaded ones for use in file byte-compilation." (let ((cl-macro-environment cl-env)) (while (progn (setq cl-macro (funcall cl-old-macroexpand cl-macro cl-env)) (and (symbolp cl-macro)