|
76 | 76 | ;; :type 'number
|
77 | 77 | ;; :group 'coq)
|
78 | 78 |
|
| 79 | +(defcustom coq-run-completely-silent t |
| 80 | + "Run Coq completely silent if enabled. |
| 81 | +Please restart Proof General after changing this setting! |
| 82 | +
|
| 83 | +If enabled, run Coq completely silent (Set Silent) and only issue |
| 84 | +a show command when necessary to update the goals buffer. This |
| 85 | +behavior is new. If you experience strange effects, please report |
| 86 | +a bug and switch this flag off to return to old behavior. When |
| 87 | +disabled, Coq is dynamically switched to silent for longer lists |
| 88 | +of commands and switched to verbose before the last command. A |
| 89 | +manual Show command (C-c C-p) is necessary if the last command |
| 90 | +fails to update the goals buffer (e.g., if it is a comment or it |
| 91 | +is not executed because some other command before failed, see |
| 92 | +also bug report #568)." |
| 93 | + :type 'boolean |
| 94 | + :safe 'booleanp |
| 95 | + :group 'coq) |
| 96 | + |
79 | 97 | (defcustom coq-user-init-cmd nil
|
80 | 98 | "User defined init commands for Coq.
|
81 | 99 | These are appended at the end of `coq-shell-init-cmd'."
|
@@ -122,16 +140,17 @@ Namely, goals that do not fit in the goals window."
|
122 | 140 | ;; should re-intialize to coq-search-blacklist-string instead of
|
123 | 141 | ;; keeping the current value (that may come from another file).
|
124 | 142 | ,(format "Add Search Blacklist %s. " coq-search-blacklist-current-string))
|
125 |
| - '("Set Suggest Proof Using. " |
126 |
| - "Set Silent. ") |
| 143 | + '("Set Suggest Proof Using. ") |
| 144 | + (if coq-run-completely-silent '("Set Silent. ") ()) |
127 | 145 | coq-user-init-cmd)
|
128 | 146 | "Commands for initial Coq configuration, Coq variant of `proof-shell-init-cmd'.
|
129 | 147 | List of commands sent to the Coq background process just after it
|
130 | 148 | has been started. This happens inside `proof-shell-config-done',
|
131 | 149 | when the major mode `coq-shell-mode' is configured in the `*coq*'
|
132 | 150 | buffer.
|
133 | 151 |
|
134 |
| -Sets silent mode. |
| 152 | +Sets silent mode if `coq-run-completely-silent' is set. Note that |
| 153 | +this constant is not updated when `coq-run-completely-silent' is changed. |
135 | 154 |
|
136 | 155 | In normal interaction, Coq is started because the user asserts
|
137 | 156 | some commands. Therefore the commands here are followed by those
|
@@ -1247,15 +1266,17 @@ This function is called from `proof-shell-exec-loop' via
|
1247 | 1266 | (and (string-match-p "BackTo\\s-" cmd)
|
1248 | 1267 | (> (length coq-last-but-one-proofstack) coq--retract-naborts)))
|
1249 | 1268 | (append
|
| 1269 | + (unless coq-run-completely-silent '("Unset Silent.")) |
1250 | 1270 | (if (coq--post-v810) (list (coq-diffs)) ())
|
1251 |
| - ;; '("Show.") |
1252 | 1271 | (coq--show-proof-stepwise-cmds)))
|
1253 | 1272 |
|
1254 | 1273 | ((or
|
1255 | 1274 | ;; If we go back in the buffer and not in the above case, i.e., outside a
|
1256 | 1275 | ;; proof, then only set the Diffs option.
|
1257 | 1276 | (string-match-p "BackTo\\s-" cmd))
|
1258 |
| - (if (coq--post-v810) (list (coq-diffs)) ())) |
| 1277 | + (append |
| 1278 | + (unless coq-run-completely-silent '("Unset Silent.")) |
| 1279 | + (if (coq--post-v810) (list (coq-diffs)) ()))) |
1259 | 1280 |
|
1260 | 1281 | ((or
|
1261 | 1282 | ;; If starting a proof, Show Proof if need be
|
@@ -1965,8 +1986,9 @@ at `proof-assistant-settings-cmds' evaluation time.")
|
1965 | 1986 | ;; When proof-shell-start-silent-cmd and proof-shell-stop-silent-cmd stay at
|
1966 | 1987 | ;; their default value nil, the generic code won't switch Coq to silent and
|
1967 | 1988 | ;; noisy at, respectively, the beginning and end of longer asserted regions.
|
1968 |
| - ;; (setq proof-shell-start-silent-cmd "Set Silent. " |
1969 |
| - ;; proof-shell-stop-silent-cmd "Unset Silent. ") |
| 1989 | + (unless coq-run-completely-silent |
| 1990 | + (setq proof-shell-start-silent-cmd "Set Silent. " |
| 1991 | + proof-shell-stop-silent-cmd "Unset Silent. ")) |
1970 | 1992 |
|
1971 | 1993 | ;; prooftree config
|
1972 | 1994 | (setq
|
@@ -3080,22 +3102,25 @@ buffer."
|
3080 | 3102 |
|
3081 | 3103 |
|
3082 | 3104 | (defun coq-show-goals-inside-proof (keep-response)
|
3083 |
| - "Update goals buffer when action item list has been processed. |
3084 |
| -Add a Show command as priority action, such that it will still be |
3085 |
| -processed if the generic machinery inside `proof-shell-filter' |
3086 |
| -believes it has processed the last item from the action list. |
3087 |
| -When Coq runs in silent mode, we need to update the goals |
3088 |
| -precisely when everything else from the action list has been |
3089 |
| -processed. |
| 3105 | + "Update goals when action item list has been processed, if running silent. |
| 3106 | +If `coq-run-completely-silent' is set, add a Show command as |
| 3107 | +priority action, such that it will still be processed if the |
| 3108 | +generic machinery inside `proof-shell-filter' believes it has |
| 3109 | +processed the last item from the action list. When Coq runs in |
| 3110 | +silent mode, we need to update the goals precisely when |
| 3111 | +everything else from the action list has been processed. |
3090 | 3112 |
|
3091 | 3113 | The Show command is only added inside proofs and only if the last
|
3092 | 3114 | processed command was not a show command from this function. The
|
3093 | 3115 | action item flag `'dont-show-when-silent' is used for the latter.
|
3094 | 3116 |
|
3095 | 3117 | KEEP-RESPONSE should be set if the last command produced some
|
3096 | 3118 | error or response that should be kept and shown to the user. If
|
3097 |
| -set, the flag `'keep-response' is added to the action item." |
3098 |
| - (when (and coq-last-but-one-proofstack |
| 3119 | +set, the flag `'keep-response' is added to the action item. |
| 3120 | +
|
| 3121 | +Do nothing if `coq-run-completely-silent' is disabled." |
| 3122 | + (when (and coq-run-completely-silent |
| 3123 | + coq-last-but-one-proofstack |
3099 | 3124 | (not (member 'dont-show-when-silent
|
3100 | 3125 | proof-shell-delayed-output-flags)))
|
3101 | 3126 | (let* ((flags-1 (list 'dont-show-when-silent 'invisible 'empty-action-list))
|
|
0 commit comments