|
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
|
@@ -1246,15 +1265,17 @@ This function is called from `proof-shell-exec-loop' via
|
1246 | 1265 | (and (string-match-p "BackTo\\s-" cmd)
|
1247 | 1266 | (> (length coq-last-but-one-proofstack) coq--retract-naborts)))
|
1248 | 1267 | (append
|
| 1268 | + (unless coq-run-completely-silent '("Unset Silent.")) |
1249 | 1269 | (if (coq--post-v810) (list (coq-diffs)) ())
|
1250 |
| - ;; '("Show.") |
1251 | 1270 | (coq--show-proof-stepwise-cmds)))
|
1252 | 1271 |
|
1253 | 1272 | ((or
|
1254 | 1273 | ;; If we go back in the buffer and not in the above case, i.e., outside a
|
1255 | 1274 | ;; proof, then only set the Diffs option.
|
1256 | 1275 | (string-match-p "BackTo\\s-" cmd))
|
1257 |
| - (if (coq--post-v810) (list (coq-diffs)) ())) |
| 1276 | + (append |
| 1277 | + (unless coq-run-completely-silent '("Unset Silent.")) |
| 1278 | + (if (coq--post-v810) (list (coq-diffs)) ()))) |
1258 | 1279 |
|
1259 | 1280 | ((or
|
1260 | 1281 | ;; If starting a proof, Show Proof if need be
|
@@ -1968,8 +1989,9 @@ at `proof-assistant-settings-cmds' evaluation time.")
|
1968 | 1989 | ;; When proof-shell-start-silent-cmd and proof-shell-stop-silent-cmd stay at
|
1969 | 1990 | ;; their default value nil, the generic code won't switch Coq to silent and
|
1970 | 1991 | ;; noisy at, respectively, the beginning and end of longer asserted regions.
|
1971 |
| - ;; (setq proof-shell-start-silent-cmd "Set Silent." |
1972 |
| - ;; proof-shell-stop-silent-cmd "Unset Silent.") |
| 1992 | + (unless coq-run-completely-silent |
| 1993 | + (setq proof-shell-start-silent-cmd "Set Silent." |
| 1994 | + proof-shell-stop-silent-cmd "Unset Silent.")) |
1973 | 1995 |
|
1974 | 1996 | ;; prooftree config
|
1975 | 1997 | (setq
|
@@ -3103,22 +3125,25 @@ Important: Coq gives char positions in bytes instead of chars.
|
3103 | 3125 |
|
3104 | 3126 |
|
3105 | 3127 | (defun coq-show-goals-inside-proof (keep-response)
|
3106 |
| - "Update goals buffer when action item list has been processed. |
3107 |
| -Add a Show command as priority action, such that it will still be |
3108 |
| -processed if the generic machinery inside `proof-shell-filter' |
3109 |
| -believes it has processed the last item from the action list. |
3110 |
| -When Coq runs in silent mode, we need to update the goals |
3111 |
| -precisely when everything else from the action list has been |
3112 |
| -processed. |
| 3128 | + "Update goals when action item list has been processed, if running silent. |
| 3129 | +If `coq-run-completely-silent' is set, add a Show command as |
| 3130 | +priority action, such that it will still be processed if the |
| 3131 | +generic machinery inside `proof-shell-filter' believes it has |
| 3132 | +processed the last item from the action list. When Coq runs in |
| 3133 | +silent mode, we need to update the goals precisely when |
| 3134 | +everything else from the action list has been processed. |
3113 | 3135 |
|
3114 | 3136 | The Show command is only added inside proofs and only if the last
|
3115 | 3137 | processed command was not a show command from this function. The
|
3116 | 3138 | action item flag `'dont-show-when-silent' is used for the latter.
|
3117 | 3139 |
|
3118 | 3140 | KEEP-RESPONSE should be set if the last command produced some
|
3119 | 3141 | error or response that should be kept and shown to the user. If
|
3120 |
| -set, the flag `'keep-response' is added to the action item." |
3121 |
| - (when (and coq-last-but-one-proofstack |
| 3142 | +set, the flag `'keep-response' is added to the action item. |
| 3143 | +
|
| 3144 | +Do nothing if `coq-run-completely-silent' is disabled." |
| 3145 | + (when (and coq-run-completely-silent |
| 3146 | + coq-last-but-one-proofstack |
3122 | 3147 | (not (member 'dont-show-when-silent
|
3123 | 3148 | proof-shell-delayed-output-flags)))
|
3124 | 3149 | (let* ((flags-1 (list 'dont-show-when-silent 'invisible 'empty-action-list))
|
|
0 commit comments