-
Notifications
You must be signed in to change notification settings - Fork 33
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
Improve history browsing with file completions #368
Improve history browsing with file completions #368
Conversation
f4f074f
to
296bade
Compare
296bade
to
7b1a099
Compare
@minad Do you think the current behaviour for file history browsing is sufficient? Or should there be a help message that you have to press TAB to refresh for the current history item? |
I am not sure I understand exactly what you mean but I never had problems with file browsing 😆 |
I mean when you press |
This avoid issues with tramp and unintended hitting of slow file systems when going through the items using |
Yes, I've seen that. Why is that? It is not a big problem but I always felt that this is some kind of bug, but not a problematic one. |
Okay, I see - because of TRAMP. I would just keep it as is then. No help message please. Usually I am annoyed by too many messages. I even have the following somewhere in my config: ;; completely suppress some standard messages
(defconst config--suppressed-messages
'("Mark set" "Mark activated" "Mark deactivated"
"Mark saved where search started"
"Back to top level"
"Beginning of buffer" "End of buffer"))
(defconst config--suppressed-errors
'(beginning-of-buffer end-of-buffer))
(advice-add #'message :around
(lambda (fun fmt &rest args)
(if (and (null args) (member fmt config--suppressed-messages))
fmt
(apply fun fmt args))))
(advice-add #'command-error-default-function :around
(lambda (fun data &rest args)
(unless (memq (car data) config--suppressed-errors)
(apply fun data args)))) |
I see 😆, okay no message then but maybe indicating it in the prompt like for |
But I would also prefer to avoid introducing ugly handling code because of that. Maybe i's obvious enough that you have to use TAB to refresh. |
Hmm, I would also not add it to the prompt in particular if it needs special casing. It is really not important. In contrast, in the case of completing-read-multiple I find the message helpful and good, since otherwise it is not obvious that you have a completing-read-multiple. But maybe the message could be slightly more concise?
|
That is a good idea, I think I will change it to |
Oh, no that is not possible, because sometimes you get a more elaborate message like |
Or the word order would just be different then I guess that would be ok. |
"..and crm-separator", that's an overly verbose message. I did't even understand it before looking at the source. And it is not helpful since it does not show you what the crm separator is. I would probably just show the keybinding since I guess this is what people are going to use. And it is also clear that something special is going on since a keybinding is shown. But it might not be super beginner friendly. |
You could also change it to |
If the regexp used is known we already do show the character instead of "crm-separator", that is only used if someone uses a not so common regexp not found in our alist. |
Ah, I see. I didn't look that closely ;) |
I think generally I prefer that history commands don't automatically trigger updates, it find it distracting when using |
An alternative could be to also update for file history by default but check for tramp paths and when there is one don't update and show a message. Either this or what I have written above. |
I went with the latter, see #370. Now only tramp paths are not refreshed and a message is shown in that case, I hope the message won't annoy you to much it only appears when using |
Ensure the changes only affect the intended purpose and improve general behaviour:
selectrum-insert-current-candidate
in general only when browsing through history