-
-
Notifications
You must be signed in to change notification settings - Fork 22
QueryOne!: Support /./ to immediately get term + -default when 0 results #265
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -221,13 +221,9 @@ When $::thisNode claims printer /name/ is a cups printer with /...options/ { | |
| } | ||
|
|
||
| Subscribe: print code /code/ { | ||
| set formats [dict get [QueryOne! the paper formats are /formats/] formats] | ||
| set formatName letter | ||
| set defaultFormatMatches [Query! paper format /format/ is the default paper format] | ||
| if {[llength $defaultFormatMatches] > 0} { | ||
| set candidate [dict get [lindex $defaultFormatMatches 0] format] | ||
| if {[dict exists $formats $candidate]} { set formatName $candidate } | ||
| } | ||
| Expect! the paper formats are /formats/ | ||
| set formatName [QueryOne! paper format /./ is the default paper format \ | ||
| -default letter] | ||
| set fmt $formats($formatName) | ||
|
|
||
| set mToPt 2834.646 | ||
|
|
@@ -345,20 +341,20 @@ Subscribe: print pdf /pdfPath/ with /...options/ { | |
| set args [list] | ||
|
|
||
| if {![dict exists $options printer]} { | ||
| set defaultPrinterMatches [Query! printer /printer/ is the default printer] | ||
| if {[llength $defaultPrinterMatches] > 0} { | ||
| dict set options printer [dict get [lindex $defaultPrinterMatches 0] printer] | ||
| } | ||
| try { | ||
| dict set options printer \ | ||
| [QueryOne! printer /./ is the default printer] | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would you want a flag like
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or I suppose this is just in case nothing is returned, never mind. |
||
| } on error e {} | ||
| } | ||
| if {[dict exists $options printer]} { | ||
| lappend args -P $options(printer) | ||
| } | ||
|
|
||
| if {![dict exists $options format]} { | ||
| set defaultFormatMatches [Query! paper format /format/ is the default paper format] | ||
| if {[llength $defaultFormatMatches] > 0} { | ||
| dict set options format [dict get [lindex $defaultFormatMatches 0] format] | ||
| } | ||
| try { | ||
| dict set options format \ | ||
| [QueryOne! paper format /./ is the default paper format] | ||
| } on error e {} | ||
| } | ||
| if {[dict exists $options format]} { | ||
| lappend args -o media=$options(format) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you allow flags to be passed in after query parameters? I suppose this is more of an edge case, but
--might be needed in the future.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, I think we allow flags anywhere? + it reads better this way, I think, without the
letterright up next topaperThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I like the idea of eventually supporting
--