[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#48681: Patch: Make prettify-symbols-mode work with ruby-mode
From: |
Dmitry Gutov |
Subject: |
bug#48681: Patch: Make prettify-symbols-mode work with ruby-mode |
Date: |
Thu, 27 May 2021 21:02:05 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 |
On 27.05.2021 06:52, William Denton wrote:
An excellent question, and I think I overstepped things. The
documentation¹ and answers on Stack Exchange² say "&&" and "||" are
logical operators (so the logical symbols work) but "and" and "or" have
lower precedence and are used differently.
Right. And apparently, it's exactly the same situation in Perl.
It'd be best to just prettify "&&" and "||" with symbols, and anyone who
wants "and" and "or" could add those by hand. Shall I send a revised
patch, or do you just want to delete those bits?
Looking at the various prettify-symbols definitions, there is no great
consistency.
Even so, we can see that only python-mode uses the symbols ∧ and ∨.
As someone who graduated with an engineering degree a decade ago, the
"intersection" and "union" symbols look unusual in a programming context
to me. And a lot of software developers don't have a math background at all.
I'd recommend to just use the list from perl-mode:
'(("->" . ?→)
("=>" . ?⇒)
("::" . ?∷))
and also add the ("lambda" . ?λ) mapping to it.