From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bernardo Newsgroups: gmane.emacs.help Subject: Re: python setup ? Date: Tue, 28 Apr 2009 20:43:00 +1000 Message-ID: <49F6DDB4.9080908@pobox.com> References: <8bc963be-70e6-44c8-bd3e-bed3cbbc22d7@u9g2000pre.googlegroups.com> Reply-To: bernardo.bacic@pobox.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1240915355 7171 80.91.229.12 (28 Apr 2009 10:42:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Apr 2009 10:42:35 +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 12:42:26 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 1Lykld-0007us-KZ for geh-help-gnu-emacs@m.gmane.org; Tue, 28 Apr 2009 12:42:25 +0200 Original-Received: from localhost ([127.0.0.1]:42418 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lyklc-0001Dd-Uu for geh-help-gnu-emacs@m.gmane.org; Tue, 28 Apr 2009 06:42:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LyklB-00017z-3n for help-gnu-emacs@gnu.org; Tue, 28 Apr 2009 06:41:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lykl6-00011M-23 for help-gnu-emacs@gnu.org; Tue, 28 Apr 2009 06:41:56 -0400 Original-Received: from [199.232.76.173] (port=58121 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lykl5-00011A-S0 for help-gnu-emacs@gnu.org; Tue, 28 Apr 2009 06:41:51 -0400 Original-Received: from a-sasl-fastnet.sasl.smtp.pobox.com ([207.106.133.19]:40106 helo=sasl.smtp.pobox.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lykl5-0006ql-Gk for help-gnu-emacs@gnu.org; Tue, 28 Apr 2009 06:41:51 -0400 Original-Received: from localhost.localdomain (unknown [127.0.0.1]) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTP id E91A1AE5F7 for ; Tue, 28 Apr 2009 06:41:46 -0400 (EDT) Original-Received: from [192.168.1.10] (unknown [220.233.188.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTPSA id 411E8AE5F4 for ; Tue, 28 Apr 2009 06:41:45 -0400 (EDT) User-Agent: Thunderbird 2.0.0.21 (X11/20090302) In-Reply-To: <8bc963be-70e6-44c8-bd3e-bed3cbbc22d7@u9g2000pre.googlegroups.com> X-Pobox-Relay-ID: 2C2966AE-33E1-11DE-8594-CABC03BA4B0C-14340206!a-sasl-fastnet.pobox.com X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) 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:64073 Archived-At: > 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) "Helper function for the bb-use-old-hideshow-setting below" (python-end-of-defun) (skip-chars-backward " \t\n")) (defun bb-use-old-hideshow-setting () "Restore the hs-special-modes-alist setting that used to work fine in v22.1.1" (if (and (= emacs-major-version 22) (>= emacs-minor-version 2)) (progn (setq hs-special-modes-alist (assq-delete-all 'python-mode hs-special-modes-alist)) (add-to-list 'hs-special-modes-alist '(python-mode "^\\s-*def\\>" nil "#" bb-python-hs-helper nil))))) (add-hook 'python-mode-hook (lambda () (hs-minor-mode 1) (bb-use-old-hideshow-setting) ;other stuff )) 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