From cf1409db71152926767da189bf044c3a63e77128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Mon, 11 Oct 2021 22:19:51 +0100 Subject: Don't apply shorthands to punctuation-only symbols (bug#51089) This includes symbols used for arithmetic functions such as -, /=, etc. Using "-" or "/=" is still possible but doing so won't shadow those functions. * doc/lispref/symbols.texi (Shorthand, Exceptions): New subsubsection. * src/lread.c (read1): Exempt punctionation-only symbols from oblookup_considering_shorthand. * test/lisp/progmodes/elisp-mode-tests.el (elisp-dont-shadow-punctuation-only-symbols): Tweak test. --- test/lisp/progmodes/elisp-mode-tests.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'test/lisp') diff --git a/test/lisp/progmodes/elisp-mode-tests.el b/test/lisp/progmodes/elisp-mode-tests.el index e816d3c1b02..400c76c187f 100644 --- a/test/lisp/progmodes/elisp-mode-tests.el +++ b/test/lisp/progmodes/elisp-mode-tests.el @@ -1094,9 +1094,8 @@ evaluation of BODY." (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 -- cgit v1.2.1