{"action":"created","comment":{"url":"https://api.github.com/repos/idris-hackers/idris-mode/pulls/comments/30116361","id":30116361,"diff_hunk":"@@ -0,0 +1,68 @@\n+;;; idris-highlight-input.el --- Compiler-driven highlighting of user input  -*- lexical-binding: t; -*-\n+\n+;; Copyright (C) 2015  David Raymond Christiansen\n+\n+;; Author: David Raymond Christiansen <david@davidchristiansen.dk>\n+;; Keywords: languages\n+\n+;; This program is free software; you can redistribute it and/or modify\n+;; it under the terms of the GNU General Public License as published by\n+;; the Free Software Foundation, either version 3 of the License, or\n+;; (at your option) any later version.\n+\n+;; This program is distributed in the hope that it will be useful,\n+;; but WITHOUT ANY WARRANTY; without even the implied warranty of\n+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+;; GNU General Public License for more details.\n+\n+;; You should have received a copy of the GNU General Public License\n+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.\n+\n+;;; Commentary:\n+\n+;; This file contains routines for highlighting user input with\n+;; information generated by the Idris elaborator.\n+\n+;;; Code:\n+\n+(require 'idris-common-utils)\n+(require 'idris-settings)\n+\n+(defun idris-highlight-remove-overlays (&optional buffer)\n+  \"Remove all Idris highlighting overlays from BUFFER, or the current buffer if it's nil.\"\n+  (interactive)\n+  (with-current-buffer (or buffer (current-buffer))\n+    (save-restriction\n+      (widen)\n+      (dolist (overlay (overlays-in (point-min) (point-max)))\n+        (when (overlay-get overlay 'idris-source-highlight)\n+          (delete-overlay overlay))))))\n+\n+(defun idris-highlight-column (idris-col)\n+  \"Compute the Emacs position offset of the Idris column IDRIS-COL, for highlighting.\n+\n+In particular, this takes bird tracks into account in literate Idris.\"\n+  (+ idris-col (if (idris-lidr-p) 1 -1)))\n+\n+(defun idris-highlight-input-region (buffer start-line start-col end-line end-col highlight)\n+  \"Highight in BUFFER using an overlay from START-LINE and START-COL to END-LINE and END-COL and the semantic properties specified in HIGHLIGHT.\"\n+  (when idris-semantic-source-highlighting\n+    (if (not (or (and (> end-line start-line))","path":"idris-highlight-input.el","position":50,"original_position":50,"commit_id":"afbfc1652f87471922e79055c6a44b10e86ba53d","original_commit_id":"afbfc1652f87471922e79055c6a44b10e86ba53d","user":{"login":"hannesm","id":228456,"avatar_url":"https://avatars.githubusercontent.com/u/228456?v=3","gravatar_id":"","url":"https://api.github.com/users/hannesm","html_url":"https://github.com/hannesm","followers_url":"https://api.github.com/users/hannesm/followers","following_url":"https://api.github.com/users/hannesm/following{/other_user}","gists_url":"https://api.github.com/users/hannesm/gists{/gist_id}","starred_url":"https://api.github.com/users/hannesm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hannesm/subscriptions","organizations_url":"https://api.github.com/users/hannesm/orgs","repos_url":"https://api.github.com/users/hannesm/repos","events_url":"https://api.github.com/users/hannesm/events{/privacy}","received_events_url":"https://api.github.com/users/hannesm/received_events","type":"User","site_admin":false},"body":"is this `and` with a single argument here?","created_at":"2015-05-12T09:07:34Z","updated_at":"2015-05-12T09:07:34Z","html_url":"https://github.com/idris-hackers/idris-mode/pull/333#discussion_r30116361","pull_request_url":"https://api.github.com/repos/idris-hackers/idris-mode/pulls/333","_links":{"self":{"href":"https://api.github.com/repos/idris-hackers/idris-mode/pulls/comments/30116361"},"html":{"href":"https://github.com/idris-hackers/idris-mode/pull/333#discussion_r30116361"},"pull_request":{"href":"https://api.github.com/repos/idris-hackers/idris-mode/pulls/333"}}},"pull_request":{"url":"https://api.github.com/repos/idris-hackers/idris-mode/pulls/333","id":35091864,"html_url":"https://github.com/idris-hackers/idris-mode/pull/333","diff_url":"https://github.com/idris-hackers/idris-mode/pull/333.diff","patch_url":"https://github.com/idris-hackers/idris-mode/pull/333.patch","issue_url":"https://api.github.com/repos/idris-hackers/idris-mode/issues/333","number":333,"state":"open","locked":false,"title":"Compiler-support highlighting","user":{"login":"david-christiansen","id":115330,"avatar_url":"https://avatars.githubusercontent.com/u/115330?v=3","gravatar_id":"","url":"https://api.github.com/users/david-christiansen","html_url":"https://github.com/david-christiansen","followers_url":"https://api.github.com/users/david-christiansen/followers","following_url":"https://api.github.com/users/david-christiansen/following{/other_user}","gists_url":"https://api.github.com/users/david-christiansen/gists{/gist_id}","starred_url":"https://api.github.com/users/david-christiansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/david-christiansen/subscriptions","organizations_url":"https://api.github.com/users/david-christiansen/orgs","repos_url":"https://api.github.com/users/david-christiansen/repos","events_url":"https://api.github.com/users/david-christiansen/events{/privacy}","received_events_url":"https://api.github.com/users/david-christiansen/received_events","type":"User","site_admin":false},"body":"This creates Agda-style highlighting. Note that it's also an incompatibility in the protocol, and clients will need to update to support the new Idris.\r\n\r\nSee https://github.com/idris-lang/Idris-dev/pull/2250 for details.","created_at":"2015-05-11T00:49:09Z","updated_at":"2015-05-12T09:07:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cdf89d38361f21666b3e3b597f5b95562178824f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/idris-hackers/idris-mode/pulls/333/commits","review_comments_url":"https://api.github.com/repos/idris-hackers/idris-mode/pulls/333/comments","review_comment_url":"https://api.github.com/repos/idris-hackers/idris-mode/pulls/comments{/number}","comments_url":"https://api.github.com/repos/idris-hackers/idris-mode/issues/333/comments","statuses_url":"https://api.github.com/repos/idris-hackers/idris-mode/statuses/afbfc1652f87471922e79055c6a44b10e86ba53d","head":{"label":"david-christiansen:compiler-highlighting","ref":"compiler-highlighting","sha":"afbfc1652f87471922e79055c6a44b10e86ba53d","user":{"login":"david-christiansen","id":115330,"avatar_url":"https://avatars.githubusercontent.com/u/115330?v=3","gravatar_id":"","url":"https://api.github.com/users/david-christiansen","html_url":"https://github.com/david-christiansen","followers_url":"https://api.github.com/users/david-christiansen/followers","following_url":"https://api.github.com/users/david-christiansen/following{/other_user}","gists_url":"https://api.github.com/users/david-christiansen/gists{/gist_id}","starred_url":"https://api.github.com/users/david-christiansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/david-christiansen/subscriptions","organizations_url":"https://api.github.com/users/david-christiansen/orgs","repos_url":"https://api.github.com/users/david-christiansen/repos","events_url":"https://api.github.com/users/david-christiansen/events{/privacy}","received_events_url":"https://api.github.com/users/david-christiansen/received_events","type":"User","site_admin":false},"repo":{"id":8949344,"name":"idris-mode","full_name":"david-christiansen/idris-mode","owner":{"login":"david-christiansen","id":115330,"avatar_url":"https://avatars.githubusercontent.com/u/115330?v=3","gravatar_id":"","url":"https://api.github.com/users/david-christiansen","html_url":"https://github.com/david-christiansen","followers_url":"https://api.github.com/users/david-christiansen/followers","following_url":"https://api.github.com/users/david-christiansen/following{/other_user}","gists_url":"https://api.github.com/users/david-christiansen/gists{/gist_id}","starred_url":"https://api.github.com/users/david-christiansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/david-christiansen/subscriptions","organizations_url":"https://api.github.com/users/david-christiansen/orgs","repos_url":"https://api.github.com/users/david-christiansen/repos","events_url":"https://api.github.com/users/david-christiansen/events{/privacy}","received_events_url":"https://api.github.com/users/david-christiansen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/david-christiansen/idris-mode","description":"Idris syntax highlighting and (eventually) other things for emacs.","fork":true,"url":"https://api.github.com/repos/david-christiansen/idris-mode","forks_url":"https://api.github.com/repos/david-christiansen/idris-mode/forks","keys_url":"https://api.github.com/repos/david-christiansen/idris-mode/keys{/key_id}","collaborators_url":"https://api.github.com/repos/david-christiansen/idris-mode/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/david-christiansen/idris-mode/teams","hooks_url":"https://api.github.com/repos/david-christiansen/idris-mode/hooks","issue_events_url":"https://api.github.com/repos/david-christiansen/idris-mode/issues/events{/number}","events_url":"https://api.github.com/repos/david-christiansen/idris-mode/events","assignees_url":"https://api.github.com/repos/david-christiansen/idris-mode/assignees{/user}","branches_url":"https://api.github.com/repos/david-christiansen/idris-mode/branches{/branch}","tags_url":"https://api.github.com/repos/david-christiansen/idris-mode/tags","blobs_url":"https://api.github.com/repos/david-christiansen/idris-mode/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/david-christiansen/idris-mode/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/david-christiansen/idris-mode/git/refs{/sha}","trees_url":"https://api.github.com/repos/david-christiansen/idris-mode/git/trees{/sha}","statuses_url":"https://api.github.com/repos/david-christiansen/idris-mode/statuses/{sha}","languages_url":"https://api.github.com/repos/david-christiansen/idris-mode/languages","stargazers_url":"https://api.github.com/repos/david-christiansen/idris-mode/stargazers","contributors_url":"https://api.github.com/repos/david-christiansen/idris-mode/contributors","subscribers_url":"https://api.github.com/repos/david-christiansen/idris-mode/subscribers","subscription_url":"https://api.github.com/repos/david-christiansen/idris-mode/subscription","commits_url":"https://api.github.com/repos/david-christiansen/idris-mode/commits{/sha}","git_commits_url":"https://api.github.com/repos/david-christiansen/idris-mode/git/commits{/sha}","comments_url":"https://api.github.com/repos/david-christiansen/idris-mode/comments{/number}","issue_comment_url":"https://api.github.com/repos/david-christiansen/idris-mode/issues/comments{/number}","contents_url":"https://api.github.com/repos/david-christiansen/idris-mode/contents/{+path}","compare_url":"https://api.github.com/repos/david-christiansen/idris-mode/compare/{base}...{head}","merges_url":"https://api.github.com/repos/david-christiansen/idris-mode/merges","archive_url":"https://api.github.com/repos/david-christiansen/idris-mode/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/david-christiansen/idris-mode/downloads","issues_url":"https://api.github.com/repos/david-christiansen/idris-mode/issues{/number}","pulls_url":"https://api.github.com/repos/david-christiansen/idris-mode/pulls{/number}","milestones_url":"https://api.github.com/repos/david-christiansen/idris-mode/milestones{/number}","notifications_url":"https://api.github.com/repos/david-christiansen/idris-mode/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/david-christiansen/idris-mode/labels{/name}","releases_url":"https://api.github.com/repos/david-christiansen/idris-mode/releases{/id}","created_at":"2013-03-22T10:07:52Z","updated_at":"2015-05-08T12:21:06Z","pushed_at":"2015-05-11T14:44:57Z","git_url":"git://github.com/david-christiansen/idris-mode.git","ssh_url":"git@github.com:david-christiansen/idris-mode.git","clone_url":"https://github.com/david-christiansen/idris-mode.git","svn_url":"https://github.com/david-christiansen/idris-mode","homepage":null,"size":2032,"stargazers_count":0,"watchers_count":0,"language":"Emacs Lisp","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"idris-hackers:master","ref":"master","sha":"fbe1c6c585df96f307b0bb5321ea454d982a8583","user":{"login":"idris-hackers","id":3963683,"avatar_url":"https://avatars.githubusercontent.com/u/3963683?v=3","gravatar_id":"","url":"https://api.github.com/users/idris-hackers","html_url":"https://github.com/idris-hackers","followers_url":"https://api.github.com/users/idris-hackers/followers","following_url":"https://api.github.com/users/idris-hackers/following{/other_user}","gists_url":"https://api.github.com/users/idris-hackers/gists{/gist_id}","starred_url":"https://api.github.com/users/idris-hackers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idris-hackers/subscriptions","organizations_url":"https://api.github.com/users/idris-hackers/orgs","repos_url":"https://api.github.com/users/idris-hackers/repos","events_url":"https://api.github.com/users/idris-hackers/events{/privacy}","received_events_url":"https://api.github.com/users/idris-hackers/received_events","type":"Organization","site_admin":false},"repo":{"id":6729615,"name":"idris-mode","full_name":"idris-hackers/idris-mode","owner":{"login":"idris-hackers","id":3963683,"avatar_url":"https://avatars.githubusercontent.com/u/3963683?v=3","gravatar_id":"","url":"https://api.github.com/users/idris-hackers","html_url":"https://github.com/idris-hackers","followers_url":"https://api.github.com/users/idris-hackers/followers","following_url":"https://api.github.com/users/idris-hackers/following{/other_user}","gists_url":"https://api.github.com/users/idris-hackers/gists{/gist_id}","starred_url":"https://api.github.com/users/idris-hackers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idris-hackers/subscriptions","organizations_url":"https://api.github.com/users/idris-hackers/orgs","repos_url":"https://api.github.com/users/idris-hackers/repos","events_url":"https://api.github.com/users/idris-hackers/events{/privacy}","received_events_url":"https://api.github.com/users/idris-hackers/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/idris-hackers/idris-mode","description":"Idris syntax highlighting, compiler-supported editing, interactive REPL and more things for Emacs.","fork":false,"url":"https://api.github.com/repos/idris-hackers/idris-mode","forks_url":"https://api.github.com/repos/idris-hackers/idris-mode/forks","keys_url":"https://api.github.com/repos/idris-hackers/idris-mode/keys{/key_id}","collaborators_url":"https://api.github.com/repos/idris-hackers/idris-mode/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/idris-hackers/idris-mode/teams","hooks_url":"https://api.github.com/repos/idris-hackers/idris-mode/hooks","issue_events_url":"https://api.github.com/repos/idris-hackers/idris-mode/issues/events{/number}","events_url":"https://api.github.com/repos/idris-hackers/idris-mode/events","assignees_url":"https://api.github.com/repos/idris-hackers/idris-mode/assignees{/user}","branches_url":"https://api.github.com/repos/idris-hackers/idris-mode/branches{/branch}","tags_url":"https://api.github.com/repos/idris-hackers/idris-mode/tags","blobs_url":"https://api.github.com/repos/idris-hackers/idris-mode/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/idris-hackers/idris-mode/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/idris-hackers/idris-mode/git/refs{/sha}","trees_url":"https://api.github.com/repos/idris-hackers/idris-mode/git/trees{/sha}","statuses_url":"https://api.github.com/repos/idris-hackers/idris-mode/statuses/{sha}","languages_url":"https://api.github.com/repos/idris-hackers/idris-mode/languages","stargazers_url":"https://api.github.com/repos/idris-hackers/idris-mode/stargazers","contributors_url":"https://api.github.com/repos/idris-hackers/idris-mode/contributors","subscribers_url":"https://api.github.com/repos/idris-hackers/idris-mode/subscribers","subscription_url":"https://api.github.com/repos/idris-hackers/idris-mode/subscription","commits_url":"https://api.github.com/repos/idris-hackers/idris-mode/commits{/sha}","git_commits_url":"https://api.github.com/repos/idris-hackers/idris-mode/git/commits{/sha}","comments_url":"https://api.github.com/repos/idris-hackers/idris-mode/comments{/number}","issue_comment_url":"https://api.github.com/repos/idris-hackers/idris-mode/issues/comments{/number}","contents_url":"https://api.github.com/repos/idris-hackers/idris-mode/contents/{+path}","compare_url":"https://api.github.com/repos/idris-hackers/idris-mode/compare/{base}...{head}","merges_url":"https://api.github.com/repos/idris-hackers/idris-mode/merges","archive_url":"https://api.github.com/repos/idris-hackers/idris-mode/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/idris-hackers/idris-mode/downloads","issues_url":"https://api.github.com/repos/idris-hackers/idris-mode/issues{/number}","pulls_url":"https://api.github.com/repos/idris-hackers/idris-mode/pulls{/number}","milestones_url":"https://api.github.com/repos/idris-hackers/idris-mode/milestones{/number}","notifications_url":"https://api.github.com/repos/idris-hackers/idris-mode/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/idris-hackers/idris-mode/labels{/name}","releases_url":"https://api.github.com/repos/idris-hackers/idris-mode/releases{/id}","created_at":"2012-11-16T23:14:19Z","updated_at":"2015-05-07T13:57:25Z","pushed_at":"2015-05-12T09:05:54Z","git_url":"git://github.com/idris-hackers/idris-mode.git","ssh_url":"git@github.com:idris-hackers/idris-mode.git","clone_url":"https://github.com/idris-hackers/idris-mode.git","svn_url":"https://github.com/idris-hackers/idris-mode","homepage":"","size":2103,"stargazers_count":84,"watchers_count":84,"language":"Emacs Lisp","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":27,"forks":22,"open_issues":27,"watchers":84,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/idris-hackers/idris-mode/pulls/333"},"html":{"href":"https://github.com/idris-hackers/idris-mode/pull/333"},"issue":{"href":"https://api.github.com/repos/idris-hackers/idris-mode/issues/333"},"comments":{"href":"https://api.github.com/repos/idris-hackers/idris-mode/issues/333/comments"},"review_comments":{"href":"https://api.github.com/repos/idris-hackers/idris-mode/pulls/333/comments"},"review_comment":{"href":"https://api.github.com/repos/idris-hackers/idris-mode/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/idris-hackers/idris-mode/pulls/333/commits"},"statuses":{"href":"https://api.github.com/repos/idris-hackers/idris-mode/statuses/afbfc1652f87471922e79055c6a44b10e86ba53d"}}}}