Merge lp:~freiksenet/python-mode/hide-show-support into lp:python-mode

Proposed by Mikhail Novikov on 2009-09-27
Status: Merged
Approved by: Andreas Roehler on 2010-01-18
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~freiksenet/python-mode/hide-show-support
Merge into: lp:python-mode
Diff against target: 41 lines
1 file modified
python-mode.el (+24/-0)
To merge this branch: bzr merge lp:~freiksenet/python-mode/hide-show-support
Reviewer Review Type Date Requested Status
Barry Warsaw code 2009-09-27 Needs Information on 2010-01-15
Review via email: mp+12493@code.launchpad.net

Commit message

add support for hide-show hs-minor-mode

To post a comment you must log in.
Mikhail Novikov (freiksenet) wrote :

Fixed the XEmacs bug, seems to work alright now.

Barry Warsaw (barry) wrote :

Could you please open a bug that describes the exact problem, and link the bug to this branch? It's not clear to me what this is trying to fix.

review: Needs Information (code)
Mikhail Novikov (freiksenet) wrote :

> Could you please open a bug that describes the exact problem, and link the bug
> to this branch? It's not clear to me what this is trying to fix.

Hello!

This bug was inside this particular branch, not inside python-mode. Branch itself is dedicated to make hideshow mode work with python-mode.

Best regards, Mikhail

Barry Warsaw (barry) wrote :

From <email address hidden>:

"reconsidered these stuff, it's not ready for merge now.

Intend coming up with a new approach.

Is there a way to remove the merge-proposal? Should I delete the whole branch rather?"

Barry Warsaw (barry) wrote :

Oops, that was the wrong branch. Andreas, please review this branch yourself and mark it approved if you want. Then merge this branch and push it.

Andreas Roehler (a-roehler) wrote :

Barry Warsaw wrote:
> Oops, that was the wrong branch. Andreas, please review this branch yourself and mark it approved if you want. Then merge this branch and push it.

OK, merged locally. Got

" M python-mode.el
All changes applied successfully."

Seems I have to do a commit still.
After this: push into the trunk?

Andreas

Barry Warsaw (barry) wrote :

On Jan 18, 2010, at 2:43 AM, Andreas Roehler wrote:

> Barry Warsaw wrote:
>> Oops, that was the wrong branch. Andreas, please review this branch yourself and mark it approved if you want. Then merge this branch and push it.
>
> OK, merged locally. Got
>
> " M python-mode.el
> All changes applied successfully."
>
> Seems I have to do a commit still.
> After this: push into the trunk?

Correct.

Uses --fixes when you do a commit (see 'bzr help commit') and attach the bug number. Then when you push, Launchpad should update all the data.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'python-mode.el'
2--- python-mode.el 2009-03-20 01:37:21 +0000
3+++ python-mode.el 2009-09-27 18:55:18 +0000
4@@ -375,6 +375,21 @@
5 :type 'boolean
6 :group 'python)
7
8+(defcustom py-hide-show-keywords '(
9+ "class" "def" "elif" "else" "except"
10+ "for" "if" "while" "finally" "try"
11+ "with"
12+ )
13+ "*Keywords that can be hiden by hide-show"
14+ :type '(repeat string)
15+ :group 'python)
16+
17+(defcustom py-hide-show-hide-docstrings t
18+ "*Controls if doc strings can be hiden by hide-show"
19+ :type 'boolean
20+ :group 'python)
21+
22+
23
24
25 ;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26 ;; NO USER DEFINABLE VARIABLES BEYOND THIS POINT
27@@ -1225,6 +1240,15 @@
28 (if (fboundp 'imenu-add-to-menubar)
29 (imenu-add-to-menubar (format "%s-%s" "IM" mode-name)))
30 )
31+
32+ ;; Add support for HideShow
33+ (add-to-list 'hs-special-modes-alist (list
34+ 'python-mode (concat (if py-hide-show-hide-docstrings "^\\s-*\"\"\"\\|" "") (mapconcat 'identity (mapcar #'(lambda (x) (concat "^\\s-*" x "\\>")) py-hide-show-keywords ) "\\|")) nil "#"
35+ (lambda (arg)
36+ (py-goto-beyond-block)
37+ (skip-chars-backward " \t\n"))
38+ nil))
39+
40 ;; Run the mode hook. Note that py-mode-hook is deprecated.
41 (if python-mode-hook
42 (run-hooks 'python-mode-hook)

Subscribers

People subscribed via source and target branches

to status/vote changes: