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

nano: add nix syntax hightlight, nano module: provide default #21912

Merged
merged 2 commits into from Jan 18, 2017
Merged

nano: add nix syntax hightlight, nano module: provide default #21912

merged 2 commits into from Jan 18, 2017

Conversation

ghost
Copy link

@ghost ghost commented Jan 15, 2017

cc @seitz

Motivation for this change
Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@mention-bot
Copy link

@gnidorah, thanks for your PR! By analyzing the history of the files in this pull request, we identified @joachifm, @mimadrid and @gridaphobe to be potential reviewers.

set nowrap
set tabstospaces
set tabsize 2
include "${pkgs.nano}/share/nano/*.nanorc"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this line be added always? Not only when no other value is set?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@globin sorry, what do you want to ask?

i see problems in the tabstospaces and tabsize definition. the include just makes the nix-highlight but basically all highlights a default, which would be a huge win.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@globin For me this line is not added when I set programs.nano.nanorc in configuration.nix, or am I miss something?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gnidorah I took that to mean that perhaps the include should be addded unconditionally

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joachifm Not sure it's a good idea, user may wish not to load these highlights

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that now nix must build nano to generate the manual; usually, we use defaultText to work around that.

Perhaps enabling syntax highlighting could be made into an option?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joachifm

Perhaps enabling syntax highlighting could be made into an option?

Added, thank you!

Note that now nix must build nano to generate the manual; usually, we use defaultText to work around that.

Should I just put defaultText = "something";? I see manual gets rebuilded only when I change default value in module file, not when I overwrite programs.nano.nanorc in configuration.nix

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not necessary to set defaultText now; it's a hack to avoid incurring lots of work to render the manual (typically whenever the default value refers to a package or other non-trivial artefact).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also to make build artefacts render better; package values tend to not look very good when rendered directly, to the point of being useless to the reader (compare the rendered result of default = pkgs.foo versus defaultText = "pkgs.foo").

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qknight

the include just makes the nix-highlight but basically all highlights a default, which would be a huge win

This is now moved into an option as suggested by @joachifm

Copy link
Member

@qknight qknight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gnidorah
please remove the tabstospaces as it will destroy Makefiles for instance. if you fix that last bit i will just merge it. thanks for all your work!

set nowrap
set tabstospaces
set tabsize 2
include "${pkgs.nano}/share/nano/*.nanorc"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@globin sorry, what do you want to ask?

i see problems in the tabstospaces and tabsize definition. the include just makes the nix-highlight but basically all highlights a default, which would be a huge win.

@ghost
Copy link
Author

ghost commented Jan 18, 2017

@qknight Thanks! The default was composed for nix files in mind, but since it breaks Makefile format, I've undo that change.

@qknight qknight merged commit 4a662e5 into NixOS:master Jan 18, 2017
@ghost ghost deleted the nano branch January 18, 2017 12:19
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

Successfully merging this pull request may close these issues.

None yet

4 participants