From 203baa7b7b7f377dee040ed8d905550bec971901 Mon Sep 17 00:00:00 2001 From: Pierre Courtieu Date: Thu, 2 Apr 2015 17:52:20 +0000 Subject: Highlighting stuff in goals mode (C-c C-a C-h). Very basic for now. --- coq/coq.el | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/coq/coq.el b/coq/coq.el index 4c6a3d20..b4aa039d 100644 --- a/coq/coq.el +++ b/coq/coq.el @@ -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. ") -- cgit v1.2.3