diff options
author | Pierre Courtieu <courtieu@lri.fr> | 2015-04-02 17:52:20 +0000 |
---|---|---|
committer | Pierre Courtieu <courtieu@lri.fr> | 2015-04-02 17:52:20 +0000 |
commit | 203baa7b7b7f377dee040ed8d905550bec971901 (patch) | |
tree | 27e1b7a903b09e9920586f4a0d3605680c5281e2 /coq/coq.el | |
parent | fa7ef80e7d9bf4a4058b74dbde0b58c5ba94cf70 (diff) |
Highlighting stuff in goals mode (C-c C-a C-h). Very basic for now.
Diffstat (limited to 'coq/coq.el')
-rw-r--r-- | coq/coq.el | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -1106,6 +1106,25 @@ A Show command is also issued, so that the goal is redisplayed." (proof-shell-invisible-command (format "Set Printing Width %S." (- wdth 1)) t) (proof-shell-invisible-command (format "Show.") t))) +(defvar coq-highlight-id-last-regexp nil) + +(defun coq-highlight-id-in-goals (re) + (with-current-buffer proof-goals-buffer + (highlight-regexp re 'lazy-highlight))) + +(defun coq-unhighlight-id-in-goals (re) + (with-current-buffer proof-goals-buffer + (unhighlight-regexp re))) + +(defun coq-highlight-id-at-pt-in-goals () + (interactive) + (let* ((id (coq-id-or-notation-at-point)) + (re (regexp-quote (or id "")))) + (when coq-highlight-id-last-regexp + (coq-unhighlight-id-in-goals coq-highlight-id-last-regexp)) + (when id + (coq-highlight-id-in-goals re) + (setq coq-highlight-id-last-regexp re)))) (proof-definvisible coq-PrintHint "Print Hint. ") |