[COMMIT] Be a little better about deciding when to add CL docstring argument info.
13 years, 6 months
Aidan Kehoe
OK, this time I didn’t get an error when pushing. I haven’t seen a commit
mail, but imagine it will be along soon enough.
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1306689429 -3600
# Node ID 9d519ab9fd683ee9b3e426cebc22fa668308cae1
# Parent cf2733b1ff4b5bf474ab34daba83ced4e20b4b04
Be a little better about deciding when to add CL docstring argument info.
2011-05-29 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-macs.el (cl-transform-lambda):
Move the code to decide whether to add argument information to the
docstring a little later, so the information about what the
function's docstring ends up being is a little more exact.
diff -r cf2733b1ff4b -r 9d519ab9fd68 lisp/ChangeLog
--- a/lisp/ChangeLog Fri May 27 14:31:56 2011 +0100
+++ b/lisp/ChangeLog Sun May 29 18:17:09 2011 +0100
@@ -1,3 +1,10 @@
+2011-05-29 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * cl-macs.el (cl-transform-lambda):
+ Move the code to decide whether to add argument information to the
+ docstring a little later, so the information about what the
+ function's docstring ends up being is a little more exact.
+
2011-05-27 Aidan Kehoe <kehoea(a)parhasard.net>
* modeline.el (make-modeline-command-wrapper):
diff -r cf2733b1ff4b -r 9d519ab9fd68 lisp/cl-macs.el
--- a/lisp/cl-macs.el Fri May 27 14:31:56 2011 +0100
+++ b/lisp/cl-macs.el Sun May 29 18:17:09 2011 +0100
@@ -380,15 +380,6 @@
(setq body (list (list* 'block bind-block body))))
(setq simple-args (nreverse simple-args)
header (nreverse header))
- ;; Add CL lambda list to documentation, if the CL lambda list differs
- ;; from the non-CL lambda list. npak(a)ispras.ru
- (unless (equal complex-arglist
- (cl-function-arglist simple-args))
- (and (stringp (car header)) (setq doc (pop header)))
- ;; Stick the arguments onto the end of the doc string in a way that
- ;; will be recognized specially by `function-arglist'.
- (push (concat doc "\n\narguments: " complex-arglist "\n")
- header))
(if (null args)
(list* nil simple-args (nconc header body))
(if (memq '&optional simple-args) (push '&optional args))
@@ -398,7 +389,21 @@
;; This code originally needed to create the keywords itself, that
;; wasn't done by the Lisp reader; the first element of the result
;; list comprised code to do this. It's not used any more.
- (list* nil (nconc simple-args (list '&rest (car (pop bind-lets))))
+ (list* nil (prog1
+ (setq simple-args
+ (nconc simple-args
+ (list '&rest (car (pop bind-lets)))))
+ ;; Add CL lambda list to documentation, if the CL lambda
+ ;; list differs from the non-CL lambda
+ ;; list. npak(a)ispras.ru
+ (unless (equal complex-arglist
+ (cl-function-arglist simple-args))
+ (and (stringp (car header)) (setq doc (pop header)))
+ ;; Stick the arguments onto the end of the doc string
+ ;; in a way that will be recognized specially by
+ ;; `function-arglist'.
+ (push (concat doc "\n\narguments: " complex-arglist "\n")
+ header)))
;; XEmacs change: we add usage information using Nickolay's
;; approach above
(nconc header
--
“Apart from the nine-banded armadillo, man is the only natural host of
Mycobacterium leprae, although it can be grown in the footpads of mice.”
-- Kumar & Clark, Clinical Medicine, summarising improbable leprosy research
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT] Be more reasonable in the implementation of #'make-modeline-command-wrapper.
13 years, 7 months
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1306503116 -3600
# Node ID cf2733b1ff4b5bf474ab34daba83ced4e20b4b04
# Parent 4aa8ee813265ea1ff20c6cc95697fac206c86f2d
Be more reasonable in the implementation of #'make-modeline-command-wrapper.
lisp/ChangeLog addition:
2011-05-27 Aidan Kehoe <kehoea(a)parhasard.net>
* modeline.el (make-modeline-command-wrapper):
Be more reasonable about the implementation of this wrapper, don't
require that the value of COMMAND be available at macro-expansion
time. (Basically, implement a closure.)
* modeline.el (add-minor-mode):
Remove a workaround and misguided comment that are no longer
necessary or exact.
diff -r 4aa8ee813265 -r cf2733b1ff4b lisp/ChangeLog
--- a/lisp/ChangeLog Wed May 25 09:15:20 2011 -0600
+++ b/lisp/ChangeLog Fri May 27 14:31:56 2011 +0100
@@ -1,3 +1,13 @@
+2011-05-27 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * modeline.el (make-modeline-command-wrapper):
+ Be more reasonable about the implementation of this wrapper, don't
+ require that the value of COMMAND be available at macro-expansion
+ time. (Basically, implement a closure.)
+ * modeline.el (add-minor-mode):
+ Remove a workaround and misguided comment that are no longer
+ necessary or exact.
+
2011-05-25 Didier Verna <didier(a)xemacs.org>
* cl-macs.el (macrolet):
diff -r 4aa8ee813265 -r cf2733b1ff4b lisp/modeline.el
--- a/lisp/modeline.el Wed May 25 09:15:20 2011 -0600
+++ b/lisp/modeline.el Fri May 27 14:31:56 2011 +0100
@@ -332,11 +332,43 @@
(set-face-font 'modeline-mousable [bold] nil '(default grayscale win)))
(defmacro make-modeline-command-wrapper (command)
- `#'(lambda (event)
- (interactive "e")
- (save-selected-window
- (select-window (event-window event))
- (call-interactively ',(eval command)))))
+ "Return a function object wrapping COMMAND, for use with the modeline.
+
+The function (itself a command, with \"e\" as its interactive spec) calls
+COMMAND with the appropriate window selected, and is suitable as a binding
+in the keymaps associated with the modeline."
+ (cond
+ ((and-fboundp 'cl-const-expr-p (cl-const-expr-p command))
+ `#'(lambda (event)
+ (interactive "e")
+ (save-selected-window
+ (select-window (event-window event))
+ (call-interactively ,command))))
+ ((eval-when-compile (cl-compiling-file))
+ (let ((compiled
+ (eval-when-compile
+ (byte-compile-sexp
+ #'(lambda (event)
+ (interactive "e")
+ (save-selected-window
+ (select-window (event-window event))
+ (call-interactively 'placeholder)))))))
+ `(make-byte-code ',(compiled-function-arglist compiled)
+ ,(compiled-function-instructions compiled)
+ (vector ,@(subst command ''placeholder
+ (mapcar 'quote-maybe
+ (compiled-function-constants compiled))
+:test 'equal))
+ ,(compiled-function-stack-depth compiled)
+ ,(compiled-function-doc-string compiled)
+ ,(quote-maybe (second (compiled-function-interactive compiled))))))
+ (t
+ `(lexical-let ((command ,command))
+ #'(lambda (event)
+ (interactive "e")
+ (save-selected-window
+ (select-window (event-window event))
+ (call-interactively command)))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Minor modes ;;;
@@ -427,9 +459,7 @@
(symbol-name toggle)
"-map"))))
(define-key toggle-keymap 'button2
- ;; defeat the DUMB-ASS byte-compiler, which tries to
- ;; expand the macro at compile time and fucks up.
- (eval '(make-modeline-command-wrapper toggle-fun)))
+ (make-modeline-command-wrapper toggle-fun))
(put toggle 'modeline-toggle-function toggle-fun))
(when name
(let ((hacked-name
--
“Apart from the nine-banded armadillo, man is the only natural host of
Mycobacterium leprae, although it can be grown in the footpads of mice.”
-- Kumar & Clark, Clinical Medicine, summarising improbable leprosy research
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit: Add a DESTDIR variable to all Makefiles, defaulting to the empty string, and
13 years, 7 months
Jerry James
changeset: 5512:4aa8ee813265
tag: tip
user: Jerry James <james(a)xemacs.org>
date: Wed May 25 09:15:20 2011 -0600
files: ChangeLog Makefile.in.in etc/ChangeLog etc/tests/external-widget/Makefile lib-src/ChangeLog lib-src/Makefile.in.in lwlib/ChangeLog lwlib/Makefile.in.in man/ChangeLog man/Makefile modules/ChangeLog modules/base64/Makefile modules/common/Makefile.common modules/sample/external/Makefile.in.in modules/zlib/Makefile src/ChangeLog src/Makefile.in.in tests/ChangeLog tests/tooltalk/Makefile
description:
Add a DESTDIR variable to all Makefiles, defaulting to the empty string, and
use it in install targets. See xemacs-patches message
<BANLkTinRnwk9qsCfBj_xkcyf7H4sH9fn7A(a)mail.gmail.com>.
diff -r 7b5254f6e0d5 -r 4aa8ee813265 ChangeLog
--- a/ChangeLog Wed May 25 14:01:38 2011 +0200
+++ b/ChangeLog Wed May 25 09:15:20 2011 -0600
@@ -1,3 +1,8 @@
+2011-05-20 Jerry James <james(a)xemacs.org>
+
+ * Makefile.in.in: Default DESTDIR to the empty string, and use it in
+ install targets.
+
2011-05-02 Jeff Sparkes <jsparkes(a)gmail.com>
* configure.ac (HAVE_MS_WINDOWS): On cygwin, use the w32api package
diff -r 7b5254f6e0d5 -r 4aa8ee813265 Makefile.in.in
--- a/Makefile.in.in Wed May 25 14:01:38 2011 +0200
+++ b/Makefile.in.in Wed May 25 09:15:20 2011 -0600
@@ -59,6 +59,8 @@
RECURSIVE_MAKE_ARGS=@RECURSIVE_MAKE_ARGS@
#endif
+DESTDIR=
+
SHELL = /bin/sh
LANG = C
LC_ALL = C
@@ -398,43 +400,43 @@
(cd ./$${subdir} && $(MAKE) $(RECURSIVE_MAKE_ARGS) install prefix=${prefix} \
exec_prefix=${exec_prefix} bindir=${bindir} libdir=${libdir} \
archlibdir=${archlibdir}) ; done
- if test "`(cd ${archlibdir} && $(pwd))`" != \
+ if test "`(cd $(DESTDIR)${archlibdir} && $(pwd))`" != \
"`(cd ./lib-src && $(pwd))`"; then \
if test -f ../Installation; then \
- ${INSTALL_DATA} ../Installation ${archlibdir}/Installation; \
+ ${INSTALL_DATA} ../Installation $(DESTDIR)${archlibdir}/Installation; \
fi; \
- ${INSTALL_DATA} lib-src/config.values ${docdir}/config.values; \
- ${INSTALL_DATA} lib-src/DOC ${docdir}/DOC; \
+ ${INSTALL_DATA} lib-src/config.values $(DESTDIR)${docdir}/config.values; \
+ ${INSTALL_DATA} lib-src/DOC $(DESTDIR)${docdir}/DOC; \
for subdir in `find ${archlibdir} -type d ! -name RCS ! -name SCCS ! -name CVS -print` ; \
do (cd $${subdir} && $(RM) -r RCS CVS SCCS \#* *~) ; done ; \
else true; fi
#if (defined(PDUMP) && !defined (DUMP_IN_EXEC)) || (defined (PDUMP) && defined(WIN32_NATIVE))
- ${INSTALL_DATA} src/${PROGNAME}.dmp ${bindir}/${PROGNAME}-${version}-`src/${PROGNAME} -sd`.dmp
+ ${INSTALL_DATA} src/${PROGNAME}.dmp $(DESTDIR)${bindir}/${PROGNAME}-${version}-`src/${PROGNAME} -sd`.dmp
#endif
#ifdef WIN32_NATIVE
- ${INSTALL_PROGRAM} src/${PROGNAME} ${bindir}/${PROGNAME}
- -chmod 0755 ${bindir}/${PROGNAME}
+ ${INSTALL_PROGRAM} src/${PROGNAME} $(DESTDIR)${bindir}/${PROGNAME}
+ -chmod 0755 $(DESTDIR)${bindir}/${PROGNAME}
#else
# ifdef CYGWIN
- ${INSTALL_PROGRAM} src/${PROGNAME} ${bindir}/${PROGNAME}-${version}.exe
- -chmod 0755 ${bindir}/${PROGNAME}-${version}.exe
- cd ${bindir} && $(RM) ./${PROGNAME} && ${LN_S} ${PROGNAME}-${version}.exe ./${PROGNAME}
- cd ${bindir} && $(RM) ./${SHEBANG_PROGNAME} && ${LN_S} ${PROGNAME}-${version}.exe ./${SHEBANG_PROGNAME}
+ ${INSTALL_PROGRAM} src/${PROGNAME} $(DESTDIR)${bindir}/${PROGNAME}-${version}.exe
+ -chmod 0755 $(DESTDIR)${bindir}/${PROGNAME}-${version}.exe
+ cd $(DESTDIR)${bindir} && $(RM) ./${PROGNAME} && ${LN_S} ${PROGNAME}-${version}.exe ./${PROGNAME}
+ cd $(DESTDIR)${bindir} && $(RM) ./${SHEBANG_PROGNAME} && ${LN_S} ${PROGNAME}-${version}.exe ./${SHEBANG_PROGNAME}
# else
- ${INSTALL_PROGRAM} src/${PROGNAME} ${bindir}/${PROGNAME}-${version}
- -chmod 0755 ${bindir}/${PROGNAME}-${version}
- cd ${bindir} && $(RM) ./${PROGNAME} && ${LN_S} ${PROGNAME}-${version} ./${PROGNAME}
- cd ${bindir} && $(RM) ./${SHEBANG_PROGNAME} && ${LN_S} ${PROGNAME}-${version} ./${SHEBANG_PROGNAME}
+ ${INSTALL_PROGRAM} src/${PROGNAME} $(DESTDIR)${bindir}/${PROGNAME}-${version}
+ -chmod 0755 $(DESTDIR)${bindir}/${PROGNAME}-${version}
+ cd $(DESTDIR)${bindir} && $(RM) ./${PROGNAME} && ${LN_S} ${PROGNAME}-${version} ./${PROGNAME}
+ cd $(DESTDIR)${bindir} && $(RM) ./${SHEBANG_PROGNAME} && ${LN_S} ${PROGNAME}-${version} ./${SHEBANG_PROGNAME}
# endif /* CYGWIN */
#endif /* WIN32_NATIVE */
#ifdef HAVE_SHLIB
- $(INSTALL_DATA) $(srcdir)/modules/auto-autoloads.* $(moduledir)
+ $(INSTALL_DATA) $(srcdir)/modules/auto-autoloads.* $(DESTDIR)$(moduledir)
#endif
install-arch-indep: mkdir info
-@set ${COPYDESTS} ; \
for dir in ${COPYDIR} ; do \
- if test "`(cd $$1 && $(pwd))`" != \
+ if test "`(cd $(DESTDIR)$$1 && $(pwd))`" != \
"`(cd $${dir} && $(pwd))`"; then \
: do nothing - echo "rm -rf $$1" ; \
fi ; \
@@ -442,35 +444,35 @@
done
-set ${COPYDESTS} ; \
for dir in ${COPYDESTS} ; do \
- if test ! -d $${dir} ; then mkdir $${dir} ; fi ; \
+ if test ! -d $${dir} ; then mkdir $(DESTDIR)$${dir} ; fi ; \
done ; \
for dir in ${COPYDIR} ; do \
dest=$$1 ; shift ; \
test -d $${dir} \
-a "`(cd $${dir} && $(pwd))`" != \
- "`(cd $${dest} && $(pwd))`" \
+ "`(cd $(DESTDIR)$${dest} && $(pwd))`" \
&& (echo "Copying $${dir}..." ; \
(cd $${dir} && $(TAR) -cf - . ) | \
- (cd $${dest} && umask 022 && $(TAR) -xf - );\
- chmod 0755 $${dest}; \
- for subdir in `find $${dest} -type d ! -name RCS ! -name SCCS ! -name CVS -print` ; do \
+ (cd $(DESTDIR)$${dest} && umask 022 && $(TAR) -xf - );\
+ chmod 0755 $(DESTDIR)$${dest}; \
+ for subdir in `find $(DESTDIR)$${dest} -type d ! -name RCS ! -name SCCS ! -name CVS -print` ; do \
(cd $${subdir} && $(RM) -r RCS CVS SCCS \#* *~) ; \
done) ; \
done
if test "`(cd ${srcdir}/info && $(pwd))`" != \
- "`(cd ${infodir} && $(pwd))`" && cd ${srcdir}/info; then \
- if test ! -f ${infodir}/dir -a -f dir ; then \
- ${INSTALL_DATA} ${srcdir}/info/dir ${infodir}/dir ; \
+ "`(cd $(DESTDIR)${infodir} && $(pwd))`" && cd ${srcdir}/info; then \
+ if test ! -f $(DESTDIR)${infodir}/dir -a -f dir ; then \
+ ${INSTALL_DATA} ${srcdir}/info/dir $(DESTDIR)${infodir}/dir ; \
fi ; \
for file in *.info* ; do \
- ${INSTALL_DATA} $${file} ${infodir}/$${file} ; \
- chmod 0644 ${infodir}/$${file}; \
+ ${INSTALL_DATA} $${file} $(DESTDIR)${infodir}/$${file} ; \
+ chmod 0644 $(DESTDIR)${infodir}/$${file}; \
done ; \
fi
cd ${srcdir}/etc && \
for page in xemacs etags ctags gnuserv gnuclient gnuattach gnudoit; do \
- ${INSTALL_DATA} ${srcdir}/etc/$${page}.1 ${mandir}/$${page}${manext} ; \
- chmod 0644 ${mandir}/$${page}${manext} ; \
+ ${INSTALL_DATA} ${srcdir}/etc/$${page}.1 $(DESTDIR)${mandir}/$${page}${manext} ; \
+ chmod 0644 $(DESTDIR)${mandir}/$${page}${manext} ; \
done
@echo "If you would like to save approximately 4M of disk space, do"
@echo "make gzip-el"
@@ -480,19 +482,23 @@
@echo "${lispdir}"
gzip-el:
- $(SHELL) ${srcdir}/lib-src/gzip-el.sh ${lispdir}
+ $(SHELL) ${srcdir}/lib-src/gzip-el.sh $(DESTDIR)${lispdir}
## Build all the directories to install XEmacs in.
## Since we may be creating several layers of directories,
## (e.g. /usr/local/lib/${PROGNAME}-20.5/sparc-sun-solaris2.6), we use
## make-path instead of mkdir. Not all mkdirs have the `-p' flag.
mkdir: FRC.mkdir
- ${MAKEPATH} ${COPYDESTS} ${docdir} ${infodir} ${archlibdir} \
- ${mandir} ${bindir} ${datadir} ${libdir} \
+ for dir in \
+ ${COPYDESTS} ${docdir} ${infodir} ${archlibdir} \
+ ${mandir} ${bindir} ${datadir} ${libdir} \
#ifdef HAVE_SHLIB
- ${moduledir} ${sitemoduledir} \
+ ${moduledir} ${sitemoduledir} \
#endif
- ${sitelispdir}
+ ${sitelispdir} ; \
+ do \
+ ${MAKEPATH} $(DESTDIR)$${dir} ; \
+ done ;
## Install bundled packages, if present.
diff -r 7b5254f6e0d5 -r 4aa8ee813265 etc/ChangeLog
--- a/etc/ChangeLog Wed May 25 14:01:38 2011 +0200
+++ b/etc/ChangeLog Wed May 25 09:15:20 2011 -0600
@@ -1,3 +1,8 @@
+2011-05-20 Jerry James <james(a)xemacs.org>
+
+ * tests/external-widget/Makefile (DESTDIR): New variable for all
+ Makefiles, unused in this one.
+
2011-04-29 Stephen J. Turnbull <stephen(a)xemacs.org>
* XEmacs 21.5.31 "ginger" is released.
diff -r 7b5254f6e0d5 -r 4aa8ee813265 etc/tests/external-widget/Makefile
--- a/etc/tests/external-widget/Makefile Wed May 25 14:01:38 2011 +0200
+++ b/etc/tests/external-widget/Makefile Wed May 25 09:15:20 2011 -0600
@@ -16,6 +16,8 @@
## You should have received a copy of the GNU General Public License
## along with XEmacs. If not, see <http://www.gnu.org/licenses/>.
+DESTDIR=
+
CFLAGS += -Xc -g -DTOOLTALK
EMACSHOME = ../../..
EMACSLIBDIR = $(EMACSHOME)/editor/src
diff -r 7b5254f6e0d5 -r 4aa8ee813265 lib-src/ChangeLog
--- a/lib-src/ChangeLog Wed May 25 14:01:38 2011 +0200
+++ b/lib-src/ChangeLog Wed May 25 09:15:20 2011 -0600
@@ -1,3 +1,8 @@
+2011-05-20 Jerry James <james(a)xemacs.org>
+
+ * Makefile.in.in: Default DESTDIR to the empty string, and use it in
+ install targets.
+
2011-04-29 Stephen J. Turnbull <stephen(a)xemacs.org>
* XEmacs 21.5.31 "ginger" is released.
diff -r 7b5254f6e0d5 -r 4aa8ee813265 lib-src/Makefile.in.in
--- a/lib-src/Makefile.in.in Wed May 25 14:01:38 2011 +0200
+++ b/lib-src/Makefile.in.in Wed May 25 09:15:20 2011 -0600
@@ -22,6 +22,8 @@
## above a certain point in this file are in shell format instead of
## in C format. How the hell is this supposed to work? */
+DESTDIR=
+
## For performance and consistency, no built-in rules
.SUFFIXES:
.SUFFIXES: .c .h .o
@@ -242,26 +244,26 @@
## just run them directly from lib-src.
${archlibdir}: all
@echo; echo "Installing utilities run internally by XEmacs."
- ./make-path ${archlibdir}
+ ./make-path $(DESTDIR)${archlibdir}
if test "`(cd ${archlibdir} && $(pwd))`" != "`$(pwd)`"; then \
for f in ${PRIVATE_INSTALLABLE_EXES}; do \
- (cd .. && $(INSTALL_PROGRAM) lib-src/$$f ${archlibdir}/$$f) ; \
+ (cd .. && $(INSTALL_PROGRAM) lib-src/$$f $(DESTDIR)${archlibdir}/$$f) ; \
done ; \
fi
if test "`(cd ${archlibdir} && $(pwd))`" \
!= "`(cd ${srcdir} && $(pwd))`"; then \
for f in ${PRIVATE_INSTALLABLE_SCRIPTS}; do \
- (cd .. && $(INSTALL_PROGRAM) ${srcdir}/$$f ${archlibdir}/$$f); \
+ (cd .. && $(INSTALL_PROGRAM) ${srcdir}/$$f $(DESTDIR)${archlibdir}/$$f); \
done ; \
fi
install: ${archlibdir}
@echo; echo "Installing utilities for users to run."
for file in ${PUBLIC_INSTALLABLE_EXES} ; do \
- (cd .. && $(INSTALL_PROGRAM) lib-src/$${file} ${bindir}/$${file}) ; \
+ (cd .. && $(INSTALL_PROGRAM) lib-src/$${file} $(DESTDIR)${bindir}/$${file}) ; \
done
for file in ${PUBLIC_INSTALLABLE_SCRIPTS} ; do \
- (cd .. && $(INSTALL_PROGRAM) ${srcdir}/$${file} ${bindir}/$${file}) ; \
+ (cd .. && $(INSTALL_PROGRAM) ${srcdir}/$${file} $(DESTDIR)${bindir}/$${file}) ; \
done
uninstall:
diff -r 7b5254f6e0d5 -r 4aa8ee813265 lwlib/ChangeLog
--- a/lwlib/ChangeLog Wed May 25 14:01:38 2011 +0200
+++ b/lwlib/ChangeLog Wed May 25 09:15:20 2011 -0600
@@ -1,3 +1,8 @@
+2011-05-20 Jerry James <james(a)xemacs.org>
+
+ * Makefile.in.in (DESTDIR): New variable for all Makefiles, unused in
+ this one.
+
2011-04-29 Stephen J. Turnbull <stephen(a)xemacs.org>
* XEmacs 21.5.31 "ginger" is released.
diff -r 7b5254f6e0d5 -r 4aa8ee813265 lwlib/Makefile.in.in
--- a/lwlib/Makefile.in.in Wed May 25 14:01:38 2011 +0200
+++ b/lwlib/Makefile.in.in Wed May 25 09:15:20 2011 -0600
@@ -21,6 +21,8 @@
## along with the Lucid Widget Library. If not, see
## <http://www.gnu.org/licenses/>.
+DESTDIR=
+
## For performance and consistency, no built-in rules
.SUFFIXES:
.SUFFIXES: .c .h .o .i .s
diff -r 7b5254f6e0d5 -r 4aa8ee813265 man/ChangeLog
--- a/man/ChangeLog Wed May 25 14:01:38 2011 +0200
+++ b/man/ChangeLog Wed May 25 09:15:20 2011 -0600
@@ -1,3 +1,8 @@
+2011-05-20 Jerry James <james(a)xemacs.org>
+
+ * Makefile (DESTDIR): New variable for all Makefiles, unused in this
+ one.
+
2011-04-29 Stephen J. Turnbull <stephen(a)xemacs.org>
* XEmacs 21.5.31 "ginger" is released.
diff -r 7b5254f6e0d5 -r 4aa8ee813265 man/Makefile
--- a/man/Makefile Wed May 25 14:01:38 2011 +0200
+++ b/man/Makefile Wed May 25 09:15:20 2011 -0600
@@ -20,6 +20,8 @@
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
+DESTDIR=
+
SHELL = /bin/sh
MAKEINFO = makeinfo
TEXI2DVI = texi2dvi
diff -r 7b5254f6e0d5 -r 4aa8ee813265 modules/ChangeLog
--- a/modules/ChangeLog Wed May 25 14:01:38 2011 +0200
+++ b/modules/ChangeLog Wed May 25 09:15:20 2011 -0600
@@ -1,3 +1,11 @@
+2011-05-20 Jerry James <james(a)xemacs.org>
+
+ * base64/Makefile: Default DESTDIR to the empty string, and use it in
+ install targets.
+ * common/Makefile.common: Ditto.
+ * external/Makefile.in.in: Ditto.
+ * zlib/Makefile: Ditto.
+
2011-04-29 Stephen J. Turnbull <stephen(a)xemacs.org>
* XEmacs 21.5.31 "ginger" is released.
diff -r 7b5254f6e0d5 -r 4aa8ee813265 modules/base64/Makefile
--- a/modules/base64/Makefile Wed May 25 14:01:38 2011 +0200
+++ b/modules/base64/Makefile Wed May 25 09:15:20 2011 -0600
@@ -25,6 +25,8 @@
# 'installed'.
#
+DESTDIR=
+
SHELL=/bin/sh
RM=rm -f
CC=../../lib-src/ellcc
diff -r 7b5254f6e0d5 -r 4aa8ee813265 modules/common/Makefile.common
--- a/modules/common/Makefile.common Wed May 25 14:01:38 2011 +0200
+++ b/modules/common/Makefile.common Wed May 25 09:15:20 2011 -0600
@@ -29,6 +29,8 @@
#define NOT_C_CODE
#include "../../src/config.h"
+DESTDIR=
+
SHELL=/bin/sh
RM=rm -f
PROGNAME=@PROGNAME@
@@ -96,7 +98,7 @@
-$(RM) *~ \#*
install: $(OBJECT_TO_BUILD)
- $(INSTALL_PROGRAM) $< $(INSTALLPATH)
+ $(INSTALL_PROGRAM) $< $(DESTDIR)$(INSTALLPATH)
##
## Local Variables:
diff -r 7b5254f6e0d5 -r 4aa8ee813265 modules/sample/external/Makefile.in.in
--- a/modules/sample/external/Makefile.in.in Wed May 25 14:01:38 2011 +0200
+++ b/modules/sample/external/Makefile.in.in Wed May 25 09:15:20 2011 -0600
@@ -15,6 +15,7 @@
SRCS=sample.c
### You should not need to modify anything below this line
+DESTDIR=
SHELL=/bin/sh
RM=rm -f
CFLAGS=@CFLAGS@
@@ -54,4 +55,4 @@
$(RM) Makefile config.* configure
install: $(MODNAME).ell
- $(INSTALL_PROGRAM) $< $(INSTALLPATH)
+ $(INSTALL_PROGRAM) $< $(DESTDIR)$(INSTALLPATH)
diff -r 7b5254f6e0d5 -r 4aa8ee813265 modules/zlib/Makefile
--- a/modules/zlib/Makefile Wed May 25 14:01:38 2011 +0200
+++ b/modules/zlib/Makefile Wed May 25 09:15:20 2011 -0600
@@ -26,6 +26,8 @@
# 'installed'.
#
+DESTDIR=
+
SHELL=/bin/sh
RM=rm -f
CC=../../lib-src/ellcc
diff -r 7b5254f6e0d5 -r 4aa8ee813265 src/ChangeLog
--- a/src/ChangeLog Wed May 25 14:01:38 2011 +0200
+++ b/src/ChangeLog Wed May 25 09:15:20 2011 -0600
@@ -1,3 +1,8 @@
+2011-05-20 Jerry James <james(a)xemacs.org>
+
+ * Makefile.in.in: Default DESTDIR to the empty string, and use it in
+ install targets.
+
2011-05-20 Aidan Kehoe <kehoea(a)parhasard.net>
* config.h.in:
diff -r 7b5254f6e0d5 -r 4aa8ee813265 src/Makefile.in.in
--- a/src/Makefile.in.in Wed May 25 14:01:38 2011 +0200
+++ b/src/Makefile.in.in Wed May 25 09:15:20 2011 -0600
@@ -37,6 +37,8 @@
RECURSIVE_MAKE_ARGS=@RECURSIVE_MAKE_ARGS@
#endif
+DESTDIR=
+
PROGNAME=@PROGNAME@
prefix=@prefix@
SRC=@srcdir@
@@ -1019,7 +1021,7 @@
#ifdef HAVE_SHLIB
MAKEPATH=../lib-src/make-path
install: $(PROGNAME)
- $(MAKEPATH) $(archlibdir)/include $(archlibdir)/include/m $(archlibdir)/include/s
+ $(MAKEPATH) $(DESTDIR)$(archlibdir)/include $(DESTDIR)$(archlibdir)/include/m $(DESTDIR)$(archlibdir)/include/s
-@echo "Copying include files for ellcc..."
-@hdir=`pwd`; \
cd $(SRC); hdrdir2=`pwd`; cd $$hdir; \
@@ -1033,12 +1035,12 @@
test -d s && hdrtars="$$hdrtars s/*"; \
test -d m && hdrtars="$$hdrtars m/*"; \
test -n "$$hdrtars" && (tar cf - $$hdrtars) | \
- (cd $(archlibdir)/include && umask 022 && tar xf -); \
- chmod 755 $(archlibdir)/include; \
- test -d $(archlibdir)/include/s && \
- chmod 755 $(archlibdir)/include/s; \
- test -d $(archlibdir)/include/m && \
- chmod 755 $(archlibdir)/include/s;) \
+ (cd $(DESTDIR)$(archlibdir)/include && umask 022 && tar xf -); \
+ chmod 755 $(DESTDIR)$(archlibdir)/include; \
+ test -d $(DESTDIR)$(archlibdir)/include/s && \
+ chmod 755 $(DESTDIR)$(archlibdir)/include/s; \
+ test -d $(DESTDIR)$(archlibdir)/include/m && \
+ chmod 755 $(DESTDIR)$(archlibdir)/include/s;) \
done)
#endif
diff -r 7b5254f6e0d5 -r 4aa8ee813265 tests/ChangeLog
--- a/tests/ChangeLog Wed May 25 14:01:38 2011 +0200
+++ b/tests/ChangeLog Wed May 25 09:15:20 2011 -0600
@@ -1,3 +1,8 @@
+2011-05-20 Jerry James <james(a)xemacs.org>
+
+ * tooltalk/Makefile (DESTDIR): New variable for all Makefiles, unused
+ in this one.
+
2011-05-01 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/lisp-reader-tests.el:
diff -r 7b5254f6e0d5 -r 4aa8ee813265 tests/tooltalk/Makefile
--- a/tests/tooltalk/Makefile Wed May 25 14:01:38 2011 +0200
+++ b/tests/tooltalk/Makefile Wed May 25 09:15:20 2011 -0600
@@ -27,6 +27,8 @@
### Code:
+DESTDIR=
+
CC = cc -Xc
CPPFLAGS = -I/usr/openwin/include
CFLAGS = -g -v -DNeedFunctionPrototypes
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[PATCH 21.5] More use of DESTDIR
13 years, 7 months
Jerry James
PATCH 21.5
This is a patch we are carrying in the Fedora repository. Judging
from the date, it must have been created shortly before Ville handed
off maintainership to me. I don't know the full rationale behind it,
although I can guess. It looks like we are simply missing DESTDIR in
some places where its presence makes "make install
DESTDIR=/staging_area" style invocations easy.
diff -r b0d87f92e60b Makefile.in.in
--- a/Makefile.in.in Sun May 08 09:19:25 2011 +0100
+++ b/Makefile.in.in Tue May 10 11:02:51 2011 -0600
@@ -59,6 +59,8 @@
RECURSIVE_MAKE_ARGS=@RECURSIVE_MAKE_ARGS@
#endif
+DESTDIR=
+
SHELL = /bin/sh
LANG = C
LC_ALL = C
@@ -398,43 +400,43 @@
(cd ./$${subdir} && $(MAKE) $(RECURSIVE_MAKE_ARGS) install prefix=${prefix} \
exec_prefix=${exec_prefix} bindir=${bindir} libdir=${libdir} \
archlibdir=${archlibdir}) ; done
- if test "`(cd ${archlibdir} && $(pwd))`" != \
+ if test "`(cd $(DESTDIR)${archlibdir} && $(pwd))`" != \
"`(cd ./lib-src && $(pwd))`"; then \
if test -f ../Installation; then \
- ${INSTALL_DATA} ../Installation ${archlibdir}/Installation; \
+ ${INSTALL_DATA} ../Installation $(DESTDIR)${archlibdir}/Installation; \
fi; \
- ${INSTALL_DATA} lib-src/config.values ${docdir}/config.values; \
- ${INSTALL_DATA} lib-src/DOC ${docdir}/DOC; \
+ ${INSTALL_DATA} lib-src/config.values $(DESTDIR)${docdir}/config.values; \
+ ${INSTALL_DATA} lib-src/DOC $(DESTDIR)${docdir}/DOC; \
for subdir in `find ${archlibdir} -type d ! -name RCS ! -name
SCCS ! -name CVS -print` ; \
do (cd $${subdir} && $(RM) -r RCS CVS SCCS \#* *~) ; done ; \
else true; fi
#if (defined(PDUMP) && !defined (DUMP_IN_EXEC)) || (defined (PDUMP)
&& defined(WIN32_NATIVE))
- ${INSTALL_DATA} src/${PROGNAME}.dmp
${bindir}/${PROGNAME}-${version}-`src/${PROGNAME} -sd`.dmp
+ ${INSTALL_DATA} src/${PROGNAME}.dmp
$(DESTDIR)${bindir}/${PROGNAME}-${version}-`src/${PROGNAME} -sd`.dmp
#endif
#ifdef WIN32_NATIVE
- ${INSTALL_PROGRAM} src/${PROGNAME} ${bindir}/${PROGNAME}
- -chmod 0755 ${bindir}/${PROGNAME}
+ ${INSTALL_PROGRAM} src/${PROGNAME} $(DESTDIR)${bindir}/${PROGNAME}
+ -chmod 0755 $(DESTDIR)${bindir}/${PROGNAME}
#else
# ifdef CYGWIN
- ${INSTALL_PROGRAM} src/${PROGNAME} ${bindir}/${PROGNAME}-${version}.exe
- -chmod 0755 ${bindir}/${PROGNAME}-${version}.exe
- cd ${bindir} && $(RM) ./${PROGNAME} && ${LN_S}
${PROGNAME}-${version}.exe ./${PROGNAME}
- cd ${bindir} && $(RM) ./${SHEBANG_PROGNAME} && ${LN_S}
${PROGNAME}-${version}.exe ./${SHEBANG_PROGNAME}
+ ${INSTALL_PROGRAM} src/${PROGNAME}
$(DESTDIR)${bindir}/${PROGNAME}-${version}.exe
+ -chmod 0755 $(DESTDIR)${bindir}/${PROGNAME}-${version}.exe
+ cd $(DESTDIR)${bindir} && $(RM) ./${PROGNAME} && ${LN_S}
${PROGNAME}-${version}.exe ./${PROGNAME}
+ cd $(DESTDIR)${bindir} && $(RM) ./${SHEBANG_PROGNAME} && ${LN_S}
${PROGNAME}-${version}.exe ./${SHEBANG_PROGNAME}
# else
- ${INSTALL_PROGRAM} src/${PROGNAME} ${bindir}/${PROGNAME}-${version}
- -chmod 0755 ${bindir}/${PROGNAME}-${version}
- cd ${bindir} && $(RM) ./${PROGNAME} && ${LN_S}
${PROGNAME}-${version} ./${PROGNAME}
- cd ${bindir} && $(RM) ./${SHEBANG_PROGNAME} && ${LN_S}
${PROGNAME}-${version} ./${SHEBANG_PROGNAME}
+ ${INSTALL_PROGRAM} src/${PROGNAME} $(DESTDIR)${bindir}/${PROGNAME}-${version}
+ -chmod 0755 $(DESTDIR)${bindir}/${PROGNAME}-${version}
+ cd $(DESTDIR)${bindir} && $(RM) ./${PROGNAME} && ${LN_S}
${PROGNAME}-${version} ./${PROGNAME}
+ cd $(DESTDIR)${bindir} && $(RM) ./${SHEBANG_PROGNAME} && ${LN_S}
${PROGNAME}-${version} ./${SHEBANG_PROGNAME}
# endif /* CYGWIN */
#endif /* WIN32_NATIVE */
#ifdef HAVE_SHLIB
- $(INSTALL_DATA) $(srcdir)/modules/auto-autoloads.* $(moduledir)
+ $(INSTALL_DATA) $(srcdir)/modules/auto-autoloads.* $(DESTDIR)$(moduledir)
#endif
install-arch-indep: mkdir info
-@set ${COPYDESTS} ; \
for dir in ${COPYDIR} ; do \
- if test "`(cd $$1 && $(pwd))`" != \
+ if test "`(cd $(DESTDIR)$$1 && $(pwd))`" != \
"`(cd $${dir} && $(pwd))`"; then \
: do nothing - echo "rm -rf $$1" ; \
fi ; \
@@ -442,35 +444,35 @@
done
-set ${COPYDESTS} ; \
for dir in ${COPYDESTS} ; do \
- if test ! -d $${dir} ; then mkdir $${dir} ; fi ; \
+ if test ! -d $${dir} ; then mkdir $(DESTDIR)$${dir} ; fi ; \
done ; \
for dir in ${COPYDIR} ; do \
dest=$$1 ; shift ; \
test -d $${dir} \
-a "`(cd $${dir} && $(pwd))`" != \
- "`(cd $${dest} && $(pwd))`" \
+ "`(cd $(DESTDIR)$${dest} && $(pwd))`" \
&& (echo "Copying $${dir}..." ; \
(cd $${dir} && $(TAR) -cf - . ) | \
- (cd $${dest} && umask 022 && $(TAR) -xf - );\
- chmod 0755 $${dest}; \
- for subdir in `find $${dest} -type d ! -name RCS ! -name SCCS
! -name CVS -print` ; do \
+ (cd $(DESTDIR)$${dest} && umask 022 && $(TAR) -xf - );\
+ chmod 0755 $(DESTDIR)$${dest}; \
+ for subdir in `find $(DESTDIR)$${dest} -type d ! -name RCS !
-name SCCS ! -name CVS -print` ; do \
(cd $${subdir} && $(RM) -r RCS CVS SCCS \#* *~) ; \
done) ; \
done
if test "`(cd ${srcdir}/info && $(pwd))`" != \
- "`(cd ${infodir} && $(pwd))`" && cd ${srcdir}/info; then \
- if test ! -f ${infodir}/dir -a -f dir ; then \
- ${INSTALL_DATA} ${srcdir}/info/dir ${infodir}/dir ; \
+ "`(cd $(DESTDIR)${infodir} && $(pwd))`" && cd ${srcdir}/info; then \
+ if test ! -f $(DESTDIR)${infodir}/dir -a -f dir ; then \
+ ${INSTALL_DATA} ${srcdir}/info/dir $(DESTDIR)${infodir}/dir ; \
fi ; \
for file in *.info* ; do \
- ${INSTALL_DATA} $${file} ${infodir}/$${file} ; \
- chmod 0644 ${infodir}/$${file}; \
+ ${INSTALL_DATA} $${file} $(DESTDIR)${infodir}/$${file} ; \
+ chmod 0644 $(DESTDIR)${infodir}/$${file}; \
done ; \
fi
cd ${srcdir}/etc && \
for page in xemacs etags ctags gnuserv gnuclient gnuattach gnudoit; do \
- ${INSTALL_DATA} ${srcdir}/etc/$${page}.1 ${mandir}/$${page}${manext} ; \
- chmod 0644 ${mandir}/$${page}${manext} ; \
+ ${INSTALL_DATA} ${srcdir}/etc/$${page}.1
$(DESTDIR)${mandir}/$${page}${manext} ; \
+ chmod 0644 $(DESTDIR)${mandir}/$${page}${manext} ; \
done
@echo "If you would like to save approximately 4M of disk space, do"
@echo "make gzip-el"
@@ -480,19 +482,23 @@
@echo "${lispdir}"
gzip-el:
- $(SHELL) ${srcdir}/lib-src/gzip-el.sh ${lispdir}
+ $(SHELL) ${srcdir}/lib-src/gzip-el.sh $(DESTDIR)${lispdir}
## Build all the directories to install XEmacs in.
## Since we may be creating several layers of directories,
## (e.g. /usr/local/lib/${PROGNAME}-20.5/sparc-sun-solaris2.6), we use
## make-path instead of mkdir. Not all mkdirs have the `-p' flag.
mkdir: FRC.mkdir
- ${MAKEPATH} ${COPYDESTS} ${docdir} ${infodir} ${archlibdir} \
- ${mandir} ${bindir} ${datadir} ${libdir} \
+ for dir in \
+ ${COPYDESTS} ${docdir} ${infodir} ${archlibdir} \
+ ${mandir} ${bindir} ${datadir} ${libdir} \
#ifdef HAVE_SHLIB
- ${moduledir} ${sitemoduledir} \
+ ${moduledir} ${sitemoduledir} \
#endif
- ${sitelispdir}
+ ${sitelispdir} ; \
+ do \
+ ${MAKEPATH} $(DESTDIR)$${dir} ; \
+ done ;
## Install bundled packages, if present.
diff -r b0d87f92e60b etc/tests/external-widget/Makefile
--- a/etc/tests/external-widget/Makefile Sun May 08 09:19:25 2011 +0100
+++ b/etc/tests/external-widget/Makefile Tue May 10 11:02:51 2011 -0600
@@ -16,6 +16,8 @@
## You should have received a copy of the GNU General Public License
## along with XEmacs. If not, see <http://www.gnu.org/licenses/>.
+DESTDIR=
+
CFLAGS += -Xc -g -DTOOLTALK
EMACSHOME = ../../..
EMACSLIBDIR = $(EMACSHOME)/editor/src
diff -r b0d87f92e60b lib-src/Makefile.in.in
--- a/lib-src/Makefile.in.in Sun May 08 09:19:25 2011 +0100
+++ b/lib-src/Makefile.in.in Tue May 10 11:02:51 2011 -0600
@@ -22,6 +22,8 @@
## above a certain point in this file are in shell format instead of
## in C format. How the hell is this supposed to work? */
+DESTDIR=
+
## For performance and consistency, no built-in rules
.SUFFIXES:
.SUFFIXES: .c .h .o
@@ -242,26 +244,26 @@
## just run them directly from lib-src.
${archlibdir}: all
@echo; echo "Installing utilities run internally by XEmacs."
- ./make-path ${archlibdir}
+ ./make-path $(DESTDIR)${archlibdir}
if test "`(cd ${archlibdir} && $(pwd))`" != "`$(pwd)`"; then \
for f in ${PRIVATE_INSTALLABLE_EXES}; do \
- (cd .. && $(INSTALL_PROGRAM) lib-src/$$f ${archlibdir}/$$f) ; \
+ (cd .. && $(INSTALL_PROGRAM) lib-src/$$f $(DESTDIR)${archlibdir}/$$f) ; \
done ; \
fi
if test "`(cd ${archlibdir} && $(pwd))`" \
!= "`(cd ${srcdir} && $(pwd))`"; then \
for f in ${PRIVATE_INSTALLABLE_SCRIPTS}; do \
- (cd .. && $(INSTALL_PROGRAM) ${srcdir}/$$f ${archlibdir}/$$f); \
+ (cd .. && $(INSTALL_PROGRAM) ${srcdir}/$$f $(DESTDIR)${archlibdir}/$$f); \
done ; \
fi
install: ${archlibdir}
@echo; echo "Installing utilities for users to run."
for file in ${PUBLIC_INSTALLABLE_EXES} ; do \
- (cd .. && $(INSTALL_PROGRAM) lib-src/$${file} ${bindir}/$${file}) ; \
+ (cd .. && $(INSTALL_PROGRAM) lib-src/$${file}
$(DESTDIR)${bindir}/$${file}) ; \
done
for file in ${PUBLIC_INSTALLABLE_SCRIPTS} ; do \
- (cd .. && $(INSTALL_PROGRAM) ${srcdir}/$${file} ${bindir}/$${file}) ; \
+ (cd .. && $(INSTALL_PROGRAM) ${srcdir}/$${file}
$(DESTDIR)${bindir}/$${file}) ; \
done
uninstall:
diff -r b0d87f92e60b lwlib/Makefile.in.in
--- a/lwlib/Makefile.in.in Sun May 08 09:19:25 2011 +0100
+++ b/lwlib/Makefile.in.in Tue May 10 11:02:51 2011 -0600
@@ -21,6 +21,8 @@
## along with the Lucid Widget Library. If not, see
## <http://www.gnu.org/licenses/>.
+DESTDIR=
+
## For performance and consistency, no built-in rules
.SUFFIXES:
.SUFFIXES: .c .h .o .i .s
diff -r b0d87f92e60b man/Makefile
--- a/man/Makefile Sun May 08 09:19:25 2011 +0100
+++ b/man/Makefile Tue May 10 11:02:51 2011 -0600
@@ -20,6 +20,8 @@
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
+DESTDIR=
+
SHELL = /bin/sh
MAKEINFO = makeinfo
TEXI2DVI = texi2dvi
diff -r b0d87f92e60b modules/base64/Makefile
--- a/modules/base64/Makefile Sun May 08 09:19:25 2011 +0100
+++ b/modules/base64/Makefile Tue May 10 11:02:51 2011 -0600
@@ -25,6 +25,8 @@
# 'installed'.
#
+DESTDIR=
+
SHELL=/bin/sh
RM=rm -f
CC=../../lib-src/ellcc
diff -r b0d87f92e60b modules/common/Makefile.common
--- a/modules/common/Makefile.common Sun May 08 09:19:25 2011 +0100
+++ b/modules/common/Makefile.common Tue May 10 11:02:51 2011 -0600
@@ -29,6 +29,8 @@
#define NOT_C_CODE
#include "../../src/config.h"
+DESTDIR=
+
SHELL=/bin/sh
RM=rm -f
PROGNAME=@PROGNAME@
@@ -96,7 +98,7 @@
-$(RM) *~ \#*
install: $(OBJECT_TO_BUILD)
- $(INSTALL_PROGRAM) $< $(INSTALLPATH)
+ $(INSTALL_PROGRAM) $< $(DESTDIR)$(INSTALLPATH)
##
## Local Variables:
diff -r b0d87f92e60b modules/zlib/Makefile
--- a/modules/zlib/Makefile Sun May 08 09:19:25 2011 +0100
+++ b/modules/zlib/Makefile Tue May 10 11:02:51 2011 -0600
@@ -26,6 +26,8 @@
# 'installed'.
#
+DESTDIR=
+
SHELL=/bin/sh
RM=rm -f
CC=../../lib-src/ellcc
diff -r b0d87f92e60b src/Makefile.in.in
--- a/src/Makefile.in.in Sun May 08 09:19:25 2011 +0100
+++ b/src/Makefile.in.in Tue May 10 11:02:51 2011 -0600
@@ -37,6 +37,8 @@
RECURSIVE_MAKE_ARGS=@RECURSIVE_MAKE_ARGS@
#endif
+DESTDIR=
+
PROGNAME=@PROGNAME@
prefix=@prefix@
SRC=@srcdir@
@@ -1019,7 +1021,7 @@
#ifdef HAVE_SHLIB
MAKEPATH=../lib-src/make-path
install: $(PROGNAME)
- $(MAKEPATH) $(archlibdir)/include $(archlibdir)/include/m
$(archlibdir)/include/s
+ $(MAKEPATH) $(DESTDIR)$(archlibdir)/include
$(DESTDIR)$(archlibdir)/include/m $(DESTDIR)$(archlibdir)/include/s
-@echo "Copying include files for ellcc..."
-@hdir=`pwd`; \
cd $(SRC); hdrdir2=`pwd`; cd $$hdir; \
@@ -1033,12 +1035,12 @@
test -d s && hdrtars="$$hdrtars s/*"; \
test -d m && hdrtars="$$hdrtars m/*"; \
test -n "$$hdrtars" && (tar cf - $$hdrtars) | \
- (cd $(archlibdir)/include && umask 022 && tar xf -); \
- chmod 755 $(archlibdir)/include; \
- test -d $(archlibdir)/include/s && \
- chmod 755 $(archlibdir)/include/s; \
- test -d $(archlibdir)/include/m && \
- chmod 755 $(archlibdir)/include/s;) \
+ (cd $(DESTDIR)$(archlibdir)/include && umask 022 && tar xf -); \
+ chmod 755 $(DESTDIR)$(archlibdir)/include; \
+ test -d $(DESTDIR)$(archlibdir)/include/s && \
+ chmod 755 $(DESTDIR)$(archlibdir)/include/s; \
+ test -d $(DESTDIR)$(archlibdir)/include/m && \
+ chmod 755 $(DESTDIR)$(archlibdir)/include/s;) \
done)
#endif
diff -r b0d87f92e60b tests/tooltalk/Makefile
--- a/tests/tooltalk/Makefile Sun May 08 09:19:25 2011 +0100
+++ b/tests/tooltalk/Makefile Tue May 10 11:02:51 2011 -0600
@@ -27,6 +27,8 @@
### Code:
+DESTDIR=
+
CC = cc -Xc
CPPFLAGS = -I/usr/openwin/include
CFLAGS = -g -v -DNeedFunctionPrototypes
--
Jerry James
http://www.jamezone.org/
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT] Fix CL compliance of [symbol-]macrolet
13 years, 7 months
Didier Verna
NOTE: This patch has been committed.
Hello,
the following patch fixes ANSI Common Lisp compliance of
[SYMBOL-]MACROLET.
lisp/ChangeLog addition:
2011-05-25 Didier Verna <didier(a)xemacs.org>
* cl-macs.el (macrolet):
* cl-macs.el (symbol-macrolet): Don't require one mandatory
[symbol-]macro definition in the first argument. The Common Lisp
standard allows the list of definitions to be empty.
XEmacs 21.5 source patch:
Diff command: hg diff --git --show-function
Files affected: lisp/cl-macs.el
diff --git a/lisp/cl-macs.el b/lisp/cl-macs.el
--- a/lisp/cl-macs.el
+++ b/lisp/cl-macs.el
@@ -1769,29 +1769,27 @@ arguments: (((FUNC ARGLIST &body BODY) &
;; The following ought to have a better definition for use with newer
;; byte compilers.
;;;###autoload
-(defmacro* macrolet (((name arglist &optional docstring &body body)
- &rest macros) &body form)
+(defmacro* macrolet ((&rest macros) &body form)
"Make temporary macro definitions.
This is like `flet', but for macros instead of functions."
(cl-macroexpand-all (cons 'progn form)
(nconc
(loop
for (name . details)
- in (cons (list* name arglist docstring body) macros)
+ in macros
collect
(list* name 'lambda (cdr (cl-transform-lambda details
name))))
cl-macro-environment)))
;;;###autoload
-(defmacro* symbol-macrolet (((name expansion) &rest symbol-macros) &body form)
- "Make symbol macro definitions.
-Within the body FORMs, references to the variable NAME will be replaced
-by EXPANSION, and (setq NAME ...) will act like (setf EXPANSION ...)."
- (check-type name symbol)
+(defmacro* symbol-macrolet ((&rest symbol-macros) &body form)
+ "Make temporary symbol macro definitions.
+Elements in SYMBOL-MACROS look like (NAME EXPANSION).
+Within the body FORMs, a reference to NAME is replaced with its EXPANSION,
+and (setq NAME ...) acts like (setf EXPANSION ...)."
(cl-macroexpand-all (cons 'progn form)
- (nconc (list (list (eq-hash name) expansion))
- (loop
+ (nconc (loop
for (name expansion) in symbol-macros
do (check-type name symbol)
collect (list (eq-hash name) expansion))
--
Resistance is futile. You will be jazzimilated.
Scientific site: http://www.lrde.epita.fr/~didier
Music (Jazz) site: http://www.didierverna.com
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT] Remove the LOSING_BYTECODE compile-time option, it's been off since 1997.
13 years, 7 months
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1305890202 -3600
# Node ID 6b3caa55668cdb3df50e0a56620ae5e60b43e593
# Parent 9ac0016d8fe8de796c91284b29a09563b8ef3221
Remove the LOSING_BYTECODE compile-time option, it's been off since 1997.
2011-05-20 Aidan Kehoe <kehoea(a)parhasard.net>
* config.h.in:
* data.c (Faref):
* fns.c (check_losing_bytecode):
* fns.c (concat):
* fns.c (Felt):
Remove the LOSING_BYTECODE compile-time option entirely. It
allowed access to the elements of a compiled function using
#'aref, and has been turned off since 1997.
diff -r 9ac0016d8fe8 -r 6b3caa55668c src/ChangeLog
--- a/src/ChangeLog Wed May 18 14:21:52 2011 +0100
+++ b/src/ChangeLog Fri May 20 12:16:42 2011 +0100
@@ -1,3 +1,14 @@
+2011-05-20 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * config.h.in:
+ * data.c (Faref):
+ * fns.c (check_losing_bytecode):
+ * fns.c (concat):
+ * fns.c (Felt):
+ Remove the LOSING_BYTECODE compile-time option entirely. It
+ allowed access to the elements of a compiled function using
+ #'aref, and has been turned off since 1997.
+
2011-05-07 Aidan Kehoe <kehoea(a)parhasard.net>
* eval.c:
diff -r 9ac0016d8fe8 -r 6b3caa55668c src/config.h.in
--- a/src/config.h.in Wed May 18 14:21:52 2011 +0100
+++ b/src/config.h.in Fri May 20 12:16:42 2011 +0100
@@ -947,12 +947,6 @@
}
#endif
-/* This will be removed in 19.15. */
-/* Hah! Try 20.3 ... */
-/* Hah! Try never ... */
-/* If at first you don't succeed, try, try again. */
-/* #define LOSING_BYTECODE */
-
/* USER_FULL_NAME returns a string that is the user's full name.
It can assume that the variable `pw' points to the password file
entry for this user.
diff -r 9ac0016d8fe8 -r 6b3caa55668c src/data.c
--- a/src/data.c Wed May 18 14:21:52 2011 +0100
+++ b/src/data.c Fri May 20 12:16:42 2011 +0100
@@ -753,13 +753,6 @@
if (idx >= string_char_length (array)) goto range_error;
return make_char (string_ichar (array, idx));
}
-#ifdef LOSING_BYTECODE
- else if (COMPILED_FUNCTIONP (array))
- {
- /* Weird, gross compatibility kludge */
- return Felt (array, index_);
- }
-#endif
else
{
check_losing_bytecode ("aref", array);
diff -r 9ac0016d8fe8 -r 6b3caa55668c src/fns.c
--- a/src/fns.c Wed May 18 14:21:52 2011 +0100
+++ b/src/fns.c Fri May 20 12:16:42 2011 +0100
@@ -836,31 +836,6 @@
/* Random data-structure functions */
-#ifdef LOSING_BYTECODE
-
-/* #### Delete this shit */
-
-/* Charcount is a misnomer here as we might be dealing with the
- length of a vector or list, but emphasizes that we're not dealing
- with Bytecounts in strings */
-static Charcount
-length_with_bytecode_hack (Lisp_Object seq)
-{
- if (!COMPILED_FUNCTIONP (seq))
- return XINT (Flength (seq));
- else
- {
- Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (seq);
-
- return (f->flags.interactivep ? COMPILED_INTERACTIVE :
- f->flags.domainp ? COMPILED_DOMAIN :
- COMPILED_DOC_STRING)
- + 1;
- }
-}
-
-#endif /* LOSING_BYTECODE */
-
void
check_losing_bytecode (const Ascbyte *function, Lisp_Object seq)
{
@@ -1653,11 +1628,6 @@
;
else if (VECTORP (seq) || STRINGP (seq) || BIT_VECTORP (seq))
;
-#ifdef LOSING_BYTECODE
- else if (COMPILED_FUNCTIONP (seq))
- /* Urk! We allow this, for "compatibility"... */
- ;
-#endif
#if 0 /* removed for XEmacs 21 */
else if (INTP (seq))
/* This is too revolting to think about but maintains
@@ -1687,11 +1657,7 @@
for (argnum = 0, total_length = 0; argnum < nargs; argnum++)
{
-#ifdef LOSING_BYTECODE
- Charcount thislen = length_with_bytecode_hack (args[argnum]);
-#else
Charcount thislen = XINT (Flength (args[argnum]));
-#endif
total_length += thislen;
}
@@ -1752,11 +1718,7 @@
if (!CONSP (seq))
{
-#ifdef LOSING_BYTECODE
- thisleni = length_with_bytecode_hack (seq);
-#else
thisleni = XINT (Flength (seq));
-#endif
}
if (STRINGP (seq))
string_source_ptr = XSTRING_DATA (seq);
@@ -2352,44 +2314,6 @@
VECTORP (sequence) ||
BIT_VECTORP (sequence))
return Faref (sequence, n);
-#ifdef LOSING_BYTECODE
- else if (COMPILED_FUNCTIONP (sequence))
- {
- EMACS_INT idx = XINT (n);
- if (idx < 0)
- {
- lose:
- args_out_of_range (sequence, n);
- }
- /* Utter perversity */
- {
- Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (sequence);
- switch (idx)
- {
- case COMPILED_ARGLIST:
- return compiled_function_arglist (f);
- case COMPILED_INSTRUCTIONS:
- return compiled_function_instructions (f);
- case COMPILED_CONSTANTS:
- return compiled_function_constants (f);
- case COMPILED_STACK_DEPTH:
- return compiled_function_stack_depth (f);
- case COMPILED_DOC_STRING:
- return compiled_function_documentation (f);
- case COMPILED_DOMAIN:
- return compiled_function_domain (f);
- case COMPILED_INTERACTIVE:
- if (f->flags.interactivep)
- return compiled_function_interactive (f);
- /* if we return nil, can't tell interactive with no args
- from noninteractive. */
- goto lose;
- default:
- goto lose;
- }
- }
- }
-#endif /* LOSING_BYTECODE */
else
{
check_losing_bytecode ("elt", sequence);
--
“Apart from the nine-banded armadillo, man is the only natural host of
Mycobacterium leprae, although it can be grown in the footpads of mice.”
-- Kumar & Clark, Clinical Medicine, summarising improbable leprosy research
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit: Remove the LOSING_BYTECODE compile-time option, it's been off since 1997.
13 years, 7 months
Aidan Kehoe
changeset: 5510:6b3caa55668c
tag: tip
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Fri May 20 12:16:42 2011 +0100
files: src/ChangeLog src/config.h.in src/data.c src/fns.c
description:
Remove the LOSING_BYTECODE compile-time option, it's been off since 1997.
2011-05-20 Aidan Kehoe <kehoea(a)parhasard.net>
* config.h.in:
* data.c (Faref):
* fns.c (check_losing_bytecode):
* fns.c (concat):
* fns.c (Felt):
Remove the LOSING_BYTECODE compile-time option entirely. It
allowed access to the elements of a compiled function using
#'aref, and has been turned off since 1997.
diff -r 9ac0016d8fe8 -r 6b3caa55668c src/ChangeLog
--- a/src/ChangeLog Wed May 18 14:21:52 2011 +0100
+++ b/src/ChangeLog Fri May 20 12:16:42 2011 +0100
@@ -1,3 +1,14 @@
+2011-05-20 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * config.h.in:
+ * data.c (Faref):
+ * fns.c (check_losing_bytecode):
+ * fns.c (concat):
+ * fns.c (Felt):
+ Remove the LOSING_BYTECODE compile-time option entirely. It
+ allowed access to the elements of a compiled function using
+ #'aref, and has been turned off since 1997.
+
2011-05-07 Aidan Kehoe <kehoea(a)parhasard.net>
* eval.c:
diff -r 9ac0016d8fe8 -r 6b3caa55668c src/config.h.in
--- a/src/config.h.in Wed May 18 14:21:52 2011 +0100
+++ b/src/config.h.in Fri May 20 12:16:42 2011 +0100
@@ -947,12 +947,6 @@
}
#endif
-/* This will be removed in 19.15. */
-/* Hah! Try 20.3 ... */
-/* Hah! Try never ... */
-/* If at first you don't succeed, try, try again. */
-/* #define LOSING_BYTECODE */
-
/* USER_FULL_NAME returns a string that is the user's full name.
It can assume that the variable `pw' points to the password file
entry for this user.
diff -r 9ac0016d8fe8 -r 6b3caa55668c src/data.c
--- a/src/data.c Wed May 18 14:21:52 2011 +0100
+++ b/src/data.c Fri May 20 12:16:42 2011 +0100
@@ -753,13 +753,6 @@
if (idx >= string_char_length (array)) goto range_error;
return make_char (string_ichar (array, idx));
}
-#ifdef LOSING_BYTECODE
- else if (COMPILED_FUNCTIONP (array))
- {
- /* Weird, gross compatibility kludge */
- return Felt (array, index_);
- }
-#endif
else
{
check_losing_bytecode ("aref", array);
diff -r 9ac0016d8fe8 -r 6b3caa55668c src/fns.c
--- a/src/fns.c Wed May 18 14:21:52 2011 +0100
+++ b/src/fns.c Fri May 20 12:16:42 2011 +0100
@@ -836,31 +836,6 @@
/* Random data-structure functions */
-#ifdef LOSING_BYTECODE
-
-/* #### Delete this shit */
-
-/* Charcount is a misnomer here as we might be dealing with the
- length of a vector or list, but emphasizes that we're not dealing
- with Bytecounts in strings */
-static Charcount
-length_with_bytecode_hack (Lisp_Object seq)
-{
- if (!COMPILED_FUNCTIONP (seq))
- return XINT (Flength (seq));
- else
- {
- Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (seq);
-
- return (f->flags.interactivep ? COMPILED_INTERACTIVE :
- f->flags.domainp ? COMPILED_DOMAIN :
- COMPILED_DOC_STRING)
- + 1;
- }
-}
-
-#endif /* LOSING_BYTECODE */
-
void
check_losing_bytecode (const Ascbyte *function, Lisp_Object seq)
{
@@ -1653,11 +1628,6 @@
;
else if (VECTORP (seq) || STRINGP (seq) || BIT_VECTORP (seq))
;
-#ifdef LOSING_BYTECODE
- else if (COMPILED_FUNCTIONP (seq))
- /* Urk! We allow this, for "compatibility"... */
- ;
-#endif
#if 0 /* removed for XEmacs 21 */
else if (INTP (seq))
/* This is too revolting to think about but maintains
@@ -1687,11 +1657,7 @@
for (argnum = 0, total_length = 0; argnum < nargs; argnum++)
{
-#ifdef LOSING_BYTECODE
- Charcount thislen = length_with_bytecode_hack (args[argnum]);
-#else
Charcount thislen = XINT (Flength (args[argnum]));
-#endif
total_length += thislen;
}
@@ -1752,11 +1718,7 @@
if (!CONSP (seq))
{
-#ifdef LOSING_BYTECODE
- thisleni = length_with_bytecode_hack (seq);
-#else
thisleni = XINT (Flength (seq));
-#endif
}
if (STRINGP (seq))
string_source_ptr = XSTRING_DATA (seq);
@@ -2352,44 +2314,6 @@
VECTORP (sequence) ||
BIT_VECTORP (sequence))
return Faref (sequence, n);
-#ifdef LOSING_BYTECODE
- else if (COMPILED_FUNCTIONP (sequence))
- {
- EMACS_INT idx = XINT (n);
- if (idx < 0)
- {
- lose:
- args_out_of_range (sequence, n);
- }
- /* Utter perversity */
- {
- Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (sequence);
- switch (idx)
- {
- case COMPILED_ARGLIST:
- return compiled_function_arglist (f);
- case COMPILED_INSTRUCTIONS:
- return compiled_function_instructions (f);
- case COMPILED_CONSTANTS:
- return compiled_function_constants (f);
- case COMPILED_STACK_DEPTH:
- return compiled_function_stack_depth (f);
- case COMPILED_DOC_STRING:
- return compiled_function_documentation (f);
- case COMPILED_DOMAIN:
- return compiled_function_domain (f);
- case COMPILED_INTERACTIVE:
- if (f->flags.interactivep)
- return compiled_function_interactive (f);
- /* if we return nil, can't tell interactive with no args
- from noninteractive. */
- goto lose;
- default:
- goto lose;
- }
- }
- }
-#endif /* LOSING_BYTECODE */
else
{
check_losing_bytecode ("elt", sequence);
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT] Remove `bind-inits', cl-macs.el, it's no longer used.
13 years, 7 months
Aidan Kehoe
This came up with some code Didier pointed me towards off-list, and I think
it makes this aspect of cl-macs substantially clearer.
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1305724912 -3600
# Node ID 9ac0016d8fe8de796c91284b29a09563b8ef3221
# Parent 3fe8358ad59ab0463fa1443600b522dbf0b13d5d
Remove `bind-inits', cl-macs.el, it's no longer used.
2011-05-18 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-macs.el (bind-inits)): Removed.
* cl-macs.el (defun*):
* cl-macs.el (defmacro*):
* cl-macs.el (function*):
* cl-macs.el (macrolet):
* cl-macs.el (cl-transform-function-property):
* cl-macs.el (destructuring-bind):
Remove `bind-inits' from this file, and only ever return nil as
the first element of cl-transform-lambda's result list; bind-inits
hasn't been used since the support for non-self-quoting keywords
was removed, and its absence (and the guarantee that the first
element of the result of cl-transform-lambda is nil) make the
implementations of various other macros easier and clearer.
* cl-macs.el (cl-transform-lambda):
Give this function a docstring.
diff -r 3fe8358ad59a -r 9ac0016d8fe8 lisp/ChangeLog
--- a/lisp/ChangeLog Mon May 09 20:47:31 2011 +0100
+++ b/lisp/ChangeLog Wed May 18 14:21:52 2011 +0100
@@ -1,3 +1,21 @@
+2011-05-18 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * cl-macs.el (bind-inits)): Removed.
+ * cl-macs.el (defun*):
+ * cl-macs.el (defmacro*):
+ * cl-macs.el (function*):
+ * cl-macs.el (macrolet):
+ * cl-macs.el (cl-transform-function-property):
+ * cl-macs.el (destructuring-bind):
+ Remove `bind-inits' from this file, and only ever return nil as
+ the first element of cl-transform-lambda's result list; bind-inits
+ hasn't been used since the support for non-self-quoting keywords
+ was removed, and its absence (and the guarantee that the first
+ element of the result of cl-transform-lambda is nil) make the
+ implementations of various other macros easier and clearer.
+ * cl-macs.el (cl-transform-lambda):
+ Give this function a docstring.
+
2011-05-07 Aidan Kehoe <kehoea(a)parhasard.net>
* bytecomp-runtime.el:
diff -r 3fe8358ad59a -r 9ac0016d8fe8 lisp/cl-macs.el
--- a/lisp/cl-macs.el Mon May 09 20:47:31 2011 +0100
+++ b/lisp/cl-macs.el Wed May 18 14:21:52 2011 +0100
@@ -222,9 +222,8 @@
The format of each binding is VAR || (VAR [INITFORM]) -- exactly like the
format of `let'/`let*' bindings.
"
- (let* ((res (cl-transform-lambda (list* arglist docstring body) name))
- (form (list* 'defun name (cdr res))))
- (if (car res) (list 'progn (car res) form) form)))
+ (list* 'defun name (cdr (cl-transform-lambda (list* arglist docstring body)
+ name))))
;;;###autoload
(defmacro defmacro* (name arglist &optional docstring &rest body)
@@ -278,33 +277,29 @@
are ignored, not enough arguments cause the remaining parameters to
receive a value of nil, etc.
"
- (let* ((res (cl-transform-lambda (list* arglist docstring body) name))
- (form (list* 'defmacro name (cdr res))))
- (if (car res) (list 'progn (car res) form) form)))
+ (list* 'defmacro name (cdr (cl-transform-lambda (list* arglist docstring body)
+ name))))
;;;###autoload
(defmacro function* (symbol-or-lambda)
"Introduce a function.
Like normal `function', except that if argument is a lambda form, its
ARGLIST allows full Common Lisp conventions."
- (if (eq (car-safe symbol-or-lambda) 'lambda)
- (let* ((res (cl-transform-lambda (cdr symbol-or-lambda) 'cl-none))
- (form (list 'function (cons 'lambda (cdr res)))))
- (if (car res) (list 'progn (car res) form) form))
- (list 'function symbol-or-lambda)))
+ `(function
+ ,(if (eq (car-safe symbol-or-lambda) 'lambda)
+ (cons 'lambda (cdr (cl-transform-lambda (cdr symbol-or-lambda)
+ 'cl-none)))
+ symbol-or-lambda)))
(defun cl-transform-function-property (func prop form)
- (let ((res (cl-transform-lambda form func)))
- (append '(progn) (cdr (cdr (car res)))
- (list (list 'put (list 'quote func) (list 'quote prop)
- (list 'function (cons 'lambda (cdr res))))))))
+ `(put ',func ',prop #'(lambda ,@(cdr (cl-transform-lambda form func)))))
(defconst lambda-list-keywords
'(&optional &rest &key &allow-other-keys &aux &whole &body &environment))
(defvar cl-macro-environment nil)
(defvar bind-block) (defvar bind-defs) (defvar bind-enquote)
-(defvar bind-inits) (defvar bind-lets) (defvar bind-forms)
+(defvar bind-lets) (defvar bind-forms)
;; npak(a)ispras.ru
(defun cl-upcase-arg (arg)
@@ -346,9 +341,20 @@
(t "Not available")))))
(defun cl-transform-lambda (form bind-block)
+ "Transform a lambda expression to support Common Lisp conventions.
+
+FORM is the cdr of the lambda expression. BIND-BLOCK is the implicit block
+name that's added, typically the name of the associated function. It can be
+the symbol `cl-none', to indicate no implicit block is needed.
+
+The Common Lisp conventions described are those detailed in the `defun*' and
+`defmacro*' docstrings. This function returns a list with the first element
+nil, to be ignored. The rest of the list represents a transformed lambda
+expression, with any argument list parsing code necessary, and a surrounding
+block."
(let* ((args (car form)) (body (cdr form))
(bind-defs nil) (bind-enquote nil)
- (bind-inits nil) (bind-lets nil) (bind-forms nil)
+ (bind-lets nil) (bind-forms nil)
(header nil) (simple-args nil)
(complex-arglist (cl-function-arglist args))
(doc ""))
@@ -389,10 +395,10 @@
(cl-do-arglist args nil (- (length simple-args)
(if (memq '&optional simple-args) 1 0)))
(setq bind-lets (nreverse bind-lets))
- (list* (and bind-inits (list* 'eval-when '(compile load eval)
- (nreverse bind-inits)))
- (nconc simple-args
- (list '&rest (car (pop bind-lets))))
+ ;; This code originally needed to create the keywords itself, that
+ ;; wasn't done by the Lisp reader; the first element of the result
+ ;; list comprised code to do this. It's not used any more.
+ (list* nil (nconc simple-args (list '&rest (car (pop bind-lets))))
;; XEmacs change: we add usage information using Nickolay's
;; approach above
(nconc header
@@ -571,13 +577,9 @@
I say \"approximately\" because the destructuring works in a somewhat
different fashion, although for most reasonably simple constructs the
results will be the same."
- (let* ((bind-lets nil) (bind-forms nil) (bind-inits nil)
- (bind-defs nil) (bind-block 'cl-none))
+ (let ((bind-block 'cl-none) bind-lets bind-forms bind-defs)
(cl-do-arglist (or args '(&aux)) expr)
- (append '(progn) bind-inits
- (list (nconc (list 'let* (nreverse bind-lets))
- (nreverse bind-forms) body)))))
-
+ (nconc (list 'let* (nreverse bind-lets)) (nreverse bind-forms) body)))
;;; The `eval-when' form.
@@ -1777,11 +1779,8 @@
for (name . details)
in (cons (list* name arglist docstring body) macros)
collect
- (list* name 'lambda
- (prog1
- (cdr (setq details (cl-transform-lambda
- details name)))
- (eval (car details)))))
+ (list* name 'lambda (cdr (cl-transform-lambda details
+ name))))
cl-macro-environment)))
;;;###autoload
--
“Apart from the nine-banded armadillo, man is the only natural host of
Mycobacterium leprae, although it can be grown in the footpads of mice.”
-- Kumar & Clark, Clinical Medicine, summarising improbable leprosy research
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit: Remove `bind-inits', cl-macs.el, it's no longer used.
13 years, 7 months
Aidan Kehoe
changeset: 5509:9ac0016d8fe8
tag: tip
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Wed May 18 14:21:52 2011 +0100
files: lisp/ChangeLog lisp/cl-macs.el
description:
Remove `bind-inits', cl-macs.el, it's no longer used.
2011-05-18 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-macs.el (bind-inits)): Removed.
* cl-macs.el (defun*):
* cl-macs.el (defmacro*):
* cl-macs.el (function*):
* cl-macs.el (macrolet):
* cl-macs.el (cl-transform-function-property):
* cl-macs.el (destructuring-bind):
Remove `bind-inits' from this file, and only ever return nil as
the first element of cl-transform-lambda's result list; bind-inits
hasn't been used since the support for non-self-quoting keywords
was removed, and its absence (and the guarantee that the first
element of the result of cl-transform-lambda is nil) make the
implementations of various other macros easier and clearer.
* cl-macs.el (cl-transform-lambda):
Give this function a docstring.
diff -r 3fe8358ad59a -r 9ac0016d8fe8 lisp/ChangeLog
--- a/lisp/ChangeLog Mon May 09 20:47:31 2011 +0100
+++ b/lisp/ChangeLog Wed May 18 14:21:52 2011 +0100
@@ -1,3 +1,21 @@
+2011-05-18 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * cl-macs.el (bind-inits)): Removed.
+ * cl-macs.el (defun*):
+ * cl-macs.el (defmacro*):
+ * cl-macs.el (function*):
+ * cl-macs.el (macrolet):
+ * cl-macs.el (cl-transform-function-property):
+ * cl-macs.el (destructuring-bind):
+ Remove `bind-inits' from this file, and only ever return nil as
+ the first element of cl-transform-lambda's result list; bind-inits
+ hasn't been used since the support for non-self-quoting keywords
+ was removed, and its absence (and the guarantee that the first
+ element of the result of cl-transform-lambda is nil) make the
+ implementations of various other macros easier and clearer.
+ * cl-macs.el (cl-transform-lambda):
+ Give this function a docstring.
+
2011-05-07 Aidan Kehoe <kehoea(a)parhasard.net>
* bytecomp-runtime.el:
diff -r 3fe8358ad59a -r 9ac0016d8fe8 lisp/cl-macs.el
--- a/lisp/cl-macs.el Mon May 09 20:47:31 2011 +0100
+++ b/lisp/cl-macs.el Wed May 18 14:21:52 2011 +0100
@@ -222,9 +222,8 @@
The format of each binding is VAR || (VAR [INITFORM]) -- exactly like the
format of `let'/`let*' bindings.
"
- (let* ((res (cl-transform-lambda (list* arglist docstring body) name))
- (form (list* 'defun name (cdr res))))
- (if (car res) (list 'progn (car res) form) form)))
+ (list* 'defun name (cdr (cl-transform-lambda (list* arglist docstring body)
+ name))))
;;;###autoload
(defmacro defmacro* (name arglist &optional docstring &rest body)
@@ -278,33 +277,29 @@
are ignored, not enough arguments cause the remaining parameters to
receive a value of nil, etc.
"
- (let* ((res (cl-transform-lambda (list* arglist docstring body) name))
- (form (list* 'defmacro name (cdr res))))
- (if (car res) (list 'progn (car res) form) form)))
+ (list* 'defmacro name (cdr (cl-transform-lambda (list* arglist docstring body)
+ name))))
;;;###autoload
(defmacro function* (symbol-or-lambda)
"Introduce a function.
Like normal `function', except that if argument is a lambda form, its
ARGLIST allows full Common Lisp conventions."
- (if (eq (car-safe symbol-or-lambda) 'lambda)
- (let* ((res (cl-transform-lambda (cdr symbol-or-lambda) 'cl-none))
- (form (list 'function (cons 'lambda (cdr res)))))
- (if (car res) (list 'progn (car res) form) form))
- (list 'function symbol-or-lambda)))
+ `(function
+ ,(if (eq (car-safe symbol-or-lambda) 'lambda)
+ (cons 'lambda (cdr (cl-transform-lambda (cdr symbol-or-lambda)
+ 'cl-none)))
+ symbol-or-lambda)))
(defun cl-transform-function-property (func prop form)
- (let ((res (cl-transform-lambda form func)))
- (append '(progn) (cdr (cdr (car res)))
- (list (list 'put (list 'quote func) (list 'quote prop)
- (list 'function (cons 'lambda (cdr res))))))))
+ `(put ',func ',prop #'(lambda ,@(cdr (cl-transform-lambda form func)))))
(defconst lambda-list-keywords
'(&optional &rest &key &allow-other-keys &aux &whole &body &environment))
(defvar cl-macro-environment nil)
(defvar bind-block) (defvar bind-defs) (defvar bind-enquote)
-(defvar bind-inits) (defvar bind-lets) (defvar bind-forms)
+(defvar bind-lets) (defvar bind-forms)
;; npak(a)ispras.ru
(defun cl-upcase-arg (arg)
@@ -346,9 +341,20 @@
(t "Not available")))))
(defun cl-transform-lambda (form bind-block)
+ "Transform a lambda expression to support Common Lisp conventions.
+
+FORM is the cdr of the lambda expression. BIND-BLOCK is the implicit block
+name that's added, typically the name of the associated function. It can be
+the symbol `cl-none', to indicate no implicit block is needed.
+
+The Common Lisp conventions described are those detailed in the `defun*' and
+`defmacro*' docstrings. This function returns a list with the first element
+nil, to be ignored. The rest of the list represents a transformed lambda
+expression, with any argument list parsing code necessary, and a surrounding
+block."
(let* ((args (car form)) (body (cdr form))
(bind-defs nil) (bind-enquote nil)
- (bind-inits nil) (bind-lets nil) (bind-forms nil)
+ (bind-lets nil) (bind-forms nil)
(header nil) (simple-args nil)
(complex-arglist (cl-function-arglist args))
(doc ""))
@@ -389,10 +395,10 @@
(cl-do-arglist args nil (- (length simple-args)
(if (memq '&optional simple-args) 1 0)))
(setq bind-lets (nreverse bind-lets))
- (list* (and bind-inits (list* 'eval-when '(compile load eval)
- (nreverse bind-inits)))
- (nconc simple-args
- (list '&rest (car (pop bind-lets))))
+ ;; This code originally needed to create the keywords itself, that
+ ;; wasn't done by the Lisp reader; the first element of the result
+ ;; list comprised code to do this. It's not used any more.
+ (list* nil (nconc simple-args (list '&rest (car (pop bind-lets))))
;; XEmacs change: we add usage information using Nickolay's
;; approach above
(nconc header
@@ -571,13 +577,9 @@
I say \"approximately\" because the destructuring works in a somewhat
different fashion, although for most reasonably simple constructs the
results will be the same."
- (let* ((bind-lets nil) (bind-forms nil) (bind-inits nil)
- (bind-defs nil) (bind-block 'cl-none))
+ (let ((bind-block 'cl-none) bind-lets bind-forms bind-defs)
(cl-do-arglist (or args '(&aux)) expr)
- (append '(progn) bind-inits
- (list (nconc (list 'let* (nreverse bind-lets))
- (nreverse bind-forms) body)))))
-
+ (nconc (list 'let* (nreverse bind-lets)) (nreverse bind-forms) body)))
;;; The `eval-when' form.
@@ -1777,11 +1779,8 @@
for (name . details)
in (cons (list* name arglist docstring body) macros)
collect
- (list* name 'lambda
- (prog1
- (cdr (setq details (cl-transform-lambda
- details name)))
- (eval (car details)))))
+ (list* name 'lambda (cdr (cl-transform-lambda details
+ name))))
cl-macro-environment)))
;;;###autoload
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT] Support for IF* and a test suite
13 years, 7 months
Didier Verna
NOTE: This patch has been committed.
xemacs-packages/prog-modes/ChangeLog addition:
2011-05-15 Didier Verna <didier(a)xemacs.org>
From Nikodemus Siivola.
* cl-indent.el (common-lisp-indent-if*-keyword): New variable.
* cl-indent.el (common-lisp-indent-if*):
* cl-indent.el (common-lisp-indent-if*-1):
* cl-indent.el (common-lisp-indent-if*-advance-past-keyword-on-line):
New functions.
* cl-indent.el: Add an IF* common-lisp-indent-property.
* cl-indent.el (test-lisp-indent):
* cl-indent.el (run-lisp-indent-tests): New functions.
XEmacs Packages source patch:
Diff command: cvs -q diff -u
Files affected: xemacs-packages/prog-modes/cl-indent.el
Index: xemacs-packages/prog-modes/cl-indent.el
===================================================================
RCS file: /cvsroot/xemacs/XEmacs/packages/xemacs-packages/prog-modes/cl-indent.el,v
retrieving revision 1.11
diff -u -u -r1.11 cl-indent.el
--- xemacs-packages/prog-modes/cl-indent.el 15 May 2011 11:53:52 -0000 1.11
+++ xemacs-packages/prog-modes/cl-indent.el 15 May 2011 12:39:09 -0000
@@ -28,7 +28,7 @@
;;; Plus:
;;; - Enhancements on defmethod and lambda-lists indentation by Didier Verna.
;;; - Enhancements on LOOP indentation merged from Slime.
-;;; - A couple of additions from Nikodemus Siivola.
+;;; - Support for IF* and a test suite from Nikodemus Siivola.
;;; Commentary:
@@ -136,6 +136,46 @@
This applies when the value of the `common-lisp-indent-function' property
is set to `defun'.")
+;;;; LOOP indentation, the simple version
+
+(defun common-lisp-loop-type (loop-start)
+ "Returns the type of the loop form at LOOP-START.
+Possible types are SIMPLE, EXTENDED, and EXTENDED/SPLIT.
+EXTENDED/SPLIT refers to extended loops whose body does
+not start on the same line as the opening parenthesis of
+the loop."
+ (condition-case ()
+ (save-excursion
+ (goto-char loop-start)
+ (let ((line (line-number-at-pos)))
+ (forward-char 1)
+ (forward-sexp 2)
+ (backward-sexp 1)
+ (if (looking-at "\\sw")
+ (if (= line (line-number-at-pos))
+ 'extended
+ 'extended/split)
+ 'simple)))
+ (error 'simple)))
+
+(defun common-lisp-loop-part-indentation (indent-point state)
+ "Compute the indentation of loop form constituents."
+ (let* ((loop-start (elt state 1))
+ (type (common-lisp-loop-type loop-start))
+ (loop-indentation (save-excursion
+ (goto-char loop-start)
+ (if (eq 'extended/split type)
+ (- (current-column) 4)
+ (current-column)))))
+ (goto-char indent-point)
+ (beginning-of-line)
+ (cond ((eq 'simple type)
+ (+ loop-indentation lisp-simple-loop-indentation))
+ ((looking-at "^\\s-*\\(:?\\sw+\\|;\\)")
+ (list (+ loop-indentation 6) loop-start))
+ (t
+ (list (+ loop-indentation 9) loop-start)))))
+
;;;###autoload
(defun common-lisp-indent-function (indent-point state)
"Function to indent the arguments of a Lisp function call.
@@ -661,46 +701,6 @@
(common-lisp-indent-parse-state-start state))
(common-lisp-loop-part-indentation indent-point state)))
-;;;; LOOP indentation, the simple version
-
-(defun common-lisp-loop-type (loop-start)
- "Returns the type of the loop form at LOOP-START.
-Possible types are SIMPLE, EXTENDED, and EXTENDED/SPLIT.
-EXTENDED/SPLIT refers to extended loops whose body does
-not start on the same line as the opening parenthesis of
-the loop."
- (condition-case ()
- (save-excursion
- (goto-char loop-start)
- (let ((line (line-number-at-pos)))
- (forward-char 1)
- (forward-sexp 2)
- (backward-sexp 1)
- (if (looking-at "\\sw")
- (if (= line (line-number-at-pos))
- 'extended
- 'extended/split)
- 'simple)))
- (error 'simple)))
-
-(defun common-lisp-loop-part-indentation (indent-point state)
- "Compute the indentation of loop form constituents."
- (let* ((loop-start (elt state 1))
- (type (common-lisp-loop-type loop-start))
- (loop-indentation (save-excursion
- (goto-char loop-start)
- (if (eq 'extended/split type)
- (- (current-column) 4)
- (current-column)))))
- (goto-char indent-point)
- (beginning-of-line)
- (cond ((eq 'simple type)
- (+ loop-indentation lisp-simple-loop-indentation))
- ((looking-at "^\\s-*\\(:?\\sw+\\|;\\)")
- (list (+ loop-indentation 6) loop-start))
- (t
- (list (+ loop-indentation 9) loop-start)))))
-
;;;; LOOP indentation, the complex version -- handles subclause indentation
;; Regexps matching various varieties of loop macro keyword ...
@@ -871,33 +871,85 @@
nil
(current-column)))
-;; Test-case for subclause indentation
-'(loop for i from 0 below 2
- for j from 0 below 2
- when foo
- do (fubar)
- (bar)
- (moo)
- and collect cash
- into honduras
- else do ;; this is the body of the first else
- ;; the body is ...
- (indented to the above comment)
- (ZMACS gets this wrong)
- and do this
- and do that
- and when foo
- do the-other
- and cry
- when this-is-a-short-condition do
- (body code of the when)
- when here's something I used to botch do (here is a body)
- (rest of body indented same)
- do
- (exdented loop body)
- (I'm not sure I like this but it's compatible)
- when funny-predicate do ;; Here's a comment
- (body filled to comment))
+;;;; IF* is not standard, but a plague upon the land
+;;;; ...let's at least try to indent it.
+
+(defvar common-lisp-indent-if*-keyword
+ "threnret\\|elseif\\|then\\|else"
+ "Regexp matching if* keywords")
+
+(defun common-lisp-indent-if*
+ (path parse-state indent-point sexp-column normal-indent)
+ (list (common-lisp-indent-if*-1 parse-state indent-point)
+ (common-lisp-indent-parse-state-start parse-state)))
+
+(defun common-lisp-indent-if*-1 (parse-state indent-point)
+ (catch 'return-indentation
+ (save-excursion
+ ;; Find first clause of if* macro, and use it to establish
+ ;; base column for indentation
+ (goto-char (common-lisp-indent-parse-state-start parse-state))
+ (let ((if*-start-column (current-column)))
+ (common-lisp-indent-if*-advance-past-keyword-on-line)
+ (let* ((case-fold-search t)
+ (if*-first-clause (point))
+ (previous-expression-start
+ (common-lisp-indent-parse-state-prev parse-state))
+ (default-value (current-column))
+ (if*-body-p nil)
+ (if*-body-indentation nil))
+ ;; Determine context of this if* clause, starting with the
+ ;; expression immediately preceding the line we're trying to indent
+ (goto-char previous-expression-start)
+ ;; Handle a body-introducing-clause which ends a line specially.
+ (back-to-indentation)
+ (if (< (point) if*-first-clause)
+ (goto-char if*-first-clause))
+ ;; Found start of if* clause preceding the one we're trying to indent.
+ ;; Glean context ...
+ (cond
+ ((looking-at common-lisp-indent-if*-keyword)
+ (setq if*-body-p t)
+ ;; Know there's something else on the line (or would
+ ;; have been caught above)
+ (common-lisp-indent-if*-advance-past-keyword-on-line)
+ (setq if*-body-indentation (current-column)))
+ ((looking-at "#'\\|'\\|(")
+ ;; We're in the middle of a clause body ...
+ (setq if*-body-p t)
+ (setq if*-body-indentation (current-column)))
+ (t
+ (setq if*-body-p nil)
+ ;; We still need if*-body-indentation for "syntax errors" ...
+ (goto-char previous-expression-start)
+ (setq if*-body-indentation (current-column))))
+
+ ;; Go to first non-blank character of the line we're trying to indent.
+ ;; (if none, wind up poised on the new-line ...)
+ (goto-char indent-point)
+ (back-to-indentation)
+ (cond
+ ((or (eolp) (looking-at ";"))
+ ;; Blank line. If body-p, indent as body, else indent as
+ ;; vanilla clause.
+ (if if*-body-p
+ if*-body-indentation
+ default-value))
+ ((not (looking-at common-lisp-indent-if*-keyword))
+ ;; Clause body ...
+ if*-body-indentation)
+ (t
+ (- (+ 7 if*-start-column)
+ (- (match-end 0) (match-beginning 0))))))))))
+
+(defun common-lisp-indent-if*-advance-past-keyword-on-line ()
+ (forward-word 1)
+ (block move-forward
+ (while (and (looking-at "\\s-") (not (eolp)))
+ (forward-char 1)))
+ (if (eolp)
+ nil
+ (current-column)))
;;;; Indentation specs for standard symbols, and a few semistandard ones.
@@ -948,6 +1000,7 @@
(if (nil nil &body))
;; single-else style (then and else equally indented)
(if (&rest nil))
+ (if* common-lisp-indent-if*)
(lambda (&lambda &rest lisp-indent-function-lambda-hack))
(let ((&whole 4 &rest (&whole 1 1 2)) &body))
(let* . let)
@@ -990,35 +1043,182 @@
(get (cdr el) 'common-lisp-indent-function)
(car (cdr el))))))
-
-;(defun foo (x)
-; (tagbody
-; foo
-; (bar)
-; baz
-; (when (losing)
-; (with-big-loser
-; (yow)
-; ((lambda ()
-; foo)
-; big)))
-; (flet ((foo (bar baz zap)
-; (zip))
-; (zot ()
-; quux))
-; (do ()
-; ((lose)
-; (foo 1))
-; (quux)
-; foo
-; (lose))
-; (cond ((x)
-; (win 1 2
-; (foo)))
-; (t
-; (lose
-; 3))))))
+(defun test-lisp-indent (tests)
+ (let ((ok 0))
+ (dolist (test tests)
+ (with-temp-buffer
+ (lisp-mode)
+ (setq indent-tabs-mode nil)
+ (when (consp test)
+ (dolist (bind (first test))
+ (make-variable-buffer-local (first bind))
+ (set (first bind) (second bind)))
+ (setf test (second test)))
+ (insert test)
+ (goto-char 0)
+ (skip-chars-forward " \t\n")
+ ;; Mess up the indentation so we know reindentation works
+ (let ((mess nil))
+ (save-excursion
+ (while (not (eobp))
+ (forward-line 1)
+ (ignore-errors (delete-char 1) (setf mess t))))
+ (if (not mess)
+ (error "Couldn't mess up indentation?")))
+ (indent-sexp)
+ (if (equal (buffer-string) test)
+ (incf ok)
+ (error "Bad indentation.\nWanted: %s\nGot: %s"
+ test
+ (buffer-string)))))
+ ok))
+
+;; (run-lisp-indent-tests)
+
+(defun run-lisp-indent-tests ()
+ (test-lisp-indent
+ '("
+ (defun foo ()
+ t)"
+ (((lisp-lambda-list-keyword-parameter-alignment nil)
+ (lisp-lambda-list-keyword-alignment nil))
+ "
+ (defun foo (foo &optional opt1
+ opt2
+ &rest rest)
+ (list foo opt1 opt2
+ rest))")
+ (((lisp-lambda-list-keyword-parameter-alignment t)
+ (lisp-lambda-list-keyword-alignment nil))
+ "
+ (defun foo (foo &optional opt1
+ opt2
+ &rest rest)
+ (list foo opt1 opt2
+ rest))")
+ (((lisp-lambda-list-keyword-parameter-alignment nil)
+ (lisp-lambda-list-keyword-alignment t))
+ "
+ (defun foo (foo &optional opt1
+ opt2
+ &rest rest)
+ (list foo opt1 opt2
+ rest))")
+ (((lisp-lambda-list-keyword-parameter-alignment t)
+ (lisp-lambda-list-keyword-alignment t))
+ "
+ (defun foo (foo &optional opt1
+ opt2
+ &rest rest)
+ (list foo opt1 opt2
+ rest))")
+ (((lisp-lambda-list-keyword-parameter-alignment nil)
+ (lisp-lambda-list-keyword-alignment nil))
+ "
+ (defmacro foo ((foo &optional opt1
+ opt2
+ &rest rest))
+ (list foo opt1 opt2
+ rest))")
+ (((lisp-lambda-list-keyword-parameter-alignment t)
+ (lisp-lambda-list-keyword-alignment nil))
+ "
+ (defmacro foo ((foo &optional opt1
+ opt2
+ &rest rest))
+ (list foo opt1 opt2
+ rest))")
+ (((lisp-lambda-list-keyword-parameter-alignment nil)
+ (lisp-lambda-list-keyword-alignment t))
+ "
+ (defmacro foo ((foo &optional opt1
+ opt2
+ &rest rest))
+ (list foo opt1 opt2
+ rest))")
+ (((lisp-lambda-list-keyword-parameter-alignment t)
+ (lisp-lambda-list-keyword-alignment t))
+ "
+ (defmacro foo ((foo &optional opt1
+ opt2
+ &rest rest))
+ (list foo opt1 opt2
+ rest))")
+ "
+ (let ((x y)
+ (foo #-foo (no-foo)
+ #+foo (yes-foo))
+ (bar #-bar
+ (no-bar)
+ #+bar
+ (yes-bar)))
+ (list foo bar
+ x))"
+ "
+ (loop for i from 0 below 2
+ for j from 0 below 2
+ when foo
+ do (fubar)
+ (bar)
+ (moo)
+ and collect cash
+ into honduras
+ else do ;; this is the body of the first else
+ ;; the body is ...
+ (indented to the above comment)
+ (ZMACS gets this wrong)
+ and do this
+ and do that
+ and when foo
+ do the-other
+ and cry
+ when this-is-a-short-condition do
+ (body code of the when)
+ when here's something I used to botch do (here is a body)
+ (rest of body indented same)
+ do
+ (exdented loop body)
+ (I'm not sure I like this but it's compatible)
+ when funny-predicate do ;; Here's a comment
+ (body filled to comment))"
+ "
+ (defun foo (x)
+ (tagbody
+ foo
+ (bar)
+ baz
+ (when (losing)
+ (with-big-loser
+ (yow)
+ ((lambda ()
+ foo)
+ big)))
+ (flet ((foo (bar baz zap)
+ (zip))
+ (zot ()
+ quux))
+ (do ()
+ ((lose)
+ (foo 1))
+ (quux)
+ foo
+ (lose))
+ (cond ((x)
+ (win 1 2
+ (foo)))
+ (t
+ (lose
+ 3))))))"
+ "
+ (if* (eq t nil)
+ then ()
+ ()
+ elseif (dsf)
+ thenret x
+ else (balbkj)
+ (sdf))")))
+
;(put 'while 'common-lisp-indent-function 1)
;(put 'defwrapper'common-lisp-indent-function ...)
--
Scientific site: http://www.lrde.epita.fr/~didier
Music (Jazz) site: http://www.didierverna.com
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches