emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Face for literal numbers.


From: Ergus
Subject: Re: Face for literal numbers.
Date: Sun, 8 Sep 2019 16:49:21 +0200
User-agent: NeoMutt/20180716

On Sun, Sep 08, 2019 at 01:25:39PM +0000, Alan Mackenzie wrote:
Hello, Ergus.

On Sun, Sep 08, 2019 at 04:41:46 +0200, Ergus wrote:
Hi I have seen that vim provides a color for the literal numbers in
prog-modes. I was looking for something similar en emacs and
surprisingly there is nothing within emacs or at least in elpa. The only
similar (fully functional) package is in melpa:

https://github.com/Fanael/highlight-numbers

Could we provide some basic support for this without depending of
melpa. Such simple functionalities must be at least in elpa right?

I'm against such a feature.  "Because vim has it" doesn't seem like a
sufficient justification.


Hi Alan:

I will not insist on this too much because it is basically an aesthetic
preference. I find it more "elegant" and up to now the package works
pretty fine for me (and it is not so complex actually).

And it is not only vim, but many other editors do (even very dumb ones)
at least for simple numeric constants.

I'm against such a feature because it would be complicated.  All of the
following would need to get the new face:
   5
   -5
   0x27
   0xffff'ffff       /* in C++ Mode */
   'a'               /* in C Mode, etc. */
   ?a                ; Emacs Lisp Mode

The code in the link supports most of those. And it is mode dependent already.

And it doesn't look to be very complex actually.

The last two of these would be controversial: should an C or Elisp
literal character count as a number for this purpose or not?

I don't think so; but there will be many opinions about if we ask, so I
won't ask again. I promise.

But in my opinion it makes more sense to support at least the most
general ones (the ones supported in the package, for example) than not
support anything.

We could spend quite a lot of time bikeshedding about this proposed
feature.  Do we need it?  I don't think we do.

--
Alan Mackenzie (Nuremberg, Germany).

I know how it works actually... So I will just ask the author if he is
fine adding it to elpa... half a loaf is better than no bread.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]