Mercurial > hg > xemacs-beta
annotate lib-src/update-autoloads.sh @ 5560:58b38d5b32d0
Implement print-circle, allowing recursive and circular structures to be read.
src/ChangeLog addition:
2011-09-04 Aidan Kehoe <kehoea@parhasard.net>
* alloc.c:
* alloc.c (ALLOC_FROB_BLOCK_LISP_OBJECT_1):
* alloc.c (ALLOC_FROB_BLOCK_LISP_OBJECT):
* alloc.c (cons_print_preprocess):
* alloc.c (vector_print_preprocess):
* alloc.c (vector_nsubst_structures_descend):
* alloc.c (Fmake_symbol):
* alloc.c (UNMARK_symbol):
* alloc.c (sweep_symbols):
* alloc.c (reinit_alloc_objects_early):
* alloc.c (reinit_alloc_early):
* bytecode.c:
* bytecode.c (compiled_function_print_preprocess):
* bytecode.c (compiled_function_nsubst_structures_descend):
* bytecode.c (set_compiled_function_arglist):
* bytecode.c (set_compiled_function_interactive):
* bytecode.c (bytecode_objects_create):
* chartab.c:
* chartab.c (print_preprocess_mapper):
* chartab.c (nsubst_structures_mapper):
* chartab.c (char_table_nsubst_structures_descend):
* chartab.c (chartab_objects_create):
* elhash.c:
* elhash.c (nsubst_structures_map_hash_table):
* elhash.c (hash_table_nsubst_structures_descend):
* elhash.c (print_preprocess_mapper):
* elhash.c (hash_table_print_preprocess):
* elhash.c (inchash_eq):
* elhash.c (hash_table_objects_create):
* elhash.c (syms_of_elhash):
* elhash.h:
* emacs.c (main_1):
* fns.c:
* fns.c (check_eq_nokey):
* fns.c (Fnsubst):
* fns.c (syms_of_fns):
* lisp.h:
* lisp.h (struct Lisp_Symbol):
* lisp.h (IN_OBARRAY):
* lisp.h (struct):
* lisp.h (PRINT_PREPROCESS):
* lread.c (read1):
* lrecord.h:
* lrecord.h (struct lrecord_implementation):
* lrecord.h (DEFINE_DUMPABLE_MODULE_LISP_OBJECT):
* print.c:
* print.c (PRINT_CIRCLE_LIMIT):
* print.c (print_continuous_numbering_changed):
* print.c (print_prepare):
* print.c (print_finish):
* print.c (Fprin1_to_string):
* print.c (print_cons):
* print.c (print_preprocess_inchash_eq):
* print.c (print_preprocess):
* print.c (print_sort_get_numbers):
* print.c (print_sort_compare_ordinals):
* print.c (print_gensym_or_circle):
* print.c (nsubst_structures_descend):
* print.c (nsubst_structures):
* print.c (print_internal):
* print.c (print_symbol):
* print.c (vars_of_print):
* rangetab.c:
* rangetab.c (range_table_print_preprocess):
* rangetab.c (range_table_nsubst_structures_descend):
* rangetab.c (rangetab_objects_create):
* rangetab.c (syms_of_rangetab):
* symbols.c:
* symbols.c (symbol_print_preprocess):
* symbols.c (Fintern):
* symbols.c (Funintern):
* symbols.c (reinit_symbol_objects_early):
* symbols.c (init_symbols_once_early):
* symsinit.h:
Implement print-circle, printing circular structures in a readable
fashion, and treating them appropriately on read. This is by means
of two new object methods, print_preprocess (detecting
circularities), and nsubst_structures_descend (replacing
placeholders with the read objects).
Expose the substitution to Lisp via #'nsubst and its new
:descend-structures keyword.
Store information as to whether symbols are interned in obarray or
not in their header, making checking for keywords and uninterned
symbols (and thus printing) cheaper.
Default print_gensym to t, as Common Lisp does, and as a
more-than-decade old comment suggests.
lisp/ChangeLog addition:
2011-09-04 Aidan Kehoe <kehoea@parhasard.net>
* bytecomp.el (byte-compile-output-file-form):
* bytecomp.el (byte-compile-output-docform):
Bind print-circle, print-continuous-numbering in these functions,
now those variables are available.
* lisp.el (forward-sexp):
* lisp.el (backward-sexp):
Recognise leading #N= as being part of an expression.
tests/ChangeLog addition:
2011-09-04 Aidan Kehoe <kehoea@parhasard.net>
* automated/lisp-reader-tests.el:
* automated/lisp-tests.el (literal-with-uninterned):
* automated/symbol-tests.el (foo):
Test print-circle, for printing (mutually-)recursive and circular
structures.
Bind print-continuous-numbering where appropriate.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sun, 04 Sep 2011 19:51:35 +0100 |
parents | 308d34e9f07d |
children |
rev | line source |
---|---|
428 | 1 #!/bin/sh |
2 ### update-autoloads.sh --- update auto-autoloads.el as necessary | |
3 | |
4 # Author: Jamie Zawinski, Ben Wing, Martin Buchholz, Steve Baur | |
5 # Maintainer: Steve Baur | |
6 # Keywords: internal | |
7 | |
8 # This file is part of XEmacs. | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
428
diff
changeset
|
9 # |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
428
diff
changeset
|
10 # XEmacs is free software: you can redistribute it and/or modify it |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
428
diff
changeset
|
11 # under the terms of the GNU General Public License as published by the |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
428
diff
changeset
|
12 # Free Software Foundation, either version 3 of the License, or (at your |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
428
diff
changeset
|
13 # option) any later version. |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
428
diff
changeset
|
14 # |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
428
diff
changeset
|
15 # XEmacs is distributed in the hope that it will be useful, but WITHOUT |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
428
diff
changeset
|
16 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
428
diff
changeset
|
17 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
428
diff
changeset
|
18 # for more details. |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
428
diff
changeset
|
19 # |
428 | 20 # You should have received a copy of the GNU General Public License |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
428
diff
changeset
|
21 # along with XEmacs. If not, see <http://www.gnu.org/licenses/>. |
428 | 22 |
23 ### Commentary: | |
24 | |
25 ### Code: | |
26 | |
27 set -eu | |
28 | |
29 # This means we're running in a Sun workspace | |
30 test -d ../era-specific && cd ../editor | |
31 | |
32 # get to the right directory | |
33 test ! -d ./lisp -a -d ../lisp && cd .. | |
34 if test ! -d ./lisp ; then | |
35 echo $0: neither ./lisp/ nor ../lisp/ exist | |
36 exit 1 | |
37 fi | |
38 | |
39 test -z "$EMACS" && EMACS="./src/xemacs" | |
40 echo " (using $EMACS)" | |
41 | |
42 export EMACS | |
43 | |
44 EMACS_DIR=`cd \`dirname $EMACS\` && pwd`; | |
45 CANON_PWD=`pwd` | |
46 # Account for various system automounter configurations | |
47 if test -d "/net"; then | |
48 if test -d "/tmp_mnt/net"; then tdir="/tmp_mnt/net"; else tdir="/tmp_mnt"; fi | |
49 EMACS_DIR=`echo "$EMACS_DIR" | \ | |
50 sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"` | |
51 CANON_PWD=`echo "$CANON_PWD" | \ | |
52 sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"` | |
53 fi | |
54 REAL="$EMACS_DIR/`basename $EMACS`" | |
55 | |
56 echo "Rebuilding autoloads in $CANON_PWD" | |
57 echo " with $REAL..." | |
58 | |
59 #### echon really sucks! | |
60 if [ "`uname -r | sed 's/\(.\).*/\1/'`" -gt 4 ]; then | |
61 echon() | |
62 { | |
63 /bin/echo $* '\c' | |
64 } | |
65 else | |
66 echon() | |
67 { | |
68 echo -n $* | |
69 } | |
70 fi | |
71 | |
72 # Compute patterns to ignore when searching for files | |
73 # These directories don't have autoloads or are partially broken. | |
74 ignore_dirs="egg eos ilisp its locale mel mu sunpro term tooltalk" | |
75 | |
76 # Prepare for autoloading directories with directory-specific instructions | |
77 make_special_commands='' | |
78 make_special () { | |
79 dir="$1"; shift; | |
80 ignore_dirs="$ignore_dirs $dir" | |
81 make_special_commands="$make_special_commands \ | |
82 (cd \"lisp/$dir\" && ${MAKE:-make} EMACS=$REAL ${1+$*});" | |
83 } | |
84 | |
85 # Only use Mule XEmacs to build Mule-specific autoloads & custom-loads. | |
86 echon "Checking for Mule support..." | |
87 lisp_prog='(princ (featurep (quote mule)))' | |
88 mule_p="`$EMACS -batch -q -no-site-file -eval \"$lisp_prog\"`" | |
89 if test "$mule_p" = nil ; then | |
90 echo No | |
91 ignore_dirs="$ignore_dirs mule leim language skk" | |
92 else | |
93 echo Yes | |
94 fi | |
95 | |
96 ## AUCTeX is a Package now | |
97 # if test "$mule_p" = nil ; then | |
98 # make_special auctex autoloads | |
99 # else | |
100 # make_special auctex autoloads MULE_EL=tex-jp.elc | |
101 # fi | |
102 #make_special cc-mode autoloads | |
103 # EFS is now packaged | |
104 #make_special efs autoloads | |
105 #make_special eos autoloads # EOS doesn't have custom or autoloads | |
106 # Hyperbole is now packaged | |
107 # make_special hyperbole autoloads | |
108 # make_special ilisp autoloads | |
109 # oobr is now packaged | |
110 # make_special oobr HYPB_ELC='' autoloads | |
111 ## W3 is a package now | |
112 ##make_special w3 autoloads | |
113 | |
114 dirs= | |
115 for dir in lisp/*; do | |
116 if test -d $dir \ | |
117 -a $dir != lisp/CVS \ | |
118 -a $dir != lisp/SCCS; then | |
119 for ignore in $ignore_dirs; do | |
120 if test $dir = lisp/$ignore; then | |
121 continue 2 | |
122 fi | |
123 done | |
124 dirs="$dirs $dir" | |
125 fi | |
126 done | |
127 | |
128 $EMACS -batch -q -no-site-file -eval '(setq autoload-package-name "Standard")' \ | |
129 -l autoload -f batch-update-directory lisp | |
130 | |
131 # set -x | |
132 for dir in $dirs; do | |
133 $EMACS -batch -q -no-site-file -l autoload -f batch-update-directory $dir | |
134 done | |
135 | |
136 # eval "$make_special_commands" |