unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* python.el -- support for the with statement
@ 2007-04-18  4:10 Edward O'Connor
  2007-05-08  3:18 ` Stefan Monnier
  0 siblings, 1 reply; 7+ messages in thread
From: Edward O'Connor @ 2007-04-18  4:10 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 295 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: add support for the with statement to python.el --]
[-- Type: text/x-patch, Size: 1333 bytes --]

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)

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: python.el -- support for the with statement
  2007-04-18  4:10 python.el -- support for the with statement Edward O'Connor
@ 2007-05-08  3:18 ` Stefan Monnier
  2007-05-08 21:13   ` Richard Stallman
  2007-05-09  4:36   ` Michael Olson
  0 siblings, 2 replies; 7+ messages in thread
From: Stefan Monnier @ 2007-05-08  3:18 UTC (permalink / raw)
  To: Edward O'Connor; +Cc: emacs-devel

> 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. :)

This looks good, but I'm not sure I can install it as-is: I see you have
signed an assignment for all the code related to ERC, but not to Emacs.
We already have some tiny changes of yours installed (some of it installed
into viper but not marked as tiny, presumably because they have to do with
ERC).  Richard, can you check this situation?

If the viper stuff is indeed covered by his ERC assignment, then this
python.el change can definitely go in as a "tiny change", but otherwise I'm
not so sure.  Maybe we'd be better off asking for an assignment for the
whole of Emacs and be done with it.


        Stefan


> -- 
> Edward O'Connor
> hober0@gmail.com

> 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)

> _______________________________________________
> Emacs-devel mailing list
> Emacs-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: python.el -- support for the with statement
  2007-05-08  3:18 ` Stefan Monnier
@ 2007-05-08 21:13   ` Richard Stallman
  2007-05-09  4:36   ` Michael Olson
  1 sibling, 0 replies; 7+ messages in thread
From: Richard Stallman @ 2007-05-08 21:13 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: hober0, emacs-devel

These changes are so tiny that they are ok.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: python.el -- support for the with statement
  2007-05-08  3:18 ` Stefan Monnier
  2007-05-08 21:13   ` Richard Stallman
@ 2007-05-09  4:36   ` Michael Olson
  2007-05-09 14:17     ` Stefan Monnier
  2007-05-09 16:34     ` Edward O'Connor
  1 sibling, 2 replies; 7+ messages in thread
From: Michael Olson @ 2007-05-09  4:36 UTC (permalink / raw)
  To: emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 865 bytes --]

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> If the viper stuff is indeed covered by his ERC assignment, then this
> python.el change can definitely go in as a "tiny change", but otherwise I'm
> not so sure.  Maybe we'd be better off asking for an assignment for the
> whole of Emacs and be done with it.

His viper changes were all ERC-related, and should be covered by the
ERC assignment -- we even distribute the changes with the version of
ERC that is separate from Emacs as "erc-viper.el".

-- 
Michael Olson -- FSF Associate Member #652 -- http://www.mwolson.org/
Interests: Lisp, text markup, protocols -- Jabber: mwolson_at_hcoop.net
  /` |\ | | | Projects: Emacs, Muse, ERC, EMMS, Planner, ErBot, DVC
 |_] | \| |_| Reclaim your digital rights by eliminating DRM.
      See http://www.defectivebydesign.org/what_is_drm for details.

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: python.el -- support for the with statement
  2007-05-09  4:36   ` Michael Olson
@ 2007-05-09 14:17     ` Stefan Monnier
  2007-05-09 16:34     ` Edward O'Connor
  1 sibling, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2007-05-09 14:17 UTC (permalink / raw)
  To: Michael Olson; +Cc: emacs-devel

> His viper changes were all ERC-related, and should be covered by the
> ERC assignment -- we even distribute the changes with the version of
> ERC that is separate from Emacs as "erc-viper.el".

OK, great, thanks,


        Stefan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: python.el -- support for the with statement
  2007-05-09  4:36   ` Michael Olson
  2007-05-09 14:17     ` Stefan Monnier
@ 2007-05-09 16:34     ` Edward O'Connor
  2007-05-09 16:56       ` Stefan Monnier
  1 sibling, 1 reply; 7+ messages in thread
From: Edward O'Connor @ 2007-05-09 16:34 UTC (permalink / raw)
  To: emacs-devel

>> If the viper stuff is indeed covered by his ERC assignment, then this
>> python.el change can definitely go in as a "tiny change", but
>> otherwise I'm not so sure. Maybe we'd be better off asking for an
>> assignment for the whole of Emacs and be done with it.
>
> His viper changes were all ERC-related, and should be covered by the
> ERC assignment -- we even distribute the changes with the version of
> ERC that is separate from Emacs as "erc-viper.el".

Right, exactly -- erc-viper.el contains the same Viper alterations, but
as monkey-patches.


Ted

-- 
Edward O'Connor
hober0@gmail.com

Ense petit placidam sub libertate quietem.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: python.el -- support for the with statement
  2007-05-09 16:34     ` Edward O'Connor
@ 2007-05-09 16:56       ` Stefan Monnier
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2007-05-09 16:56 UTC (permalink / raw)
  To: Edward O'Connor; +Cc: emacs-devel

>>> If the viper stuff is indeed covered by his ERC assignment, then this
>>> python.el change can definitely go in as a "tiny change", but
>>> otherwise I'm not so sure. Maybe we'd be better off asking for an
>>> assignment for the whole of Emacs and be done with it.
>> 
>> His viper changes were all ERC-related, and should be covered by the
>> ERC assignment -- we even distribute the changes with the version of
>> ERC that is separate from Emacs as "erc-viper.el".

> Right, exactly -- erc-viper.el contains the same Viper alterations, but
> as monkey-patches.

OK, thanks.  I just installed your patch,


        Stefan

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-05-09 16:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-18  4:10 python.el -- support for the with statement Edward O'Connor
2007-05-08  3:18 ` Stefan Monnier
2007-05-08 21:13   ` Richard Stallman
2007-05-09  4:36   ` Michael Olson
2007-05-09 14:17     ` Stefan Monnier
2007-05-09 16:34     ` Edward O'Connor
2007-05-09 16:56       ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).