all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* can vertico approximate this ido setup?
@ 2023-06-04  1:40 Samuel Wales
  2023-06-04  6:41 ` Michael Albinus
  2023-06-04  8:57 ` Tassilo Horn
  0 siblings, 2 replies; 9+ messages in thread
From: Samuel Wales @ 2023-06-04  1:40 UTC (permalink / raw)
  To: help-gnu-emacs

i have used ido, with this set of libraries:

  ido
  ido-hacks [speeds up ido and makes it run most places]
  ido-clever-match [really good matching]
  a line that makes it vertical, not horizontal

it generally works well in /most/ places in emacs, including
org-refile.  i /usually/ get the candidate i want with supernatural
efficiency.  there are maybe a few glitches, but they are really small
with my setup, which is below.

sometimes i do c-x c-f and then c-f again to get regular find-file so
i can do tramp or so.

this ido setup works well enough for me, but i fear it might not work
in a future emacs upgrade.  i currently use emacs 27.1.  in at least
one past upgrade i have had to upgrade something or make a change to
get it to work.  i don't want that.


recently, vertico and orderless and friends have come along, and they
use the standard completion mechanism, and have more features, and
they feel like they are well maintained and configurable and will
stick around.

i'd like to set them up to work approximately like my vertical and
clever matching ido setup, at least initially.  to try.

but my initial attempts were worse than my ido setup.  i do NOT know
what i am doing here.  but e.g.

  - my selections are very wrong compared to clever match
  - faces don't seem to get recognized when i specify them
    - also i don't get variable pitch
    - also i don't understand the completion-first-difference face
  - not sure how to get a less-busy marginalia [not critical]
  - still figuring out things like m-ret for create new dir
  - have not tried consult yet
  - embark uses more than window height or confuses

i am very limited in computer use, so before i try new things or
search, i want to know if it is worth trying to configure vertico to
work approximately like my setup.  my question is whether it is
configurable to come close-ish to my ido.

i do not use ido fancy features like virtual buffers or directory merge stuff.

here are my notes in my old color-theme on the faces:

       ;; vertico uses this
       ;; this isn't reflected in results when changed here
       ;; fixme variable pitch
       ;; mode or my direct
       (completions-annotation ((t (:background "black" :foreground
"#d44400"))))
       ;; default is italic
       ;; this is not respected by marginalia for some reason so
       ;; marginalia tends to be an overly bright copper for e.g.
       ;; docstrings
       ;; (completions-annotation ((t (:background "black" :foreground
"#f48400"))))
       ;; (completions-annotation ((t (:background "black" :foreground
"#e46400"))))

       (completions-common-part ((t (:background "black" :foreground
"#aaaa00"))))
       ;; (completions-common-part ((t (:background "black"
:foreground "#666600"))))
       ;; (completions-common-part ((t (:background "black"
:foreground "grey60"))))

       ;; fixme idk if this is correct in vertico
       ;; supposed to be first char after point
       ;; and so it is
       ;; but if you enter that char,
       ;; you might get a different line than you expected
       ;; so what is it good for?
       (completions-first-difference ((t (:foreground "OrangeRed2"))))

here is my vertico and friends setup:

;; package-initialize seems not to take care of turning on modes
(vertico-mode)
(cl-pushnew 'orderless completion-styles)
(cl-pushnew 'flex completion-styles)
(cl-pushnew 'prefix completion-styles)
(cl-pushnew 'substring completion-styles)
;; (marginalia-mode)
;; try built in wth flex and also fido but need vertical q is in 28
(require 'orderless)
(with-eval-after-load 'orderless
  (add-to-list 'orderless-matching-styles 'orderless-flex))

and here is some messy years-old comments and setup for my pretty
comfortable vertical clever matching ido:

(progn
  ;;might not be nec if ido-everywhere
  (require 'ido)
  ;;prob not nec if require is used; require is not nec if this is used
  (ido-mode 1)
  ;;(ido-mode 0)
  ;;maybe this allows dired copying
  ;;(ido-everywhere 1)                      ;conflict with ido-hacks?
  ;; what is ido-ubiquitous?
  ;; do i need ido-completing-read-plus?
  ;; do i need ido-speed-hack?  ido-hacks is very fast as it is.

  ;; for pop-up-windows ido-default-buffer-method
  ;;
  ;; instead of raising frame if exists in another frame
  ;; (setq ido-default-file-method 'selected-window)

  (defadvice ido-switch-buffer
      (before ido-try-superstition activate compile)
    (switch-to-buffer (current-buffer)))

  ;; this is like orderless
  ;; (define-key ido-common-completion-map (kbd "SPC")
#'ido-restrict-to-matches)
  ;; (define-key ido-common-completion-map (kbd "SPC") #'ido-complete-space)

  ;;i think it gets the dir list to merge from the default dirs of
  ;;all open buffers -- so open a file then you can find others.
  ;;ka.
  (setq ido-auto-merge-work-directories-length -1)
;;; (setq ido-auto-merge-work-directories-length 5)
  ;;make / work better
  ;; (setq ido-enter-matching-directory 'first)
;;; (setq ido-enter-matching-directory 'only)
;;; (setq ido-enter-matching-directory t)

  ;;not sure what this does
  ;;(setq ido-rotate-file-list-default t)
  ;;(setq ido-rotate-file-list-default nil)
  ;;(setq ido-max-work-file-list 100)
  (setq ido-create-new-buffer 'always)
  ;; fixme dunno if this is needed
  (setq confirm-nonexistent-file-or-buffer nil)
  ;; (setq ido-confirm-unique-completion t)
  ;;(setq ido-confirm-unique-completion nil)
  ;;privacy leak if not there, but to default, just change
  ;;alpha-getenv to getenv.
  ;;this seems to work without a slash
  ;; (alpha-awhen (alpha-getenv "demacsbackup")
  ;;   (setq ido-save-directory-list-file
  ;;         (expand-file-name "emacs-ido-save-directory-list-file" it)))
  (setq ido-show-dot-for-dired t)
  ;;(setq resize-mini-windows t) ;emacs 22 default is grow-only
  ;;emacs 22 default is 0.25.  this is good for edebug.
  ;;(setq max-mini-window-height 0.33)
  (setq ido-max-window-height 0.66) ;overrides max-mini-window-height
  ;;default 12
  ;;(setq ido-max-prospects 12)
  ;;(setq ido-max-prospects 10)
  ;; buggy (setq ido-enable-tramp-completion nil)
  ;; (setq ido-enable-tramp-completion t)
  (setq ido-enable-flex-matching t)
  ;; uses completion-ignored-extensions to ignore .git
  ;; fixme maybe include this but remove ones with /
  (setq ido-ignore-extensions nil)
  ;; (setq ido-ignore-extensions t)
  ;;ido-ignore-buffers

  ;; (setq ido-use-filename-at-point t)
  (setq ido-use-filename-at-point nil)

  ;; vertical layout ka
  (setq ido-decorations
        (quote
         ("\n-> " ""
                  ;;see ido-separator
                  "\n   "
                  ;;ellipsis
                  ""
;;;                   "\n   ..."
                  "[" "]"
                  " [No match]"
                  " [Matched]"
                  " [Not readable]"
                  " [Too big]"
                  " [Confirm]")))
  (add-hook 'ido-setup-hook 'alpha-ido-my-keys)
  (defun alpha-ido-my-keys ()
    "Add my keybindings for ido."
    ;; i think spc in default ido (ido-complete-space) is just tab
    ;; that sometimes inserts spc.
    ;;
    ;; in at least org-mode olpath completion, such as for refiling,
    ;; at least with ido-hacks, spc by default always tries to
    ;; complete.  this behavior might or might not be related to
    ;; variables like (setq org-refile-use-outline-path 'file).
    ;;
    ;; we have tab already for completion, so spc is not necessary
    ;; for completion.  therefore i define spc to work globally in
    ;; ido like letters.
    ;;
    ;; i use ido-hacks.el, which runs ido all over emacs, so the
    ;; filename-centric assumption that filenames don't include
    ;; spaces, or the attempt at context-dependent insertion of
    ;; space, do not apply.
    (define-key ido-completion-map " " 'self-insert-command))

  ;;     (define-key ido-completion-map (kbd "C-n") 'ido-next-match)
  ;;     (define-key ido-completion-map (kbd "C-p") 'ido-prev-match))
  ;;   (add-hook 'ido-minibuffer-setup-hook 'ido-disable-line-truncation)

  (add-hook 'ido-setup-hook 'alpha-ido-setup-hook)
  ;; was ido-minibuffer-setup-hook
  (defun alpha-ido-setup-hook ()
    ;; notwork to fix the bug where / goes to the wrong dir
    ;; (define-key ido-completion-map (kbd "/") 'ido-exit-minibuffer)
    (define-key ido-completion-map [up] 'ido-prev-match)
    (define-key ido-completion-map [down] 'ido-next-match)
    ;; in horizontal ido
    ;;   up down is dirs (and history in org refiling and buffers)
    ;;   left right is choices
    ;; in this fixed vertical ido
    ;;   up down is choices
    ;;   left right is dirs (and dirs=nothing in org refiling and buffers)
    ;;     maybe i want this to be history when that makes sense
    ;;   c-up c-down is history
    (define-key ido-completion-map (kbd "C-<up>") 'previous-history-element)
    (define-key ido-completion-map (kbd "C-<down>") 'next-history-element)
    (define-key ido-completion-map [right] 'ido-next-match-dir)
    (define-key ido-completion-map [left] 'ido-prev-match-dir)
    ;; fixme if previous-history-element is on up down, then bind
    ;; it to left right -- or even control up down
    ;; fixme or history on left right, choices on up down, dir on
    ;; control up down
    ;; or c-n c-p for something
    ;; normally left right edits and up down is history
    ;; (set (make-local-variable 'truncate-lines) nil)
    )

  ;; fixme no ned to enable recentf.  just set this.
  ;; (setq ido-use-virtual-buffers t)
  ;;fixme privacy violations -- but see recentf-exclude
  ;;   =later presumably i meant if your buffer you wanted gone
  ;;(add-to-list 'recentf-exclude ...)

;;;Control-TAB buffer switching with Ido
;;;
;;;nXhtml tweaks Ido to do ControlTABbufferCycling combined
;;;with Ido’s normal buffer switching.

  (require 'ido-hacks)
  (with-no-warnings (ido-hacks-mode 1))
;;; (ido-hacks-mode 0)
;;; (ido-hacks-mode -1)
;;; (ido-hacks-mode nil)

  (when (require 'ido-clever-match nil t)
    ;; make header sort higher if substring earlier in header
    ;; (ido-clever-match-disable)
    (ido-clever-match-enable))

  ;; fixme why does this remapping not work?
  (define-key global-map [remap ido-write-file] 'alpha-ido-write-file)
  (define-key global-map [remap write-file] 'alpha-ido-write-file)
  (defun alpha-ido-write-file ()
    "fixed to include files.

Write current buffer to a file.
The file name is selected interactively by typing a substring.
For details of keybindings, see `ido-find-file'."
    (interactive)
    (let (
          ;; (ido-process-ignore-lists t)
          (ido-work-directory-match-only nil)
          ;; (ido-ignore-files (cons "[^/]\\'" ido-ignore-files))
          (ido-report-no-match nil)
          (ido-confirm-unique-completion t)
          (ido-auto-merge-work-directories-length -1))
      (ido-file-internal 'write 'write-file nil "Alpha Ido Write file:
" nil nil 'ignore))))


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: can vertico approximate this ido setup?
  2023-06-04  1:40 can vertico approximate this ido setup? Samuel Wales
@ 2023-06-04  6:41 ` Michael Albinus
  2023-06-04  7:08   ` Samuel Wales
  2023-06-04  8:57 ` Tassilo Horn
  1 sibling, 1 reply; 9+ messages in thread
From: Michael Albinus @ 2023-06-04  6:41 UTC (permalink / raw)
  To: Samuel Wales; +Cc: help-gnu-emacs

Samuel Wales <samologist@gmail.com> writes:

Hi Samuel,

> i have used ido, with this set of libraries:
>
>   ido
>   ido-hacks [speeds up ido and makes it run most places]
>   ido-clever-match [really good matching]
>   a line that makes it vertical, not horizontal
>
> it generally works well in /most/ places in emacs, including
> org-refile.  i /usually/ get the candidate i want with supernatural
> efficiency.  there are maybe a few glitches, but they are really small
> with my setup, which is below.
>
> sometimes i do c-x c-f and then c-f again to get regular find-file so
> i can do tramp or so.

I cannot comment on your current and future setup (I don't use
sophisticated completion myself), but for proper Tramp user and host
name completion, you should use a recent Tramp version from GNU
ELPA. There are fixes needed in completion styles like flex and friends.

Best regards, Michael.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: can vertico approximate this ido setup?
  2023-06-04  6:41 ` Michael Albinus
@ 2023-06-04  7:08   ` Samuel Wales
  0 siblings, 0 replies; 9+ messages in thread
From: Samuel Wales @ 2023-06-04  7:08 UTC (permalink / raw)
  To: Michael Albinus; +Cc: help-gnu-emacs

thanks for the tip.  i didn't know you could get a new version of a
builtin like that.

up until now at least, with c-f in ido, it turns off ido, so i use
nothing special for tramp.  ido doesn't know tramp or v-v.

would be interesting to have a setup, either ido or vertico, in which
pretty much everything works.


On 6/3/23, Michael Albinus <michael.albinus@gmx.de> wrote:
> Samuel Wales <samologist@gmail.com> writes:
>
> Hi Samuel,
>
>> i have used ido, with this set of libraries:
>>
>>   ido
>>   ido-hacks [speeds up ido and makes it run most places]
>>   ido-clever-match [really good matching]
>>   a line that makes it vertical, not horizontal
>>
>> it generally works well in /most/ places in emacs, including
>> org-refile.  i /usually/ get the candidate i want with supernatural
>> efficiency.  there are maybe a few glitches, but they are really small
>> with my setup, which is below.
>>
>> sometimes i do c-x c-f and then c-f again to get regular find-file so
>> i can do tramp or so.
>
> I cannot comment on your current and future setup (I don't use
> sophisticated completion myself), but for proper Tramp user and host
> name completion, you should use a recent Tramp version from GNU
> ELPA. There are fixes needed in completion styles like flex and friends.
>
> Best regards, Michael.
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: can vertico approximate this ido setup?
  2023-06-04  1:40 can vertico approximate this ido setup? Samuel Wales
  2023-06-04  6:41 ` Michael Albinus
@ 2023-06-04  8:57 ` Tassilo Horn
  2023-06-05  1:07   ` Samuel Wales
  1 sibling, 1 reply; 9+ messages in thread
From: Tassilo Horn @ 2023-06-04  8:57 UTC (permalink / raw)
  To: Samuel Wales; +Cc: help-gnu-emacs

Samuel Wales <samologist@gmail.com> writes:

Hi Samuel,

> but my initial attempts were worse than my ido setup.  i do NOT know
> what i am doing here.  but e.g.
>
>   - my selections are very wrong compared to clever match

Define "very wrong", e.g., with a screenshot of what you get and a
statement what you'd expect to get.

FWIW, I see that you put the flex and orderless completion style in
completion-styles.  You have to be aware that at least flex matches very
distant candidates, e.g., foo matches after-some-root.  Ok, that's the
purpose of the style but I think it's only useful if you place it at the
very end of completion-styles with more exact styles at the beginning,
e.g. (partial-completion substring flex).

Orderless can also be slightly confusing because fo-ba matches bar-foo.
Again, that's the purpose of the style but maybe it's also better used
later in completion-styles, e.g., it's much more exact than flex but
less so than partial-completion or substring.

Also, I have the experience that some completion styles work great for
one kind/category of completion but not for others, so I use
completion-category-overrides.

--8<---------------cut here---------------start------------->8---
(setopt completion-styles '(partial-completion substring flex))

(setopt completion-category-overrides
        '((project-file
           (styles partial-completion substring initials))
          (file
           (styles partial-completion substring initials))
          (eglot
           (styles partial-completion substring))))
--8<---------------cut here---------------end--------------->8---

>   - faces don't seem to get recognized when i specify them
>     - also i don't get variable pitch
>     - also i don't understand the completion-first-difference face

I go with the defaults (of my theme) so cannot comment on that.  I guess
that also completion-first-difference is not well-defined with styles
where matching is not anchored at the beginning of the candidate.  I
think it's always the character after the last matched character.

>   - have not tried consult yet
>   - embark uses more than window height or confuses
> [...]
> i am very limited in computer use, so before i try new things or
> search, i want to know if it is worth trying to configure vertico to
> work approximately like my setup.  my question is whether it is
> configurable to come close-ish to my ido.

I'd rather start out small, i.e., vertico / corfu / marginalia and add
more stuff (orderless, consult, cape, embark) later on if I feel that
I'm missing something here and there.  I think ido supports some special
things (creating directories, deleting files during file completion or
killing buffers during buffer completion?) which you could probably do
with embark but well...

Bye,
Tassilo



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: can vertico approximate this ido setup?
  2023-06-04  8:57 ` Tassilo Horn
@ 2023-06-05  1:07   ` Samuel Wales
  2023-06-05  7:08     ` Tassilo Horn
  0 siblings, 1 reply; 9+ messages in thread
From: Samuel Wales @ 2023-06-05  1:07 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: help-gnu-emacs

On 6/4/23, Tassilo Horn <tsdh@gnu.org> wrote:

hi tasillo,

> Samuel Wales <samologist@gmail.com> writes:
> Define "very wrong", e.g., with a screenshot of what you get and a
> statement what you'd expect to get.

i will have to do that when i am able to.  not able to get my brain to
think about what makes a good test case etc. now.

>
> FWIW, I see that you put the flex and orderless completion style in
> completion-styles.  You have to be aware that at least flex matches very
> distant candidates, e.g., foo matches after-some-root.  Ok, that's the

ok.

my sequening sounds like it could be bad.

to me, above would be more desirable if f were not a single letter.
to match above i might do ftoot not foo or foot.

i think ido-clever-match got that right:
https://github.com/Bogdanp/ido-clever-match .  it is almost perfect.

btw i have trouble understanding the emacs manual on completion.  the
completion styles don't make sense to me whent they talk about text
after point.  idk what i am missing there.  the descriptions are a bit
over my head i guess.

here is a big long quote from ido-clever-match exactly what it does.
i wonder if vertico/orderless can do it similarly?

vvv
The matcher ranks the input against each item by class and
then by some sub-metric within that class if applicable
(length difference between the two strings in the case of
substr, the cumulative distance of consecutive characters
in the case of flex, whether the match was case-sensitive
or not, etc.).

The match classes are:

exact
    Exact matches score the highest and they require an
    exact string match.
prefix
    Prefix matches score second highest. They are treated
    as a special case of substring matches and will always
    rank higher. This class differentiates between
    sub-matches by comparing the length of the input and
    each match: the closer the two numbers are, the higher
    the score will be.
substring
    Substring matches score third highest. This class
    differentiates between sub-matches in the same way that
    prefix matches do with an additional check on the
    distance between the beginning of the string and the
    first occurrence of the text within that string: the
    further away the substring is from the beginning of the
    string, the lower it will score.
flex
    Flex matches score lowest. This class differentiates
    between sub-matches by computing the cumulative
    distance of consecutive characters: the higher that
    distance is, the lower the score.
^^^

> purpose of the style but I think it's only useful if you place it at the
> very end of completion-styles with more exact styles at the beginning,
> e.g. (partial-completion substring flex).

ok.  even after orderless?

>
> Orderless can also be slightly confusing because fo-ba matches bar-foo.
> Again, that's the purpose of the style but maybe it's also better used
> later in completion-styles, e.g., it's much more exact than flex but
> less so than partial-completion or substring.

i presume just before flex.

btw, in ido, i use c-spc to limit the candidates then enter the second
string when i need bar-foo.

>
> Also, I have the experience that some completion styles work great for
> one kind/category of completion but not for others, so I use
> completion-category-overrides.
>
> --8<---------------cut here---------------start------------->8---
> (setopt completion-styles '(partial-completion substring flex))

ok so we are out of the territory of cl-pushnew or add-to-list i think
now and i have to do my own setopt.  like setq?

>
> (setopt completion-category-overrides
>         '((project-file
>            (styles partial-completion substring initials))

>           (file
>            (styles partial-completion substring initials))

i'd want almple or alcp to match .../alpha-completion.el.  not sure if
this would do it without flex?

unfamiliar with projects and eglot.

>           (eglot
>            (styles partial-completion substring))))
> --8<---------------cut here---------------end--------------->8---
>
>>   - faces don't seem to get recognized when i specify them
>>     - also i don't get variable pitch
>>     - also i don't understand the completion-first-difference face
>
> I go with the defaults (of my theme) so cannot comment on that.  I guess
> that also completion-first-difference is not well-defined with styles
> where matching is not anchored at the beginning of the candidate.  I
> think it's always the character after the last matched character.

ok.  it seems a bit redundant in vertico to me; i can see immediately
that the grey matching text has an end and a first char after that
without this face.  so it must serve a purpose.  but it jumps around.

>
>>   - have not tried consult yet
>>   - embark uses more than window height or confuses
>> [...]
>> i am very limited in computer use, so before i try new things or
>> search, i want to know if it is worth trying to configure vertico to
>> work approximately like my setup.  my question is whether it is
>> configurable to come close-ish to my ido.
>
> I'd rather start out small, i.e., vertico / corfu / marginalia and add
> more stuff (orderless, consult, cape, embark) later on if I feel that
> I'm missing something here and there.  I think ido supports some special

well if i could get it to work, i think i could maybe just use vertico
only to begin with.

> things (creating directories, deleting files during file completion or
> killing buffers during buffer completion?) which you could probably do
> with embark but well...

i don't use those in ido.  embark might have other stuff i'd use.

>
> Bye,
> Tassilo
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: can vertico approximate this ido setup?
  2023-06-05  1:07   ` Samuel Wales
@ 2023-06-05  7:08     ` Tassilo Horn
  2023-06-11  0:54       ` Samuel Wales
  2023-06-11  1:05       ` Samuel Wales
  0 siblings, 2 replies; 9+ messages in thread
From: Tassilo Horn @ 2023-06-05  7:08 UTC (permalink / raw)
  To: Samuel Wales; +Cc: help-gnu-emacs

Samuel Wales <samologist@gmail.com> writes:

> On 6/4/23, Tassilo Horn <tsdh@gnu.org> wrote:
>
>> FWIW, I see that you put the flex and orderless completion style in
>> completion-styles.  You have to be aware that at least flex matches very
>> distant candidates, e.g., foo matches after-some-root.  Ok, that's the
>
> ok.
>
> my sequening sounds like it could be bad.

Since you are pushing, you append very unspecific styles at the front,
yes.

> to me, above would be more desirable if f were not a single letter.
> to match above i might do ftoot not foo or foot.
>
> i think ido-clever-match got that right:
> https://github.com/Bogdanp/ido-clever-match .  it is almost perfect.

You might want to play around with flex-score-match-tightness for the
flex style,

> btw i have trouble understanding the emacs manual on completion.  the
> completion styles don't make sense to me whent they talk about text
> after point.  idk what i am missing there. 

Do emacs -Q (and probably set one completion-style at a time), enter
something and move point forward again.  At least some styles seem to
ignore text after point or at least handle it differently.

> here is a big long quote from ido-clever-match exactly what it does.
> i wonder if vertico/orderless can do it similarly?

Vertico doesn't come into play here and I don't know orderless well
enough.  I think it's similar to partial-completion where the order of
words doesn't matter.

>> purpose of the style but I think it's only useful if you place it at the
>> very end of completion-styles with more exact styles at the beginning,
>> e.g. (partial-completion substring flex).
>
> ok.  even after orderless?

Yes, think (... orderless flex) would be most sensible but of course
that's a matter of preference.

>> Also, I have the experience that some completion styles work great for
>> one kind/category of completion but not for others, so I use
>> completion-category-overrides.
>>
>> --8<---------------cut here---------------start------------->8---
>> (setopt completion-styles '(partial-completion substring flex))
>
> ok so we are out of the territory of cl-pushnew or add-to-list i think
> now and i have to do my own setopt.  like setq?

Yes, setopt is like setq but would also do what the customize machinery
would do.  But it doesn't make a difference for those variables.  Using
setq/setopt instead of cl-pushnew/add-to-list just ensures the order and
that you get what you want in cases the defaults might change.

>> (setopt completion-category-overrides
>>         '((project-file
>>            (styles partial-completion substring initials))
>
>>           (file
>>            (styles partial-completion substring initials))
>
> i'd want almple or alcp to match .../alpha-completion.el.  not sure if
> this would do it without flex?

I think, it does.  One thing to note is that with completion-styles (a b
c) is that b won't kick in as long as a delivers matches and c won't
kick in as long as b finds matches.

Bye,
Tassilo



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: can vertico approximate this ido setup?
  2023-06-05  7:08     ` Tassilo Horn
@ 2023-06-11  0:54       ` Samuel Wales
  2023-06-11  1:05       ` Samuel Wales
  1 sibling, 0 replies; 9+ messages in thread
From: Samuel Wales @ 2023-06-11  0:54 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: help-gnu-emacs

thank you, tassilo.

for now, i found that by adding yet another ido package,
ido-completing-read-plus or so, i can get back most of my ido setup
that was broken by emacs 27.1.

i think that, long-term, i should try to get decenly similar behavior
from vertico and friends, but at this time it is too much for me so i
took notes from your comments.  if my ido breaks with 28+, i will
likely need to try again.

fido-vertical [which is is not in 27.1] with my ido setup or built-in
are also possible candidates, but as mentioned, vertico et al. seem a
likely good target to switch to.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: can vertico approximate this ido setup?
  2023-06-05  7:08     ` Tassilo Horn
  2023-06-11  0:54       ` Samuel Wales
@ 2023-06-11  1:05       ` Samuel Wales
  2023-06-11 13:26         ` [External] : " Drew Adams
  1 sibling, 1 reply; 9+ messages in thread
From: Samuel Wales @ 2023-06-11  1:05 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: help-gnu-emacs

more below.

On 6/5/23, Tassilo Horn <tsdh@gnu.org> wrote:
>> i think ido-clever-match got that right:
>> https://github.com/Bogdanp/ido-clever-match .  it is almost perfect.

i really do mean that :).  it matches well ime.

> You might want to play around with flex-score-match-tightness for the
> flex style,

will do.

>
>> btw i have trouble understanding the emacs manual on completion.  the
>> completion styles don't make sense to me whent they talk about text
>> after point.  idk what i am missing there.
>
> Do emacs -Q (and probably set one completion-style at a time), enter
> something and move point forward again.  At least some styles seem to
> ignore text after point or at least handle it differently.

move point forward /again/?  it doesn't seem to go back.

>
>> here is a big long quote from ido-clever-match exactly what it does.
>> i wonder if vertico/orderless can do it similarly?
>
> Vertico doesn't come into play here and I don't know orderless well
> enough.  I think it's similar to partial-completion where the order of
> words doesn't matter.

my limited understanding is that vertico does come into play if i want
something like ido-clever-match.  i thought orderless, for example,
leaves sorting to vertico.  but maybe i am confusing sorting with
matching or something similar.

>
>>> Also, I have the experience that some completion styles work great for
>>> one kind/category of completion but not for others, so I use
>>> completion-category-overrides.

another thing i will keep in mind.

> I think, it does.  One thing to note is that with completion-styles (a b
> c) is that b won't kick in as long as a delivers matches and c won't
> kick in as long as b finds matches.

aha.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [External] : Re: can vertico approximate this ido setup?
  2023-06-11  1:05       ` Samuel Wales
@ 2023-06-11 13:26         ` Drew Adams
  0 siblings, 0 replies; 9+ messages in thread
From: Drew Adams @ 2023-06-11 13:26 UTC (permalink / raw)
  To: Samuel Wales, Tassilo Horn; +Cc: help-gnu-emacs@gnu.org

>> One thing to note is that with completion-styles
>> (a b c) is that b won't kick in as long as a
>> delivers matches and c won't kick in as long
>> as b finds matches.
> 
> aha.

So it doesn't let you see matches for
one or the other.  And you don't know
which matched.

The set of matches is a function of
(1) the input domain, (2) your match
patterns, and (3) the matchers/styles.
You can't control #3 interactively,
and #1 is typically determined by the
command/code invoking matching. 

That #3 isn't accessible interactively
is OK for some use cases, but overall
it's an inherent design weakness, IMO.

Better to be able to control matching
interactively (and consequently know
what does what) - including #3 (even
#1 to some extent).

Be able to switch among style lists,
including singletons: (c), (a b c),
(b a), (a), (c f),... anytime during
matching/completion.

(Style categories were added, so #3
can at least be predefined now, in
effect allowing more than a single
`completion-styles' value.  That's a
start.)

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-06-11 13:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-04  1:40 can vertico approximate this ido setup? Samuel Wales
2023-06-04  6:41 ` Michael Albinus
2023-06-04  7:08   ` Samuel Wales
2023-06-04  8:57 ` Tassilo Horn
2023-06-05  1:07   ` Samuel Wales
2023-06-05  7:08     ` Tassilo Horn
2023-06-11  0:54       ` Samuel Wales
2023-06-11  1:05       ` Samuel Wales
2023-06-11 13:26         ` [External] : " Drew Adams

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.