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: Sat, 02 Feb 2019 23:03:50 +0200 Organization: LINKOV.NET Message-ID: <87imy19b6x.fsf@mail.linkov.net> References: <877eelupkc.fsf@errge.nilcons.com> <5C52FCDD.7010803@gmx.at> <878sz0o9nd.fsf@mail.linkov.net> <87r2cstpia.fsf@errge.nilcons.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="194119"; 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 Sat Feb 02 22:18:52 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 1gq2gd-000oLP-5K for ged-emacs-devel@m.gmane.org; Sat, 02 Feb 2019 22:18:51 +0100 Original-Received: from localhost ([127.0.0.1]:48049 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gq2gc-00055P-6J for ged-emacs-devel@m.gmane.org; Sat, 02 Feb 2019 16:18:50 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gq2fi-00055H-62 for emacs-devel@gnu.org; Sat, 02 Feb 2019 16:17:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gq2ff-0007ux-7H for emacs-devel@gnu.org; Sat, 02 Feb 2019 16:17:54 -0500 Original-Received: from indri.birch.relay.mailchannels.net ([23.83.209.92]:13421) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gq2fe-0007tM-TW for emacs-devel@gnu.org; Sat, 02 Feb 2019 16:17:51 -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 0C36E682959; Sat, 2 Feb 2019 21:17:49 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a30.g.dreamhost.com (unknown [100.96.26.166]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id A4755682987; Sat, 2 Feb 2019 21:17:48 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a30.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); Sat, 02 Feb 2019 21:17:48 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Bored-Soft: 5594d20f103d12b3_1549142268906_590430204 X-MC-Loop-Signature: 1549142268906:946920169 X-MC-Ingress-Time: 1549142268905 Original-Received: from pdx1-sub0-mail-a30.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a30.g.dreamhost.com (Postfix) with ESMTP id 442BE8015A; Sat, 2 Feb 2019 13:17:48 -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=o3VAuEnBfsaINjB++iRyG7L7EUc=; b= xuX3aK9vQRjqeQ4H2amZVBCSeOjf3jsJDPV1Q3KgpJQFhx5sJbgjGDhA1X9NvZuL o1LD+NYndJWXukyjTjh3eT2Fdp9y4LSWCqr3je3xLB/OhQtq/XUqiBlTVcr9WTlK nsLQkW4qf1o3ZLtXYukWhcQhm/052RGBtIGSXSKvCuY= 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-a30.g.dreamhost.com (Postfix) with ESMTPSA id 0D3AF8014A; Sat, 2 Feb 2019 13:17:45 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a30 In-Reply-To: <87r2cstpia.fsf@errge.nilcons.com> (Gergely Risko's message of "Thu, 31 Jan 2019 23:45:49 +0100") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledrkedtgdduhedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrdduuddurdejudenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrdduuddurdejuddprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehgvghrghgvlhihsehrihhskhhordhhuhenucevlhhushhtvghrufhiiigvpedu X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 23.83.209.92 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:232915 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.