{"action":"created","issue":{"url":"https://api.github.com/repos/xonsh/xonsh/issues/1186","repository_url":"https://api.github.com/repos/xonsh/xonsh","labels_url":"https://api.github.com/repos/xonsh/xonsh/issues/1186/labels{/name}","comments_url":"https://api.github.com/repos/xonsh/xonsh/issues/1186/comments","events_url":"https://api.github.com/repos/xonsh/xonsh/issues/1186/events","html_url":"https://github.com/xonsh/xonsh/pull/1186","id":159319270,"number":1186,"title":"More Ways to Search","user":{"login":"adqm","id":549404,"avatar_url":"https://avatars.githubusercontent.com/u/549404?v=3","gravatar_id":"","url":"https://api.github.com/users/adqm","html_url":"https://github.com/adqm","followers_url":"https://api.github.com/users/adqm/followers","following_url":"https://api.github.com/users/adqm/following{/other_user}","gists_url":"https://api.github.com/users/adqm/gists{/gist_id}","starred_url":"https://api.github.com/users/adqm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adqm/subscriptions","organizations_url":"https://api.github.com/users/adqm/orgs","repos_url":"https://api.github.com/users/adqm/repos","events_url":"https://api.github.com/users/adqm/events{/privacy}","received_events_url":"https://api.github.com/users/adqm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-09T03:01:14Z","updated_at":"2016-06-09T03:10:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/xonsh/xonsh/pulls/1186","html_url":"https://github.com/xonsh/xonsh/pull/1186","diff_url":"https://github.com/xonsh/xonsh/pull/1186.diff","patch_url":"https://github.com/xonsh/xonsh/pull/1186.patch"},"body":"There was some call in the Gitter/IRC for the ability to do something like the regex globs, but for normal globs, so...\r\n\r\nThis changeset expands upon the \"regex globbing\" syntax (<code>``</code>), adding support for additional types of searches with backticks.\r\n\r\nThe behavior of <code>``</code> is unchanged, but this patch includes the ability to use:\r\n* <code>r``</code> for regex globbing\r\n*  <code>regex``</code> for regex globbing\r\n* <code>g``</code> for normal globbing\r\n* <code>glob``</code> for normal globbing\r\n\r\n\r\nJust in case those aren't enough, this also allows users to specify their own search functions, and what prefixes should be associated with them.  A dumb example:\r\n```\r\nhartz@virtual1 ~ $ $PATH_SEARCH_FUNCS\r\n{'': <function xonsh.built_ins.regexsearch>,\r\n 'g': <function xonsh.tools.globpath>,\r\n 'glob': <function xonsh.tools.globpath>,\r\n 'r': <function xonsh.built_ins.regexsearch>,\r\n 'regex': <function xonsh.built_ins.regexsearch>}\r\nhartz@virtual1 ~ $ $PATH_SEARCH_FUNCS['b'] = lambda s: ['hey', 'there']\r\nhartz@virtual1 ~ $ \r\nhartz@virtual1 ~ $ b`test`\r\n['hey', 'there']\r\n```\r\n\r\nWhen trying to use a nonexistent search function, an error is generated, both in Python mode and in subproc mode:\r\n```\r\nhartz@virtual1 ~ $ for i in notdefined`test`:\r\n..................     print(7)\r\n..................     \r\n.................. \r\n'notdefined' is not a known path search function\r\nhartz@virtual1 ~ $ \r\nhartz@virtual1 ~ $ ls notdefined`test`\r\n'notdefined' is not a known path search function\r\n```"},"comment":{"url":"https://api.github.com/repos/xonsh/xonsh/issues/comments/224789947","html_url":"https://github.com/xonsh/xonsh/pull/1186#issuecomment-224789947","issue_url":"https://api.github.com/repos/xonsh/xonsh/issues/1186","id":224789947,"user":{"login":"codecov-io","id":8655789,"avatar_url":"https://avatars.githubusercontent.com/u/8655789?v=3","gravatar_id":"","url":"https://api.github.com/users/codecov-io","html_url":"https://github.com/codecov-io","followers_url":"https://api.github.com/users/codecov-io/followers","following_url":"https://api.github.com/users/codecov-io/following{/other_user}","gists_url":"https://api.github.com/users/codecov-io/gists{/gist_id}","starred_url":"https://api.github.com/users/codecov-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codecov-io/subscriptions","organizations_url":"https://api.github.com/users/codecov-io/orgs","repos_url":"https://api.github.com/users/codecov-io/repos","events_url":"https://api.github.com/users/codecov-io/events{/privacy}","received_events_url":"https://api.github.com/users/codecov-io/received_events","type":"User","site_admin":false},"created_at":"2016-06-09T03:10:43Z","updated_at":"2016-06-09T03:10:43Z","body":"## [Current coverage][cc-pull] is **39.04%**\n> Merging [#1186][cc-pull] into [master][cc-base-branch] will increase coverage by **0.04%**\n\n```diff\n@@             master      #1186   diff @@\n==========================================\n  Files            66         66          \n  Lines         14165      14179    +14   \n  Methods           0          0          \n  Messages          0          0          \n  Branches          0          0          \n==========================================\n+ Hits           5524       5536    +12   \n- Misses         8641       8643     +2   \n  Partials          0          0          \n```\n\n> Powered by [Codecov](https://codecov.io?src=pr). Last updated by [cb1a3cb...95076d8][cc-compare]\n[cc-base-branch]: https://codecov.io/gh/xonsh/xonsh/branch/master?src=pr\n[cc-compare]: https://codecov.io/gh/xonsh/xonsh/compare/cb1a3cb4f05afed7ea19fb7527e9ac64aae63f06...95076d89342180831aff77d66626c73d76e0d56b\n[cc-pull]: https://codecov.io/gh/xonsh/xonsh/pull/1186?src=pr"}}
{"actor":{"display_login":"codecov-io"}}