From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.bugs Subject: bug#44550: 28.0.50; proposal for tabulated-list-mode to provide narrowing incremental search Date: Wed, 11 Nov 2020 20:22:04 +0300 Message-ID: References: <835z6d2oip.fsf@gnu.org> <83ft5f29fc.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13339"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0 (3d08634) (2020-11-07) Cc: 44550@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 11 18:28:24 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1kctuw-0003NU-WB for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 11 Nov 2020 18:28:23 +0100 Original-Received: from localhost ([::1]:42734 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kctuw-0000pg-05 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 11 Nov 2020 12:28:22 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kctte-0008GX-DW for bug-gnu-emacs@gnu.org; Wed, 11 Nov 2020 12:27:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kctte-0007Si-4d for bug-gnu-emacs@gnu.org; Wed, 11 Nov 2020 12:27:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kctte-0003z3-0c for bug-gnu-emacs@gnu.org; Wed, 11 Nov 2020 12:27:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jean Louis Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Nov 2020 17:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44550 X-GNU-PR-Package: emacs Original-Received: via spool by 44550-submit@debbugs.gnu.org id=B44550.160511557015245 (code B ref 44550); Wed, 11 Nov 2020 17:27:01 +0000 Original-Received: (at 44550) by debbugs.gnu.org; 11 Nov 2020 17:26:10 +0000 Original-Received: from localhost ([127.0.0.1]:42743 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kctsn-0003xo-JH for submit@debbugs.gnu.org; Wed, 11 Nov 2020 12:26:10 -0500 Original-Received: from static.rcdrun.com ([95.85.24.50]:43425) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kctsk-0003xe-0D for 44550@debbugs.gnu.org; Wed, 11 Nov 2020 12:26:07 -0500 Original-Received: from localhost ([::ffff:197.157.34.177]) (AUTH: PLAIN admin, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by static.rcdrun.com with ESMTPSA id 00000000002C0005.000000005FAC1EAB.000058CF; Wed, 11 Nov 2020 17:26:02 +0000 Content-Disposition: inline In-Reply-To: <83ft5f29fc.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:193119 Archived-At: * Eli Zaretskii [2020-11-11 18:35]: > > Date: Tue, 10 Nov 2020 22:57:35 +0300 > > From: Jean Louis > > Cc: 44550@debbugs.gnu.org > > > > - imagine list of items in tabulated-list-mode > > > > - user press / to open up the feature (real time incremental narrowing) > > > > - when user starts typing the list of items in tabulated-list-mode are > > narrowing themselves visually and in real time. It is very similar > > to completion networks. > > What does "narrowing" mean in this context? What should happen in > real time? Do you mean "filtering", i.e. that some items should > disappear from view? Yes, thank you. I mean filtering. By pressing specific key for filtering let us say "/" or other key, user starts typing and anything above X length of characters (normally 3, should be customizable) starts removing other lines that do not contain the written query. User could enter few words and words could go match filter also in reverse order (could be customizable). When user finishes filtering process one could press enter to get the display in order to browse down or up in the list. Even filtered list as result can be very long. > If so, what criteria should be used to filter out items, and how is > that derived from what the user types? Criteria is that query should match the line. I prefer that several words or parts of words can be inserted and that they can be matched in reverse order. When choosing a chocolate, designation in the database can be: "Chocolate (white)" or "White Chocolate" and program does not know how user will want to search for white chocolate. That is why reverse order helps. Multiple words should be possible As I am using tabulated list mode I see that lines can be concatenated so that it is a list of strings. Query that user types would make temporary tabulated-list-entries-filtered that replaces the original tabulated-list-entries. User could go back to unfiltered view. > I'm still confused regarding the feature you are looking for, and > how it relates to completion. I am using already tabulated mode to choose an entry. I guess it was made for that as there is function (tabulated-list-get-id) and by that id the choice is completed. tabulated-list-mode can be used as additional completing-read function and is very suitable for that. I know it is no adapted to that. I just see it is very simple as it works with the list tabulated-list-entries and when redisplayed it shows candidates, one can obtain ID and candidate entry. This below should serve to concept understanding that such function "tabulated-completing-read" is possible. (define-derived-mode choice-mode tabulated-list-mode "Choice" "Choice Mode" (setq tabulated-list-format [("Prompt here" 80 t)]) (setq tabulated-list-padding 1) (tabulated-list-init-header)) (define-key choice-mode-map (kbd "") 'choice-get-id) (defun tabulated-completing-read (prompt collection) (erase-buffer) (choice-mode) (setq tabulated-list-entries collection) (read-only-mode 1) (tabulated-list-print t)) (setq collection '((1 ["~/tmp"]) (2 ["~/Maildir"]))) (defun choice-get-id () "Returns the choice" (interactive) (let ((id (tabulated-list-get-id))) (when id (set-register 100 (aref (car (alist-get id collection)) 0)) ;; character d (kill-this-buffer) (get-register 100)))) ;; I do not know how to return, so in my program I am using register, ;; but I do not know how to return register from similar function as ;; above ;; When you evaluate this below buffer will change. ;; (tabulated-completing-read "Files" collection) > > In general I would like to have direct real time incremental narrowing > > of collection instead of blowing up minibuffer, making modeline jump > > up and down with ivy-mode and splitting windows. > > > > Interface would be clean just as tabulated-list-mode is and minibuffer > > could be used for narrowing. > > And now I'm completely confused: I thought you were talking about > tabulated-list-mode, but now you've made some gigantic leap to much > more general issues. For my personal use case I almost finished such function but I do not know how to return the ID. When that is solved then it becomes possible for tabulated list mode to be used as replacement for usual completing-read.