From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: find-file-hook, recenter, scroll-conservatively and save-place Date: Sun, 03 Feb 2019 22:18:47 +0200 Organization: LINKOV.NET Message-ID: <87k1igocbc.fsf@mail.linkov.net> References: <877eelupkc.fsf@errge.nilcons.com> <5C52FCDD.7010803@gmx.at> <878sz0o9nd.fsf@mail.linkov.net> <87r2cstpia.fsf@errge.nilcons.com> <87imy19b6x.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="263879"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: emacs-devel@gnu.org To: Gergely Risko Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 03 21:56:46 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gqOon-0016W1-H9 for ged-emacs-devel@m.gmane.org; Sun, 03 Feb 2019 21:56:45 +0100 Original-Received: from localhost ([127.0.0.1]:60296 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqOom-0004vc-FQ for ged-emacs-devel@m.gmane.org; Sun, 03 Feb 2019 15:56:44 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57631) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqOmo-00045W-UY for emacs-devel@gnu.org; Sun, 03 Feb 2019 15:54:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gqOhh-00042T-8y for emacs-devel@gnu.org; Sun, 03 Feb 2019 15:49:25 -0500 Original-Received: from bisque.maple.relay.mailchannels.net ([23.83.214.18]:16292) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gqOhg-00041G-WD for emacs-devel@gnu.org; Sun, 03 Feb 2019 15:49:25 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id B5AE4123FA2; Sun, 3 Feb 2019 20:49:20 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a23.g.dreamhost.com (unknown [100.96.33.121]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 37DF6123729; Sun, 3 Feb 2019 20:49:20 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a23.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Sun, 03 Feb 2019 20:49:20 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Cooperative-Name: 5c729c6633f5c89d_1549226960408_4091164216 X-MC-Loop-Signature: 1549226960408:253305437 X-MC-Ingress-Time: 1549226960408 Original-Received: from pdx1-sub0-mail-a23.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a23.g.dreamhost.com (Postfix) with ESMTP id DC069818C5; Sun, 3 Feb 2019 12:49:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=TFEiQuK4c5yrlvg2LAcPNlRKYsU=; b= ed9+OFvyV2wXnPWV6G7YCYXmj6sSREu9Ckc4yaaEcug7O46aF+VbfJb9X81oMX8f 0u+MZOdXg2eevmWVO9mEAG4Y3N0S2Ihj9DqBort5tuw8AsQ7xR0drnGWrHy4kFki rjXq4hYTtkvOIRay5CWDdDrG7K6rqdHnWiQKzeO6w88= Original-Received: from mail.jurta.org (m91-129-111-71.cust.tele2.ee [91.129.111.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a23.g.dreamhost.com (Postfix) with ESMTPSA id 8774B818BB; Sun, 3 Feb 2019 12:49:18 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a23 In-Reply-To: <87imy19b6x.fsf@mail.linkov.net> (Juri Linkov's message of "Sat, 02 Feb 2019 23:03:50 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledrkedvgddugeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrdduuddurdejudenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrdduuddurdejuddprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehgvghrghgvlhihsehrihhskhhordhhuhenucevlhhushhtvghrufhiiigvpedt X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 23.83.214.18 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:232941 Archived-At: >>> Interesting question. Maybe introduce two new buffer-local variables >>> 'window-point' and 'window-start' that a hook could set and then >>> display-buffer could read and call functions window-point and window-start? >>> These buffer-local values should be used only once and should be reverted >>> to nil after the first use. >> >> I start to understand the approach proposed by you and Martin. This >> buffer-local variable approach feels natural and OK to me. >> >> Martin also said this: >> >>>> When 'display-buffer' finds a '(window-start . recenter) ALIST entry >>>> it would call 'recenter' after assigning the window buffer. >> >> Just one point to this: should we have '(window-start . (recenter 10)) >> also, where 10 is the ARG for the future recenter call? > > Using one-off buffer-local variables will allow standard hooks > like adding window-start-hook. Alternatively, we could use a solution like in windmove-display-in-direction that sets display-buffer-overriding-action with a lambda (in this case, with some recentering) until the end of the current command.