Subject: prolog-mode: inferior prolog process not available when prolog-inferior-mode-hook is run

From: Tim Lee <[email-masked]>
Date: Wed, 20 Jan 2021 16:26:45 +0800

I am using prolog-mode in Emacs 25.2. The following code shows that the
inferior prolog process is not available when prolog-inferior-mode-hook
is run:

(add-hook 'prolog-inferior-mode-hook
          (lambda ()
            (unless (get-buffer-process (current-buffer))
              (warn "NO PROCESS!"))))

When I have above in my ~/.emacs, and when I start the Prolog REPL using
M-x run-prolog, the warning "NO PROCESS!" will appear, showing that the
inferior prolog process in not available when the hook is run.

I don't get this problem with the inferior mode hooks of other
programming languages (e.g. inferior-python-mode-hook,
inferior-lisp-mode-hook, inferior-scheme-mode-hook, etc.); their process
is available when their hook is run. I assume that there is problem with
prolog-mode.