From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: torys.anderson@gmail.com (Tory S. Anderson) Newsgroups: gmane.emacs.help Subject: Re: What exactly are "window configurations"? Date: Tue, 27 Jan 2015 21:03:50 -0500 Message-ID: <87vbjry83d.fsf@gmail.com> References: <87fvavepyr.fsf@wmi.amu.edu.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1422410647 11001 80.91.229.3 (28 Jan 2015 02:04:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 28 Jan 2015 02:04:07 +0000 (UTC) Cc: Help Gnu Emacs mailing list To: Marcin Borkowski Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 28 03:04:06 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YGHzB-0007vZ-Ce for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Jan 2015 03:04:05 +0100 Original-Received: from localhost ([::1]:50887 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGHzA-0008Rd-Lt for geh-help-gnu-emacs@m.gmane.org; Tue, 27 Jan 2015 21:04:04 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34640) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGHyz-0008OT-RU for help-gnu-emacs@gnu.org; Tue, 27 Jan 2015 21:03:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGHyy-0007O5-P6 for help-gnu-emacs@gnu.org; Tue, 27 Jan 2015 21:03:53 -0500 Original-Received: from mail-yk0-x229.google.com ([2607:f8b0:4002:c07::229]:58699) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGHyy-0007Nx-LH for help-gnu-emacs@gnu.org; Tue, 27 Jan 2015 21:03:52 -0500 Original-Received: by mail-yk0-f169.google.com with SMTP id 200so7835920ykr.0 for ; Tue, 27 Jan 2015 18:03:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=rhElEpzyLbGCaXtO87+I4PXcAi3AouEZpZIkT9UOhU4=; b=efREdzdIYD5BwU1QhzI1Hest73IDnwCv+0fBJ4Mb9sBEskN7USqoyd7bJBdqwjV65E hb+qWat5gQ/I9FA/nBGQ3hGK8nXmdG32PjdUn5S1w/WDjjrr6g7BTfXgiwBSgoE6YDK7 4bHLKO2hW/hxc2R1GjBL2vWIH/QpyxGeOvKECMWobKE4eofn8phNy8WoS1/fH4ti7ktj r/icViaM6JZN17kuNNKSeY+LILjyi2kWmFniL4jbbDShBQQwa8Ll1nhU783MeH5DZBwk ZUhiokrnA+0rselLezc98sU/rZvQQ6UsKb7dUxaepEJ0Vvxhuz75/n9txfD45JDIZd73 M93Q== X-Received: by 10.236.1.102 with SMTP id 66mr118253yhc.163.1422410632213; Tue, 27 Jan 2015 18:03:52 -0800 (PST) Original-Received: from localhost.localdomain ([2601:0:a000:4a1:ee55:f9ff:feb5:5589]) by mx.google.com with ESMTPSA id 28sm1793688yhw.17.2015.01.27.18.03.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Jan 2015 18:03:51 -0800 (PST) In-Reply-To: <87fvavepyr.fsf@wmi.amu.edu.pl> (Marcin Borkowski's message of "Wed, 28 Jan 2015 00:58:04 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4002:c07::229 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:102324 Archived-At: 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 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,