unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: k3tu0isui@gmail.com
Cc: progscriptclone@gmail.com, 46003@debbugs.gnu.org
Subject: bug#46003: prolog-mode: inferior prolog process not available when prolog-inferior-mode-hook is run
Date: Tue, 07 Jun 2022 16:37:56 +0200	[thread overview]
Message-ID: <87pmjkfsjf.fsf_-_@gnus.org> (raw)
In-Reply-To: <20210127061134.wzaxfjsqinhkk2oe@sildranDT.localdomain> (k3tu0isui@gmail.com's message of "Wed, 27 Jan 2021 11:41:34 +0530")

k3tu0isui@gmail.com writes:

> I assume this was required because (prolog-inferior-mode) sets up the
> variables required for (prolog-program-name) and (prolog-program-switches).

Those are computed before we enter prolog-inferior-mode, though...  Oh,
because you've fixed that in an earlier applied patch.

> If the relevant variables are inherited from the buffer from which
> run-prolog is called then, this bug fix[1] will remove this dependency
> and prolog-inferior-mode can be activated after the process is
> created.
>
> [1]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45795

OK, then I'm applying this patch to Emacs 29, which should fix this bug
report:

diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el
index 8382c4bd09..9598209f5e 100644
--- a/lisp/progmodes/prolog.el
+++ b/lisp/progmodes/prolog.el
@@ -1355,8 +1355,6 @@ prolog-ensure-process
         (error "This Prolog system has defined no interpreter"))
     (unless (comint-check-proc "*prolog*")
       (with-current-buffer (get-buffer-create "*prolog*")
-        (prolog-inferior-mode)
-
         ;; The "INFERIOR=yes" hack is for SWI-Prolog 7.2.3 and earlier,
         ;; which assumes it is running under Emacs if either INFERIOR=yes or
         ;; if EMACS is set to a nonempty value.  The EMACS setting is
@@ -1369,6 +1367,7 @@ prolog-ensure-process
 	         (cons "INFERIOR=yes" process-environment))))
 	  (apply 'make-comint-in-buffer "prolog" (current-buffer)
 	         pname nil pswitches))
+        (prolog-inferior-mode)
 
         (unless prolog-system
           ;; Setup auto-detection.



-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





      reply	other threads:[~2022-06-07 14:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-20  8:26 bug#46003: prolog-mode: inferior prolog process not available when prolog-inferior-mode-hook is run Tim Lee
2021-01-27  6:11 ` bug#46003: #46003: should this be a bug? k3tu0isui
2022-06-07 14:37   ` Lars Ingebrigtsen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pmjkfsjf.fsf_-_@gnus.org \
    --to=larsi@gnus.org \
    --cc=46003@debbugs.gnu.org \
    --cc=k3tu0isui@gmail.com \
    --cc=progscriptclone@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).