all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michal Nazarewicz <mpn@google.com>
To: Jambunathan K <kjambunathan@gmail.com>
Cc: Felix Lee <felix8a@gmail.com>, emacs-devel@gnu.org
Subject: Re: PATCH: num3-mode for highlighting groups of digits in long numbers
Date: Fri, 07 Sep 2012 03:14:58 +0200	[thread overview]
Message-ID: <xa1tk3w68wh9.fsf@mina86.com> (raw)
In-Reply-To: <87627qrb9k.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1995 bytes --]

>> 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
uses.

> 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: mpn@google.com>--------------ooO--(_)--Ooo--

[-- Attachment #2.1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2.2: Type: application/pgp-signature, Size: 835 bytes --]

      parent reply	other threads:[~2012-09-07  1:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-06 16:21 PATCH: num3-mode for highlighting groups of digits in long numbers Michal Nazarewicz
2012-09-06 17:23 ` Lars Ingebrigtsen
2012-09-06 21:22 ` Stefan Monnier
2012-09-25 20:40   ` Michal Nazarewicz
2012-09-26  1:07     ` Stefan Monnier
2012-09-26 12:27       ` Michal Nazarewicz
2012-09-26 12:56         ` Noah Lavine
2012-09-26 13:06           ` Michal Nazarewicz
2012-09-26 14:58             ` Lennart Borgman
2012-09-26 20:02               ` Stefan Monnier
2012-09-26 20:01             ` Stefan Monnier
2012-09-26 21:33               ` Michal Nazarewicz
2012-09-26 21:44                 ` Stefan Monnier
2012-09-26 23:33                   ` Michal Nazarewicz
2012-09-26 21:36               ` turn-on/off-*MODE* (was: Re: PATCH: num3-mode for highlighting groups of digits in long numbers) chad
2012-09-26 21:47                 ` turn-on/off-*MODE* Stefan Monnier
2012-09-26 21:59               ` PATCH: num3-mode for highlighting groups of digits in long numbers felix
2012-09-06 23:18 ` Jambunathan K
2012-09-06 23:41   ` felix
2012-09-07  1:14   ` Michal Nazarewicz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xa1tk3w68wh9.fsf@mina86.com \
    --to=mpn@google.com \
    --cc=emacs-devel@gnu.org \
    --cc=felix8a@gmail.com \
    --cc=kjambunathan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.