From debbugs-submit-bounces@debbugs.gnu.org Sun May 08 19:46:12 2011 Received: (at submit) by debbugs.gnu.org; 8 May 2011 23:46:12 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QJDfv-0003ew-Cb for submit@debbugs.gnu.org; Sun, 08 May 2011 19:46:12 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QJDG6-00036A-Qv for submit@debbugs.gnu.org; Sun, 08 May 2011 19:19:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QJDG0-0003pq-Jz for submit@debbugs.gnu.org; Sun, 08 May 2011 19:19:25 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, T_RP_MATCHES_RCVD autolearn=no version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:56221) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJDG0-0003pl-IO for submit@debbugs.gnu.org; Sun, 08 May 2011 19:19:24 -0400 Received: from eggs.gnu.org ([140.186.70.92]:54357) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJDFz-0004aT-C1 for bug-gnu-emacs@gnu.org; Sun, 08 May 2011 19:19:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QJDFy-0003pY-Fo for bug-gnu-emacs@gnu.org; Sun, 08 May 2011 19:19:23 -0400 Received: from stevechapel.com ([69.11.220.126]:48737 helo=laptop.stevechapel.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJDFy-0003pR-1E for bug-gnu-emacs@gnu.org; Sun, 08 May 2011 19:19:22 -0400 Received: from laptop.stevechapel.com (laptop.stevechapel.com [127.0.0.1]) by laptop.stevechapel.com (8.14.4/8.14.4) with ESMTP id p48MuJPv025106 for ; Sun, 8 May 2011 18:56:19 -0400 Received: (from schapel@localhost) by laptop.stevechapel.com (8.14.4/8.14.4/Submit) id p48MuIMM025104; Sun, 8 May 2011 18:56:18 -0400 From: Steve Chapel To: bug-gnu-emacs@gnu.org Subject: 23.2; emacs python mode should colorize nonlocal keyword Date: Sun, 08 May 2011 18:56:18 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 08 May 2011 19:46:09 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.1 (-----) When editing a Python source file, the nonlocal keyword is not colorized as are other keywords. The following program is an example: #!/usr/bin/python3 def foo(): i = 1 def bar(): nonlocal i return i + 1 return bar print(foo()()) In GNU Emacs 23.2.1 (x86_64-redhat-linux-gnu, GTK+ Version 2.21.4) of 2010-07-08 on x86-10.phx2.fedoraproject.org configured using `configure '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-dbus' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xft' '--with-xpm' '--with-x-toolkit=gtk' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-optimize-sibling-calls'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.utf8 value of $XMODIFIERS: @im=none locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Python Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: ESC [ > 1 ; 2 6 0 1 ; 0 c ESC x r e p TAB DEL DEL DEL b u g TAB TAB DEL DEL DEL DEL DEL DEL DEL DEL DEL DEL DEL DEL DEL DEL r e p o r t TAB RET Recent messages: ("emacs" "hop4_2.py") Loading /usr/share/emacs/site-lisp/site-start.d/focus-init.el (source)...done Loading /usr/share/emacs/site-lisp/site-start.d/php-mode-init.el (source)...done Loading /usr/share/emacs/site-lisp/site-start.d/rpm-spec-mode-init.el (source)...done For information about GNU Emacs and the GNU system, type C-h C-a. Making completion list... [2 times] Load-path shadows: None found. Features: (shadow sort mail-extr message idna sendmail regexp-opt ecomplete rfc822 mml mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util netrc time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock sha1 hex-util hashcash mail-utils emacsbug help-mode view python-21 python easymenu comint ring tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd font-setting tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces cus-face files text-properties overlay md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind system-font-setting font-render-setting gtk x-toolkit x multi-tty emacs) From debbugs-submit-bounces@debbugs.gnu.org Wed May 11 18:14:05 2011 Received: (at 8639) by debbugs.gnu.org; 11 May 2011 22:14:05 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QKHfQ-00050D-OL for submit@debbugs.gnu.org; Wed, 11 May 2011 18:14:05 -0400 Received: from mail-gx0-f172.google.com ([209.85.161.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QKHfO-0004ze-MD for 8639@debbugs.gnu.org; Wed, 11 May 2011 18:14:03 -0400 Received: by gxk19 with SMTP id 19so343929gxk.3 for <8639@debbugs.gnu.org>; Wed, 11 May 2011 15:13:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=/RncSmqfStsLeIOTeeCIiuSqMdUB+nWCOajFav4hOi0=; b=wRWUdci849XYhqGtvswjZR8KjF7mHJTvAWgwPu5TBqdBD5Rd49LhKe2RAtnGo49IFq pI8y2zMkLJFhZRO7rdeU/vOsEgVnBlkwg/H9wPV/4h/pX8dABLQ5K3PjrOGEbgsLZZoI Rj/2idPSm4zmNmZnrZmWYhhUEJ9w1nUimBcG8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=kWjJcF3ZWdzHaF4Y86EMulmBWvHeNgUANjGSz75KSzfMET+6vt+oBM1VKEny0k/M1Y Xp29Ms5t2T5KjITH9c6xdr+xpJ+rnIjBx4NFseSVnBwz0Er6tKOo1SEaJ35jqRLAIJqP 9yE2idHJlAYRWI5mUXf6dGuO7i5X9zSxwRkqA= Received: by 10.236.78.34 with SMTP id f22mr10786447yhe.428.1305152037082; Wed, 11 May 2011 15:13:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.147.41.4 with HTTP; Wed, 11 May 2011 15:13:17 -0700 (PDT) In-Reply-To: References: From: Juanma Barranquero Date: Thu, 12 May 2011 00:13:17 +0200 Message-ID: Subject: Re: bug#8639: 23.2; emacs python mode should colorize nonlocal keyword To: Steve Chapel Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -3.3 (---) X-Debbugs-Envelope-To: 8639 Cc: 8639@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.3 (---) On Mon, May 9, 2011 at 00:56, Steve Chapel wrote: > When editing a Python source file, the nonlocal keyword is not colorized > as are other keywords. It's easy to fix (see below), but "nonlocal" is a Python 3.X keyword, and python-mode does not really support Python 3 at this point, so I suppose that's not the only inconvenience you find when editing Python 3 code. =C2=A0 =C2=A0 Juanma =3D=3D=3D modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2011-04-22 18:44:26 +0000 +++ lisp/progmodes/python.el 2011-05-11 22:08:51 +0000 @@ -100,5 +100,7 @@ "raise" "return" "try" "while" "with" "yield" ;; Not real keywords, but close enough to be fontified as suc= h - "self" "True" "False") + "self" "True" "False" + ;; Python 3 + "nonlocal") symbol-end) (,(rx symbol-start "None" symbol-end) ; see =C2=A7 Keywords in 2.7 man= ual From debbugs-submit-bounces@debbugs.gnu.org Fri May 13 08:29:44 2011 Received: (at 8639) by debbugs.gnu.org; 13 May 2011 12:29:44 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QKrV1-0002B4-Ss for submit@debbugs.gnu.org; Fri, 13 May 2011 08:29:44 -0400 Received: from smtp.mail.umich.edu ([141.211.14.82] helo=hellskitchen.mr.itd.umich.edu) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QKrUz-0002Ar-MF for 8639@debbugs.gnu.org; Fri, 13 May 2011 08:29:42 -0400 Received: FROM laptop.stevechapel.com (stevechapel.com [69.11.220.126]) By hellskitchen.mr.itd.umich.edu ID 4DCD242F.15B4A.13720 ; Authuser schapel; 13 May 2011 08:29:35 EDT Message-ID: <4DCD242A.5050807@umich.edu> Date: Fri, 13 May 2011 08:29:30 -0400 From: Steve Chapel User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Thunderbird/3.1.10 MIME-Version: 1.0 To: Juanma Barranquero Subject: Re: bug#8639: 23.2; emacs python mode should colorize nonlocal keyword References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -6.6 (------) X-Debbugs-Envelope-To: 8639 Cc: 8639@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) On 05/11/2011 06:13 PM, Juanma Barranquero wrote: > On Mon, May 9, 2011 at 00:56, Steve Chapel wrote: > >> When editing a Python source file, the nonlocal keyword is not colorized >> as are other keywords. > It's easy to fix (see below), but "nonlocal" is a Python 3.X keyword, > and python-mode does not really support Python 3 at this point, so I > suppose that's not the only inconvenience you find when editing Python > 3 code. I've programmed thousands of lines of Python 3 code over the past year, nearly exclusively in emacs, and this is the only problem I've noticed. Perhaps there are others I'm not aware of. Thanks for the patch! -- Steve From debbugs-submit-bounces@debbugs.gnu.org Fri May 13 08:46:35 2011 Received: (at 8639-done) by debbugs.gnu.org; 13 May 2011 12:46:36 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QKrlL-0002bW-FP for submit@debbugs.gnu.org; Fri, 13 May 2011 08:46:35 -0400 Received: from mail-yw0-f44.google.com ([209.85.213.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QKrlJ-0002bI-Pn for 8639-done@debbugs.gnu.org; Fri, 13 May 2011 08:46:34 -0400 Received: by ywi6 with SMTP id 6so879155ywi.3 for <8639-done@debbugs.gnu.org>; Fri, 13 May 2011 05:46:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=kwyKCUNGtRRDbEsjzUPYRyFSjxX/06io1pjWkCPvXmc=; b=ACKNGRD8J3cSNh5kGADS+BbUDOHSMEXPYSooHSskh1ShUC4/k3BTTHS6PdyepyC7OC g6QqIgzYD/6DuCSleP5hTAUYy3YN1fil9x1iRFl21rpyIAHIiw+v/CR2RXU3Kd4EaUg1 +qnmOgFtNOJ9xL/lkAy8cQCo4psC7yZqFbKlI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=PPt/efyrvT2JyOb51ETqVtv4sTm0dcSix8S0FbCJJhwsku6etPxdG+BEvMId0R+rrO U+JycRb0+VOfvMne3vQbyhcSkno8yMrM2OIjqQxsFriB2X5kuY+VicNREVzeq4IEEMmM 2bW3AwTwl+WsAfmFZYGGsG6iYgr98yjQTuIbI= Received: by 10.236.77.196 with SMTP id d44mr1296831yhe.469.1305290788079; Fri, 13 May 2011 05:46:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.147.167.11 with HTTP; Fri, 13 May 2011 05:45:48 -0700 (PDT) In-Reply-To: <4DCD242A.5050807@umich.edu> References: <4DCD242A.5050807@umich.edu> From: Juanma Barranquero Date: Fri, 13 May 2011 14:45:48 +0200 Message-ID: Subject: Re: bug#8639: 23.2; emacs python mode should colorize nonlocal keyword To: Steve Chapel Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -3.3 (---) X-Debbugs-Envelope-To: 8639-done Cc: 8639-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.3 (---) On Fri, May 13, 2011 at 14:29, Steve Chapel wrote: > I've programmed thousands of lines of Python 3 code over the past year, > nearly exclusively in emacs, and this is the only problem I've noticed. > Perhaps there are others I'm not aware of. OK, the patch is tiny and harmless and won't hinder any future work to adapt to Python 3, so I've committed it to the emacs-23 branch. =C2=A0 =C2=A0 Juanma From unknown Wed Jun 18 22:58:21 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 11 Jun 2011 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator