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

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

RE: How to get back to a place in a buffer, or: what is a window configu


From: Drew Adams
Subject: RE: How to get back to a place in a buffer, or: what is a window configuration?
Date: Wed, 3 Aug 2016 07:42:01 -0700 (PDT)

> sometimes I work on a particular place in some buffer,

A place (position) in a buffer has little or nothing to do with
windows.

It sounds, from the rest of your question, like you are more
interested in restoring a window configuration.  But your
question is still unclear, to me.  Hopefully, Kaushal's answer
gives you what you want.

> and Emacs for some reason scrolls me out of that place.  I want
> then to get back to it.

Getting back to a buffer position is simple - you can use
temporary bookmarks or the mark ring or other methods.  But
I don't think that's really what you're asking.

> Is there a way (in stock Emacs or with help of M?elpa) to
> accomplish that?
> 
> Bonus points for a package/command which /temporarily/ disables C-v/M-v
> and other commands that might result in scrolling text in the window.

I don't see the connection between that and your request
(apparently) to restore a window config.  Is it that you really
(or additionally?) want to prevent moving `window-point'?
or perhaps prevent it from moving too far?  The underlying
question or use case is not clear to me.

> (Narrowing to what is currently visible should do the trick, so
> a combination of M-r, C-e and C-SPC would probably do what I want.
> Coding that is three minutes, but maybe someone did it already?)

If narrowing to what is currently shown in the window is
what you're looking for, then yes, you can easily code that.

(If you use library zones.el then you can easily flip among
multiple narrowings, in case that is related to what you want.
https://www.emacswiki.org/emacs/MultipleNarrowings)

> Note that it's not the same as keeping a position in a register.
> A simple experiment shows that keeping a /window configurations/ seems
> to do what I want,

`C-x r w' puts window-config in a register.  `C-x r j' restores it.

> but from reading the manual I'm not sure what
> a "window configuration" really is.  What does a "window
> configuration" consist of, exactly?

What part of (elisp) `Window Configurations' is unclear to you?



reply via email to

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