From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Edward O'Connor Newsgroups: gmane.emacs.devel Subject: python.el -- support for the with statement Date: Wed, 18 Apr 2007 00:10:23 -0400 Organization: Church of Emacs Message-ID: <86d5228gr4.fsf@rakim.cfhp.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1176869455 4921 80.91.229.12 (18 Apr 2007 04:10:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 18 Apr 2007 04:10:55 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 18 06:10:49 2007 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.50) id 1He1VI-0004Iv-7r for ged-emacs-devel@m.gmane.org; Wed, 18 Apr 2007 06:10:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1He1a4-0006Hk-Si for ged-emacs-devel@m.gmane.org; Wed, 18 Apr 2007 00:15:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1He1a0-0006HN-7Z for emacs-devel@gnu.org; Wed, 18 Apr 2007 00:15:40 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1He1Zx-0006B4-Nu for emacs-devel@gnu.org; Wed, 18 Apr 2007 00:15:38 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1He1Zx-0006Aw-Jn for emacs-devel@gnu.org; Wed, 18 Apr 2007 00:15:37 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1He1V9-000432-Ow for emacs-devel@gnu.org; Wed, 18 Apr 2007 00:10:39 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1He1V1-0006ft-Bq for emacs-devel@gnu.org; Wed, 18 Apr 2007 06:10:31 +0200 Original-Received: from rakim.cfhp.org ([69.45.6.105]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 18 Apr 2007 06:10:31 +0200 Original-Received: from hober0 by rakim.cfhp.org with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 18 Apr 2007 06:10:31 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 57 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: rakim.cfhp.org Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAHlBMVEX47PoBAAegiLwiH1N IQYI0M4iMeKYBAAYGBBGqm9JF4g0mAAACYElEQVR4nGWTsY/aMBTGLXoLo8WQjNVrFJXxzviUbig JEcy5SNft5LhRGT3RNecUuRuiCMn/bZ+dhHDqJ2SZ7+f3nt/DEMOcqv9E9AdQTsD7fPw6hRIz+iw xxuhbMBn3SUtRofk95CTa9D49UIWiRvt4TnTiNmUbHIIDykUxdwm8lTvQUmergwoCpXR/qwojXqk 7jTEK1xANXhKOgD8eRmHggrt2CNKKtfcAU3EHkCbB5OJn4Ws40Prco6jhAyiDoSyeTrAb1gNe+dI eKNVlpvXNE5+pT6HUIjEi24a8B6XvjSrd0rCon5vCDwX7eA2wvV9bqrPWdCAFZBtfA0tQRWmRsE6 uZCMA6qYHbRDg6I5RlxVSFNCISG56QB3oIBNSRKL+JuLMg9LZlGqIUhCFlH9m8FN74GxFQwEFxKm crWYQJQ680v43TSEGEDArAWLJPVAObN8BHDghhrwcI1RYH2GSLMfiKnzWd6DGx4DvwNc41mIC0QQ WqzgXH0HV+kvVoohvIB5AaHRSyCZHyzawtOd4SBUyXR9lxOb2RB7Sz4T0AB8zY/smvWzRIrN0OQL GcsbW8zf7dY1gfsIlZm66JUsdOK3ljjjNCbnoHuxq9jQnb+TkAa6XY0XyJmf7C1uRwfbk4b0m1tr 8+zljb+ROD0+xA9f4umHP9+CTAAesjfGPWNyBvzCAc5ax/I40CFJPvkQrC/vRP+NsiC58LpGKfWH 7Ppy/JMY8ObK0AJfTRUDTz5eQxHS2VxPlG1697N0ee4qSbjeQ64bjc94Nhex1b+2N5Hn1MoJJwlp pf1Rr7/8DXitGHanPc2gAAAAASUVORK5CYII= X-Attribution: Ted Jabber-ID: hober0@gmail.com User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.3 (berkeley-unix) Cancel-Lock: sha1:iwreMEGmVzBbyiZTiINAdewJJXs= X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:69556 Archived-At: --=-=-= Hi, Attached is a patch for progmodes/python.el to support the with statement (new in Python 2.5). It's been only lightly tested, but Works For Me and is a pretty minimal patch besides. It'd be nice to slip this in before the release if possible. :) Ted -- Edward O'Connor hober0@gmail.com --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=pyel-with-statement.diff Content-Description: add support for the with statement to python.el Index: python.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/progmodes/python.el,v retrieving revision 1.57 diff -u -r1.57 python.el --- python.el 28 Mar 2007 01:21:46 -0000 1.57 +++ python.el 18 Apr 2007 04:07:21 -0000 @@ -96,7 +96,7 @@ "import" "in" "is" "lambda" "not" "or" "pass" "print" "raise" "return" "try" "while" "yield" ;; Future keywords - "as" "None" + "as" "None" "with" ;; Not real keywords, but close enough to be fontified as such "self" "True" "False") symbol-end) @@ -374,7 +374,7 @@ (save-excursion (unless bos (python-beginning-of-statement)) (looking-at (rx (and (or "if" "else" "elif" "while" "for" "def" - "class" "try" "except" "finally") + "class" "try" "except" "finally" "with") symbol-end))))) (defun python-close-block-statement-p (&optional bos) @@ -2236,7 +2236,7 @@ #'python-current-defun) (set (make-local-variable 'outline-regexp) (rx (* space) (or "class" "def" "elif" "else" "except" "finally" - "for" "if" "try" "while") + "for" "if" "try" "while" "with") symbol-end)) (set (make-local-variable 'outline-heading-end-regexp) ":\\s-*\n") (set (make-local-variable 'outline-level) #'python-outline-level) --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --=-=-=--