[Top][All Lists]

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

Re: PATCH: num3-mode for highlighting groups of digits in long numbers

From: Michal Nazarewicz
Subject: Re: PATCH: num3-mode for highlighting groups of digits in long numbers
Date: Fri, 07 Sep 2012 03:14:58 +0200
User-agent: Notmuch/0.14+22~g8bdc16b (http://notmuchmail.org) Emacs/ (x86_64-unknown-linux-gnu)

>> This time I bring to you a patch adding num3-mode which helps read long
>> numbers by alternating highlighting of group of digits in a long
>> number, so for instance something like:
>>      12345678.12345678
>> would be displayed as ("-" symbolising underscore):
>>      12345678.12345678
>>        ---       ---
>> This also works for hexadecimal numbers by grouping 4-digits at a time,
>> ie.:
>>      0x0123456789ABCDEF
>>        ----    ----

On Fri, Sep 07 2012, Jambunathan K wrote:
> Just curious.
> Can we highlight like telephone numbers by creating an *extra* dash,
> space or a point.
> Tel no: 1234567890 rendered as
> Tel no: 12345-67890

If you ask whether it is theoretically possible than it is.  nxml-mode
has code to render entities, so the same mechanism can be used to add
dashes to separate numbers.

Still, this is not doable with num3-mode at this point.  Feel free to
hack support for it. :)  It should not be too hard -- just need to add
some defcustom variable and than modify -num3-put defun.

Note that this will work for any kind of *numbers*, so if you want to
treat some specific kind of numbers specially, like phone numbers, than
there will be more coding, probably including a different regex for
phone number detection (BTW. good luck with that, I've spent weeks on
my previous work doing something like that for Mozilla).

In general however, I see more problems with adding extra dashes than

> In some ways, the highlighting as seen above is in-band and not
> out-of-band (as underlines are).  It is also naturally how one would
> write down long numbers on a piece of paper for ease of reading.

I don't quite get your point here.

Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +----<email/xmpp: address@hidden>--------------ooO--(_)--Ooo--

Attachment: pgpo3UrM5gPGM.pgp
Description: PGP signature

reply via email to

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