[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: python setup ?
From: |
superbobry |
Subject: |
Re: python setup ? |
Date: |
Tue, 28 Apr 2009 04:25:28 -0700 (PDT) |
User-agent: |
G2/1.0 |
On Apr 28, 2:43 pm, Bernardo <bernardo.ba...@pobox.com> 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)
> "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
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
- Re: python setup ?, (continued)
- Re: python setup ?, Richard Riley, 2009/04/26
- Re: python setup ?, Andreas Röhler, 2009/04/27
- Message not available
- Re: python setup ?, Richard Riley, 2009/04/27
- Re: python setup ?, Andreas Röhler, 2009/04/27
- Message not available
- Re: python setup ?, Richard Riley, 2009/04/27
- Re: python setup ?, thierry . volpiatto, 2009/04/27
- Message not available
- Re: python setup ?, Richard Riley, 2009/04/27
- Re: python setup ?, thierry . volpiatto, 2009/04/27
- Message not available
- Re: python setup ?, superbobry, 2009/04/28
- Re: python setup ?, Bernardo, 2009/04/28
- Message not available
- Re: python setup ?,
superbobry <=
- Message not available
- Re: python setup ?, Richard Riley, 2009/04/27
- Re: python setup ?, Andreas Röhler, 2009/04/27
Re: python setup ?, Xavier Maillard, 2009/04/28
Re: python setup ?, Xavier Maillard, 2009/04/28
Re: python setup ?, Xavier Maillard, 2009/04/28
Re: python setup ?, Xavier Maillard, 2009/04/28
Re: python setup ?, Richard Riley, 2009/04/28