From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Re: vertical fido-mode (new branch) Date: Wed, 26 Aug 2020 06:34:49 +0200 Message-ID: <20200826043419.5kl4h5qxg7idbexd@Ergus> References: <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; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26171"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Juri Linkov , "emacs-devel@gnu.org" To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 26 06:35:53 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 1kAnA8-0006jg-Mp for ged-emacs-devel@m.gmane-mx.org; Wed, 26 Aug 2020 06:35:52 +0200 Original-Received: from localhost ([::1]:45008 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAnA7-00073R-PK for ged-emacs-devel@m.gmane-mx.org; Wed, 26 Aug 2020 00:35:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44974) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAn9M-0006Y3-Ht for emacs-devel@gnu.org; Wed, 26 Aug 2020 00:35:04 -0400 Original-Received: from sonic306-3.consmr.mail.bf2.yahoo.com ([74.6.132.42]:44324) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kAn9G-000481-1O for emacs-devel@gnu.org; Wed, 26 Aug 2020 00:34:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1598416495; bh=rx8Ncwn2byaI3wMlHFE9/vcKMFLtpEVYHEUu3Pj9qZE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=cwJdsh4K8/3l1SVRJbAcZG4VZ2Qv36R2/x88QbOROaBVXbNh5rBgkawaJ+SmT1fW5kF9itm5p3/oO0E0Ttx7UWqVHfyyFgbdVBiXxepJtFOvBFCTKb9d7t3cx68v9CXrlPcqpWMFdxhW66Msps1p9iAeLQC3OfNoYFXvFHMGNtUjj1VcYhI+1zDm7nm17aDFMvn1ZxtPmRzVF1h1qdGlH6y307eIww1wX4f3pZbES/WkZzMkGSvgONTnKtO8WxcC2lsvTh8EzRiXN0N64kxtD++P/+koLIvrP057UpAdRJx/OwyZy+2ZBVfJXei0mLsW0CqdfCGuEciLapCQ4Yo4PQ== X-YMail-OSG: RaSCNkAVM1n11hw.BJzg6Hc07pR_9XSb0k3oJKiZQcC50SLbcJWc3vmLi1PkbkY afJAm4xEcaZGe0ZrEG1MBu03vSiMGcCLKkTyBgk3ttfBCVc8JVhJw5v2UFe9oiPN3I2KZHa3Ev3A aoQF1e_6TICzIFpMbpFQcW.TL3DU_ln5hnzlEjhl62b9GRAUqj0lfhxp9lbplFspGepvC8hq4tAh 4NbYY8kuqVJEJ03ur0X4jFnlxk9yDO7uEtn45ePp6GiiD382BaZbTJKMJghJc2k9xuyMzwwIWbJU M3fzbzLEjyJSPFkWAHEtB3Tmia2DP88A45UxAEBqxG3PqkmU_P5KmpVNl4KTvLeSJDyzO8nG237i R7_rxu.JRu4WGl.vm5AudJPDFN.g6mIPGp4Yum_4RIIZzG96Y1FMTBqWwqx6J9CTzQV6jpdEZz9o Ejjt2vXjrT0HHn0zCHOC6bICRo2OJq5Ts.1RC4wP3t2mFWTtT1glIt6TuJMv0heDnmRSBBQabuHM Cyy.wWRU8xcj5I7274zgxpyUFBohYUUa5uSoNjYWckvjIvZwSTLfk63.C6u3_XtmZeAQ5AV8aDgX 72xT1LX07dzG8YLdq07BNUcPnQ_Kw5if5E1KFwyV1GA8FXknjvdiXO66.cm6BRyxM_vHszCVOMFW f9VhpPhhcSHZ0zatOlCpDPtSwIVaaNQYKD5LwBtwcBjYo6IjY_k_9E21UBY_g3TK6Dc8zU.Gw_bp lfXqW9BvdhPSl2t.m8YZIxyUlzpAZBt.jp1FjVRTPKdbYg6RkKkYLBo8aUdZvqImRJHIBi0B7gsj mgA50r7gGBPcY65aMV5_Sp8nKc9eLPyBbyCBqSUrzd Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.bf2.yahoo.com with HTTP; Wed, 26 Aug 2020 04:34:55 +0000 Original-Received: by smtp409.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 92948b6fda3eb700bcd20581067e320a; Wed, 26 Aug 2020 04:34:54 +0000 (UTC) Content-Disposition: inline In-Reply-To: X-Mailer: WebService/1.1.16455 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol Apache-HttpAsyncClient/4.1.4 (Java/11.0.7) Received-SPF: pass client-ip=74.6.132.42; envelope-from=spacibba@aol.com; helo=sonic306-3.consmr.mail.bf2.yahoo.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/25 23:02:35 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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:254239 Archived-At: On Tue, Aug 25, 2020 at 07:42:23PM -0400, Stefan Monnier wrote: > >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... > Hi Stefan: Yes I also thought that, but as there is the `completion-setup-hook` called when the completions are shown I just thought in a `symmetric` hook to call when closing. In my opinion the hook here was just simpler. Also because the bury-buffer runs inside a with-selected-window and the action I need are in the minibuffer. > >... 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. > This is exactly what I did ;p thanks for the name cause mine was worst. > >This makes me think maybe you were thinking exactly the same and we're >just in violent agreement. > > > Stefan > I have 2 questions: 1) Why the function needs to return nil if the return value of completion--in-region-1 is not used anywhere so far? 2) What's the "canonical method" to add a keymap to the minibuffer (and *Completions*) when enabling the mode but restoring it cleanly at the end? Is it possible to do something like push/pop a keymap to another? I see we have inheritance for keymaps but maybe there is a simpler method? How can I restrict the mode-keymap to the minibuffer for example? Thanks in advance, Ergus