rust-lang / rust-mode

Emacs configuration for Rust
Apache License 2.0
1.1k stars 176 forks source link

Enable the use of prettify-symbols-mode #429

Closed Chris00 closed 2 years ago

Chris00 commented 2 years ago

Make M-x prettify-symbols-mode prettify some symbols (e.g. <=, >=, ->) in Rust code.

Chris00 commented 2 years ago

The code to disambiguate the two uses of || has to be improved but, before, I'd like to know whether there is interest in this feature.

brotzeit commented 2 years ago

I'd like to know whether there is interest in this feature.

I'm sure many users want this feature. But I think these changes should be optional. I'm actually not sure if we should make this a default. We should definitely document this in the readme. Most use doom-emacs etc. anyway so there will be probably a pull request for those distros soon.

I wonder if there's already some mode that provides this feature major mode independent. I think we should ensure this feature doesn't interfere with other packages.

Chris00 commented 2 years ago

But I think these changes should be optional. I'm actually not sure if we should make this a default.

The commit prepares the infrastructure for prettifying but nothing gets activated until the user issues M-x prettify-symbols-mode (or puts it in the mode hook or uses global-prettify-symbols-mode). I've changed a comment to reflect that. Prettify is the major-mode independent way of prettifying symbols (but it must be tailored to the mode).

brotzeit commented 2 years ago

Sorry, I was obviously too lazy to google. Can you do me a favor and a note to the readme ?

Chris00 commented 2 years ago

Done.

brotzeit commented 2 years ago

Thanks!