From: "Herring, Davis" <herring@lanl.gov>
To: Oleh Krehel <ohwoeowho@gmail.com>,
"emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: RE: forward-sexp when on a floating point number
Date: Tue, 12 Jan 2016 13:58:38 +0000 [thread overview]
Message-ID: <B393F5AD12955C48A84FFB08032CD04F6C268AB8@ECS-EXG-P-MB01.win.lanl.gov> (raw)
In-Reply-To: <87y4bvf59p.fsf@gmail.com>
> (modify-syntax-entry ?\. "w" c++-mode-syntax-table)
This could be done for only those periods following numbers with a font-lock syntactic highlight:
("[0-9]\\(\\.\\)" 1 "_") ; you want "symbol", not "word" anyway
Better would be to check for numbers after it too, to catch numbers less than 1 with no leading zero.
> (looking-back "[0-9]+" (line-beginning-position)))
Just use "[0-9]"; how many doesn't matter.
> (skip-chars-forward "[0-9]")))
You want [-+0-9e] to handle scientific notation too. In C you also need to tolerate a trailing "d" or "f" for full generality. Of course, from after the decimal your command won't skip + or -, because you can't tell (looking only forward) that "1e+2" isn't part of "0x1e+2". So more font-lock trickery would be better (other than in requiring font-lock!), since it could mark the "-/+" ahead of time.
Davis
next prev parent reply other threads:[~2016-01-12 13:58 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-12 10:42 forward-sexp when on a floating point number Oleh Krehel
2016-01-12 13:58 ` Herring, Davis [this message]
2016-01-12 14:20 ` Andreas Schwab
2016-01-12 14:41 ` Oleh Krehel
2016-01-12 17:35 ` John Wiegley
2016-01-12 17:45 ` Dmitry Gutov
2016-01-17 23:07 ` Stefan Monnier
2016-01-17 23:42 ` John Wiegley
2016-01-18 1:36 ` Stefan Monnier
2016-01-18 5:08 ` John Wiegley
2016-01-18 13:30 ` Stefan Monnier
2016-01-18 19:02 ` John Wiegley
2016-01-18 21:03 ` Marcin Borkowski
2016-01-18 21:34 ` Stefan Monnier
2016-01-20 22:15 ` Marcin Borkowski
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=B393F5AD12955C48A84FFB08032CD04F6C268AB8@ECS-EXG-P-MB01.win.lanl.gov \
--to=herring@lanl.gov \
--cc=emacs-devel@gnu.org \
--cc=ohwoeowho@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.