* src/lread.c (intern_1): Make sure we'd find the symbol we add

Fixes: debbugs:20334

* src/xfaces.c (resolve_face_name): Don't use `intern' with Lisp_Strings.
This commit is contained in:
Stefan Monnier 2015-04-15 12:15:14 -04:00
parent cc4705f693
commit 66ae3cff96
3 changed files with 15 additions and 3 deletions

View file

@ -3778,8 +3778,11 @@ intern_1 (const char *str, ptrdiff_t len)
Lisp_Object obarray = check_obarray (Vobarray);
Lisp_Object tem = oblookup (obarray, str, len, len);
return SYMBOLP (tem) ? tem : intern_driver (make_string (str, len),
obarray, tem);
return (SYMBOLP (tem) ? tem
/* The above `oblookup' was done on the basis of nchars==nbytes, so
the string has to be unibyte. */
: intern_driver (make_unibyte_string (str, len),
obarray, tem));
}
Lisp_Object

View file

@ -1822,7 +1822,7 @@ resolve_face_name (Lisp_Object face_name, bool signal_p)
Lisp_Object tortoise, hare;
if (STRINGP (face_name))
face_name = intern (SSDATA (face_name));
face_name = Fintern (face_name, Qnil);
if (NILP (face_name) || !SYMBOLP (face_name))
return face_name;

View file

@ -5,6 +5,15 @@ ($)
return 0;
}
my $hash = {
foo => 'bar',
format => 'some',
};
sub some_code {
print "will not indent :(";
};
use v5.14;
my $str= <<END;