{"action":"created","issue":{"url":"https://api.github.com/repos/kkinnear/zprint/issues/85","repository_url":"https://api.github.com/repos/kkinnear/zprint","labels_url":"https://api.github.com/repos/kkinnear/zprint/issues/85/labels{/name}","comments_url":"https://api.github.com/repos/kkinnear/zprint/issues/85/comments","events_url":"https://api.github.com/repos/kkinnear/zprint/issues/85/events","html_url":"https://github.com/kkinnear/zprint/issues/85","id":391049154,"node_id":"MDU6SXNzdWUzOTEwNDkxNTQ=","number":85,"title":"Newline insertion according to a configuration","user":{"login":"vemv","id":1162994,"node_id":"MDQ6VXNlcjExNjI5OTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1162994?v=4","gravatar_id":"","url":"https://api.github.com/users/vemv","html_url":"https://github.com/vemv","followers_url":"https://api.github.com/users/vemv/followers","following_url":"https://api.github.com/users/vemv/following{/other_user}","gists_url":"https://api.github.com/users/vemv/gists{/gist_id}","starred_url":"https://api.github.com/users/vemv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vemv/subscriptions","organizations_url":"https://api.github.com/users/vemv/orgs","repos_url":"https://api.github.com/users/vemv/repos","events_url":"https://api.github.com/users/vemv/events{/privacy}","received_events_url":"https://api.github.com/users/vemv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-14T10:18:20Z","updated_at":"2018-12-18T02:32:08Z","closed_at":null,"author_association":"NONE","body":"Hi!\r\n\r\nI'm considering adopting zprint.\r\n\r\nI wonder if as of today it can turn `(if x y z)` into `(if x\\n  y\\n  z)` according to a user-tweakable configuration.\r\n\r\nIOW, I want to establish+enforce some rules about what should include newlines, and where. More examples: `fn` (always insert a newline after the first _vector_), `when` (always insert a newline after whatever the first arg is). `if` is particularly interesting because it features _two_ newlines to be inserted.\r\n\r\nThoughts?\r\n\r\nThanks - Victor"},"comment":{"url":"https://api.github.com/repos/kkinnear/zprint/issues/comments/448074553","html_url":"https://github.com/kkinnear/zprint/issues/85#issuecomment-448074553","issue_url":"https://api.github.com/repos/kkinnear/zprint/issues/85","id":448074553,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0ODA3NDU1Mw==","user":{"login":"kkinnear","id":1503220,"node_id":"MDQ6VXNlcjE1MDMyMjA=","avatar_url":"https://avatars2.githubusercontent.com/u/1503220?v=4","gravatar_id":"","url":"https://api.github.com/users/kkinnear","html_url":"https://github.com/kkinnear","followers_url":"https://api.github.com/users/kkinnear/followers","following_url":"https://api.github.com/users/kkinnear/following{/other_user}","gists_url":"https://api.github.com/users/kkinnear/gists{/gist_id}","starred_url":"https://api.github.com/users/kkinnear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkinnear/subscriptions","organizations_url":"https://api.github.com/users/kkinnear/orgs","repos_url":"https://api.github.com/users/kkinnear/repos","events_url":"https://api.github.com/users/kkinnear/events{/privacy}","received_events_url":"https://api.github.com/users/kkinnear/received_events","type":"User","site_admin":false},"created_at":"2018-12-18T02:32:08Z","updated_at":"2018-12-18T02:32:08Z","author_association":"OWNER","body":"Sure, you can configure that by changing the `:fn-map` for `if`, `when`, and `fn`:\r\n```\r\nzprint.core=> (czprint \"(if a b c)\" {:parse-string? true})\r\n(if a b c)\r\nnil\r\nzprint.core=> (czprint \"(if a b c)\" {:parse-string? true :fn-map {\"if\" :arg1-force-nl}})\r\n(if a\r\n  b\r\n  c)\r\nnil\r\nzprint.core=> (czprint \"(fn [] a b c)\" {:parse-string? true :fn-map {\"fn\" :arg1-force-nl}})\r\n(fn []\r\n  a\r\n  b\r\n  c)\r\n```\r\nThe `{:parse-string? true}` is just to make it easier to show this formatting.  You would just put this:\r\n```\r\n{:fn-map {\"if\" :arg1-force-nl \"when\" :arg1-force-nl \"fn\" :arg1-force-nl}}\r\n```\r\nin your `~/.zprintrc`.   Let me know if you have any problems."}}
{"actor":{"display_login":"kkinnear"}}