emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] refs/scratch/raeburn/startup 49caeac 2/5: Stefan's patch f


From: Ken Raeburn
Subject: [Emacs-diffs] refs/scratch/raeburn/startup 49caeac 2/5: Stefan's patch for reducing lread substitutions.
Date: Sun, 30 Oct 2016 14:16:47 +0000 (UTC)

reference: refs/scratch/raeburn/startup
commit 49caeace7aec8f4a0a83a76af5be8cca16e2396d
Author: Ken Raeburn <address@hidden>
Commit: Ken Raeburn <address@hidden>

    Stefan's patch for reducing lread substitutions.
---
 src/lread.c |   17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/lread.c b/src/lread.c
index 58d518c..a06a78f 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -2936,12 +2936,21 @@ read1 (Lisp_Object readcharfun, int *pch, bool 
first_in_list)
                      tem = read0 (readcharfun);
 
                      /* Now put it everywhere the placeholder was...  */
-                     substitute_object_in_subtree (tem, placeholder);
+                      if (CONSP (tem))
+                        {
+                          Fsetcar (placeholder, XCAR (tem));
+                          Fsetcdr (placeholder, XCDR (tem));
+                          return placeholder;
+                        }
+                      else
+                        {
+                         substitute_object_in_subtree (tem, placeholder);
 
-                     /* ...and #n# will use the real value from now on.  */
-                     Fsetcdr (cell, tem);
+                         /* ...and #n# will use the real value from now on.  */
+                         Fsetcdr (cell, tem);
 
-                     return tem;
+                         return tem;
+                        }
                    }
 
                  /* #n# returns a previously read object.  */



reply via email to

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