From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: superbobry Newsgroups: gmane.emacs.help Subject: Re: python setup ? Date: Tue, 28 Apr 2009 04:25:28 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <8bc963be-70e6-44c8-bd3e-bed3cbbc22d7@u9g2000pre.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1240918863 19413 80.91.229.12 (28 Apr 2009 11:41:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Apr 2009 11:41:03 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 28 13:40:54 2009 Return-path: Envelope-to: geh-help-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 1Lylg4-000579-Bt for geh-help-gnu-emacs@m.gmane.org; Tue, 28 Apr 2009 13:40:44 +0200 Original-Received: from localhost ([127.0.0.1]:51622 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lylg3-0007Lp-Rt for geh-help-gnu-emacs@m.gmane.org; Tue, 28 Apr 2009 07:40:43 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!z23g2000prd.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 60 Original-NNTP-Posting-Host: 88.201.234.242 Original-X-Trace: posting.google.com 1240917929 7251 127.0.0.1 (28 Apr 2009 11:25:29 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 28 Apr 2009 11:25:29 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z23g2000prd.googlegroups.com; posting-host=88.201.234.242; posting-account=-1kA_woAAACqD2nSiHPcFd2kGWR-l3rw User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.9) Gecko/2009042211 GranParadiso/3.0.9,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:168802 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:64075 Archived-At: On Apr 28, 2:43=A0pm, Bernardo wrote: > > Hello, > > Can anyone help me with python code folding please? I tried: > > * hs-minor-mode (doesn't work with python) > > * outline mode (it does the folding part, but is really buggy with > > python) > > > Is there a solution? > > Thank you, > > Sergei > > hi, > > which version of Emacs are you using? > i remember there was a hideshow problem introduced somewhere after v22.1 > and i added this 'quick-n-dirty' hack into my .emacs > > (defun bb-python-hs-helper (arg) > =A0 =A0"Helper function for the bb-use-old-hideshow-setting below" > =A0 =A0(python-end-of-defun) > =A0 =A0(skip-chars-backward " \t\n")) > > (defun bb-use-old-hideshow-setting () > =A0 =A0"Restore the hs-special-modes-alist setting that used to work fine= in > v22.1.1" > =A0 =A0(if (and (=3D emacs-major-version 22) > =A0 =A0 =A0 =A0 =A0 =A0 (>=3D emacs-minor-version 2)) > =A0 =A0 =A0 =A0(progn > =A0 =A0 =A0 =A0 =A0(setq hs-special-modes-alist > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(assq-delete-all 'python-mode =A0hs-specia= l-modes-alist)) > =A0 =A0 =A0 =A0 =A0(add-to-list 'hs-special-modes-alist > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 '(python-mode "^\\s-*def\\>" = nil "#" > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 b= b-python-hs-helper > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 n= il))))) > > (add-hook 'python-mode-hook > =A0 =A0(lambda () > =A0 =A0 =A0(hs-minor-mode 1) > =A0 =A0 =A0(bb-use-old-hideshow-setting) > =A0 =A0 =A0;other stuff > =A0 =A0 =A0)) > > this fixed the folding problem in v22.3 but may or may not help with > your issue > > however, version pre-23 seems to work without this ugly hack > > HTH Hello, I'm using 23.0 from, built from cvs. I tryed the hack above already, and it wasnt working 100% with me. Anyway, i managed to solve the problem using semantic (from CEDET tools). Cheers, Sergei