oantolin / orderless

Emacs completion style that matches multiple regexps in any order
GNU General Public License v3.0
776 stars 27 forks source link

cannot rename with orderless #156

Closed mohan43u closed 10 months ago

mohan43u commented 10 months ago

Hi, this is my config

;; orderless                                                                                                                                                                                   
(use-package orderless
  :ensure t
  :custom
  (completion-styles '(orderless basic))
  (completion-category-overrides '((file . (styles basic partial-completion)))))

with this, when I try to rename a file workspaces-myprojects.org to workspace-myprojects.org from dired, emacs always thinks that I'm giving the same filename, but I'm not giving the same filename, I'm taking out last s from the workspaces, the completion selection when I type the new filename always shows workspaces-myprojects.org, it should not show after I type workspace-. How can I prevent this?

oantolin commented 10 months ago

There are two separate issues here, neither of which actually has anything to do with orderless:

1) Why does workspace-myprojects.org match workspace-myprojects.org even though it does not have the final s?

The answer is that this is not because of orderless. In your configuration you have specified that for file names you want Emacs to using the basic and partial-completion styles before it tries orderless. The partial-completion style is defined so that these two names match; indeed even wor-myp.org would match.

2) How do you tell Emacs to use workspace-myprojects.org verbatim even if it does match workspaces-myprojects.org?

This was nothing to do with orderless or indeed any completion style and is instead something that you need to know how to do in the completion UI you are using, most have a dedicated command for this: