GNU bug report logs - #64739
(forward-thing 'number) doesn't work with decimal numbers

Previous Next

Package: emacs;

Reported by: Joseph Turner <joseph <at> breatheoutbreathe.in>

Date: Thu, 20 Jul 2023 06:27:01 UTC

Severity: normal

Merged with 74662

Found in version 29.4

Full log


Message #38 received at 64739 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Joseph Turner <joseph <at> breatheoutbreathe.in>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 64739 <at> debbugs.gnu.org, winkler <at> gnu.org
Subject: Re: bug#64739: (forward-thing 'number) doesn't work with decimal
 numbers
Date: Mon, 24 Jul 2023 14:25:48 +0300
> From: Joseph Turner <joseph <at> breatheoutbreathe.in>
> Cc: winkler <at> gnu.org, 64739 <at> debbugs.gnu.org
> Date: Sun, 23 Jul 2023 12:03:50 -0700
> 
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > That's probably one idea, yes.  (But note that those regexps don't
> > support numbers like "1.0e2".)
> 
> I agree that the regexp solution is not ideal.
> 
> > Another idea is to define a special-purpose syntax table and use that
> > with forward-word.
> 
> Did you have something like this in mind?

More or less.  TBH, I didn't think about this too much, so maybe this
idea doesn't "hold water".

> > Yet another idea is to use 'read', since the Lisp reader already knows
> > how to read numbers.
> 
> Sounds interesting! I'm not sure how to approach a solution like that.
> How would you let the Lisp reader know where to start and stop reading?

Start is easy: 'read' always starts at point.  End might give us
trouble, but in general 'read' reads one expression, so it should stop
at the end of the number, no?

Anyway, I was just brain-storming.  A real solution will need more
thought and more testing.  Perhaps Stefan (CC'ed) has some ideas or
inputs.




This bug report was last modified 110 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.