Replies: 3 comments 21 replies
-
|
I agree that the current argument interface could be improved. But I don't really find your suggestion convincing. I have to think about it more. There are also other improvement ideas, which didn't materialize so far, e.g., a transient which manipulate the arguments separately (but then they would be lost in the minibuffer history), or completion of arguments. What about this format? Initial input could be this: Unfortunately this makes it harder to change the separator character, so its probably also not that great. |
Beta Was this translation helpful? Give feedback.
-
|
Continuing this after our discussion on
Taken together, this would imply that it needs to be easy to enter either input or arguments or both, in whichever order. This suggests:
|
Beta Was this translation helpful? Give feedback.
-
|
I took a look. This works very well so far, and I'm finding it pretty intuitive. The options highlighting really helps. A few things I noticed:
On the last point, since the package is so new, I don't mind requiring the new version of One other little thing: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I make heavy use of arguments with various "two-part" consult commands (e.g.
consult-rgoften needs a type (e.g.-t elisp) or pattern (-g *.[ch]). The current UI for providing arguments —#<search> -- <args>#filter— is not ideal for a couple of reasons:<args>, arguments which may drastically limit the search space. This can generate a massive amount of unwanted data, especially if...consult-fdwith (e.g.)--newer 60min, and I don't need any match pattern — I just want the files modified in the last hour. Right now I have to use#. -- --newer 60min, which of course kicks off a large search of everything matching.if you type in that order. Otherwise you have to type in the args, then go back to the beginning of the prompt and add an (uninteresting) pattern.I've considered an alternative syntax for arguments:
(where
@is some separator char).E.g. in
consult-fd,--newer 60min@would kick off afd --newer 60minprocess.But the separator here becomes a problem. First, this would obviously require args not to contain the separator character. Since consult uses any instance of leading punctuation as the separator, this would have to be refined. How will it know what separator to use?
consultcould take a page fromcorfuand letM-SPCenter a fixed separator such as a non-breaking space, and respect that as a fixed separator no matter where it occurs. This would probably also require ruling out-as a valid separator character, and, if the string starts with-, wait to kick off the search until a "real" separator is supplied. I think-is of dubious use as a separator anyway, since it basically eliminates the possibility of arguments.So:
#foo: as now, kicks off a process withfooas pattern.#foo -- -abc: same, but with args-abc.#foo -- -abc#filter: same but with a filter too.-abc@: (where@indicates the always-on separator character) starts a search with no pattern and args-abc, only after the separator is provided.-abc@foo@filter: full pattern/args/filter using 2 separators.The user could configure a "magic character" for the "always on" separator, which is always respected (and can be entered with
M-SPCas a convenience for using unicode chars here). E.g.consult-alternate-separator-char(defaultnil).One possible variation on this theme: if the alternate separator is configured, you could prompt with it instead of
#. Everything else would remain the same, but all two part commands now become three part commands:@args@pattern@filter. This would save removing the#if you wanted the alternate syntax. I don't love this since often/usually I don't want args, and I'd have to use@@pattern.Maybe there's a better version/simplification/refinement of this type of idea, but it definitely feels like arguments could use some love in the interface.
Beta Was this translation helpful? Give feedback.
All reactions