Opened 12 years ago

Closed 12 years ago

#436 closed defect (fixed)

Starting the coq process results in an error

Reported by: coquser Owned by: David Aspinall
Priority: major Milestone: PG-Emacs-4.2
Component: 2:pg-emacs Keywords:
Cc: alan.schmitt@…

Description

When starting the coq process, I get an error (wrong-type-argument stringp nil) displayed in the mini-buffer. It keeps flashing, as if it were repeated. If I "C-g" then I can start using Proof General normally, with no further problem.

This is with Aquamacs 2.4 and Proof General Emacs 4.2

Here is a debugger trace.

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  get-buffer(nil)
  switch-to-buffer(nil)
  (let* ((nbgoals ...) (dummy ...) (toclean ...)) (while toclean (setq minor-mode-alist ...) (setq toclean ...)) (setq minor-mode-alist (append ... minor-mode-alist)))
  (save-window-excursion (switch-to-buffer proof-goals-buffer) (let* (... ... ...) (while toclean ... ...) (setq minor-mode-alist ...)))
  coq-update-minor-mode-alist()
  run-hooks(proof-shell-handle-delayed-output-hook)
  (let ((start proof-shell-delayed-output-start) (end proof-shell-delayed-output-end) (flags proof-shell-delayed-output-flags)) (goto-char start) (cond (... ...) (t ... ...)) (run-hooks (quote proof-shell-handle-delayed-output-hook)))
  proof-shell-handle-delayed-output()
  (setq proof-shell-last-output-kind (proof-shell-handle-delayed-output))
  (if (proof-shell-exec-loop) (setq proof-shell-last-output-kind (proof-shell-handle-delayed-output)))
  (if proof-shell-last-output-kind nil (setq proof-shell-delayed-output-start start) (setq proof-shell-delayed-output-end end) (setq proof-shell-delayed-output-flags flags) (if (proof-shell-exec-loop) (setq proof-shell-last-output-kind ...)))
  (unless proof-shell-last-output-kind (setq proof-shell-delayed-output-start start) (setq proof-shell-delayed-output-end end) (setq proof-shell-delayed-output-flags flags) (if (proof-shell-exec-loop) (setq proof-shell-last-output-kind ...)))
  (let ((cmd ...) (flags ...)) (setq proof-shell-last-output (buffer-substring-no-properties start end)) (proof-shell-handle-immediate-output cmd start end flags) (unless proof-shell-last-output-kind (setq proof-shell-delayed-output-start start) (setq proof-shell-delayed-output-end end) (setq proof-shell-delayed-output-flags flags) (if ... ...)))
  proof-shell-filter-manage-output(226 226)
  (progn (setq endpos (match-beginning 0)) (setq proof-shell-last-prompt (buffer-substring-no-properties endpos ...)) (goto-char (point-max)) (proof-shell-filter-manage-output startpos endpos))
  (if (re-search-forward proof-shell-annotated-prompt-regexp nil t) (progn (setq endpos ...) (setq proof-shell-last-prompt ...) (goto-char ...) (proof-shell-filter-manage-output startpos endpos)))
  (let ((urgnt ...) (prev-prompt pos) (startpos pos) endpos) (goto-char pos) (if (and urgnt ...) (setq startpos ...) (if ... ... ...)) (if (re-search-forward proof-shell-annotated-prompt-regexp nil t) (progn ... ... ... ...)))
  (if proof-action-list (let (... ... ... endpos) (goto-char pos) (if ... ... ...) (if ... ...)) (if proof-shell-busy (progn ... ...)))
  (if (not pos) (proof-shell-filter-first-command) (if proof-action-list (let ... ... ... ...) (if proof-shell-busy ...)))
  (let ((pos ...)) (if (not pos) (proof-shell-filter-first-command) (if proof-action-list ... ...)))
  (save-excursion (and proof-shell-eager-annotation-start (proof-shell-process-urgent-messages)) (let (...) (if ... ... ...)))
  proof-shell-filter("\n<prompt>Coq < 2 || 0 < </prompt>")
  run-hook-with-args(proof-shell-filter "\n<prompt>Coq < 2 || 0 < </prompt>")
  (let ((saved-point ...)) (goto-char (process-mark process)) (set-marker scomint-last-output-start (point)) (insert string) (set-marker (process-mark process) (point)) (goto-char saved-point) (run-hook-with-args (quote scomint-output-filter-functions) string) (set-marker saved-point (point)))
  (save-current-buffer (set-buffer oprocbuf) (let (...) (goto-char ...) (set-marker scomint-last-output-start ...) (insert string) (set-marker ... ...) (goto-char saved-point) (run-hook-with-args ... string) (set-marker saved-point ...)))
  (with-current-buffer oprocbuf (let (...) (goto-char ...) (set-marker scomint-last-output-start ...) (insert string) (set-marker ... ...) (goto-char saved-point) (run-hook-with-args ... string) (set-marker saved-point ...)))
  (progn (with-current-buffer oprocbuf (let ... ... ... ... ... ... ... ...)))
  (if (and string (buffer-live-p oprocbuf)) (progn (with-current-buffer oprocbuf ...)))
  (when (and string (buffer-live-p oprocbuf)) (with-current-buffer oprocbuf (let ... ... ... ... ... ... ... ...)))
  (let ((oprocbuf ...)) (when (and string ...) (with-current-buffer oprocbuf ...)))
  scomint-output-filter(#<process coq> "\n<prompt>Coq < 2 || 0 < </prompt>")
  accept-process-output(#<process coq> 0.01 nil 1)
  (while (and proof-shell-busy (not quit-flag) (if timecount ... t) (not ...)) (accept-process-output proverproc accepttime nil 1))
  (progn (while (and proof-shell-busy ... ... ...) (accept-process-output proverproc accepttime nil 1)) (redisplay) (if quit-flag (error "Proof General: quit in proof-shell-wait")))
  (if proverproc (progn (while ... ...) (redisplay) (if quit-flag ...)))
  (when proverproc (while (and proof-shell-busy ... ... ...) (accept-process-output proverproc accepttime nil 1)) (redisplay) (if quit-flag (error "Proof General: quit in proof-shell-wait")))
  (let* ((proverproc ...) (accepttime 0.01) (timecount ...)) (when proverproc (while ... ...) (redisplay) (if quit-flag ...)))
  proof-shell-wait()
  (if wait (proof-shell-wait))
  (progn (unless (or ... ... ...) (setq cmd ...)) (if wait (proof-shell-wait)) (proof-shell-ready-prover) (let* (...) (proof-start-queue nil nil ...)) (if wait (proof-shell-wait)))
  (if cmd (progn (unless ... ...) (if wait ...) (proof-shell-ready-prover) (let* ... ...) (if wait ...)))
  proof-shell-invisible-command("Unset Printing All. " t)
  (lambda (c) (proof-shell-invisible-command c t))("Unset Printing All. ")
  mapcar((lambda (c) (proof-shell-invisible-command c t)) ("Unset Printing All. " "Unset Printing Implicit. " "Unset Printing Coercions. " "Set Printing Wildcard. " "Set Printing Synth. " "Set Printing Depth 50 . " "Set Undo 200 . "))
  (if proof-assistant-settings (mapcar (lambda ... ...) (proof-assistant-settings-cmds)))
  (progn (run-hooks (quote proof-shell-init-hook)) (when proof-shell-init-cmd (if ... ... ...)) (proof-shell-wait) (if proof-assistant-settings (mapcar ... ...)))
  (unwind-protect (progn (run-hooks ...) (when proof-shell-init-cmd ...) (proof-shell-wait) (if proof-assistant-settings ...)))
  (progn (setq proof-action-list nil) (proof-maybe-askprefs) (unwind-protect (progn ... ... ... ...)))
  (if (memq (process-status proc) (quote ...)) (progn (setq proof-action-list nil) (proof-maybe-askprefs) (unwind-protect ...)))
  (let ((proc ...)) (add-hook (quote kill-buffer-hook) (quote proof-shell-kill-function) t t) (set-process-sentinel proc (quote proof-shell-bail-out)) (if proof-shell-pre-sync-init-cmd (proof-shell-insert proof-shell-pre-sync-init-cmd ...)) (while (and ... ...) (accept-process-output proc 1)) (if (memq ... ...) (progn ... ... ...)))
  (save-current-buffer (set-buffer proof-shell-buffer) (dolist (sym proof-shell-important-settings) (proof-warn-if-unset "proof-shell-config-done" sym)) (setq font-lock-defaults (quote ...)) (set (make-local-variable ...) (list ... proof-mode-for-shell)) (let (...) (add-hook ... ... t t) (set-process-sentinel proc ...) (if proof-shell-pre-sync-init-cmd ...) (while ... ...) (if ... ...)))
  (with-current-buffer proof-shell-buffer (dolist (sym proof-shell-important-settings) (proof-warn-if-unset "proof-shell-config-done" sym)) (setq font-lock-defaults (quote ...)) (set (make-local-variable ...) (list ... proof-mode-for-shell)) (let (...) (add-hook ... ... t t) (set-process-sentinel proc ...) (if proof-shell-pre-sync-init-cmd ...) (while ... ...) (if ... ...)))
  proof-shell-config-done()
  coq-shell-mode-config()
  (let ((delay-mode-hooks t)) (proof-shell-mode) (setq major-mode (quote coq-shell-mode)) (setq mode-name "Coq Shell") (progn (if ... ...) (unless ... ...) (let ... ...)) (use-local-map coq-shell-mode-map) (set-syntax-table coq-shell-mode-syntax-table) (setq local-abbrev-table coq-shell-mode-abbrev-table) (coq-shell-mode-config))
  (progn (make-local-variable (quote delay-mode-hooks)) (let (...) (proof-shell-mode) (setq major-mode ...) (setq mode-name "Coq Shell") (progn ... ... ...) (use-local-map coq-shell-mode-map) (set-syntax-table coq-shell-mode-syntax-table) (setq local-abbrev-table coq-shell-mode-abbrev-table) (coq-shell-mode-config)))
  (delay-mode-hooks (proof-shell-mode) (setq major-mode (quote coq-shell-mode)) (setq mode-name "Coq Shell") (progn (if ... ...) (unless ... ...) (let ... ...)) (use-local-map coq-shell-mode-map) (set-syntax-table coq-shell-mode-syntax-table) (setq local-abbrev-table coq-shell-mode-abbrev-table) (coq-shell-mode-config))
  coq-shell-mode()
  funcall(coq-shell-mode)
  (save-current-buffer (set-buffer proof-shell-buffer) (erase-buffer) (proof-shell-set-text-representation) (funcall proof-mode-for-shell) (unless (proof-shell-live-buffer) (switch-to-buffer proof-shell-buffer) (error "%s process exited!" proc)) (with-current-buffer proof-response-buffer (erase-buffer) (proof-shell-set-text-representation) (funcall proof-mode-for-response)) (with-current-buffer proof-goals-buffer (erase-buffer) (proof-shell-set-text-representation) (funcall proof-mode-for-goals)) (proof-with-current-buffer-if-exists proof-trace-buffer (erase-buffer) (proof-shell-set-text-representation) (funcall proof-mode-for-response) (setq pg-response-eagerly-raise nil)) (if proof-shell-fiddle-frames (save-selected-window ...)))
  (with-current-buffer proof-shell-buffer (erase-buffer) (proof-shell-set-text-representation) (funcall proof-mode-for-shell) (unless (proof-shell-live-buffer) (switch-to-buffer proof-shell-buffer) (error "%s process exited!" proc)) (with-current-buffer proof-response-buffer (erase-buffer) (proof-shell-set-text-representation) (funcall proof-mode-for-response)) (with-current-buffer proof-goals-buffer (erase-buffer) (proof-shell-set-text-representation) (funcall proof-mode-for-goals)) (proof-with-current-buffer-if-exists proof-trace-buffer (erase-buffer) (proof-shell-set-text-representation) (funcall proof-mode-for-response) (setq pg-response-eagerly-raise nil)) (if proof-shell-fiddle-frames (save-selected-window ...)))
  (let ((proc ...)) (let* (... ... ... ... ... ... ... ... ...) (message "Starting: %s" prog-command-line) (apply ... ...) (setq proof-shell-buffer ...) (unless ... ... ...)) (let (... ... ... ...) (setq proof-goals-buffer ...) (setq proof-response-buffer ...) (if proof-shell-trace-output-regexp ...) (if proof-shell-thms-output-regexp ...) (setq pg-response-special-display-regexp ...)) (with-current-buffer proof-shell-buffer (erase-buffer) (proof-shell-set-text-representation) (funcall proof-mode-for-shell) (unless ... ... ...) (with-current-buffer proof-response-buffer ... ... ...) (with-current-buffer proof-goals-buffer ... ... ...) (proof-with-current-buffer-if-exists proof-trace-buffer ... ... ... ...) (if proof-shell-fiddle-frames ...)) (message "Starting %s process... done." proc))
  (if (proof-shell-live-buffer) nil (setq proof-included-files-list nil) (let (...) (if ... ...)) (if proof-prog-name-ask (setq proof-prog-name ...)) (let (...) (let* ... ... ... ... ...) (let ... ... ... ... ... ...) (with-current-buffer proof-shell-buffer ... ... ... ... ... ... ... ...) (message "Starting %s process... done." proc)))
  (unless (proof-shell-live-buffer) (setq proof-included-files-list nil) (let (...) (if ... ...)) (if proof-prog-name-ask (setq proof-prog-name ...)) (let (...) (let* ... ... ... ... ...) (let ... ... ... ... ... ...) (with-current-buffer proof-shell-buffer ... ... ... ... ... ... ... ...) (message "Starting %s process... done." proc)))
  proof-shell-start()
  proof-shell-ready-prover(advancing)
  (save-excursion (when proof-script-buffer (proof-deactivate-scripting) (if proof-script-buffer ...)) (proof-unregister-buffer-file-name (quote tell-the-prover)) (if proof-script-buffer (proof-deactivate-scripting)) (assert (null proof-script-buffer) "Bug in proof-activate-scripting: deactivate failed.") (proof-shell-ready-prover queuemode) (setq proof-script-buffer (current-buffer)) (if (proof-locked-region-empty-p) (proof-init-segmentation)) (setq proof-active-buffer-fake-minor-mode t) (force-mode-line-update) (if (and proof-query-file-save-when-activating-scripting ...) (save-some-buffers nil ...)) (if proof-activate-scripting-hook (let ... ... ... ...)))
  (if (equal (current-buffer) proof-script-buffer) nil (save-excursion (when proof-script-buffer ... ...) (proof-unregister-buffer-file-name ...) (if proof-script-buffer ...) (assert ... "Bug in proof-activate-scripting: deactivate failed.") (proof-shell-ready-prover queuemode) (setq proof-script-buffer ...) (if ... ...) (setq proof-active-buffer-fake-minor-mode t) (force-mode-line-update) (if ... ...) (if proof-activate-scripting-hook ...)))
  (unless (equal (current-buffer) proof-script-buffer) (save-excursion (when proof-script-buffer ... ...) (proof-unregister-buffer-file-name ...) (if proof-script-buffer ...) (assert ... "Bug in proof-activate-scripting: deactivate failed.") (proof-shell-ready-prover queuemode) (setq proof-script-buffer ...) (if ... ...) (setq proof-active-buffer-fake-minor-mode t) (force-mode-line-update) (if ... ...) (if proof-activate-scripting-hook ...)))
  proof-activate-scripting(nil advancing)
  proof-assert-until-point()
  (save-excursion (goto-char (proof-queue-or-locked-end)) (skip-chars-forward " 	\n") (proof-assert-until-point))
  (progn (save-excursion (goto-char ...) (skip-chars-forward " 	\n") (proof-assert-until-point)) (proof-maybe-follow-locked-end))
  (cond ((eq proof-buffer-type ...) (progn ... ...)) ((buffer-live-p proof-script-buffer) (with-current-buffer proof-script-buffer ... ...)))
  (proof-with-script-buffer (save-excursion (goto-char ...) (skip-chars-forward " 	\n") (proof-assert-until-point)) (proof-maybe-follow-locked-end))
  proof-assert-next-command-interactive()
  call-interactively(proof-assert-next-command-interactive nil nil)

Change History (2)

comment:1 Changed 12 years ago by coquser

Hi,

from the debugger trace it appears that you are using a cvs version of Proof General checked out before December 5, 2011. There have been a few changes in coq-update-minor-mode-alist since then which make it more robust, IMHO. Could you update your cvs snapshot of Proof General and try to reproduce the problem?

Bye,

Hendrik

comment:2 Changed 12 years ago by coquser

Resolution: fixed
Status: newclosed

I was indeed using ProofGeneral version 4.1 (not a CVS version though). With the current developer pre-release (4.2pre120206) the error message goes away. Thanks!

Note: See TracTickets for help on using tickets.