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.devel Subject: Re: Feature branches review please (ivy hello) Date: Fri, 6 Nov 2020 13:51:48 +0300 Message-ID: References: <234bba7f-fd5c-ed39-8a5e-8a6ce3125bf1@inventati.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21282"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/+ (1036f0e) (2020-10-18) Cc: Oleh Krehel , emacs-devel@gnu.org To: Gregory Heytings Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 06 11:58:19 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 1kazRj-0005Pq-5w for ged-emacs-devel@m.gmane-mx.org; Fri, 06 Nov 2020 11:58:19 +0100 Original-Received: from localhost ([::1]:34706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kazRi-00039b-55 for ged-emacs-devel@m.gmane-mx.org; Fri, 06 Nov 2020 05:58:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55084) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kazQO-0002JI-CB for emacs-devel@gnu.org; Fri, 06 Nov 2020 05:56:56 -0500 Original-Received: from static.rcdrun.com ([95.85.24.50]:53953) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kazQM-0002gD-7L for emacs-devel@gnu.org; Fri, 06 Nov 2020 05:56:55 -0500 Original-Received: from localhost ([::ffff:197.157.0.43]) (AUTH: PLAIN admin, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by static.rcdrun.com with ESMTPSA id 00000000002C0006.000000005FA52BF3.00006996; Fri, 06 Nov 2020 10:56:51 +0000 Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=95.85.24.50; envelope-from=bugs@gnu.support; helo=static.rcdrun.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/06 04:08:03 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_SORBS_WEB=1.5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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:258799 Archived-At: * Gregory Heytings [2020-11-06 12:19]: > > I am looking for preferrably built-in system that will have narrowing > > vertical incremental search, like built-in ivy or helm. Something that > > ido or icomplete could become. Until then I keep ivy as most simplest > > solution as I prefer package from GNU ELPA. > Again I'm not sure I understand what you want, but I think you should try > (setq completion-styles (cons 'flex completion-styles)). With that setting > you can narrow the candidates list with any character, you do not need to > type the first characters. Sounds like you do not know ivy or helm? Try using helm functions, you may understand what is "narrowing incremental search". I may express myself badly so I may need help to express me very nice. > > You may see how dmenu which is separate program works under X Window > > system to launch files: > > > > 1.8M demo of dmenu program: > > https://gnu.support/images/2020/11/2020-11-05/2020-11-06-01:38:29.ogv Now the first demo works, click above to see. Click here below to see the comparison between completion frameworks, others but icomplete (as it is not complete yet). https://gnu.support/images/2020/11/2020-11-06/2020-11-06-13:22:39.ogv Here is demonstration of completions with helm, ivy, ido, and dmenu (outside command): https://tools.suckless.org/dmenu/ 1. Helm mode, can move up and down freely, have actions and multi selection possibility with highlighting. It can select by using reverse words. It is outside package with many contributors now hard to enter main Emacs. 2. Ivy mode is good candidate to enter main Emacs as it is on GNU ELPA already and author is willing. IT LACKS reverse word search. It has multiple action capability, highlighting and looks saner than Helm. This is my current choice. 3. dmenu is external program with beautiful user interface. User can move up and down and may use reverse words to come to selection. 4. ido-mode is built-in, I do not know how to get selection by using reverse order of words. For now I did not find if it has multiple choices option. P.S. I am including author of Ivy Oleh Krehel with hope and proposal to improve ivy with reverse order of words selections and hopefully to include it in GNU Emacs. You may test features to understand it by evaluating one by one here below. ;; This is what Emacs needs as a built-in function what I name for now ;; "dynamic narrowing incremental search" ;; It would be very useful to have built-in Ivy or Ivy-like completion: ;; ;; 0. Function (YOU-NAME-THE-MODE-completing-read PROMPT COLLECTION &OPTIONAL ...) ;; and possibility to automatically replace the built-in function named ;; `completing-read' when `YOU-NAME-THE-MODE-mode' is turned on ;; ;; 1. It should get selection by using words in reverse order, for ;; example to select "AMERICAN SAMOA" when one writes "SAMOA ;; AMERICAN" ;; ;; 2. Highlighting like in Ivy or Helm or Dmenu ;; ;; 3. Capability to choose other actions, not only the default action, ;; like M-o in Ivy or TAB in Helm. ;; ;; 4. Capability to choose multiple items, like marking of the item ;; with C-c SPC in Helm and conducting actions on multiple items (setq collection '("2 Ă…LAND ISLANDS" "30 BOUVET ISLAND" "41 CAYMAN ISLANDS" "46 CHRISTMAS ISLAND" "47 COCOS (KEELING) ISLANDS" "52 COOK ISLANDS" "70 FALKLAND ISLANDS (MALVINAS)" "71 FAROE ISLANDS" "94 HEARD ISLAND AND MCDONALD ISLANDS" "134 MARSHALL ISLANDS" "160 NORFOLK ISLAND" "161 NORTHERN MARIANA ISLANDS")) ;; Normal built-in Emacs completion for: ISLAND CAYMAN (helm-mode 1) (completing-read "Country: " collection) ;; ivy completion from GNU ELPA: for ISLAND CAYMAN (ivy-completing-read "Country: " collection) ;; ido completion (ido-completing-read "Country: " collection) ;; dmenu is a dynamic menu for X, originally designed for dwm. It ;; manages large numbers of user-defined menu items efficiently ;; if somebody has better function to input let me know (defun dmenu-completing-read (prompt collection) ;; &optional predicate require-match initial-input history def inherit-input-method) "Uses external `dmenu' command for Emacs completions." (let* ((collection (concat (string-join collection "\n") "\n")) (file (string-to-file-force collection "/dev/shm/collection")) (dmenu "dmenu")) (with-temp-buffer (call-process dmenu file (current-buffer) nil "-fn" "DejaVu:pixelsize=30" "-l" "10" "-i" "-b" "-p" prompt "-nb" "dark goldenrod" "-nb" "black") (string-trim (buffer-string))))) (dmenu-completing-read "Country: " collection) (dmenu-completing-read "Recent files: " (recentf-elements 10)) ;; HELM completion, good example how it should look like in Emacs with ;; built-in function. There is some bug that says `eval-last-sexp' ;; which I did not put choose. (helm-mode 1) (completing-read "Country: " collection) Only Helm mode and Dmenu show that reverse order of words can be selected. Ivy need to improve. Jean