all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* What exactly are "window configurations"?
@ 2015-01-27 23:58 Marcin Borkowski
  2015-01-28  0:08 ` Drew Adams
  2015-01-28  2:03 ` Tory S. Anderson
  0 siblings, 2 replies; 3+ messages in thread
From: Marcin Borkowski @ 2015-01-27 23:58 UTC (permalink / raw)
  To: Help Gnu Emacs mailing list

Hi there,

I'm wondering about `C-x r w' and `C-x r j'.  What I would need is a way
to restore not only point, but the "state of scrolling" (i.e., the
position of the buffer in the window, so to speak; IOW, which line is
displayed at the top).  (This is very handy when using a small, netbook
screen: I carefully `C-something C-l'ed so that exactly what I need is
seen, and I have to depart to another place in the buffer for a moment,
and then I want to get back.)

To my delight, I discovered that `window-configuration-to-register' and
`jump-to-register' do exactly that.  Wow!  I've been using Emacs for
almost 15 years now, people, and I missed /that/!

OTOH, a simple experiment showed that this does /not/ restore the text
scale (changed by `C-x C--' and `C-x C-=').  Not that it's a real
problem (although it /does/ influence what is actually visible), but
that made me think: what exactly is a "window configuration"?  I found
out that the docstring for `current-window-configuration' says

> current-window-configuration is a built-in function in `window.c'.
> 
> (current-window-configuration &optional FRAME)
> 
> Return an object representing the current window configuration of FRAME.
> If FRAME is nil or omitted, use the selected frame.
> This describes the number of windows, their sizes and current buffers,
> and for each displayed buffer, where display starts, and the position of
> point.  An exception is made for point in the current buffer:
> its value is -not- saved.
> This also records the currently selected frame, and FRAME's focus
> redirection (see `redirect-frame-focus').  The variable
> `window-persistent-parameters' specifies which window parameters are
> saved by this function.

This is not extremely precise, though.

1. Does it mean that each frame has its own window configuration?

2. This mentions "number of windows, their sizes and current buffers";
apparently, their /positions/ are also saved.

3. The sentence "An exception... -not- saved" seems not to be true: in
my experiments, `C-x r j' restored that also.  (Edit: I've just checked
the source of `window-configuration-to-register', and that made this
question redundant.  Still, the manual is ambiguous about this.)

BTW: the fact that `current-window-configuration' is written in C and
not in Elisp does not help.  I'd love if more functions were written in
Elisp; while I admit that the current state of affairs is a nice nudge
for me to (re)learn some C, it makes /fiddling/ with them more
cumbersome.  (And I /am/ aware that this is risky -- OTOH, redefining
e.g. `self-insert-command' /is/ possible[1], so Emacs is not really more
idiot-proof in this way by means of having it defined in C;-).)

[1] Don't try this at home, kids. ;-)

TIA,

-- 
Marcin Borkowski               This email was proudly sent
http://mbork.pl                from my Emacs.



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

* RE: What exactly are "window configurations"?
  2015-01-27 23:58 What exactly are "window configurations"? Marcin Borkowski
@ 2015-01-28  0:08 ` Drew Adams
  2015-01-28  2:03 ` Tory S. Anderson
  1 sibling, 0 replies; 3+ messages in thread
From: Drew Adams @ 2015-01-28  0:08 UTC (permalink / raw)
  To: Marcin Borkowski, Help Gnu Emacs mailing list

<Lots of good info & questions snipped.>

> what exactly is a "window configuration"?

Sounds like the meat of a doc bug report.  `M-x report-emacs-bug'



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

* Re: What exactly are "window configurations"?
  2015-01-27 23:58 What exactly are "window configurations"? Marcin Borkowski
  2015-01-28  0:08 ` Drew Adams
@ 2015-01-28  2:03 ` Tory S. Anderson
  1 sibling, 0 replies; 3+ messages in thread
From: Tory S. Anderson @ 2015-01-28  2:03 UTC (permalink / raw)
  To: Marcin Borkowski; +Cc: Help Gnu Emacs mailing list

Thanks for the tip about window-configuration-to-register! I had no idea. I've done the netbook emacs thing, too, and understand the pain. 

Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:

> Hi there,
>
> I'm wondering about `C-x r w' and `C-x r j'.  What I would need is a way
> to restore not only point, but the "state of scrolling" (i.e., the
> position of the buffer in the window, so to speak; IOW, which line is
> displayed at the top).  (This is very handy when using a small, netbook
> screen: I carefully `C-something C-l'ed so that exactly what I need is
> seen, and I have to depart to another place in the buffer for a moment,
> and then I want to get back.)
>
> To my delight, I discovered that `window-configuration-to-register' and
> `jump-to-register' do exactly that.  Wow!  I've been using Emacs for
> almost 15 years now, people, and I missed /that/!
>
> OTOH, a simple experiment showed that this does /not/ restore the text
> scale (changed by `C-x C--' and `C-x C-=').  Not that it's a real
> problem (although it /does/ influence what is actually visible), but
> that made me think: what exactly is a "window configuration"?  I found
> out that the docstring for `current-window-configuration' says
>
>> current-window-configuration is a built-in function in `window.c'.
>> 
>> (current-window-configuration &optional FRAME)
>> 
>> Return an object representing the current window configuration of FRAME.
>> If FRAME is nil or omitted, use the selected frame.
>> This describes the number of windows, their sizes and current buffers,
>> and for each displayed buffer, where display starts, and the position of
>> point.  An exception is made for point in the current buffer:
>> its value is -not- saved.
>> This also records the currently selected frame, and FRAME's focus
>> redirection (see `redirect-frame-focus').  The variable
>> `window-persistent-parameters' specifies which window parameters are
>> saved by this function.
>
> This is not extremely precise, though.
>
> 1. Does it mean that each frame has its own window configuration?
>
> 2. This mentions "number of windows, their sizes and current buffers";
> apparently, their /positions/ are also saved.
>
> 3. The sentence "An exception... -not- saved" seems not to be true: in
> my experiments, `C-x r j' restored that also.  (Edit: I've just checked
> the source of `window-configuration-to-register', and that made this
> question redundant.  Still, the manual is ambiguous about this.)
>
> BTW: the fact that `current-window-configuration' is written in C and
> not in Elisp does not help.  I'd love if more functions were written in
> Elisp; while I admit that the current state of affairs is a nice nudge
> for me to (re)learn some C, it makes /fiddling/ with them more
> cumbersome.  (And I /am/ aware that this is risky -- OTOH, redefining
> e.g. `self-insert-command' /is/ possible[1], so Emacs is not really more
> idiot-proof in this way by means of having it defined in C;-).)
>
> [1] Don't try this at home, kids. ;-)
>
> TIA,



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

end of thread, other threads:[~2015-01-28  2:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-27 23:58 What exactly are "window configurations"? Marcin Borkowski
2015-01-28  0:08 ` Drew Adams
2015-01-28  2:03 ` Tory S. Anderson

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.