From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Erik Newsgroups: gmane.emacs.bugs Subject: bug#1913: Identifier after reserved word "raise" is not always highlighted in Ada-mode Date: Thu, 15 Jan 2009 14:40:54 +0100 Message-ID: <496F3CE6.3080600@gmail.com> References: <496EECEB.1020209@gmail.com> Reply-To: Erik , 1913@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1232028463 13739 80.91.229.12 (15 Jan 2009 14:07:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Jan 2009 14:07:43 +0000 (UTC) Cc: 1913@emacsbugs.donarmstrong.com To: Juanma Barranquero Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 15 15:08:54 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LNSte-0005PV-Iu for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Jan 2009 15:08:34 +0100 Original-Received: from localhost ([127.0.0.1]:37373 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LNSsO-00045n-13 for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Jan 2009 09:07:16 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LNSom-0000gj-Is for bug-gnu-emacs@gnu.org; Thu, 15 Jan 2009 09:03:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LNSok-0000ez-Rk for bug-gnu-emacs@gnu.org; Thu, 15 Jan 2009 09:03:32 -0500 Original-Received: from [199.232.76.173] (port=53237 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LNSok-0000ei-In for bug-gnu-emacs@gnu.org; Thu, 15 Jan 2009 09:03:30 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:40731) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LNSoj-0000x0-SO for bug-gnu-emacs@gnu.org; Thu, 15 Jan 2009 09:03:30 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0FE3QW5008930; Thu, 15 Jan 2009 06:03:26 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n0FDj2HL002816; Thu, 15 Jan 2009 05:45:02 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Erik Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs , owner@emacsbugs.donarmstrong.com Resent-Date: Thu, 15 Jan 2009 13:45:02 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 1913 X-Emacs-PR-Package: emacs,ada-mode X-Emacs-PR-Keywords: Original-Received: via spool by 1913-submit@emacsbugs.donarmstrong.com id=B1913.12320266621050 (code B ref 1913); Thu, 15 Jan 2009 13:45:02 +0000 Original-Received: (at 1913) by emacsbugs.donarmstrong.com; 15 Jan 2009 13:37:42 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0FDbcLm001028 for <1913@emacsbugs.donarmstrong.com>; Thu, 15 Jan 2009 05:37:39 -0800 Original-Received: by fg-out-1718.google.com with SMTP id l27so508080fgb.43 for <1913@emacsbugs.donarmstrong.com>; Thu, 15 Jan 2009 05:37:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=smTUhDyR0uu1htLQ4B0AGWJAMFJVuNE+3UqI7b5uqlU=; b=u5QQeeBxQv7HsJXgjPnNatAo95NbEjBnasn6GzxVQ6QeoF17nJHD3jDOMDi/zA86WA c1gTW0gVy/jIfE7/UZ+k+kQnmfoHgQ/lNV1/TzF6gsfSHG5YaZ3GSoNL0erZZkdHcmt+ nJ0M6Vk5tCOO9gtvSpRzkobFHwpd5dDCzSH04= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=UIETHlPMz/m8hZWMlzAYNQjVCvA+vy8rw28mLeywLY6bONWNEJmxX2/aA9olZop16x u40tnKUpOy8YJLOZUiNd1eJbkQ+7Fs4jk7+UHRadu15d3xThkjv4dO2uy26ov8XGrEZI vh5vKRHHbdIVgCIDQl+ZVdTlYAujFa/0GNGVQ= Original-Received: by 10.86.91.12 with SMTP id o12mr362033fgb.16.1232026657633; Thu, 15 Jan 2009 05:37:37 -0800 (PST) Original-Received: from ?192.168.0.46? (92.44.227.87.static.f.siw.siwnet.net [87.227.44.92]) by mx.google.com with ESMTPS id e11sm172209fga.42.2009.01.15.05.37.36 (version=SSLv3 cipher=RC4-MD5); Thu, 15 Jan 2009 05:37:36 -0800 (PST) User-Agent: Thunderbird 2.0.0.19 (X11/20090102) In-Reply-To: X-MIME-Autoconverted: from 8bit to quoted-printable by rzlab.ucr.edu id n0FE3QW5008930 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Thu, 15 Jan 2009 09:03:31 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:24157 Archived-At: Juanma Barranquero skrev: > On Thu, Jan 15, 2009 at 08:59, Erik wrote: > =20 >> So how should I tell the highlighter that the file is >> Ada95 or Ada2005 (and not Ada83)? I think that emacs should assume tha= t >> the file is not Ada83 if a non-ASCII character is used in an identifie= r. >> =20 > > It's not that the Ada mode is assuming any specific version. There's a > variable `ada-language-version', but it just affects which keywords > are recognized as such. The problem is simply that some of the regexps > were written in the ASCII-only era and have not been updated. > > Try the following patch, which should fix this particular case. I'll > bring the issue to the Ada mode maintainer for a more permanent fix. > > Juanma > > > Index: lisp/progmodes/ada-mode.el > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /sources/emacs/emacs/lisp/progmodes/ada-mode.el,v > retrieving revision 1.101 > diff -u -2 -r1.101 ada-mode.el > --- lisp/progmodes/ada-mode.el 9 Jan 2009 04:15:56 -0000 1.101 > +++ lisp/progmodes/ada-mode.el 15 Jan 2009 09:05:02 -0000 > @@ -5224,5 +5224,5 @@ > ;; correctly highlight a with_clause that spans multiple lines. > (list (concat "\\<\\(goto\\|raise\\|use\\|with\\)" > - "[ \t]+\\([a-zA-Z0-9_., \t]+\\)\\W") > + "[ \t]+\\([[:alnum:]_., \t]+\\)\\W") > '(1 font-lock-keyword-face) '(2 font-lock-reference-face nil t)) > =20 The patch is an improvement, but it highlights some illegal identifiers. The correct regexp for an Ada identifier is "[[:alpha:]](_?[^\W_])*". See this example (in bash): for i in h=C3=B6g _h=C3=B6g h_=C3=B6g h__=C3=B6g h_=C3=B6_g h=C3=B6g_ _ h= au_og do echo $i | egrep "^[[:alpha:]](_?[^\W_])*$" done It only matches the allowed identifiers: h=C3=B6g h_=C3=B6g h_=C3=B6_g hau_og (no leading, consecutive or trailing '_') There seems to be a lot of places with a-z in ada-mode.el.