Skip to content
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

Let -s ignore number prefix of script to include #3

Closed
fictionic opened this issue Jan 7, 2018 · 8 comments
Closed

Let -s ignore number prefix of script to include #3

fictionic opened this issue Jan 7, 2018 · 8 comments

Comments

@fictionic
Copy link

fictionic commented Jan 7, 2018

The indeces of the scripts are an implementation detail that the user should not need to worry about. The user only cares about the functionality of the included script, which is indicated in the main part of the name. E.g. -s cover vs -s 70-cover.

Another, more drastic idea would be to make -s work exactly like -r—that is, make it include all scripts whose name match the provided regex. This is desirable for the same reason as it is for -r. Suppose you have two scripts that deal with file tags (as I do): 10-tag-fields and 11-tag-contents. If you want to run only those scripts, you'd need to do -r '' -s 10-tag-fields -s 11-tag-contents. With the regex strategy, this becomes -r '' -s tag. This also occurs when the scripts you want to include are not run by default.

What do you think?

@Ambrevar
Copy link
Owner

In retrospect, the commandline usability of demlo suffers from debatable design decisions.
Your suggestion only tackles the tip of iceberg...

  1. First of, to make sure there is no misunderstanding: indices are used to sort scripts in the script chain.
    For instance, 10-tag is run before 60-path, which is almost always what we want.

I think there originally were a few reason as for why -s does not accept regexp; however, with latest versions none of them seems to be valid anymore.

  1. Pro-tip: If you use the fish shell or Eshell, demlo can auto-complete the script names.

Completion does not work on -r though, I think it's an oversight. I should fix that too.

@Ambrevar
Copy link
Owner

Ambrevar commented Jan 16, 2018

Other points unrelated to your request, but I'm curious if you'd have any comment on this.

  1. I think each script should come with an individual help which would provide a description, a list of the global variables in use if any, and some examples. I believe that would make Demlo dramatically more user friendly.

  2. Sensible defaults: right now, the included demlorc is not parsed in the system folder. I think Demlo should parse it so that a config-less Demlo does something meaningful by default instead of doing nothing. It would still be possible revert to the current behaviour by either uninstalling the system demlorc or by creating and empty user demlorc.

@Ambrevar
Copy link
Owner

Ambrevar commented Jan 16, 2018

  1. Write a GUI. See Emacs mode (GUI) #4.

@fictionic
Copy link
Author

  1. Yes I do know the purpose of the prefixes. That's all good.
  2. I know, and I use zsh... is zsh completion something you plan on doing? Not the biggest priority obviously, but it would be nice.
  3. Yes, in fact that is something I plan to do for my own demlo script system (which sort of creates its own use framework anyway). See here (it's still a work in progress, but it's usable).
  4. Ah, that is also a good idea! Though how would you deal with the fact that the user might have modified the scripts in the user config folder? I suppose if that folder exists then the system one should be ignored?

@Ambrevar
Copy link
Owner

Ambrevar commented Jan 17, 2018

(2) I've dumped zsh a long time ago... Too much insanity there for me, sorry :p I'll welcome any contribution however, obviously.

(4) You meant demlorc, right? Then that's correct.

@fictionic
Copy link
Author

(2) Yeah it's hella complicated for sure. I'll look into it at some point.

(3) Yep

I'd also love any feedback you have on my demloconf repo that I linked above; I've worked on it a whole lot!

This was referenced Jan 19, 2018
@Ambrevar
Copy link
Owner

Fixed in 285f069.

@Ambrevar
Copy link
Owner

@fictionic Let me know if that works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants