all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Leo Alekseyev <dnquark@gmail.com>
To: Tassilo Horn <tassilo@member.fsf.org>, help-gnu-emacs@gnu.org
Subject: Re: Narrow/widen in folding.el
Date: Wed, 22 Dec 2010 01:14:12 -0800	[thread overview]
Message-ID: <AANLkTikU4UDNXO6zbkHj5cViKQAT1ROOJaV9BTEAono-@mail.gmail.com> (raw)
In-Reply-To: <87zkryz0h0.fsf@member.fsf.org>

>> Now I remember I also tried to do something like this some time ago,
>> but I couldn't stand the fact that I had to use a special syntax for
>> it.
>
> That's what I like with `outline-minor-mode' and my config (i.e. outline
> headings are `comment-start' + one or many *s).  You would comment your
> code anyway (I hope so!), and adding a few * to make a comment a
> headline to make the structure of the file visible is worth it.
>
> But I agree, that I don't like folding.el's obtrusive {{{ ... }}}
> syntax, too.


Hi Tassilo; thanks for the code snippet in your previous message.  In
fact, I had started using outline-minor-mode just in the way you
described, but I manually set up the regexes for the few languages
where I used it, so your code will definitely come in handy.

The problem with this approach, though, is the overly rigid structure:
the end of one fold is necessarily the beginning of another fold.  For
some use cases, it works rather well.  Sometimes, however, I simply
want a piece of text folded without it being logically tied to any
hierarchy.  For instance, I want to hide a header or a footer, or a
long block of commented text in the middle of the document, etc.  In
org-mode, you can achieve this effect by using "drawers", where you
have e.g. a mark-up like :DETAILS: <long block of folding/unfolding
text here> :END:.  In fact, if someone ported that functionality to
outline-minor-mode, I'd probably use that.  Failing this, folding.el
is a good option.  Unfortunately, this brings us back to the original
issue -- folding.el's annoying narrow/widen behavior in isearch.  I am
still hoping someone familiar with folding.el might help clarify the
issue :)

In general, I would say that folding behavior is one area where Emacs
could improve.  If you do a search, you'll find lots of people on
StackOverflow and other forums trying to figure out folding in Emacs.
The problem is the fragmentation of folding mechanisms, and the fact
that each has limits, drawbacks, and/or bugs.  This is remedied to a
point by using fold-dwim, and the new fold-dwim-org.  However, my pipe
dream is that someone will write a end-all folding mode that will roll
into it functionality that's currently scattered across outline minor
mode, folding.el, hideshow, and various enhancements of the above
(hideshow-org, fold-dwim, etc.)

It would probably make the most sense to merge the functionality of
folding.el into outline-minor-mode, and set it up with org bindings,
possibly through fold-dwim-org.  Code folding could be done with
hideshow, although CEDET's folding might be a better option at this
point...

--Leo



  parent reply	other threads:[~2010-12-22  9:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-20 21:41 Narrow/widen in folding.el Leo Alekseyev
2010-12-21 17:24 ` Andrea Crotti
2010-12-21 18:42   ` Tassilo Horn
2010-12-21 22:00     ` Andrea Crotti
2010-12-22  8:16       ` Tassilo Horn
2010-12-22  9:01         ` Andrea Crotti
2010-12-22  9:14         ` Leo Alekseyev [this message]
2010-12-22 11:02           ` Tassilo Horn
2010-12-22 12:26             ` Leo Alekseyev
     [not found]         ` <mailman.7.1293008512.15562.help-gnu-emacs@gnu.org>
2010-12-23 23:49           ` Tim X
2010-12-25  2:18     ` Leo Alekseyev
2010-12-25  3:08       ` Leo Alekseyev
2010-12-25  4:45     ` Leo Alekseyev
     [not found]     ` <mailman.9.1293252343.14161.help-gnu-emacs@gnu.org>
2010-12-25 22:48       ` Tim X
2010-12-27  9:19         ` Tassilo Horn
     [not found]         ` <mailman.0.1293441599.18751.help-gnu-emacs@gnu.org>
2010-12-27 22:37           ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTikU4UDNXO6zbkHj5cViKQAT1ROOJaV9BTEAono-@mail.gmail.com \
    --to=dnquark@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=tassilo@member.fsf.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.