From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: jemarch@gnu.org Newsgroups: gmane.emacs.devel Subject: Casing of number literals in ada-mode Date: Sun, 07 Feb 2010 23:06:02 +0100 Organization: GNU Message-ID: <871vgwpuph.wl%jemarch@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1265580540 13460 80.91.229.12 (7 Feb 2010 22:09:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 7 Feb 2010 22:09:00 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 07 23:08:58 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NeFJJ-0007lW-A5 for ged-emacs-devel@m.gmane.org; Sun, 07 Feb 2010 23:08:57 +0100 Original-Received: from localhost ([127.0.0.1]:45144 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NeFJI-0000H2-RK for ged-emacs-devel@m.gmane.org; Sun, 07 Feb 2010 17:08:56 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NeFJD-0000G4-2S for emacs-devel@gnu.org; Sun, 07 Feb 2010 17:08:51 -0500 Original-Received: from [199.232.76.173] (port=42995 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NeFJC-0000Fp-NZ for emacs-devel@gnu.org; Sun, 07 Feb 2010 17:08:50 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NeFJB-0005fR-BQ for emacs-devel@gnu.org; Sun, 07 Feb 2010 17:08:50 -0500 Original-Received: from p4fff1d5d.dip.t-dialin.net ([79.255.29.93]:59764 helo=termi.gnu.org) by monty-python.gnu.org with esmtpa (Exim 4.60) (envelope-from ) id 1NeFJA-0005fB-Sp for emacs-devel@gnu.org; Sun, 07 Feb 2010 17:08:49 -0500 User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?UTF-8?B?U2hpasWN?=) APEL/10.6 Emacs/23.1.91 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) X-Face: YWi{2@v4Kx"fmpv)!VdB'C1viD0`>da4ALeX5ff%")JN|VN1RnL_Sb, iEq(|K<78@`KJTX4 W)_z; v0i%Rh)\/R]m^bj%rxO4!3^cVk49m/68^BVTo7Ip8kiXE=s5_p+*q*Pfs[f,=xAy$Wy?)&eM) pU^5X,rfkf X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:121012 Archived-At: Hi. Appended is a little patch that makes ada-mode to not case number literals to avoid situations like: subtype U32 is range 16#0000_0000#..16#Ffff_Ffff#; Note the Ffff_Ffff. 2010-02-06 Jose E. Marchesi * progmodes/ada-mode.el (ada-in-numeric-literal-p): New function. (ada-adjust-case): Don't adjust case in hexadecimal number literals. === modified file 'lisp/progmodes/ada-mode.el' --- lisp/progmodes/ada-mode.el 2010-01-23 12:34:52 +0000 +++ lisp/progmodes/ada-mode.el 2010-02-07 22:02:29 +0000 @@ -1009,6 +1009,10 @@ (parse-partial-sexp (line-beginning-position) (point))))) +(defsubst ada-in-numeric-literal-p () + "Return t if point is after a prefix of a numeric literal." + (looking-back "\\([0-9]+#[0-9a-fA-F_]+\\)")) + (defsubst ada-in-string-or-comment-p (&optional parse-result) "Return t if inside a comment or string. If PARSE-RESULT is non-nil, use it instead of calling `parse-partial-sexp'." @@ -1606,6 +1610,8 @@ (eq (char-syntax (char-before)) ?w) ;; if in a string or a comment (not (ada-in-string-or-comment-p)) + ;; if in a numeric literal + (not (ada-in-numeric-literal-p)) ) (if (save-excursion (forward-word -1)