unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Harry Putnam <reader@newsguy.com>
To: help-gnu-emacs@gnu.org
Subject: Re: How to expertly fold perl or other scripting code.
Date: Sun, 20 Sep 2009 12:24:05 -0500	[thread overview]
Message-ID: <87pr9lfs22.fsf@newsguy.com> (raw)
In-Reply-To: 4AB58909.5070408@pobox.com

[...]

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.





  reply	other threads:[~2009-09-20 17:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-19 21:58 How to expertly fold perl or other scripting code Harry Putnam
2009-09-19 23:16 ` Andreas Politz
2009-09-20  1:44   ` Bernardo
2009-09-20 17:24     ` Harry Putnam [this message]
2009-09-20 22:31       ` Wang Lei
     [not found] ` <mailman.7073.1253402286.2239.help-gnu-emacs@gnu.org>
2009-09-20  4:01   ` Tim X
2009-09-20  5:22     ` Wang Lei
2009-09-20 16:36     ` Harry Putnam
     [not found]     ` <mailman.7099.1253464623.2239.help-gnu-emacs@gnu.org>
2009-09-21  7:51       ` Tim X

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=87pr9lfs22.fsf@newsguy.com \
    --to=reader@newsguy.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).