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:07 -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 21:31, schrieb tomer:
> On Sep 24, 9:13 am, Marc Mientki<mien...@nonet.com>  wrote:
>> 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.
>>
>> regards
>> Marc
>
> I appreciate your comments, I think more or lest like you,

Nice to hear it! :)

> but recently i got a task which basically maintain old code
> from other programmers, in which the distande between the
> open and close statemn could be several emacs pages,and have
> 5 or more hirarchy insisde. this makes it difficult to trak,
> but i cant change code, i need only to maintain it. my
> solution is use fodling i dont know other solution to keep
> it easy to track the code

Well... when you fold the source code you can't see it. When
you can't see it you can't understand it and as rasult you
can't track it ;-)

Do not take it too seriously, but emphasis on "too seriously".
Again und again I must read not own sources (C and C++), too.
For navigation in {}-hierarchy I use with love this piece of
lisp code:

;; define function to match a parenthesis otherwise insert a '~'
(defun goto-match-paren (arg)
  "Go to the matching parenthesis if on parenthesis otherwise insert '~'."
  (interactive "p")
  (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1))
        ((looking-at "\\s\)") (forward-char 1) (backward-list 1))
        (t (self-insert-command (or arg 1)))))
(global-set-key (kbd "~") 'goto-match-paren)

This allows me to jump to corresponding { or } with '~'

And of course I use mic-paren.el and show-paren-mode.

regards
Marc





reply via email to

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