[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to expertly fold perl or other scripting code.
From: |
Harry Putnam |
Subject: |
Re: How to expertly fold perl or other scripting code. |
Date: |
Sun, 20 Sep 2009 12:24:05 -0500 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.50 (gnu/linux) |
[...]
Andreas wrote:
>> M-x outline-minor-mode RET
>> C-c @ C-t
>>
>> For a start...
Bernardo replied:
> i never investigated what is the difference between outline-minor-mode
> and hs-minor-mode but the later is also a possibility
>
> (they seem to be defined in different files but the commands have the
> same prefix key, C-c @)
TimX replied:
[...]
>> I personally find outline of limited use when it comes to folding
>> code. However, there are a few folding modes out there (check the emacs
>> wiki). I use an old mode called folding.el (which is bundled in the
>> emacs-goodies debian package. It works quite well, is easy to install
>> and provides good functionality.
>>>
>>>Tim
Wang replied:
> After reading these from folding.el, I decided to use hs-minor-mode.
>
> ;;
> ;; Please note, that the maintainers do not recommend to use only
> ;; folding for you your code layout and navigation. Folding.el is
> ;; on its best when it can "chunk" large sections of code inside
> ;; folds. The larger the chunks, the more the usability of
> ;; folding will increase. Folding.el is not meant to hide
> ;; individual functions: you may be better served by hideshow.el
> ;; or imenu.el (which can parse the function indexes)
Good input... thanks.
hs-minor-mode, on first blush looks to be what I'm after. However I've
been unable to byte-compile folding.el offered on emacs-wiki... so
once I've got it to byte-compile... I might like it better... but for
now hs-minor-mode seems to do what I had in mind.
Especially after changing a couple of those really awkward keybindings
with `@' in the middle.
Changing: C-c @ c-s to C-c s (hs-show-block)
C-c @ c-h to C-c h (hs-hide-block)
Seems not to collide with anything when in cperl-mode at least.
Buy maybe it will be a problem somewhere else.