all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* hiding code between line numbers
@ 2006-03-17 15:54 Ryan Howard
  2006-03-17 16:09 ` Marc Tfardy
  2006-03-17 16:18 ` Pascal Bourguignon
  0 siblings, 2 replies; 7+ messages in thread
From: Ryan Howard @ 2006-03-17 15:54 UTC (permalink / raw)


I am editing a long program and would like to be able to hide lines 156
to 979.  This would allow me to page up quickly from line 985 and see
variable names created on line 150.  Is there an easy way to do this?

I sometimes split the buffer with Cx-2, but there are cases where I
have multiple sections in the program that I would like to hide just to
allow quicker scrolling.

Any suggestions are welcome.

Ryan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: hiding code between line numbers
  2006-03-17 15:54 hiding code between line numbers Ryan Howard
@ 2006-03-17 16:09 ` Marc Tfardy
  2006-03-17 20:16   ` Ryan Howard
  2006-03-19  2:55   ` Giorgos Keramidas
  2006-03-17 16:18 ` Pascal Bourguignon
  1 sibling, 2 replies; 7+ messages in thread
From: Marc Tfardy @ 2006-03-17 16:09 UTC (permalink / raw)


Ryan Howard schrieb:
> I am editing a long program and would like to be able to hide lines 156
> to 979.  This would allow me to page up quickly from line 985 and see
> variable names created on line 150.  Is there an easy way to do this?
> 
> I sometimes split the buffer with Cx-2, but there are cases where I
> have multiple sections in the program that I would like to hide just to
> allow quicker scrolling.
> 
> Any suggestions are welcome.

You could try this package:

http://www.emacswiki.org/cgi-bin/emacs-de/hide-region.el

But I use for quic jumps another feature - bookmakrs.
I've definded in my .emacs two pairs of set/jump key bindings:


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

This had one advantages in relation to region hide - you can quickly
jumps over different files and jump points are stored for future
sessions.

regards

Marc

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: hiding code between line numbers
  2006-03-17 15:54 hiding code between line numbers Ryan Howard
  2006-03-17 16:09 ` Marc Tfardy
@ 2006-03-17 16:18 ` Pascal Bourguignon
  1 sibling, 0 replies; 7+ messages in thread
From: Pascal Bourguignon @ 2006-03-17 16:18 UTC (permalink / raw)


"Ryan Howard" <ryanghoward@comcast.net> writes:
> I am editing a long program and would like to be able to hide lines 156
> to 979.  This would allow me to page up quickly from line 985 and see
> variable names created on line 150.  Is there an easy way to do this?

I don't know an easy way to hide one middle block

There's an easy way to hide TWO blocks, one from the start and the
other from the end:

Select what you want to see, and M-x narrow-to-region RET
(There's also narrow-to-defun and narrow-to-page)

To see the whole again, M-x widen RET



You can also use the outline-minor-mode which allows to hide the
bodies of the functions.


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

"Indentation! -- I will show you how to indent when I indent your skull!"

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: hiding code between line numbers
@ 2006-03-17 16:48 Phillip Lord
  0 siblings, 0 replies; 7+ messages in thread
From: Phillip Lord @ 2006-03-17 16:48 UTC (permalink / raw)


Marc Tfardy wrote:
> Ryan Howard schrieb:
>> I am editing a long program and would like to be able to hide lines
>> 156 to 979.  This would allow me to page up quickly from line 985
>> and see variable names created on line 150.  Is there an easy way to
>> do this? 
>> 
>> I sometimes split the buffer with Cx-2, but there are cases where I
>> have multiple sections in the program that I would like to hide just
>> to allow quicker scrolling. 
>> 
>> Any suggestions are welcome.
> 
> You could try this package:
> 
> http://www.emacswiki.org/cgi-bin/emacs-de/hide-region.el
> 


For programme code, hide-show and folding mode are both very good. 
These hide based on the structure of the programme which is normally
what you want. There is allout.el as well, which I've not
tried but saw recently. 

Also worth taking a look at is ECB (Emacs code browser). Doesn't
do at all what you want, but does allow you to see variables in 
a file, as well as a methods and move backwards and forwards
between them very efficiently. 

Cheers

Phil

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: hiding code between line numbers
  2006-03-17 16:09 ` Marc Tfardy
@ 2006-03-17 20:16   ` Ryan Howard
  2006-03-20 16:09     ` Mathias Dahl
  2006-03-19  2:55   ` Giorgos Keramidas
  1 sibling, 1 reply; 7+ messages in thread
From: Ryan Howard @ 2006-03-17 20:16 UTC (permalink / raw)


Marc,

I tried the package linked in your message named hide-region.el.  It
does exactly what I want it to do.  Thank you much.

Thanks also to Pascal and Phil for your suggestions on the subject.

-Ryan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: hiding code between line numbers
  2006-03-17 16:09 ` Marc Tfardy
  2006-03-17 20:16   ` Ryan Howard
@ 2006-03-19  2:55   ` Giorgos Keramidas
  1 sibling, 0 replies; 7+ messages in thread
From: Giorgos Keramidas @ 2006-03-19  2:55 UTC (permalink / raw)


On Fri, 17 Mar 2006 17:09:53 +0100,
Marc Tfardy <m-t-o___CUT_IT___@web.de> wrote:
>Ryan Howard schrieb:
>> I am editing a long program and would like to be able to hide
>> lines 156 to 979.  This would allow me to page up quickly from
>> line 985 and see variable names created on line 150.  Is there
>> an easy way to do this?  I sometimes split the buffer with
>> Cx-2, but there are cases where I have multiple sections in
>> the program that I would like to hide just to allow quicker
>> scrolling.  Any suggestions are welcome.
> [...]
> But I use for quic jumps another feature - bookmakrs.
> I've definded in my .emacs two pairs of set/jump key bindings:

I also use bookmarks heavily for this sort of thing.  Registers
are very useful too.

Ryan,

if you don't know already about the `point-to-register' command
(bound to `C-x /' by default), search for its description in the
manual.  Using registers, you can:

    1. mark certain places in the code with short, one-character
       names by hitting `C-x / CHAR'

    2. jump back to them with `C-x j CHAR'

I've already read the post where you say that `hide-region.el'
does what you need, but I just thought about this anyway since
it's a very useful and frequently unknown feature of Emacs :)

- Giorgos

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: hiding code between line numbers
  2006-03-17 20:16   ` Ryan Howard
@ 2006-03-20 16:09     ` Mathias Dahl
  0 siblings, 0 replies; 7+ messages in thread
From: Mathias Dahl @ 2006-03-20 16:09 UTC (permalink / raw)


"Ryan Howard" <ryanghoward@comcast.net> writes:

> I tried the package linked in your message named hide-region.el.  It
> does exactly what I want it to do.  Thank you much.

Yes! A user! Finally! Halleluja!

...

The time I put into writing that package which I never use myself
suddenly made more sense... :)

/Mathias

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-03-20 16:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-17 15:54 hiding code between line numbers Ryan Howard
2006-03-17 16:09 ` Marc Tfardy
2006-03-17 20:16   ` Ryan Howard
2006-03-20 16:09     ` Mathias Dahl
2006-03-19  2:55   ` Giorgos Keramidas
2006-03-17 16:18 ` Pascal Bourguignon
  -- strict thread matches above, loose matches on Subject: below --
2006-03-17 16:48 Phillip Lord

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.