{
int c;
bool uninterned_symbol = false;
+ bool skip_shorthand = false;
bool multibyte;
char stackbuf[stackbufsize];
current_thread->stack_top = stackbuf;
if (c == ':')
{
uninterned_symbol = true;
+ read_hash_prefixed_symbol:
c = READCHAR;
if (!(c > 040
&& c != NO_BREAK_SPACE
}
goto read_symbol;
}
+ /* #_foo is really the symbol foo, regardless of shorthands */
+ if (c == '_')
+ {
+ skip_shorthand = true;
+ goto read_hash_prefixed_symbol;
+ }
/* ## is the empty symbol. */
if (c == '#')
return Fintern (empty_unibyte_string, Qnil);
ptrdiff_t nbytes = p - read_buffer;
UNREAD (c);
- if (!quoted && !uninterned_symbol)
+ if (!quoted && !uninterned_symbol && !skip_shorthand)
{
ptrdiff_t len;
Lisp_Object result = string_to_number (read_buffer, 10, &len);
ptrdiff_t longhand_chars = 0;
ptrdiff_t longhand_bytes = 0;
- Lisp_Object tem
- = oblookup_considering_shorthand
+ Lisp_Object tem;
+ if (skip_shorthand)
+ tem = oblookup (obarray, read_buffer, nchars, nbytes);
+ else {
+ tem = oblookup_considering_shorthand
(obarray, read_buffer, nchars, nbytes,
&longhand, &longhand_chars, &longhand_bytes);
+ }
if (SYMBOLP (tem))
result = tem;
"elisp--foo-test-complete-me"))
(revert-buffer t t))))
+(ert-deftest elisp-shorthand-escape ()
+ (let ((test-file (expand-file-name "simple-shorthand-test.el"
+ elisp--test-resources-dir)))
+ (load test-file)
+ (should (intern-soft "f-test4---"))
+ (should-not (intern-soft "elisp--foo-test4---"))
+ (should (= 84 (funcall (intern-soft "f-test4---"))))
+ (should (unintern "f-test4---"))))
+
+
(provide 'elisp-mode-tests)
;;; elisp-mode-tests.el ends here