-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
Add bookmark and possibly register actions #54
Comments
Thanks for the bookmark actions! |
Do the register actions really make sense? I don't think there are built-in commands that prompt with completing-read for a register. They all use |
Yes, there is the register menu in consult though, but it does not make sense to add actions for them here. |
Well, hold on a second. Why not add them here? They won't bother people who don't use consult, and might be useful for consult users. I do not oppose adding stuff that benefits consult users as long as it does not involve making consult a dependency. I already have default list view for the |
But the thing with registers is that other that inserting them or jumping to them, I can't really think of relevant actions, and the consult-register command combines both of those into one command already. |
This is exactly what I thought when I pressed close ;) But there is also increment-register and maybe there are more useful ones which make sense in the action menu of consult-register... |
To be honest, I don't use |
It is nothing more than a reminder of what register values you have stored, but I am also not using it much. You can always use the register list though. There has been some recent discussion in minad/consult#6 if there is a possibility to make it more useful |
But the built-in commands also remind you of what you have stored, that's what |
@oantolin That's right. But in that case the order of selection action is reversed. As I said, consult-register is of questionable usefulness. Maybe I should kick it out of consult again. But still it might be neat to have a consult view of registers and bookmarks and other similar things. |
At least I am pretty sure we should not add actions in Embark for registers as of now. If something comes up we can still reconsider? |
Ah, gotcha! Yes. I wasn't noticing this because I don't actually use either (defun use-register-dwim (register &optional arg)
"Do what I mean with a register.
For a window configuration, restore it. For a number or text, insert it.
For a location, jump to it."
(interactive
(list (register-read-with-preview "Use register: ")
current-prefix-arg))
(condition-case nil
(jump-to-register register arg)
(user-error (insert-register register arg)))) So I sort of forgot that with the built-in command you need to know whether you want to insert or jump before you select your command.
OK, yes, seems better not to yet.
Always! |
Cool command! I should scan your config for ideas more carefully at some point ;) So let's close this! |
That's my command to use registers, I also have one to store stuff in them, which is more ad hoc, but I've gotten used to it: (defun store-register-dwim (arg register)
"Store what I mean in a register.
With an active region, store or append (with \\[universal-argument]) the
contents, optionally deleting the region (with a negative
argument). With a numeric prefix, store the number. With \\[universal-argument]
store the frame configuration. Otherwise, store the point."
(interactive
(list current-prefix-arg
(register-read-with-preview "Store in register: ")))
(cond
((use-region-p)
(let ((begin (region-beginning))
(end (region-end))
(delete-flag (or (equal arg '-) (equal arg '(-4)))))
(if (consp arg)
(append-to-register register begin end delete-flag)
(copy-to-register register begin end delete-flag t))))
((numberp arg) (number-to-register arg register))
(t (point-to-register register arg)))) |
Nice :) |
Now I have to think if I can somehow adopt this for consult. Or maybe I only add something like this to my config... |
I love deleting stuff from my personal config, so I'd enjoy it if something like this made it into consult. I've already deleted functions that correspond to I don't think there is anything wrong with saying, "normally commands in consult use |
I also love to remove stuff from the init.el :) |
I'm not certain they apply here but there are |
Those would be good actions, @hmelman! The issue with register actions though, is that no built-in commands prompt you for a register with |
@oantolin I am not 100% convinced by register-read-with-preview tbh, but consult-register is also not good. Still having this in the backlog minad/consult#77... |
Oh, I'm not saying Although it might be nice to have a chance to trigger actions... |
This is exactly what I have been thinking. |
Also |
Obviously ;) But I feel stronger about the not-so-informative preview etc. And I think other users mentioned that too in minad/consult#6 also in relation to consult-register, which uses the same non-informative text for the candidates. |
I don't use registers much, I don't think many emacs users do. I understand the UI limitations of I'd really rather see a cleaner consult/marginalia one line/register display of this info. The first (narrow) column would be the register name. A column like the describe commands do with a letter indicating the type of the register (location, text, window, number, etc.) and then the value with a longer text snippet or other value. This would probably require new FWIW, evil-mode supports vim markers which are very much like emacs registers and I think more central to the evil experience than registers are to the emacs experience. I think they just support locations and text. I don't think evil has a good display of the markers and as such counsel-evil-markers is pretty popular. A consult-registers could probably be adapted to a consult-evil-markers though I don't think it supports more actions then save and insert/jump. I'm not an evil user so I don't know more. |
@oantolin I can add those if you like.
The text was updated successfully, but these errors were encountered: