From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: Re: Casing of number literals in ada-mode Date: Mon, 08 Feb 2010 11:37:05 -0500 Message-ID: References: <871vgwpuph.wl%jemarch@gnu.org> <87wryocy26.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1265647039 6079 80.91.229.12 (8 Feb 2010 16:37:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 8 Feb 2010 16:37:19 +0000 (UTC) Cc: emacs-devel@gnu.org, jemarch@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 08 17:37:16 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 1NeWbo-0007OT-Me for ged-emacs-devel@m.gmane.org; Mon, 08 Feb 2010 17:37:13 +0100 Original-Received: from localhost ([127.0.0.1]:53880 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NeWbo-0003xr-5W for ged-emacs-devel@m.gmane.org; Mon, 08 Feb 2010 11:37:12 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NeWbg-0003wG-1b for emacs-devel@gnu.org; Mon, 08 Feb 2010 11:37:04 -0500 Original-Received: from [199.232.76.173] (port=34214 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NeWbf-0003vj-LK for emacs-devel@gnu.org; Mon, 08 Feb 2010 11:37:03 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NeWbc-0008UL-7i for emacs-devel@gnu.org; Mon, 08 Feb 2010 11:37:03 -0500 Original-Received: from qmta03.westchester.pa.mail.comcast.net ([76.96.62.32]:45389) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NeWbb-0008U3-TX for emacs-devel@gnu.org; Mon, 08 Feb 2010 11:37:00 -0500 Original-Received: from omta10.westchester.pa.mail.comcast.net ([76.96.62.28]) by qmta03.westchester.pa.mail.comcast.net with comcast id fS081d0040cZkys53UcdEc; Mon, 08 Feb 2010 16:36:37 +0000 Original-Received: from SABUL ([68.50.111.2]) by omta10.westchester.pa.mail.comcast.net with comcast id fUcz1d00B0394wc3WUczBs; Mon, 08 Feb 2010 16:37:00 +0000 In-Reply-To: <87wryocy26.fsf@stupidchicken.com> (Chong Yidong's message of "Sun\, 07 Feb 2010 20\:32\:01 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (windows-nt) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:121020 Archived-At: Chong Yidong writes: > Hi Stephen, could you check this patch? If it's OK, we can commit it. I can't reproduce the problem, so I don't see the need for the fix. Jose; can you file a bug report, with a reproducer? > > Thanks. > > > jemarch@gnu.org writes: > >> 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) -- -- Stephe