Re: display _ as left arrow (was Re: Help on sending a UDP Packet)

Stefan Monnier <[email protected]>
Newsgroups gmane.comp.lang.smalltalk.gnu.general
Message-ID <[email protected]>
Derek Zhou writes:
> Accept, but not encourage. None of the GNU smalltak and Squeak's official
> example code use it. ":=" at least is a cognate from Pascal, what else is
> using "_" ?

Indeed, and that's a good reason to say that it doesn't matter very much
if `smalltalk-mode` prettifies `_` or not, but it still doesn't seem to hurt.

Derek Zhou writes:
> You quoted me out of context. I was commenting on the patch and what I
> mean was the patch you made does not do the right thing, that's all. To
> do the right thing, ie, with prettified symbol and syntax highlight, you
> need to do more; patch welcomed. 

Ah, you mean that `smalltalk-mode` doesn't handle `_` correctly w.r.t
indentation, for example?  Indeed, a I think a patch is in order
for that.

I installed the patch below for now.  It includes the change to display
`_` as a left-arrow, since it seems noone strongly objected to it and it
can be helpful in pointing out the difference between `a_-1` and `a
_-1`.
Also it bumps the version number so as to finally release a new GNU ELPA
package for it.

> Initially I liked the idea of a pretty-print filter,
> but I'm not so sure any longer.
>
> It may complicate things;  perhaps it's not such a good idea to have a pretty-print filter,
> anyway.

`smalltalk-prettify-symbols-alist` is just a set of rules to change
the display (and only the display) of those symbols mentioned.
The prettification is only applied when the users activate
`prettify-symbols-mode`, which is not enabled by default (because
indeed, it's not always a good idea).


        Stefan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.