[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#20334: What does all-completions with COLLECTION == obarray return?
From: |
Stefan Monnier |
Subject: |
bug#20334: What does all-completions with COLLECTION == obarray return? |
Date: |
Wed, 15 Apr 2015 12:15:43 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
> (progn
> (intern "Bahá'í Date") ;this happens when requiring org
> (facep "Bahá'í Date")
> ;; Test if "Bahá'í Date" is the name of more than one interned symbol
> (let ((ss nil))
> (mapatoms (lambda (s) (when (string= (symbol-name s) "Bahá'í Date")
> (push s ss)))
> nil)
> (length ss)))
I installed the patch below which should fix this problem. Thanks.
Stefan
diff --git a/src/lread.c b/src/lread.c
index 050e43e..fa9a63e 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -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
diff --git a/src/xfaces.c b/src/xfaces.c
index b269722..d198c4b 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -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;
diff --git a/test/indent/perl.perl b/test/indent/perl.perl
index 00ef312..ea48754 100755
--- a/test/indent/perl.perl
+++ b/test/indent/perl.perl
@@ -5,6 +5,15 @@ sub add_funds($) {
return 0;
}
+my $hash = {
+ foo => 'bar',
+ format => 'some',
+};
+
+sub some_code {
+ print "will not indent :(";
+};
+
use v5.14;
my $str= <<END;