emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stepping Back: A Wealth Of Completion systems Re: [ELPA] New package


From: Jean Louis
Subject: Re: Stepping Back: A Wealth Of Completion systems Re: [ELPA] New package: vertico
Date: Wed, 7 Apr 2021 21:55:27 +0300
User-agent: Mutt/2.0.6 (2021-03-06)

* Joost Kremers <joostkremers@fastmail.fm> [2021-04-07 15:32]:
> 
> On Wed, Apr 07 2021, Gregory Heytings wrote:
> > I've been thinking about this, and I'm not sure I understand what the real
> > difference between "completing" and "selecting" is.  Do I understand 
> > correctly that the difference is between, for example, expanding command 
> > names
> > (completing), and choosing an emoji in a list (selecting)?
> 
> Yeah, I don't get it either. If I'm completing a command name, I can also say
> that I'm selecting a command name from all available command names. Or when 
> I'm
> completing a file name, I'm selecting a file from all the files on
> my system.

When user completes, user brings to a whole one of candidates, but in
general, does not necessary selects it. Completion of a candidate
preceds selection. Maybe some packages select or may be tuned to
select as soon as candidate is completed, I personally find that
dangerous.

Using external completion like dmenu or rofi, fzf or similar, is
useful when Emacs run on the command line.

(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 "Hello: " '("John" "Joe" "Baby"))

In general I would like completion to work on the command line,
without frame, as well.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://rms-support-letter.github.io/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]