emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs etc/NEWS lisp/ChangeLog lisp/files.el src...


From: Chong Yidong
Subject: [Emacs-diffs] emacs etc/NEWS lisp/ChangeLog lisp/files.el src...
Date: Wed, 29 Apr 2009 03:03:01 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      09/04/29 03:03:00

Modified files:
        etc            : NEWS 
        lisp           : ChangeLog files.el 
        src            : ChangeLog lread.c 

Log message:
        * 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.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/etc/NEWS?cvsroot=emacs&r1=1.2017&r2=1.2018
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.15617&r2=1.15618
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/files.el?cvsroot=emacs&r1=1.1046&r2=1.1047
http://cvs.savannah.gnu.org/viewcvs/emacs/src/ChangeLog?cvsroot=emacs&r1=1.7515&r2=1.7516
http://cvs.savannah.gnu.org/viewcvs/emacs/src/lread.c?cvsroot=emacs&r1=1.405&r2=1.406

Patches:
Index: etc/NEWS
===================================================================
RCS file: /sources/emacs/emacs/etc/NEWS,v
retrieving revision 1.2017
retrieving revision 1.2018
diff -u -b -r1.2017 -r1.2018
--- etc/NEWS    22 Apr 2009 04:22:20 -0000      1.2017
+++ etc/NEWS    29 Apr 2009 03:02:54 -0000      1.2018
@@ -1931,6 +1931,10 @@
 ** Miscellaneous new variables
 
 +++
+*** `read-circle', if nil, disables the reading of recursive Lisp
+structures using the #N= and #N# syntax.
+
++++
 *** `this-command-keys-shift-translated' is non-nil if the key
 sequence invoking the current command was found by shift-translation.
 

Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.15617
retrieving revision 1.15618
diff -u -b -r1.15617 -r1.15618
--- lisp/ChangeLog      28 Apr 2009 21:29:47 -0000      1.15617
+++ lisp/ChangeLog      29 Apr 2009 03:02:56 -0000      1.15618
@@ -1,3 +1,9 @@
+2009-04-29  Ulrich Mueller  <address@hidden>
+
+       * files.el (hack-local-variables-prop-line)
+       (hack-local-variables, dir-locals-read-from-file): Bind
+       read-circle to nil before reading.
+
 2009-04-28  Geert Kloosterman  <address@hidden>  (tiny change)
 
        * progmodes/which-func.el (which-function): Don't assume that

Index: lisp/files.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/files.el,v
retrieving revision 1.1046
retrieving revision 1.1047
diff -u -b -r1.1046 -r1.1047
--- lisp/files.el       28 Apr 2009 19:00:38 -0000      1.1046
+++ lisp/files.el       29 Apr 2009 03:02:58 -0000      1.1047
@@ -2898,7 +2898,8 @@
               (let ((key (intern (match-string 1)))
                     (val (save-restriction
                            (narrow-to-region (point) end)
-                           (read (current-buffer)))))
+                           (let ((read-circle nil))
+                             (read (current-buffer))))))
                 ;; It is traditional to ignore
                 ;; case when checking for `mode' in set-auto-mode,
                 ;; so we must do that here as well.
@@ -3044,12 +3045,14 @@
                  (if (eolp) (error "Missing colon in local variables entry"))
                  (skip-chars-backward " \t")
                  (let* ((str (buffer-substring beg (point)))
-                        (var (read str))
+                        (var (let ((read-circle nil))
+                               (read str)))
                         val)
                    ;; Read the variable value.
                    (skip-chars-forward "^:")
                    (forward-char 1)
-                   (setq val (read (current-buffer)))
+                   (let ((read-circle nil))
+                     (setq val (read (current-buffer))))
                    (if mode-only
                        (if (eq var 'mode)
                            (setq result t))
@@ -3348,7 +3351,8 @@
     (insert-file-contents file)
     (let* ((dir-name (file-name-directory file))
           (class-name (intern dir-name))
-          (variables (read (current-buffer))))
+          (variables (let ((read-circle nil))
+                       (read (current-buffer)))))
       (dir-locals-set-class-variables class-name variables)
       (dir-locals-set-directory-class dir-name class-name
                                      (nth 5 (file-attributes file)))

Index: src/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/src/ChangeLog,v
retrieving revision 1.7515
retrieving revision 1.7516
diff -u -b -r1.7515 -r1.7516
--- src/ChangeLog       29 Apr 2009 01:42:13 -0000      1.7515
+++ src/ChangeLog       29 Apr 2009 03:02:59 -0000      1.7516
@@ -1,3 +1,8 @@
+2009-04-29  Ulrich Mueller  <address@hidden>
+
+       * lread.c (Vread_circle): New variable.
+       (read1): Disable recursive read if Vread_circle is nil.
+
 2009-04-29  Kenichi Handa  <address@hidden>
 
        * fontset.h (set_default_ascii_font): Delete extern.

Index: src/lread.c
===================================================================
RCS file: /sources/emacs/emacs/src/lread.c,v
retrieving revision 1.405
retrieving revision 1.406
diff -u -b -r1.405 -r1.406
--- src/lread.c 10 Mar 2009 01:05:39 -0000      1.405
+++ src/lread.c 29 Apr 2009 03:03:00 -0000      1.406
@@ -125,6 +125,9 @@
 /* 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 @@
              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 @@
              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 @@
 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).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]