{"action":"created","comment":{"url":"https://api.github.com/repos/ocaml/ocaml/pulls/comments/214650537","pull_request_review_id":151751121,"id":214650537,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNDY1MDUzNw==","diff_hunk":"@@ -376,7 +376,26 @@ val set_max_indent : int -> unit\n (** [pp_set_max_indent ppf d] sets the maximum indentation limit of lines\n   to [d] (in characters):\n   once this limit is reached, new pretty-printing boxes are rejected to the\n-  left, if they do not fit on the current line.\n+  left, unless the enclosing box fully fits on the current line.\n+  As an illustration,\n+  {[ set_margin 10; set_max_indent 5; printf \"@[123456@[7@]89A@]@.\" ]}\n+  yields\n+  {[\n+    123456\n+    789A\n+  ]}\n+  because the nested box [\"@[7@]\"] is opened after the maximum indentation\n+  limit ([7>5]) and its parent box does not fit on the current line.\n+  Contrarily, either decreasing the length of the parent box to make it fit\n+  on a line:\n+  {[ printf \"@[123456@[7@]89@]@.\" ]}\n+  or opening an intermediary box before the maximum indentation limit which\n+  fits on the current line\n+  {[ printf \"@[123@[456@[7@]89@]A@]@.\" ]}\n+  avoid the rejection to the left of the inner boxes and print respectively","path":"stdlib/format.mli","position":21,"original_position":21,"commit_id":"16d6c53014661a57943d72dc273ab484250c24eb","original_commit_id":"16d6c53014661a57943d72dc273ab484250c24eb","user":{"login":"rbonichon","id":5184249,"node_id":"MDQ6VXNlcjUxODQyNDk=","avatar_url":"https://avatars3.githubusercontent.com/u/5184249?v=4","gravatar_id":"","url":"https://api.github.com/users/rbonichon","html_url":"https://github.com/rbonichon","followers_url":"https://api.github.com/users/rbonichon/followers","following_url":"https://api.github.com/users/rbonichon/following{/other_user}","gists_url":"https://api.github.com/users/rbonichon/gists{/gist_id}","starred_url":"https://api.github.com/users/rbonichon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbonichon/subscriptions","organizations_url":"https://api.github.com/users/rbonichon/orgs","repos_url":"https://api.github.com/users/rbonichon/repos","events_url":"https://api.github.com/users/rbonichon/events{/privacy}","received_events_url":"https://api.github.com/users/rbonichon/received_events","type":"User","site_admin":false},"body":"x or y avoid -> x or y avoids (I think)","created_at":"2018-09-03T11:00:13Z","updated_at":"2018-09-03T11:00:14Z","html_url":"https://github.com/ocaml/ocaml/pull/1596#discussion_r214650537","pull_request_url":"https://api.github.com/repos/ocaml/ocaml/pulls/1596","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ocaml/ocaml/pulls/comments/214650537"},"html":{"href":"https://github.com/ocaml/ocaml/pull/1596#discussion_r214650537"},"pull_request":{"href":"https://api.github.com/repos/ocaml/ocaml/pulls/1596"}}},"pull_request":{"url":"https://api.github.com/repos/ocaml/ocaml/pulls/1596","id":166957285,"node_id":"MDExOlB1bGxSZXF1ZXN0MTY2OTU3Mjg1","html_url":"https://github.com/ocaml/ocaml/pull/1596","diff_url":"https://github.com/ocaml/ocaml/pull/1596.diff","patch_url":"https://github.com/ocaml/ocaml/pull/1596.patch","issue_url":"https://api.github.com/repos/ocaml/ocaml/issues/1596","number":1596,"state":"open","locked":false,"title":"MPR#7720, format documentation: maximum indentation limit","user":{"login":"Octachron","id":7689388,"node_id":"MDQ6VXNlcjc2ODkzODg=","avatar_url":"https://avatars1.githubusercontent.com/u/7689388?v=4","gravatar_id":"","url":"https://api.github.com/users/Octachron","html_url":"https://github.com/Octachron","followers_url":"https://api.github.com/users/Octachron/followers","following_url":"https://api.github.com/users/Octachron/following{/other_user}","gists_url":"https://api.github.com/users/Octachron/gists{/gist_id}","starred_url":"https://api.github.com/users/Octachron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Octachron/subscriptions","organizations_url":"https://api.github.com/users/Octachron/orgs","repos_url":"https://api.github.com/users/Octachron/repos","events_url":"https://api.github.com/users/Octachron/events{/privacy}","received_events_url":"https://api.github.com/users/Octachron/received_events","type":"User","site_admin":false},"body":"This PR proposes to fix a discrepancy between the documentation of `Format.set_indent` and the implemented behavior of Format on the subject of when a new box is rejected to the left.\r\n\r\nThe current documentation precises that\r\n> pp_set_max_indent ppf d sets the maximum indentation limit of lines to d (in characters): once this limit is reached, new pretty-printing boxes are rejected to the left, if they do not fit on the current line.\r\n\r\nWith this documentation, it seems natural to expect that\r\n```OCaml\r\n set_margin 10;\r\nset_max_indent 5; printf \"@[123456@[7@]89A@]@.\"\r\n```\r\ndisplays\r\n> \"123456789A\"\r\n\r\nsince the contents of the box `@[7@]` does fit on the line.\r\n\r\nHowever, the currently implemented behavior is to reject new box opened after the indentation limit to the left if their *parent* box does not fit on the line (i.e. if they are not replaced by a fit box). Consequently, the previous example rejects the inner box to the left and prints\r\n\r\n> 123456\r\n> 789A\r\n\r\nwhereas both `printf \"@[123456@[7@]89@]@.\"` and `printf \"@[123@[456@[7@]89@]A@]@.\"` avoid this rejection to the left and prints `123456789` and `123456789A` respectively.\r\n\r\nThis PR updates the documentation to reflect the current behavior and adds the three examples above to illustrate this behavior.","created_at":"2018-02-03T10:52:45Z","updated_at":"2018-09-03T11:00:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"af745417ee120366e5ab879e138dfc7d8e929033","assignee":{"login":"pierreweis","id":15340192,"node_id":"MDQ6VXNlcjE1MzQwMTky","avatar_url":"https://avatars2.githubusercontent.com/u/15340192?v=4","gravatar_id":"","url":"https://api.github.com/users/pierreweis","html_url":"https://github.com/pierreweis","followers_url":"https://api.github.com/users/pierreweis/followers","following_url":"https://api.github.com/users/pierreweis/following{/other_user}","gists_url":"https://api.github.com/users/pierreweis/gists{/gist_id}","starred_url":"https://api.github.com/users/pierreweis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierreweis/subscriptions","organizations_url":"https://api.github.com/users/pierreweis/orgs","repos_url":"https://api.github.com/users/pierreweis/repos","events_url":"https://api.github.com/users/pierreweis/events{/privacy}","received_events_url":"https://api.github.com/users/pierreweis/received_events","type":"User","site_admin":false},"assignees":[{"login":"pierreweis","id":15340192,"node_id":"MDQ6VXNlcjE1MzQwMTky","avatar_url":"https://avatars2.githubusercontent.com/u/15340192?v=4","gravatar_id":"","url":"https://api.github.com/users/pierreweis","html_url":"https://github.com/pierreweis","followers_url":"https://api.github.com/users/pierreweis/followers","following_url":"https://api.github.com/users/pierreweis/following{/other_user}","gists_url":"https://api.github.com/users/pierreweis/gists{/gist_id}","starred_url":"https://api.github.com/users/pierreweis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierreweis/subscriptions","organizations_url":"https://api.github.com/users/pierreweis/orgs","repos_url":"https://api.github.com/users/pierreweis/repos","events_url":"https://api.github.com/users/pierreweis/events{/privacy}","received_events_url":"https://api.github.com/users/pierreweis/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"pierreweis","id":15340192,"node_id":"MDQ6VXNlcjE1MzQwMTky","avatar_url":"https://avatars2.githubusercontent.com/u/15340192?v=4","gravatar_id":"","url":"https://api.github.com/users/pierreweis","html_url":"https://github.com/pierreweis","followers_url":"https://api.github.com/users/pierreweis/followers","following_url":"https://api.github.com/users/pierreweis/following{/other_user}","gists_url":"https://api.github.com/users/pierreweis/gists{/gist_id}","starred_url":"https://api.github.com/users/pierreweis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierreweis/subscriptions","organizations_url":"https://api.github.com/users/pierreweis/orgs","repos_url":"https://api.github.com/users/pierreweis/repos","events_url":"https://api.github.com/users/pierreweis/events{/privacy}","received_events_url":"https://api.github.com/users/pierreweis/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ocaml/ocaml/pulls/1596/commits","review_comments_url":"https://api.github.com/repos/ocaml/ocaml/pulls/1596/comments","review_comment_url":"https://api.github.com/repos/ocaml/ocaml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ocaml/ocaml/issues/1596/comments","statuses_url":"https://api.github.com/repos/ocaml/ocaml/statuses/16d6c53014661a57943d72dc273ab484250c24eb","head":{"label":"Octachron:format_doc_max_indent","ref":"format_doc_max_indent","sha":"16d6c53014661a57943d72dc273ab484250c24eb","user":{"login":"Octachron","id":7689388,"node_id":"MDQ6VXNlcjc2ODkzODg=","avatar_url":"https://avatars1.githubusercontent.com/u/7689388?v=4","gravatar_id":"","url":"https://api.github.com/users/Octachron","html_url":"https://github.com/Octachron","followers_url":"https://api.github.com/users/Octachron/followers","following_url":"https://api.github.com/users/Octachron/following{/other_user}","gists_url":"https://api.github.com/users/Octachron/gists{/gist_id}","starred_url":"https://api.github.com/users/Octachron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Octachron/subscriptions","organizations_url":"https://api.github.com/users/Octachron/orgs","repos_url":"https://api.github.com/users/Octachron/repos","events_url":"https://api.github.com/users/Octachron/events{/privacy}","received_events_url":"https://api.github.com/users/Octachron/received_events","type":"User","site_admin":false},"repo":{"id":20154083,"node_id":"MDEwOlJlcG9zaXRvcnkyMDE1NDA4Mw==","name":"ocaml","full_name":"Octachron/ocaml","owner":{"login":"Octachron","id":7689388,"node_id":"MDQ6VXNlcjc2ODkzODg=","avatar_url":"https://avatars1.githubusercontent.com/u/7689388?v=4","gravatar_id":"","url":"https://api.github.com/users/Octachron","html_url":"https://github.com/Octachron","followers_url":"https://api.github.com/users/Octachron/followers","following_url":"https://api.github.com/users/Octachron/following{/other_user}","gists_url":"https://api.github.com/users/Octachron/gists{/gist_id}","starred_url":"https://api.github.com/users/Octachron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Octachron/subscriptions","organizations_url":"https://api.github.com/users/Octachron/orgs","repos_url":"https://api.github.com/users/Octachron/repos","events_url":"https://api.github.com/users/Octachron/events{/privacy}","received_events_url":"https://api.github.com/users/Octachron/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Octachron/ocaml","description":"Read-only mirror of INRIA SVN","fork":true,"url":"https://api.github.com/repos/Octachron/ocaml","forks_url":"https://api.github.com/repos/Octachron/ocaml/forks","keys_url":"https://api.github.com/repos/Octachron/ocaml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Octachron/ocaml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Octachron/ocaml/teams","hooks_url":"https://api.github.com/repos/Octachron/ocaml/hooks","issue_events_url":"https://api.github.com/repos/Octachron/ocaml/issues/events{/number}","events_url":"https://api.github.com/repos/Octachron/ocaml/events","assignees_url":"https://api.github.com/repos/Octachron/ocaml/assignees{/user}","branches_url":"https://api.github.com/repos/Octachron/ocaml/branches{/branch}","tags_url":"https://api.github.com/repos/Octachron/ocaml/tags","blobs_url":"https://api.github.com/repos/Octachron/ocaml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Octachron/ocaml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Octachron/ocaml/git/refs{/sha}","trees_url":"https://api.github.com/repos/Octachron/ocaml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Octachron/ocaml/statuses/{sha}","languages_url":"https://api.github.com/repos/Octachron/ocaml/languages","stargazers_url":"https://api.github.com/repos/Octachron/ocaml/stargazers","contributors_url":"https://api.github.com/repos/Octachron/ocaml/contributors","subscribers_url":"https://api.github.com/repos/Octachron/ocaml/subscribers","subscription_url":"https://api.github.com/repos/Octachron/ocaml/subscription","commits_url":"https://api.github.com/repos/Octachron/ocaml/commits{/sha}","git_commits_url":"https://api.github.com/repos/Octachron/ocaml/git/commits{/sha}","comments_url":"https://api.github.com/repos/Octachron/ocaml/comments{/number}","issue_comment_url":"https://api.github.com/repos/Octachron/ocaml/issues/comments{/number}","contents_url":"https://api.github.com/repos/Octachron/ocaml/contents/{+path}","compare_url":"https://api.github.com/repos/Octachron/ocaml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Octachron/ocaml/merges","archive_url":"https://api.github.com/repos/Octachron/ocaml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Octachron/ocaml/downloads","issues_url":"https://api.github.com/repos/Octachron/ocaml/issues{/number}","pulls_url":"https://api.github.com/repos/Octachron/ocaml/pulls{/number}","milestones_url":"https://api.github.com/repos/Octachron/ocaml/milestones{/number}","notifications_url":"https://api.github.com/repos/Octachron/ocaml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Octachron/ocaml/labels{/name}","releases_url":"https://api.github.com/repos/Octachron/ocaml/releases{/id}","deployments_url":"https://api.github.com/repos/Octachron/ocaml/deployments","created_at":"2014-05-25T12:35:17Z","updated_at":"2018-08-27T18:08:48Z","pushed_at":"2018-09-02T17:49:18Z","git_url":"git://github.com/Octachron/ocaml.git","ssh_url":"git@github.com:Octachron/ocaml.git","clone_url":"https://github.com/Octachron/ocaml.git","svn_url":"https://github.com/Octachron/ocaml","homepage":null,"size":187107,"stargazers_count":0,"watchers_count":0,"language":"OCaml","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"trunk"}},"base":{"label":"ocaml:trunk","ref":"trunk","sha":"b2321e12b73492c866eea20f65e4f6d850256d95","user":{"login":"ocaml","id":1841483,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4NDE0ODM=","avatar_url":"https://avatars3.githubusercontent.com/u/1841483?v=4","gravatar_id":"","url":"https://api.github.com/users/ocaml","html_url":"https://github.com/ocaml","followers_url":"https://api.github.com/users/ocaml/followers","following_url":"https://api.github.com/users/ocaml/following{/other_user}","gists_url":"https://api.github.com/users/ocaml/gists{/gist_id}","starred_url":"https://api.github.com/users/ocaml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocaml/subscriptions","organizations_url":"https://api.github.com/users/ocaml/orgs","repos_url":"https://api.github.com/users/ocaml/repos","events_url":"https://api.github.com/users/ocaml/events{/privacy}","received_events_url":"https://api.github.com/users/ocaml/received_events","type":"Organization","site_admin":false},"repo":{"id":6786166,"node_id":"MDEwOlJlcG9zaXRvcnk2Nzg2MTY2","name":"ocaml","full_name":"ocaml/ocaml","owner":{"login":"ocaml","id":1841483,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4NDE0ODM=","avatar_url":"https://avatars3.githubusercontent.com/u/1841483?v=4","gravatar_id":"","url":"https://api.github.com/users/ocaml","html_url":"https://github.com/ocaml","followers_url":"https://api.github.com/users/ocaml/followers","following_url":"https://api.github.com/users/ocaml/following{/other_user}","gists_url":"https://api.github.com/users/ocaml/gists{/gist_id}","starred_url":"https://api.github.com/users/ocaml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocaml/subscriptions","organizations_url":"https://api.github.com/users/ocaml/orgs","repos_url":"https://api.github.com/users/ocaml/repos","events_url":"https://api.github.com/users/ocaml/events{/privacy}","received_events_url":"https://api.github.com/users/ocaml/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ocaml/ocaml","description":"The core OCaml system: compilers, runtime system, base libraries","fork":false,"url":"https://api.github.com/repos/ocaml/ocaml","forks_url":"https://api.github.com/repos/ocaml/ocaml/forks","keys_url":"https://api.github.com/repos/ocaml/ocaml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ocaml/ocaml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ocaml/ocaml/teams","hooks_url":"https://api.github.com/repos/ocaml/ocaml/hooks","issue_events_url":"https://api.github.com/repos/ocaml/ocaml/issues/events{/number}","events_url":"https://api.github.com/repos/ocaml/ocaml/events","assignees_url":"https://api.github.com/repos/ocaml/ocaml/assignees{/user}","branches_url":"https://api.github.com/repos/ocaml/ocaml/branches{/branch}","tags_url":"https://api.github.com/repos/ocaml/ocaml/tags","blobs_url":"https://api.github.com/repos/ocaml/ocaml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ocaml/ocaml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ocaml/ocaml/git/refs{/sha}","trees_url":"https://api.github.com/repos/ocaml/ocaml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ocaml/ocaml/statuses/{sha}","languages_url":"https://api.github.com/repos/ocaml/ocaml/languages","stargazers_url":"https://api.github.com/repos/ocaml/ocaml/stargazers","contributors_url":"https://api.github.com/repos/ocaml/ocaml/contributors","subscribers_url":"https://api.github.com/repos/ocaml/ocaml/subscribers","subscription_url":"https://api.github.com/repos/ocaml/ocaml/subscription","commits_url":"https://api.github.com/repos/ocaml/ocaml/commits{/sha}","git_commits_url":"https://api.github.com/repos/ocaml/ocaml/git/commits{/sha}","comments_url":"https://api.github.com/repos/ocaml/ocaml/comments{/number}","issue_comment_url":"https://api.github.com/repos/ocaml/ocaml/issues/comments{/number}","contents_url":"https://api.github.com/repos/ocaml/ocaml/contents/{+path}","compare_url":"https://api.github.com/repos/ocaml/ocaml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ocaml/ocaml/merges","archive_url":"https://api.github.com/repos/ocaml/ocaml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ocaml/ocaml/downloads","issues_url":"https://api.github.com/repos/ocaml/ocaml/issues{/number}","pulls_url":"https://api.github.com/repos/ocaml/ocaml/pulls{/number}","milestones_url":"https://api.github.com/repos/ocaml/ocaml/milestones{/number}","notifications_url":"https://api.github.com/repos/ocaml/ocaml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ocaml/ocaml/labels{/name}","releases_url":"https://api.github.com/repos/ocaml/ocaml/releases{/id}","deployments_url":"https://api.github.com/repos/ocaml/ocaml/deployments","created_at":"2012-11-20T22:18:22Z","updated_at":"2018-09-02T15:28:51Z","pushed_at":"2018-09-03T09:24:02Z","git_url":"git://github.com/ocaml/ocaml.git","ssh_url":"git@github.com:ocaml/ocaml.git","clone_url":"https://github.com/ocaml/ocaml.git","svn_url":"https://github.com/ocaml/ocaml","homepage":"","size":177246,"stargazers_count":1956,"watchers_count":1956,"language":"OCaml","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":477,"mirror_url":null,"archived":false,"open_issues_count":172,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":477,"open_issues":172,"watchers":1956,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/ocaml/ocaml/pulls/1596"},"html":{"href":"https://github.com/ocaml/ocaml/pull/1596"},"issue":{"href":"https://api.github.com/repos/ocaml/ocaml/issues/1596"},"comments":{"href":"https://api.github.com/repos/ocaml/ocaml/issues/1596/comments"},"review_comments":{"href":"https://api.github.com/repos/ocaml/ocaml/pulls/1596/comments"},"review_comment":{"href":"https://api.github.com/repos/ocaml/ocaml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ocaml/ocaml/pulls/1596/commits"},"statuses":{"href":"https://api.github.com/repos/ocaml/ocaml/statuses/16d6c53014661a57943d72dc273ab484250c24eb"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"rbonichon"}}