-
-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable helm-completion for creating directory in Dired #910
Comments
Weihua Cheung notifications@github.com writes:
I don't see why the completion is annoying, specially if you want to (add-to-list 'helm-completing-read-handlers-alist or even better use the customize interface, to customize Note: If you use helm-find-files you can create directories in a Thierry |
Thanks for your fast response. The completion is indeed useful for subdirectory creation. However, supposing I've already haven a directory named |
Weihua Cheung notifications@github.com writes:
Huh! Why? of course you can create a directory named "app"!
Yes you can! Thierry |
After hitting "+" from dired, I guess that as soon you enter "app" helm is completing to "apple" , right ? |
From |
Note also that auto update is controlled by |
This is not only about auto updating. When hitting + in dired, with helm completion, helm always preselects the first (existing) completion candidate, which is nonsense when you need to specify a new dir name. You need to explicitly select the first (uncompleted) candidate, which is annoying. This problem more or less also applies to S, Y, C, R etc. I do the following in my init file:
|
Michael Heerdegen notifications@github.com writes:
Sorry but I don't see this here, probably due to something in your own Thierry |
@thierryvolpiatto if you type a name that has common prefix with other items in the directory, Helm always pre-selects the second line (the first line is for creating new item). Only when we enter non-existing item, our choice is selected because there's nothing else. I think for commands that creates things, Helm should prioritize the first item. That is, the line with |
Tu Do notifications@github.com writes:
Really a minor annoyance, and in most cases it is an advantage.
You can't know in advance the intention of user.
I think the current behavior is more than reasonable. Thierry |
It is like helm-M-x: it's not problematic per se, but breaking with keystrokes practiced for thousands of times. |
* helm-files.el (helm-ff--move-to-first-real-candidate): New internal flag. (helm-ff-move-to-first-real-candidate): Use it. (helm-find-files-do-action): Use it.
Tu Do notifications@github.com writes:
I have finally fixed this one. Thierry |
Thanks, I've commented out my "fix" in my init file to test your change. |
Mmh, it seems the problem the problem is back, the behavior is as it was before. |
Short version so that you don't have to re-read everything: you made the dired functions (like rename, copy) not prefer the first match as input (which makes not much sense for e.g. adding a new directory or renaming) in the helminized version but to default to the plain user input. That worked quite a time, but it stopped working some while ago (maybe two months or so). The reason why I reopen it now is that there was a question about the issue in gnu.emacs.help. |
Michael Heerdegen notifications@github.com writes:
Thanks. This start happening 3 months ago at e1cd1ee when fixing #1099. Will have a look soon. Thierry |
Was broken by commit e1cd1ee. * helm-files.el (helm-ff-update-when-only-one-matched): Check if less than two candidates remaining before jumping to next line.
Looks good. Though, in a few cases, fuzzy matching still seems to make trouble. Anyway, thanks for your work so far. |
Correction of my example: until "rathe", the "Rathenow" file line is not selected, but hitting the next letter "n" then selects it. But this is just a random example, you probably already know where to dig. |
* helm-files.el (helm-ff-update-when-only-one-matched): Use helm-ff-move-to-first-real-candidate instead of helm-next-line.
Ok, so far, it seems to be completely fixed. Many thanks! |
* helm-files.el (helm-ff-move-to-first-real-candidate): Preselect non existing file for "dired-<something>" commands but not for plain "dired".
This help me a lot, Thanks. |
@thierryvolpiatto I wonder whether it is worth making the regexp customizable? Currently it makes all commands starting with I ask this because this is kind of an "undocumented" feature. I'm surprised to see the |
Suggested in #910 (comment) * helm-files.el (helm-ff-move-to-first-real-candidate): Do it.
I pushed a fix for |
Junpeng Qiu <notifications@github.com> writes:
@thierryvolpiatto I wonder whether it is worth making the regexp
customizable? Currently it makes all commands starting with dired-
behave the same. When using +, R, this is nice. But when using j, it's
kind of annoying.
You ask in the subject how to disable helm-completion for creating
directories in Dired, then you ask for customizing the regexp preventing
to go to first real candidate in dired saying that "+" (create
directory) is nice, an then you say that it's annoying only with "j".
So I guess what you really want is disabling helm for "j" only, right ?
I ask this because this is kind of an "undocumented" feature. I'm
surprised to see the helm-read-file-name behave differently when using
dired commands. After some sort of efforts I finally figured out the
dired- commands are explicitly excluded in
helm-ff-move-to-first-real-candidate. If the feature can be controlled
by the users, it would be nice.
If the above is true, modifying the regexp which prevent dired commands
from moving to first real candidate would disable the feature for ALL
dired commands, which is not what you want apparently.
So I suggest you disable helm completion for "j" only or you use instead
`helm-find-files`.
I personally don't use anymore dired, only `helm-find-files` which DTRT
for all and in addition doesn't leave you with tons of dired buffers
around.
The feature of preventing in the dired buffers from moving to first real
line was asked by dired users who think it's better like this, I have
personally no opinion on this as I don't use dired.
So if you want to disable only "j" you can use
`helm-completing-read-handlers-alist`.
`(add-to-list 'helm-completing-read-handlers-alist '(dired-goto-file . nil))`
…--
Thierry
|
Chunyang Xu <notifications@github.com> writes:
I pushed a fix for j.
Thanks.
However, user still can't control it.
Perhaps a var containing a list of fns ?
`(memq (intern-soft name) var)`
…--
Thierry
|
I forgot to mention the context. In fact, I'm trying to discuss about this line from
Two commits, 01205d2 and 0278d3c, are related to this issue so I guess it would be nice to continue here. And yes, I would like to make |
…). * helm-files.el (helm-ff-goto-first-real-dired-exceptions): New user var. (helm-ff-move-to-first-real-candidate): Use it.
When I want to use + to create a new directory in dired mode, the completion is very annoying.
The text was updated successfully, but these errors were encountered: