diff options
| author | Jim Fehrle | 2019-04-28 12:04:54 -0700 |
|---|---|---|
| committer | Jim Fehrle | 2019-05-16 20:33:41 -0700 |
| commit | 9b41ff4e90a0303d9caf6e7e2f951a5046ce2d13 (patch) | |
| tree | e60ab950f28d2055949f4c9761a09d9030e67797 /coq/coq.el | |
| parent | 09e099f44b0dc242367eb19d584b941a6dc0de09 (diff) | |
Highlight diffs in goals and some error messages
using Coq's proof diffs feature.
Diffstat (limited to 'coq/coq.el')
| -rw-r--r-- | coq/coq.el | 30 |
1 files changed, 29 insertions, 1 deletions
@@ -1891,7 +1891,7 @@ See `coq-fold-hyp'." ;; type. (setq proof-assistant-additional-settings '(coq-compile-quick coq-compile-keep-going - coq-compile-auto-save coq-lock-ancestors)) + coq-compile-auto-save coq-lock-ancestors coq-diffs)) (setq proof-goal-command-p #'coq-goal-command-p proof-find-and-forget-fn #'coq-find-and-forget @@ -2070,6 +2070,34 @@ See `coq-fold-hyp'." :type 'integer :setting "Set Printing Depth %i . ") +(defun coq-diffs () + "Return string for setting Coq Diffs. +Return the empty string if the version of Coq < 8.10." + (if (coq--post-v810) + (format "Set Diffs \"%s\". " (symbol-name coq-diffs)) + "")) + +(defun coq-diffs--setter (symbol new-value) + ":set function fo `coq-diffs'. +Set Diffs setting if Coq is running and has a version >= 8.10." + (set symbol new-value) + (if (proof-shell-available-p) + (let ((cmd (coq-diffs))) + (if (equal cmd "") + (message "Ignore coq-diffs setting %s for Coq before 8.10" + (symbol-name coq-diffs)) + (proof-shell-invisible-command cmd))))) + +(defcustom coq-diffs 'off + "Controls Coq Diffs option" + :type '(radio + (const :tag "Don't show diffs" off) + (const :tag "Show diffs: only added" on) + (const :tag "Show diffs: added and removed" removed)) + :safe (lambda (v) (member v '(off on removed))) + :set 'coq-diffs--setter + :group 'coq) + ;; Obsolete: ;;(defpacustom undo-depth coq-default-undo-limit ;; "Depth of undo history. Undo behaviour will break beyond this size." |
