{"action":"created","comment":{"url":"https://api.github.com/repos/Wilfred/remacs/pulls/comments/127851329","pull_request_review_id":50475607,"id":127851329,"diff_hunk":"@@ -0,0 +1,64 @@\n+use remacs_macros::lisp_fn;\n+use remacs_sys::{PseudovecType, Qfont_spec, Qfont_entity, Qfont_object, Qsymbolp,\n+                 wrong_type_argument};\n+use lisp::{LispObject, Qnil};\n+\n+// See font_property_index in font.h for details.\n+#[allow(non_camel_case_types, dead_code)]\n+#[repr(C)]\n+enum font_property_index {\n+    FONT_TYPE_INDEX,\n+    FONT_FOUNDRY_INDEX,\n+    FONT_FAMILY_INDEX,\n+    FONT_ADSTYLE_INDEX,\n+    FONT_REGISTRY_INDEX,\n+    FONT_WEIGHT_INDEX,\n+    FONT_SLANT_INDEX,\n+    FONT_WIDTH_INDEX,\n+    FONT_SIZE_INDEX,\n+    FONT_DPI_INDEX,\n+    FONT_SPACING_INDEX,\n+    FONT_AVGWIDTH_INDEX,\n+    FONT_EXTRA_INDEX,\n+    // In C, we have FONT_SPEC_MAX, FONT_OBJLIST_INDEX = FONT_SPEC_MAX here.\n+    FONT_OBJLIST_INDEX,\n+    // In C, we have FONT_ENTITY_MAX, FONT_NAME_INDEX = FONT_ENTITY_MAX here.\n+    FONT_NAME_INDEX,\n+    FONT_FULLNAME_INDEX,\n+    FONT_FILE_INDEX,\n+    // In C, we have FONT_OBJECT_MAX here.\n+}\n+\n+const FONT_SPEC_MAX: i32 = font_property_index::FONT_OBJLIST_INDEX as i32;\n+const FONT_ENTITY_MAX: i32 = font_property_index::FONT_NAME_INDEX as i32;\n+const FONT_OBJECT_MAX: i32 = (font_property_index::FONT_FILE_INDEX as i32) + 1;\n+\n+/// Return t if OBJECT is a font-spec, font-entity, or font-object.\n+/// Return nil otherwise.\n+/// Optional 2nd argument EXTRA-TYPE, if non-nil, specifies to check\n+/// which kind of font it is.  It must be one of `font-spec', `font-entity',\n+/// `font-object'.\n+#[lisp_fn(min = \"1\")]\n+pub fn fontp(object: LispObject, extra_type: LispObject) -> LispObject {\n+    object.as_vectorlike().map_or(Qnil, |v| {\n+        if v.is_pseudovector(PseudovecType::PVEC_FONT) {\n+            if extra_type.eq(Qnil) {\n+                LispObject::constant_t()\n+            } else if extra_type.eq(LispObject::from_raw(unsafe { Qfont_spec })) {","path":"rust_src/src/fonts.rs","position":47,"original_position":47,"commit_id":"49ee4d8b0342052b4ad3a5ff6815be1e177addda","original_commit_id":"49ee4d8b0342052b4ad3a5ff6815be1e177addda","user":{"login":"atheriel","id":1448326,"avatar_url":"https://avatars2.githubusercontent.com/u/1448326?v=4","gravatar_id":"","url":"https://api.github.com/users/atheriel","html_url":"https://github.com/atheriel","followers_url":"https://api.github.com/users/atheriel/followers","following_url":"https://api.github.com/users/atheriel/following{/other_user}","gists_url":"https://api.github.com/users/atheriel/gists{/gist_id}","starred_url":"https://api.github.com/users/atheriel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atheriel/subscriptions","organizations_url":"https://api.github.com/users/atheriel/orgs","repos_url":"https://api.github.com/users/atheriel/repos","events_url":"https://api.github.com/users/atheriel/events{/privacy}","received_events_url":"https://api.github.com/users/atheriel/received_events","type":"User","site_admin":false},"body":"I thoought it would be \"safe enough\" to get at these symbols this way -- is there another option?","created_at":"2017-07-17T23:25:58Z","updated_at":"2017-07-17T23:25:58Z","html_url":"https://github.com/Wilfred/remacs/pull/248#discussion_r127851329","pull_request_url":"https://api.github.com/repos/Wilfred/remacs/pulls/248","_links":{"self":{"href":"https://api.github.com/repos/Wilfred/remacs/pulls/comments/127851329"},"html":{"href":"https://github.com/Wilfred/remacs/pull/248#discussion_r127851329"},"pull_request":{"href":"https://api.github.com/repos/Wilfred/remacs/pulls/248"}}},"pull_request":{"url":"https://api.github.com/repos/Wilfred/remacs/pulls/248","id":130970057,"html_url":"https://github.com/Wilfred/remacs/pull/248","diff_url":"https://github.com/Wilfred/remacs/pull/248.diff","patch_url":"https://github.com/Wilfred/remacs/pull/248.patch","issue_url":"https://api.github.com/repos/Wilfred/remacs/issues/248","number":248,"state":"open","locked":false,"title":"Port fontp to Rust","user":{"login":"atheriel","id":1448326,"avatar_url":"https://avatars2.githubusercontent.com/u/1448326?v=4","gravatar_id":"","url":"https://api.github.com/users/atheriel","html_url":"https://github.com/atheriel","followers_url":"https://api.github.com/users/atheriel/followers","following_url":"https://api.github.com/users/atheriel/following{/other_user}","gists_url":"https://api.github.com/users/atheriel/gists{/gist_id}","starred_url":"https://api.github.com/users/atheriel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atheriel/subscriptions","organizations_url":"https://api.github.com/users/atheriel/orgs","repos_url":"https://api.github.com/users/atheriel/repos","events_url":"https://api.github.com/users/atheriel/events{/privacy}","received_events_url":"https://api.github.com/users/atheriel/received_events","type":"User","site_admin":false},"body":"This is my first pass at porting `fontp` to Rust, and should be considered a work in progress. I have a few questions:\r\n\r\n1) Should I change the naming convention for the `font_property_index` enum?\r\n2) Is there a convention for calling `intern` from Rust code?\r\n3) Can or should I add `is_font_spec()` (etc) methods to `LispObject` in `lisp.rs`, so that the checking can be moved out of `fontp` and into those methods?","created_at":"2017-07-17T23:00:50Z","updated_at":"2017-07-17T23:25:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ac166567e6dd3ddb55638d52cabbe18836f2128a","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Wilfred/remacs/pulls/248/commits","review_comments_url":"https://api.github.com/repos/Wilfred/remacs/pulls/248/comments","review_comment_url":"https://api.github.com/repos/Wilfred/remacs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Wilfred/remacs/issues/248/comments","statuses_url":"https://api.github.com/repos/Wilfred/remacs/statuses/49ee4d8b0342052b4ad3a5ff6815be1e177addda","head":{"label":"atheriel:port-fontp","ref":"port-fontp","sha":"49ee4d8b0342052b4ad3a5ff6815be1e177addda","user":{"login":"atheriel","id":1448326,"avatar_url":"https://avatars2.githubusercontent.com/u/1448326?v=4","gravatar_id":"","url":"https://api.github.com/users/atheriel","html_url":"https://github.com/atheriel","followers_url":"https://api.github.com/users/atheriel/followers","following_url":"https://api.github.com/users/atheriel/following{/other_user}","gists_url":"https://api.github.com/users/atheriel/gists{/gist_id}","starred_url":"https://api.github.com/users/atheriel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atheriel/subscriptions","organizations_url":"https://api.github.com/users/atheriel/orgs","repos_url":"https://api.github.com/users/atheriel/repos","events_url":"https://api.github.com/users/atheriel/events{/privacy}","received_events_url":"https://api.github.com/users/atheriel/received_events","type":"User","site_admin":false},"repo":{"id":97529206,"name":"remacs","full_name":"atheriel/remacs","owner":{"login":"atheriel","id":1448326,"avatar_url":"https://avatars2.githubusercontent.com/u/1448326?v=4","gravatar_id":"","url":"https://api.github.com/users/atheriel","html_url":"https://github.com/atheriel","followers_url":"https://api.github.com/users/atheriel/followers","following_url":"https://api.github.com/users/atheriel/following{/other_user}","gists_url":"https://api.github.com/users/atheriel/gists{/gist_id}","starred_url":"https://api.github.com/users/atheriel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atheriel/subscriptions","organizations_url":"https://api.github.com/users/atheriel/orgs","repos_url":"https://api.github.com/users/atheriel/repos","events_url":"https://api.github.com/users/atheriel/events{/privacy}","received_events_url":"https://api.github.com/users/atheriel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/atheriel/remacs","description":"Rust :heart: Emacs","fork":true,"url":"https://api.github.com/repos/atheriel/remacs","forks_url":"https://api.github.com/repos/atheriel/remacs/forks","keys_url":"https://api.github.com/repos/atheriel/remacs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/atheriel/remacs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/atheriel/remacs/teams","hooks_url":"https://api.github.com/repos/atheriel/remacs/hooks","issue_events_url":"https://api.github.com/repos/atheriel/remacs/issues/events{/number}","events_url":"https://api.github.com/repos/atheriel/remacs/events","assignees_url":"https://api.github.com/repos/atheriel/remacs/assignees{/user}","branches_url":"https://api.github.com/repos/atheriel/remacs/branches{/branch}","tags_url":"https://api.github.com/repos/atheriel/remacs/tags","blobs_url":"https://api.github.com/repos/atheriel/remacs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/atheriel/remacs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/atheriel/remacs/git/refs{/sha}","trees_url":"https://api.github.com/repos/atheriel/remacs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/atheriel/remacs/statuses/{sha}","languages_url":"https://api.github.com/repos/atheriel/remacs/languages","stargazers_url":"https://api.github.com/repos/atheriel/remacs/stargazers","contributors_url":"https://api.github.com/repos/atheriel/remacs/contributors","subscribers_url":"https://api.github.com/repos/atheriel/remacs/subscribers","subscription_url":"https://api.github.com/repos/atheriel/remacs/subscription","commits_url":"https://api.github.com/repos/atheriel/remacs/commits{/sha}","git_commits_url":"https://api.github.com/repos/atheriel/remacs/git/commits{/sha}","comments_url":"https://api.github.com/repos/atheriel/remacs/comments{/number}","issue_comment_url":"https://api.github.com/repos/atheriel/remacs/issues/comments{/number}","contents_url":"https://api.github.com/repos/atheriel/remacs/contents/{+path}","compare_url":"https://api.github.com/repos/atheriel/remacs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/atheriel/remacs/merges","archive_url":"https://api.github.com/repos/atheriel/remacs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/atheriel/remacs/downloads","issues_url":"https://api.github.com/repos/atheriel/remacs/issues{/number}","pulls_url":"https://api.github.com/repos/atheriel/remacs/pulls{/number}","milestones_url":"https://api.github.com/repos/atheriel/remacs/milestones{/number}","notifications_url":"https://api.github.com/repos/atheriel/remacs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/atheriel/remacs/labels{/name}","releases_url":"https://api.github.com/repos/atheriel/remacs/releases{/id}","deployments_url":"https://api.github.com/repos/atheriel/remacs/deployments","created_at":"2017-07-17T22:52:21Z","updated_at":"2017-07-17T22:52:43Z","pushed_at":"2017-07-17T22:54:08Z","git_url":"git://github.com/atheriel/remacs.git","ssh_url":"git@github.com:atheriel/remacs.git","clone_url":"https://github.com/atheriel/remacs.git","svn_url":"https://github.com/atheriel/remacs","homepage":"","size":256612,"stargazers_count":0,"watchers_count":0,"language":"Emacs Lisp","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Wilfred:master","ref":"master","sha":"f6c81e1ef2a6a0db5d73ff928f91b50ffd725152","user":{"login":"Wilfred","id":70800,"avatar_url":"https://avatars0.githubusercontent.com/u/70800?v=4","gravatar_id":"","url":"https://api.github.com/users/Wilfred","html_url":"https://github.com/Wilfred","followers_url":"https://api.github.com/users/Wilfred/followers","following_url":"https://api.github.com/users/Wilfred/following{/other_user}","gists_url":"https://api.github.com/users/Wilfred/gists{/gist_id}","starred_url":"https://api.github.com/users/Wilfred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wilfred/subscriptions","organizations_url":"https://api.github.com/users/Wilfred/orgs","repos_url":"https://api.github.com/users/Wilfred/repos","events_url":"https://api.github.com/users/Wilfred/events{/privacy}","received_events_url":"https://api.github.com/users/Wilfred/received_events","type":"User","site_admin":false},"repo":{"id":74522337,"name":"remacs","full_name":"Wilfred/remacs","owner":{"login":"Wilfred","id":70800,"avatar_url":"https://avatars0.githubusercontent.com/u/70800?v=4","gravatar_id":"","url":"https://api.github.com/users/Wilfred","html_url":"https://github.com/Wilfred","followers_url":"https://api.github.com/users/Wilfred/followers","following_url":"https://api.github.com/users/Wilfred/following{/other_user}","gists_url":"https://api.github.com/users/Wilfred/gists{/gist_id}","starred_url":"https://api.github.com/users/Wilfred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wilfred/subscriptions","organizations_url":"https://api.github.com/users/Wilfred/orgs","repos_url":"https://api.github.com/users/Wilfred/repos","events_url":"https://api.github.com/users/Wilfred/events{/privacy}","received_events_url":"https://api.github.com/users/Wilfred/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Wilfred/remacs","description":"Rust :heart: Emacs","fork":false,"url":"https://api.github.com/repos/Wilfred/remacs","forks_url":"https://api.github.com/repos/Wilfred/remacs/forks","keys_url":"https://api.github.com/repos/Wilfred/remacs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wilfred/remacs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wilfred/remacs/teams","hooks_url":"https://api.github.com/repos/Wilfred/remacs/hooks","issue_events_url":"https://api.github.com/repos/Wilfred/remacs/issues/events{/number}","events_url":"https://api.github.com/repos/Wilfred/remacs/events","assignees_url":"https://api.github.com/repos/Wilfred/remacs/assignees{/user}","branches_url":"https://api.github.com/repos/Wilfred/remacs/branches{/branch}","tags_url":"https://api.github.com/repos/Wilfred/remacs/tags","blobs_url":"https://api.github.com/repos/Wilfred/remacs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wilfred/remacs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wilfred/remacs/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wilfred/remacs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wilfred/remacs/statuses/{sha}","languages_url":"https://api.github.com/repos/Wilfred/remacs/languages","stargazers_url":"https://api.github.com/repos/Wilfred/remacs/stargazers","contributors_url":"https://api.github.com/repos/Wilfred/remacs/contributors","subscribers_url":"https://api.github.com/repos/Wilfred/remacs/subscribers","subscription_url":"https://api.github.com/repos/Wilfred/remacs/subscription","commits_url":"https://api.github.com/repos/Wilfred/remacs/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wilfred/remacs/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wilfred/remacs/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wilfred/remacs/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wilfred/remacs/contents/{+path}","compare_url":"https://api.github.com/repos/Wilfred/remacs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wilfred/remacs/merges","archive_url":"https://api.github.com/repos/Wilfred/remacs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wilfred/remacs/downloads","issues_url":"https://api.github.com/repos/Wilfred/remacs/issues{/number}","pulls_url":"https://api.github.com/repos/Wilfred/remacs/pulls{/number}","milestones_url":"https://api.github.com/repos/Wilfred/remacs/milestones{/number}","notifications_url":"https://api.github.com/repos/Wilfred/remacs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wilfred/remacs/labels{/name}","releases_url":"https://api.github.com/repos/Wilfred/remacs/releases{/id}","deployments_url":"https://api.github.com/repos/Wilfred/remacs/deployments","created_at":"2016-11-22T23:29:21Z","updated_at":"2017-07-17T23:16:25Z","pushed_at":"2017-07-17T23:13:53Z","git_url":"git://github.com/Wilfred/remacs.git","ssh_url":"git@github.com:Wilfred/remacs.git","clone_url":"https://github.com/Wilfred/remacs.git","svn_url":"https://github.com/Wilfred/remacs","homepage":"","size":256612,"stargazers_count":1651,"watchers_count":1651,"language":"Emacs Lisp","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":119,"mirror_url":null,"open_issues_count":30,"forks":119,"open_issues":30,"watchers":1651,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Wilfred/remacs/pulls/248"},"html":{"href":"https://github.com/Wilfred/remacs/pull/248"},"issue":{"href":"https://api.github.com/repos/Wilfred/remacs/issues/248"},"comments":{"href":"https://api.github.com/repos/Wilfred/remacs/issues/248/comments"},"review_comments":{"href":"https://api.github.com/repos/Wilfred/remacs/pulls/248/comments"},"review_comment":{"href":"https://api.github.com/repos/Wilfred/remacs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Wilfred/remacs/pulls/248/commits"},"statuses":{"href":"https://api.github.com/repos/Wilfred/remacs/statuses/49ee4d8b0342052b4ad3a5ff6815be1e177addda"}}}}
{"actor":{"display_login":"atheriel"}}