From: Bernardo <bernardo.bacic@pobox.com>
To: help-gnu-emacs@gnu.org
Subject: Re: python setup ?
Date: Tue, 28 Apr 2009 20:43:00 +1000 [thread overview]
Message-ID: <49F6DDB4.9080908@pobox.com> (raw)
In-Reply-To: <8bc963be-70e6-44c8-bd3e-bed3cbbc22d7@u9g2000pre.googlegroups.com>
> 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
next prev parent reply other threads:[~2009-04-28 10:43 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.6045.1240741475.31690.help-gnu-emacs@gnu.org>
2009-04-26 11:25 ` python setup ? Richard Riley
2009-04-26 13:16 ` Richard Riley
2009-04-27 7:42 ` Andreas Röhler
[not found] ` <mailman.6094.1240818145.31690.help-gnu-emacs@gnu.org>
2009-04-27 8:53 ` Richard Riley
2009-04-27 11:08 ` Andreas Röhler
[not found] ` <mailman.6098.1240830481.31690.help-gnu-emacs@gnu.org>
2009-04-27 11:15 ` Richard Riley
2009-04-27 13:50 ` thierry.volpiatto
[not found] ` <mailman.6107.1240840677.31690.help-gnu-emacs@gnu.org>
2009-04-27 14:12 ` Richard Riley
2009-04-27 15:23 ` thierry.volpiatto
[not found] ` <mailman.6113.1240846261.31690.help-gnu-emacs@gnu.org>
2009-04-28 0:55 ` superbobry
2009-04-28 10:43 ` Bernardo [this message]
[not found] ` <mailman.6165.1240915318.31690.help-gnu-emacs@gnu.org>
2009-04-28 11:25 ` superbobry
2009-04-27 8:58 ` Richard Riley
2009-04-27 11:20 ` Andreas Röhler
[not found] ` <49f5b71c.0305560a.6147.25ed@mx.google.com>
2009-05-08 9:16 ` Andreas Röhler
[not found] ` <mailman.6842.1241774145.31690.help-gnu-emacs@gnu.org>
2009-05-08 16:36 ` Richard Riley
2009-05-01 21:35 ` bbbscarter
[not found] <200904280634.n3S6YctW009278@zogzog.maillard.mobi>
2009-04-30 7:25 ` Andreas Röhler
2009-04-30 13:24 ` Barry Warsaw
2009-05-04 16:57 ` Richard Riley
2009-04-29 22:25 Xavier Maillard
-- strict thread matches above, loose matches on Subject: below --
2009-04-29 22:25 Xavier Maillard
2009-04-30 5:42 ` Andreas Röhler
[not found] <mailman.6159.1240901979.31690.help-gnu-emacs@gnu.org>
2009-04-28 16:56 ` Richard Riley
2009-05-13 21:05 ` Piet van Oostrum
[not found] <mailman.6155.1240900544.31690.help-gnu-emacs@gnu.org>
2009-04-28 16:55 ` Richard Riley
2009-04-28 6:34 Xavier Maillard
2009-04-28 6:34 Xavier Maillard
2009-04-28 6:34 Xavier Maillard
2009-04-28 8:04 ` thierry.volpiatto
2009-04-28 6:34 Xavier Maillard
2009-04-28 6:42 ` thierry.volpiatto
2009-04-28 8:51 ` Andreas Röhler
2009-04-26 10:25 Xavier Maillard
2009-04-26 11:29 ` thierry.volpiatto
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49F6DDB4.9080908@pobox.com \
--to=bernardo.bacic@pobox.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).