diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2009-04-29 03:02:54 +0000 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2009-04-29 03:02:54 +0000 |
commit | 91f68422d65d4fe746e4cd89cd274636a097c4ff (patch) | |
tree | 1b8e00eeef766bcfa1827f55bd936addd6c1fb58 /src/lread.c | |
parent | ee87c5499807d57d19f95939e79cde34e22bc90d (diff) | |
download | emacs-91f68422d65d4fe746e4cd89cd274636a097c4ff.tar.gz emacs-91f68422d65d4fe746e4cd89cd274636a097c4ff.tar.bz2 emacs-91f68422d65d4fe746e4cd89cd274636a097c4ff.zip |
* files.el (hack-local-variables-prop-line)
(hack-local-variables, dir-locals-read-from-file): Bind
read-circle to nil before reading.
* lread.c (Vread_circle): New variable.
(read1): Disable recursive read if Vread_circle is nil.
Diffstat (limited to 'src/lread.c')
-rw-r--r-- | src/lread.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/lread.c b/src/lread.c index 8a4b96874ce..cb3f5b04633 100644 --- a/src/lread.c +++ b/src/lread.c @@ -125,6 +125,9 @@ Lisp_Object Vload_file_name; /* Function to use for reading, in `load' and friends. */ Lisp_Object Vload_read_function; +/* Non-nil means read recursive structures using #n= and #n# syntax. */ +Lisp_Object Vread_circle; + /* The association list of objects read with the #n=object form. Each member of the list has the form (n . object), and is used to look up the object for the corresponding #n# construct. @@ -2558,7 +2561,7 @@ read1 (readcharfun, pch, first_in_list) c = READCHAR; } /* #n=object returns object, but associates it with n for #n#. */ - if (c == '=') + if (c == '=' && !NILP (Vread_circle)) { /* Make a placeholder for #n# to use temporarily */ Lisp_Object placeholder; @@ -2580,7 +2583,7 @@ read1 (readcharfun, pch, first_in_list) return tem; } /* #n# returns a previously read object. */ - if (c == '#') + if (c == '#' && !NILP (Vread_circle)) { tem = Fassq (make_number (n), read_objects); if (CONSP (tem)) @@ -4215,6 +4218,10 @@ read multiple times. The list is in the same order as the symbols were read in. */); Vread_symbol_positions_list = Qnil; + DEFVAR_LISP ("read-circle", &Vread_circle, + doc: /* Non-nil means read recursive structures using #N= and #N# syntax. */); + Vread_circle = Qt; + DEFVAR_LISP ("load-path", &Vload_path, doc: /* *List of directories to search for files to load. Each element is a string (directory name) or nil (try default directory). |