[Python-mode] hide-show support enabled with python-mode.el

2009-09-29 Thread Andreas Röhler
Thanks for contribution!

Andreas
--- Begin Message ---
  User: aroehler
  Date: 09/09/29 12:18:50

  Modified:packages/xemacs-packages/python-modes python-mode.el
Log:
Add support for HideShow

Mikhail Novikov  delivered this patch at
https://code.launchpad.net/~freiksenet/python-mode/hide-show-support
It enables hs-minor-mode within python-mode.

Revision  ChangesPath
4.56  +21 -0 XEmacs/packages/xemacs-packages/python-modes/python-mode.el

Index: python-mode.el
===
RCS file: 
/pack/xemacscvs/XEmacs/packages/xemacs-packages/python-modes/python-mode.el,v
retrieving revision 4.55
retrieving revision 4.56
diff -u -p -r4.55 -r4.56
--- python-mode.el  2009/09/28 10:44:10 4.55
+++ python-mode.el  2009/09/29 10:18:49 4.56
@@ -366,6 +366,18 @@ to select the appropriate python interpr
   :type 'boolean
   :group 'python)
 
+(defcustom py-hide-show-keywords '("class" "def" "elif" "else" "except"
+ "for" "if" "while" "finally" "try" "with")
+  "*Keywords used by hide-show"
+:type '(repeat string)
+:group 'python)
+
+(defcustom py-hide-show-hide-docstrings t
+  "*If doc strings shall be hidden"
+:type 'boolean
+:group 'python)
+
+
 
 ;; 
 ;; NO USER DEFINABLE VARIABLES BEYOND THIS POINT
@@ -1216,6 +1228,15 @@ py-beep-if-tab-change\t\tring the bell i
 (if (fboundp 'imenu-add-to-menubar)
 (imenu-add-to-menubar (format "%s-%s" "IM" mode-name)))
 )
+
+  ;; Add support for HideShow
+  (add-to-list 'hs-special-modes-alist (list
+   'python-mode (concat (if py-hide-show-hide-docstrings 
"^\\s-*\"\"\"\\|" "") (mapconcat 'identity (mapcar #'(lambda (x) (concat 
"^\\s-*" x "\\>")) py-hide-show-keywords ) "\\|")) nil "#"
+   (lambda (arg)
+ (py-goto-beyond-block)
+ (skip-chars-backward " \t\n"))
+   nil))
+  
   ;; Run the mode hook.  Note that py-mode-hook is deprecated.
   (if python-mode-hook
   (run-hooks 'python-mode-hook)



___
XEmacs-CVS mailing list
xemacs-...@calypso.tux.org
http://calypso.tux.org/mailman/listinfo/xemacs-cvs

--- End Message ---
___
Python-mode mailing list
Python-mode@python.org
http://mail.python.org/mailman/listinfo/python-mode


Re: [Python-mode] Pymacs on GitHub (fwd)

2009-09-29 Thread Andreas Roehler


Hi Skip,

thats interesting indeed.

Setting up an appropriate state-of-the-art
(X)Emacs python-environement is an issue requested again and
again by users but not delivered until yet.

What about to include these and some other useful
stuff into XEmacs python-modes?

Then provide an installer, to that Python-Folks must
not learn Emacs-Lisp first?

Shouldn't the XEmacs packages system deliver the needed
utils for such a task?

Andreas

--
https://code.launchpad.net/s-x-emacs-werkstatt/
http://bazaar.launchpad.net/~a-roehler/python-mode/python-mode.el/






s...@pobox.com wrote:
> Thought python-mode folks might find this announcement at least peripherally
> interesting since it involves Python/Emacs integration.
> 
> Skip
> 
> 
> 
> 
> 
> Subject:
> Pymacs on GitHub
> From:
> François Pinard 
> Date:
> Mon, 28 Sep 2009 08:07:59 -0400
> To:
> Pymacs people 
> 
> To:
> Pymacs people 
> 
...

> Hi, people.
> 
> This quick hello to say I pushed the Pymacs repository to GitHub.  See
> http://github.com/pinard/Pymacs
> 
> I would like to experiment with these facilities for a while.  There is
> an issue tracker and a wiki, and I wonder if we should use them.  If
> not, better deactivate their tabs early, so people do not get tempted to
> rely on them.
> 
> The advantages of such maintainer toys are well known, there is
> presumably no need to repeat them.  But I have a few cons, that I'd like
> to explicit a bit here, seeking for opinions or advice.
> 
> All issues and wiki pages should ideally be bulk-copyable elsewhere,
> would the inclination arise.  I would not like feeling tied to GitHub,
> the same I once felt tied to Sourceforge.  Git gives us the freedom of
> having usable clones of Pymacs sources outside GitHub, and the GitHub
> copy is just a clone among others.  I would ideally seek the same
> freedom for other services.
> 
> Hopefully, issues and wiki pages keep history.  Another point is
> protection, if any, against spam.  I had a Wiki, not so long ago, that I
> ended up deactivating, as I find neither pleasure nor time, really,
> playing games with defacers.
> 
> If the issue is attractive enough (it surely looks simple), I might be
> tempted to upload a few pending issues to it, and I wonder if and how I
> should mask email addresses of submitters, or otherwise, and how to
> establish some kind of links so I could retrieve the original
> information if needed.  My intuition tells me it works more nicely for
> submitters already having a GitHub account, but I do not know yet.  I
> have a strong point against issue trackers in that maintainers should
> never force them upon users, but this implies that maintainers could be
> able to easily manage issues coming from other means — email being the
> most common.
> 
> GitHub wiki, well, that's yet another markup language to learn.  It's a
> bit sad each wiki has its own.  Also, I much enjoy the ease by which
> Tomboy allows me to maintain a lot of notes, a few of them for Pymacs. 
> It would be fun for me to have some form of inter-operability between
> Wiki pages and Tomboy notes — I wonder how easy it would be for me to
> organize.
> 
> A final point would be to document the GitHub facilities we choose to
> retain for use in the current Pymacs sites, and cross-link everything
> appropriately, so the whole stays nice, usable and elegant enough.
> 
___
Python-mode mailing list
Python-mode@python.org
http://mail.python.org/mailman/listinfo/python-mode


Re: [Python-mode] Pymacs on GitHub (fwd)

2009-09-29 Thread skip

Andreas> What about to include these and some other useful stuff into
Andreas> XEmacs python-modes?

What about rewriting python-mode using Pymacs?

Sorry, I don't know how to answer your other questions.

Skip
___
Python-mode mailing list
Python-mode@python.org
http://mail.python.org/mailman/listinfo/python-mode


Re: [Python-mode] Pymacs on GitHub (fwd)

2009-09-29 Thread Barry Warsaw
I'm not a fan of git, especially when there are two viable Python- 
based DVCS's (and I'm biased about which one of those I prefer of  
course :).


On Sep 29, 2009, at 1:29 PM, s...@pobox.com wrote:



   Andreas> What about to include these and some other useful stuff  
into

   Andreas> XEmacs python-modes?

What about rewriting python-mode using Pymacs?


I would not be in favor of that.  While I think Pymacs is very cool  
stuff, I view python-mode.el as lower-level, and it should remain pure  
elisp, at least to handle the basics of editing Python code.  It would  
be interesting to explore add-ons and extensions though that take  
advantage of Pymacs for more advanced, IDE-like stuff.  Let's keep  
python-mode.el itself simple though.


-Barry



PGP.sig
Description: This is a digitally signed message part
___
Python-mode mailing list
Python-mode@python.org
http://mail.python.org/mailman/listinfo/python-mode