Consider using hyperdrive--context-entry everywhere

We discussed removing the hyperdrive-dir-* commands in favor of using hyperdrive--context-entry' in the interactive block their hyperdrive-* alternatives. This means thathyperdrive-find-file' and similar commands would not prompt in a directory buffer without C-u.

Assigned to
4 months ago
3 months ago
0.4.0 hyperdrive.el

~tarsius 4 months ago*

I am generally very much in favor of "get the current thing of this kind, if this is at all possible in this context" functions, and then using them everywhere. This avoids having to re-implement such logic over and over, and having these competing implementations differ in correctness and functionality.

I recently improved such functions in Forge and would be interested in working on such functions in Hyperdrive too. Looking at hyperdrive--context-entry, that doesn't seem to cover much ground yet.

It also falls back to reading a drive if none is found. It probably would make sense to move that into a second function hyperdrive-select-entry, and to use that in commands' interactive forms. This function could support two modes of operation:

  1. Always prompt for an entry, defaulting to the current entry.
  2. If any, use the current entry without offering using completing-read or requiring confirmation. Else prompt for an entry.

And this could be made user customizable. I.e., we would pick a default for each command that uses this selection function, but users could add or remove commands from a list of commands that always prompt.

Register here or Log in to comment, or comment via email.