From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: vertical fido-mode (new branch) Date: Tue, 25 Aug 2020 19:42:23 -0400 Message-ID: References: <87y2ouldrr.fsf@mail.linkov.net> <20200819121755.24hgq4gyba2wkt76@Ergus> <87pn7mdqbe.fsf@mail.linkov.net> <20200820103746.6n5op7dtz563k7qm@Ergus> <87pn7llbnb.fsf@mail.linkov.net> <20200821000513.xqdhsdwxm7ov7fkw@Ergus> <87y2m5jlh6.fsf@mail.linkov.net> <20200824190654.d5obxfwyehdgpr4u@Ergus> <87lfi2sg36.fsf@mail.linkov.net> <20200825231159.spqjswxnrwn36omr@Ergus> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1064"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: "emacs-devel@gnu.org" , Juri Linkov To: Ergus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 26 01:43:16 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAiax-0000Av-Vf for ged-emacs-devel@m.gmane-mx.org; Wed, 26 Aug 2020 01:43:15 +0200 Original-Received: from localhost ([::1]:52832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAiax-0006D2-1z for ged-emacs-devel@m.gmane-mx.org; Tue, 25 Aug 2020 19:43:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45120) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAiaE-0005mO-7K for emacs-devel@gnu.org; Tue, 25 Aug 2020 19:42:30 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:43996) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAiaB-0005EH-Us for emacs-devel@gnu.org; Tue, 25 Aug 2020 19:42:29 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 8176B441DA7; Tue, 25 Aug 2020 19:42:26 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id CC00E441D9A; Tue, 25 Aug 2020 19:42:24 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1598398944; bh=LiwVoOHVmzlJh3CVpMMzmL7/M31bTt5EBU6ozWjPx10=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=j1S9VRra9WY0Xq+k/t54YhvUBNJ4efAchjrHLEq5mKfp63EV/EO1teylwr7SMX8+l LifDIWrHrfNcSpIilMu2emWoivIvPR7VYacq1Pm2DjiKnEkbUj46ADJzru3sD1z+QW Z+k7o47j+aeSNeVyWJOyZk6hd3CNq7EtzDWllPVPkCopLhuuMQ072casiOsINHS8Gn B3XupPN6KwbM9KamQWu4uQQXE+Jy7w1VtAWcm5ZWGdkAGWoVpJmL5WTlXjD5hvppm/ JG7xR9yLSXmrtNYWt9k397A8oKLWzY/pCAuxi5ox8wCAThIlycFx8l/lSSxpAuVOFP NOPO/Jd8t3sRg== Original-Received: from alfajor (unknown [45.72.246.108]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 99207120213; Tue, 25 Aug 2020 19:42:24 -0400 (EDT) In-Reply-To: <20200825231159.spqjswxnrwn36omr@Ergus> (Ergus's message of "Wed, 26 Aug 2020 01:11:59 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/25 19:42:26 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:254231 Archived-At: > - (if win (with-selected-window win (bury-buffer))))) > + (when win > + (with-selected-window win (bury-buffer)) > + (run-hooks 'minibuffer-hide-completions-hook)))) When introducing hooks, often it's a good idea to try and think of *replacing* rather than *adding*. E.g. Maybe instead of running `minibuffer-hide-completions-hook` after hiding the buffer, you want to have a `minibuffer-hide-completions-function` which defaults to `bury-buffer`. I'm not sure if it'd be better in this specific instance, but... > - ;; If end is in view, scroll up to the beginning. > - (set-window-start window (point-min) nil) > + (if (and minibuffer-tab-go-completion > + (pos-visible-in-window-p (point-min) window)) > + (minibuffer-next-completion 1) > + ;; If all completions are visible use tab completion > + ;; If end is in view, scroll up to the beginning. > + (set-window-start window (point-min) nil)) ... I think here it might be a good idea: introduce a `minibuffer-tab-through-completions-function` which by default would do the scrolling, i.e.: (let ((window minibuffer-scroll-window)) (with-current-buffer (window-buffer window) (if (pos-visible-in-window-p (point-max) window) ;; If end is in view, scroll up to the beginning. (set-window-start window (point-min) nil) ;; Else scroll down one screen. (with-selected-window window (scroll-up))) nil))) and which you could override to your liking. > I think that we can modify this one to be more general using a funcall > or so and make my function to return t on success or nil if we should go > for the `else` part. This makes me think maybe you were thinking exactly the same and we're just in violent agreement. Stefan