;; ("sns-" . "some-nice-string-utils-"))
;; End:
@end example
+
+@subsection Exceptions
+
+There are two exceptions to rules governing Shorthand transformations:
+
+@itemize @bullet
+@item
+Symbol forms comprised entirely of symbol constituents (@pxref{Syntax
+Class Table}) are exempt not transform. For example, it's possible to
+use @code{-} or @code{/=} as shorthand prefixes, but that won't shadow
+the arithmetic @emph{functions} that have exactly that prefix as their
+full name.;
+
+@item
+Symbol forms whose name starts with the the characters @code{#_} are
+also exempted.
+@end itemize
ptrdiff_t longhand_bytes = 0;
Lisp_Object tem;
- if (skip_shorthand)
+ if (skip_shorthand ||
+ /* The following ASCII characters are used in the
+ only "core" Emacs Lisp symbols that are
+ exclusively comprised of 'symbol constituent'
+ syntax. */
+ strspn(read_buffer, "^*+-/<=>_|") >= nbytes)
tem = oblookup (obarray, read_buffer, nchars, nbytes);
else
tem = oblookup_considering_shorthand (obarray, read_buffer,
(should (unintern "f-test4---"))))
(ert-deftest elisp-dont-shadow-punctuation-only-symbols ()
- :expected-result :failed ; bug#51089
- (let* ((shorthanded-form '(- 42 (-foo 42)))
- (expected-longhand-form '(- 42 (fooey-foo 42)))
+ (let* ((shorthanded-form '(/= 42 (-foo 42)))
+ (expected-longhand-form '(/= 42 (fooey-foo 42)))
(observed (let ((read-symbol-shorthands
'(("-" . "fooey-"))))
(car (read-from-string