-
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
multi-occur is not very comfortable with selectrum #226
Comments
Thanks for your input! I agree that the problem is more with the command itself than with selectrum. This is a great candidate for (defun my-multi-occur ()
(interactive)
(let ((bufs
(mapcar #'get-buffer
(completing-read-multiple "Buffer: "
#'internal-complete-buffer))))
(apply #'multi-occur (cons bufs (occur-read-primary-args))))) To exit with a single buffer you exit with |
@clemera Thank you for your response! I wonder - why is multi-occur not using |
@clemera After looking at (defun multi-occur (bufs regexp &optional nlines)
(interactive (cons
(mapcar #'get-buffer
(completing-read-multiple "Buffer: "
#'internal-complete-buffer))
(occur-read-primary-args)))
(occur-1 regexp nlines bufs)) or alternatively (defun my-multi-occur (bufs regexp &optional nlines)
(interactive (cons
(mapcar #'get-buffer
(completing-read-multiple "Buffer: "
#'internal-complete-buffer))
(occur-read-primary-args)))
(multi-occur regexp nlines bufs)) This should probably go to the wiki or we should consider upstreaming the improved multi-occur? EDIT: For reference the original code of multi-occur in replace.el is the following: (defun multi-occur (bufs regexp &optional nlines)
(interactive
(cons
(let* ((bufs (list (read-buffer "First buffer to search: "
(current-buffer) t)))
(buf nil)
(ido-ignore-item-temp-list bufs))
(while (not (string-equal
(setq buf (read-buffer
(if (eq read-buffer-function #'ido-read-buffer)
"Next buffer to search (C-j to end): "
"Next buffer to search (RET to end): ")
nil t))
""))
(cl-pushnew buf bufs)
(setq ido-ignore-item-temp-list bufs))
(nreverse (mapcar #'get-buffer bufs)))
(occur-read-primary-args)))
(occur-1 regexp nlines bufs)) |
Yes, adding it to the wiki would be great! |
@clemera Thank you - I will add this to the wiki for now! Regarding upstreaming - I will look into this when I have time, but I cannot make any promises here. |
Great, thanks! |
Just in case you didn't know, you can also use |
Any conclusions if this should be reported as a bug in Emacs that |
@hmelman If you want you can create a bug report and attach a patch based on |
If I am using
selectrum-mode
and callM-x multi-occur
it asks me to select multiple buffers and finish with "RET". Since selectrum already preselects the first choice, I have to move the cursor up to finish, which is not very comfortable. Probably selectrum should not preselect in that case? Furthermore after selecting one buffer it should not appear again in the list of choices.I am not sure if something like this could be fixed in selectrum, since it is a special case. Maybe some custom wrapper could be written around
multi-occur
? Maybe someone had the same issue and there is already a good solution for the problem?The text was updated successfully, but these errors were encountered: