help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: folding-mode question


From: Marc Mientki
Subject: Re: folding-mode question
Date: Wed, 08 Dec 2010 15:30:06 -0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4

Am 25.09.2010 02:58, schrieb Tim X:
> Marc Mientki<mientki@nonet.com>  writes:
>
>> Am 24.09.2010 02:17, schrieb tomer:
>>> On Sep 22, 12:45 pm, Marc Mientki<mien...@nonet.com>   wrote:
>>>> Am 22.09.2010 11:47, schrieb tomer:
>>>>
>>>>> Thanks for the answer I
>>>>> work with a language called "e" (hardware verification langauge) it
>>>>> looks like C but not exactly.
>>>>> am I still able to use hideshow ?
>>>>
>>>> I would simply switch to c-mode and see what happens.
>>>>
>>>> regards
>>>> Marc
>>>
>>> I have tried it is not practical.
>>> the folding is great because it not language related.
>>
>> What would you say what is the benefit of code folding?
>> I've never used folding. After I've tried this out I was so
>> dissapointed. This was never interested to me. My "mystery
>> theory" is that peole who advocate code folding never seen
>> realy good text editor with superb navigation mechanism like
>> Emacs. But maybe I'm wrong and I underrate code folding.
>>
>
> I would say your theory is very weak.

OK. As I've noticed it was only my "mystery theory" ;)


> One reason I liked it was that by using well structured folding markers,
> you could have a screen that showed not only the current code you are
> editing, but also summary information about other bits of code in the
> buffer. This means that often, you could get a quick reminder without
> having to navigate or move from hour current position at all. For
> example, when writing lots of Java code, I used folding mode so that in
> my buffer, I had folding marks that also showed the arguments and return
> values of other methods etc in my class. I found this useful because I
> could just look up and see what the arguments were for a method I'd
> defined higher/lower in the file - no need to move my cursor at all, no
> need to navigate anywhere - essntially, I got more useful real-estate
> use out of my screen.

I use in such situation another technique: I split my frame (which is almost always full screen) into 2 (or more) windows. Each window can now show another part of (same or not same) text. For quick navigation I use my 4 "high-speed-bookmarks". There are ordinary Emacs bookmarks that I place on F9 to F12. I set a bookmark with M-F9..M-F12 and jump to bookmark simply with F9..F12. This is the code:

;; quick bookmark
(global-set-key
 [\M-f9]
 (lambda () (interactive) (bookmark-set "quick-bookmark-1")))

(global-set-key
 [f9]
 (lambda () (interactive) (bookmark-jump "quick-bookmark-1")))

And so on for F10, F11 and F12. There may be exist a smarten (generalized) solution, but I typed this once and left it so.

Unfortunately using bookmarks in two or more windows with the same buffer has one bug since Emacs23 - when I jump in window 1 it jumps in window 2 to the same place.

Sometimes I use also bm.el.

The bigest drawback of code folding for me is:

 - the visual text form changes. I don't like it.

- it produced more effort. I must first navigate to the right place, then fold and than go elsewhere where I want to edit. Possibly I must repeat folding many times so that I get the state that I see in one window both distance piece of text and current edited text. With my bookmarks and splited frame I'am much faster.


regards
Marc




reply via email to

[Prev in Thread] Current Thread [Next in Thread]