From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Herring, Davis" Newsgroups: gmane.emacs.devel Subject: RE: forward-sexp when on a floating point number Date: Tue, 12 Jan 2016 13:58:38 +0000 Message-ID: References: <87y4bvf59p.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1452607155 26424 80.91.229.3 (12 Jan 2016 13:59:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 12 Jan 2016 13:59:15 +0000 (UTC) To: Oleh Krehel , "emacs-devel@gnu.org" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 12 14:59:04 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aIzTS-0003Wb-RI for ged-emacs-devel@m.gmane.org; Tue, 12 Jan 2016 14:59:02 +0100 Original-Received: from localhost ([::1]:60589 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIzTS-0008WC-7f for ged-emacs-devel@m.gmane.org; Tue, 12 Jan 2016 08:59:02 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIzTD-0008Va-6z for emacs-devel@gnu.org; Tue, 12 Jan 2016 08:58:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aIzT7-00081l-Jd for emacs-devel@gnu.org; Tue, 12 Jan 2016 08:58:47 -0500 Original-Received: from proofpoint5.lanl.gov ([2001:400:4210:400::a5]:59131) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIzT7-00081g-9e for emacs-devel@gnu.org; Tue, 12 Jan 2016 08:58:41 -0500 Original-Received: from mailrelay2.lanl.gov (mailrelay2.lanl.gov [128.165.4.103]) by mailgate5.lanl.gov (8.15.0.59/8.15.0.59) with ESMTP id u0CDwdtR030367; Tue, 12 Jan 2016 06:58:39 -0700 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mailrelay2.lanl.gov (Postfix) with ESMTP id E7529EE1E59; Tue, 12 Jan 2016 06:58:38 -0700 (MST) X-NIE-2-Virus-Scanner: amavisd-new at mailrelay2.lanl.gov Original-Received: from ECS-EXG-P-CH01.win.lanl.gov (ecs-exg-p-ch01.win.lanl.gov [128.165.106.11]) by mailrelay2.lanl.gov (Postfix) with ESMTP id 6B41BEE1E4D; Tue, 12 Jan 2016 06:58:38 -0700 (MST) Original-Received: from ECS-EXG-P-MB01.win.lanl.gov ([169.254.1.250]) by ECS-EXG-P-CH01.win.lanl.gov ([128.165.106.11]) with mapi id 14.03.0266.001; Tue, 12 Jan 2016 06:58:38 -0700 Thread-Topic: forward-sexp when on a floating point number Thread-Index: AQHRTSX3axDrHNgAYkuqHafPWZKT7J735l9Y In-Reply-To: <87y4bvf59p.fsf@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [128.165.106.85] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.15.21, 1.0.33, 0.0.0000 definitions=2016-01-12_05:2016-01-12, 2016-01-12, 1970-01-01 signatures=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 2001:400:4210:400::a5 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:198074 Archived-At: > (modify-syntax-entry ?\. "w" c++-mode-syntax-table)=0A= =0A= This could be done for only those periods following numbers with a font-loc= k syntactic highlight:=0A= =0A= ("[0-9]\\(\\.\\)" 1 "_") ; you want "symbol", not "word" anyway=0A= =0A= Better would be to check for numbers after it too, to catch numbers less th= an 1 with no leading zero.=0A= =0A= > (looking-back "[0-9]+" (line-beginning-position)))=0A= =0A= Just use "[0-9]"; how many doesn't matter.=0A= =0A= > (skip-chars-forward "[0-9]")))=0A= =0A= 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 (lookin= g only forward) that "1e+2" isn't part of "0x1e+2". So more font-lock tric= kery would be better (other than in requiring font-lock!), since it could m= ark the "-/+" ahead of time.=0A= =0A= Davis=0A=