1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-16 09:50:25 +00:00

Implement ## reader macro

* src/lread.c (read1): Read ## as empty symbol.

* src/print.c (print_object): Print empty symbol as ##.
This commit is contained in:
Andreas Schwab 2011-07-28 22:23:19 +02:00
parent d55e9c533f
commit 9a79b20c28
3 changed files with 18 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
* print.c (print_object): Print empty symbol as ##.
* lread.c (read1): Read ## as empty symbol.
2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
* nsfns.m (x_set_foreground_color): Set f->foreground_pixel when

View File

@ -2670,6 +2670,9 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
}
goto read_symbol;
}
/* ## is the empty symbol. */
if (c == '#')
return Fintern (build_string (""), Qnil);
/* Reader forms that can reuse previously read objects. */
if (c >= '0' && c <= '9')
{

View File

@ -1536,13 +1536,19 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
else
confusing = 0;
size_byte = SBYTES (name);
if (! NILP (Vprint_gensym) && !SYMBOL_INTERNED_P (obj))
{
PRINTCHAR ('#');
PRINTCHAR (':');
}
size_byte = SBYTES (name);
else if (size_byte == 0)
{
PRINTCHAR ('#');
PRINTCHAR ('#');
break;
}
for (i = 0, i_byte = 0; i_byte < size_byte;)
{
@ -1555,7 +1561,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
{
if (c == '\"' || c == '\\' || c == '\''
|| c == ';' || c == '#' || c == '(' || c == ')'
|| c == ',' || c =='.' || c == '`'
|| c == ',' || c == '.' || c == '`'
|| c == '[' || c == ']' || c == '?' || c <= 040
|| confusing)
PRINTCHAR ('\\'), confusing = 0;