Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
fb103ca9
Commit
fb103ca9
authored
Mar 16, 2011
by
Stefan Monnier
Browse files
* src/print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
(print_preprocess, print_object): New macro to fix last change.
parent
35ac2a97
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
12 deletions
+15
-12
src/ChangeLog
src/ChangeLog
+3
-0
src/print.c
src/print.c
+12
-12
No files found.
src/ChangeLog
View file @
fb103ca9
2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
* print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
(print_preprocess, print_object): New macro to fix last change.
* print.c (print_preprocess): Don't forget font objects.
2011-03-16 Juanma Barranquero <lekktu@gmail.com>
src/print.c
View file @
fb103ca9
...
...
@@ -1173,6 +1173,16 @@ print (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag)
print_object
(
obj
,
printcharfun
,
escapeflag
);
}
#define PRINT_CIRCLE_CANDIDATE_P(obj) \
(STRINGP (obj) || CONSP (obj) \
|| (VECTORLIKEP (obj) \
&& (VECTORP (obj) || COMPILEDP (obj) \
|| CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj) \
|| HASH_TABLE_P (obj) || FONTP (obj))) \
|| (! NILP (Vprint_gensym) \
&& SYMBOLP (obj) \
&& !SYMBOL_INTERNED_P (obj)))
/* Construct Vprint_number_table according to the structure of OBJ.
OBJ itself and all its elements will be added to Vprint_number_table
recursively if it is a list, vector, compiled function, char-table,
...
...
@@ -1207,12 +1217,7 @@ print_preprocess (Lisp_Object obj)
halftail
=
obj
;
loop:
if
(
STRINGP
(
obj
)
||
CONSP
(
obj
)
||
VECTORP
(
obj
)
||
COMPILEDP
(
obj
)
||
CHAR_TABLE_P
(
obj
)
||
SUB_CHAR_TABLE_P
(
obj
)
||
HASH_TABLE_P
(
obj
)
||
FONTP
(
obj
)
||
(
!
NILP
(
Vprint_gensym
)
&&
SYMBOLP
(
obj
)
&&
!
SYMBOL_INTERNED_P
(
obj
)))
if
(
PRINT_CIRCLE_CANDIDATE_P
(
obj
))
{
if
(
!
HASH_TABLE_P
(
Vprint_number_table
))
{
...
...
@@ -1389,12 +1394,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
error
(
"Apparently circular structure being printed"
);
/* Detect circularities and truncate them. */
if
(
STRINGP
(
obj
)
||
CONSP
(
obj
)
||
VECTORP
(
obj
)
||
COMPILEDP
(
obj
)
||
CHAR_TABLE_P
(
obj
)
||
SUB_CHAR_TABLE_P
(
obj
)
||
HASH_TABLE_P
(
obj
)
||
(
!
NILP
(
Vprint_gensym
)
&&
SYMBOLP
(
obj
)
&&
!
SYMBOL_INTERNED_P
(
obj
)))
if
(
PRINT_CIRCLE_CANDIDATE_P
(
obj
))
{
if
(
NILP
(
Vprint_circle
)
&&
NILP
(
Vprint_gensym
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment