diff options
| author | Chong Yidong | 2009-04-29 03:02:54 +0000 |
|---|---|---|
| committer | Chong Yidong | 2009-04-29 03:02:54 +0000 |
| commit | 91f68422d65d4fe746e4cd89cd274636a097c4ff (patch) | |
| tree | 1b8e00eeef766bcfa1827f55bd936addd6c1fb58 | |
| parent | ee87c5499807d57d19f95939e79cde34e22bc90d (diff) | |
| download | emacs-91f68422d65d4fe746e4cd89cd274636a097c4ff.tar.gz 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.
| -rw-r--r-- | etc/NEWS | 4 | ||||
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/files.el | 12 | ||||
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/lread.c | 11 |
5 files changed, 32 insertions, 6 deletions
| @@ -1931,6 +1931,10 @@ port support (see Emacs changes, above). | |||
| 1931 | ** Miscellaneous new variables | 1931 | ** Miscellaneous new variables |
| 1932 | 1932 | ||
| 1933 | +++ | 1933 | +++ |
| 1934 | *** `read-circle', if nil, disables the reading of recursive Lisp | ||
| 1935 | structures using the #N= and #N# syntax. | ||
| 1936 | |||
| 1937 | +++ | ||
| 1934 | *** `this-command-keys-shift-translated' is non-nil if the key | 1938 | *** `this-command-keys-shift-translated' is non-nil if the key |
| 1935 | sequence invoking the current command was found by shift-translation. | 1939 | sequence invoking the current command was found by shift-translation. |
| 1936 | 1940 | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8d7881c1aa1..c93996b6ef0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2009-04-29 Ulrich Mueller <ulm@gentoo.org> | ||
| 2 | |||
| 3 | * files.el (hack-local-variables-prop-line) | ||
| 4 | (hack-local-variables, dir-locals-read-from-file): Bind | ||
| 5 | read-circle to nil before reading. | ||
| 6 | |||
| 1 | 2009-04-28 Geert Kloosterman <g.j.kloosterman@gmail.com> (tiny change) | 7 | 2009-04-28 Geert Kloosterman <g.j.kloosterman@gmail.com> (tiny change) |
| 2 | 8 | ||
| 3 | * progmodes/which-func.el (which-function): Don't assume that | 9 | * progmodes/which-func.el (which-function): Don't assume that |
diff --git a/lisp/files.el b/lisp/files.el index b14ccc2be5c..7b7c438df3c 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -2898,7 +2898,8 @@ and VAL is the specified value." | |||
| 2898 | (let ((key (intern (match-string 1))) | 2898 | (let ((key (intern (match-string 1))) |
| 2899 | (val (save-restriction | 2899 | (val (save-restriction |
| 2900 | (narrow-to-region (point) end) | 2900 | (narrow-to-region (point) end) |
| 2901 | (read (current-buffer))))) | 2901 | (let ((read-circle nil)) |
| 2902 | (read (current-buffer)))))) | ||
| 2902 | ;; It is traditional to ignore | 2903 | ;; It is traditional to ignore |
| 2903 | ;; case when checking for `mode' in set-auto-mode, | 2904 | ;; case when checking for `mode' in set-auto-mode, |
| 2904 | ;; so we must do that here as well. | 2905 | ;; so we must do that here as well. |
| @@ -3044,12 +3045,14 @@ is specified, returning t if it is specified." | |||
| 3044 | (if (eolp) (error "Missing colon in local variables entry")) | 3045 | (if (eolp) (error "Missing colon in local variables entry")) |
| 3045 | (skip-chars-backward " \t") | 3046 | (skip-chars-backward " \t") |
| 3046 | (let* ((str (buffer-substring beg (point))) | 3047 | (let* ((str (buffer-substring beg (point))) |
| 3047 | (var (read str)) | 3048 | (var (let ((read-circle nil)) |
| 3049 | (read str))) | ||
| 3048 | val) | 3050 | val) |
| 3049 | ;; Read the variable value. | 3051 | ;; Read the variable value. |
| 3050 | (skip-chars-forward "^:") | 3052 | (skip-chars-forward "^:") |
| 3051 | (forward-char 1) | 3053 | (forward-char 1) |
| 3052 | (setq val (read (current-buffer))) | 3054 | (let ((read-circle nil)) |
| 3055 | (setq val (read (current-buffer)))) | ||
| 3053 | (if mode-only | 3056 | (if mode-only |
| 3054 | (if (eq var 'mode) | 3057 | (if (eq var 'mode) |
| 3055 | (setq result t)) | 3058 | (setq result t)) |
| @@ -3348,7 +3351,8 @@ is found. Returns the new class name." | |||
| 3348 | (insert-file-contents file) | 3351 | (insert-file-contents file) |
| 3349 | (let* ((dir-name (file-name-directory file)) | 3352 | (let* ((dir-name (file-name-directory file)) |
| 3350 | (class-name (intern dir-name)) | 3353 | (class-name (intern dir-name)) |
| 3351 | (variables (read (current-buffer)))) | 3354 | (variables (let ((read-circle nil)) |
| 3355 | (read (current-buffer))))) | ||
| 3352 | (dir-locals-set-class-variables class-name variables) | 3356 | (dir-locals-set-class-variables class-name variables) |
| 3353 | (dir-locals-set-directory-class dir-name class-name | 3357 | (dir-locals-set-directory-class dir-name class-name |
| 3354 | (nth 5 (file-attributes file))) | 3358 | (nth 5 (file-attributes file))) |
diff --git a/src/ChangeLog b/src/ChangeLog index d47f354ba6a..760795f1870 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2009-04-29 Ulrich Mueller <ulm@gentoo.org> | ||
| 2 | |||
| 3 | * lread.c (Vread_circle): New variable. | ||
| 4 | (read1): Disable recursive read if Vread_circle is nil. | ||
| 5 | |||
| 1 | 2009-04-29 Kenichi Handa <handa@m17n.org> | 6 | 2009-04-29 Kenichi Handa <handa@m17n.org> |
| 2 | 7 | ||
| 3 | * fontset.h (set_default_ascii_font): Delete extern. | 8 | * fontset.h (set_default_ascii_font): Delete extern. |
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; | |||
| 125 | /* Function to use for reading, in `load' and friends. */ | 125 | /* Function to use for reading, in `load' and friends. */ |
| 126 | Lisp_Object Vload_read_function; | 126 | Lisp_Object Vload_read_function; |
| 127 | 127 | ||
| 128 | /* Non-nil means read recursive structures using #n= and #n# syntax. */ | ||
| 129 | Lisp_Object Vread_circle; | ||
| 130 | |||
| 128 | /* The association list of objects read with the #n=object form. | 131 | /* The association list of objects read with the #n=object form. |
| 129 | Each member of the list has the form (n . object), and is used to | 132 | Each member of the list has the form (n . object), and is used to |
| 130 | look up the object for the corresponding #n# construct. | 133 | look up the object for the corresponding #n# construct. |
| @@ -2558,7 +2561,7 @@ read1 (readcharfun, pch, first_in_list) | |||
| 2558 | c = READCHAR; | 2561 | c = READCHAR; |
| 2559 | } | 2562 | } |
| 2560 | /* #n=object returns object, but associates it with n for #n#. */ | 2563 | /* #n=object returns object, but associates it with n for #n#. */ |
| 2561 | if (c == '=') | 2564 | if (c == '=' && !NILP (Vread_circle)) |
| 2562 | { | 2565 | { |
| 2563 | /* Make a placeholder for #n# to use temporarily */ | 2566 | /* Make a placeholder for #n# to use temporarily */ |
| 2564 | Lisp_Object placeholder; | 2567 | Lisp_Object placeholder; |
| @@ -2580,7 +2583,7 @@ read1 (readcharfun, pch, first_in_list) | |||
| 2580 | return tem; | 2583 | return tem; |
| 2581 | } | 2584 | } |
| 2582 | /* #n# returns a previously read object. */ | 2585 | /* #n# returns a previously read object. */ |
| 2583 | if (c == '#') | 2586 | if (c == '#' && !NILP (Vread_circle)) |
| 2584 | { | 2587 | { |
| 2585 | tem = Fassq (make_number (n), read_objects); | 2588 | tem = Fassq (make_number (n), read_objects); |
| 2586 | if (CONSP (tem)) | 2589 | if (CONSP (tem)) |
| @@ -4215,6 +4218,10 @@ read multiple times. The list is in the same order as the symbols | |||
| 4215 | were read in. */); | 4218 | were read in. */); |
| 4216 | Vread_symbol_positions_list = Qnil; | 4219 | Vread_symbol_positions_list = Qnil; |
| 4217 | 4220 | ||
| 4221 | DEFVAR_LISP ("read-circle", &Vread_circle, | ||
| 4222 | doc: /* Non-nil means read recursive structures using #N= and #N# syntax. */); | ||
| 4223 | Vread_circle = Qt; | ||
| 4224 | |||
| 4218 | DEFVAR_LISP ("load-path", &Vload_path, | 4225 | DEFVAR_LISP ("load-path", &Vload_path, |
| 4219 | doc: /* *List of directories to search for files to load. | 4226 | doc: /* *List of directories to search for files to load. |
| 4220 | Each element is a string (directory name) or nil (try default directory). | 4227 | Each element is a string (directory name) or nil (try default directory). |