From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help 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) Message-ID: References: <87zioutd4v.fsf@mbork.pl> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1470235383 1284 195.159.176.226 (3 Aug 2016 14:43:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 3 Aug 2016 14:43:03 +0000 (UTC) To: Marcin Borkowski , Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 03 16:42:57 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bUxNl-0007jX-9x for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Aug 2016 16:42:53 +0200 Original-Received: from localhost ([::1]:34949 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUxNi-00027v-08 for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Aug 2016 10:42:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUxNB-00025X-3g for help-gnu-emacs@gnu.org; Wed, 03 Aug 2016 10:42:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUxN6-0006OP-4F for help-gnu-emacs@gnu.org; Wed, 03 Aug 2016 10:42:16 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:16763) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUxN5-0006NU-Rh for help-gnu-emacs@gnu.org; Wed, 03 Aug 2016 10:42:12 -0400 Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u73Eg6H8007319 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 3 Aug 2016 14:42:06 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u73Eg54B028003 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 3 Aug 2016 14:42:06 GMT Original-Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u73Eg3ot007491; Wed, 3 Aug 2016 14:42:04 GMT In-Reply-To: <87zioutd4v.fsf@mbork.pl> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6744.5000 (x86)] X-Source-IP: userv0021.oracle.com [156.151.31.71] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:111053 Archived-At: > 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? >=20 > 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?