GNU bug report logs - #46003
prolog-mode: inferior prolog process not available when prolog-inferior-mode-hook is run

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Tim Lee <progscriptclone@HIDDEN>; dated Wed, 20 Jan 2021 08:34:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 46003 <at> debbugs.gnu.org:


Received: (at 46003) by debbugs.gnu.org; 27 Jan 2021 06:11:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 27 01:11:48 2021
Received: from localhost ([127.0.0.1]:43432 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1l4e3Q-0001du-E7
	for submit <at> debbugs.gnu.org; Wed, 27 Jan 2021 01:11:48 -0500
Received: from mail-pf1-f172.google.com ([209.85.210.172]:38811)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <k3tu0isui@HIDDEN>) id 1l4e3O-0001dd-Qj
 for 46003 <at> debbugs.gnu.org; Wed, 27 Jan 2021 01:11:47 -0500
Received: by mail-pf1-f172.google.com with SMTP id y205so520648pfc.5
 for <46003 <at> debbugs.gnu.org>; Tue, 26 Jan 2021 22:11:46 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=date:from:to:cc:subject:message-id:mime-version:content-disposition;
 bh=HG2Ay37UG6M0i378msoItWD5jj4UVzJbiYft/LulLBg=;
 b=S9+g6LQk2Rgs1C7CjBU7+59SABDJqg6WI5uyAZRFobik2/GzjjvVd82Bs5V7ZvSe+C
 EmFLRZPrYFvu+LM3iBadfi+JzJtfl8euQz0ydBUnTmwYe3TYs9NYqeFixQsnAeAErhVN
 niRqRcQQT+xZRd4Syb9gDAhpdqCIvnhOWh/jG+cpKX/tDVBjLDec+EQg+yNGuyTQ+rVk
 69iYUeUj5OYBlB7EEPCqmGvWkHGW8A5OpDjxalvBbrjQI5r63nqsIpc19+34/jq7wwP0
 gpE79CHkshgEMJPDS4UQ2P5dEIdwPZwp0/mkkpWrD3c7WNe9iL8W+tvYkzcTJoNN3uD2
 IvOA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version
 :content-disposition;
 bh=HG2Ay37UG6M0i378msoItWD5jj4UVzJbiYft/LulLBg=;
 b=rO22ChZFD9RsVRmDFSDdqH5DkL+fwjU6E6LJml0kgZr7irqpYLtbKbpcR/EL476sB+
 1LRDHFogViNkY2SqBRCNa0taQwyWM4n50Xrp/uXPDH9yaVV06mM/kO7REnOgBan9DzEe
 /3FhzwNJWk+rZoEJ3sYJInCYZ8Q986cJoWcjX/VhNxlEsEFlpqnw2zefeK3ZgdRHlv95
 aFDPz3+STqshjwgKIlxJoQSvuYtdbW1SC1+SY+fn5Hgt+rSZdj7TXAJUSNcUJo7ijvU6
 OcyKhoqwGDpHH+y6sXVlkjxZ0dH79j8Keh+D+M2KvNhSjct86c7wlIXtn1yh+Ll6UnjS
 xsKg==
X-Gm-Message-State: AOAM530pWxYUyQSJAezO8gbrTD7ZIQCtfjT618JXJ5fmxQmLYO2MqpAv
 PHUtk1HD5XSNgbizEVlEk0Q=
X-Google-Smtp-Source: ABdhPJxxIpEqv7GCGLkSG7IeJ5kNLB2LuDtqvqaz9eLmX56Vv//MwQAqZbKE/dh2MpEEWNMek2WsKA==
X-Received: by 2002:a62:7b8a:0:b029:1bb:4a06:bb57 with SMTP id
 w132-20020a627b8a0000b02901bb4a06bb57mr8911654pfc.47.1611727901018; 
 Tue, 26 Jan 2021 22:11:41 -0800 (PST)
Received: from sildranDT.localdomain ([2401:4900:4aa6:7954:601:f328:b3b2:8896])
 by smtp.gmail.com with ESMTPSA id 68sm1076223pfg.90.2021.01.26.22.11.38
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 26 Jan 2021 22:11:40 -0800 (PST)
Date: Wed, 27 Jan 2021 11:41:34 +0530
From: k3tu0isui@HIDDEN
To: progscriptclone@HIDDEN
Subject: #46003: should this be a bug?
Message-ID: <20210127061134.wzaxfjsqinhkk2oe@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 46003
Cc: 46003 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Is it a requirement for a buffer in a inferior-mode to always have a
process? 
When you call run-prolog or prolog-consult-buffer, if a prolog process
is not running, a *prolog* buffer is created, prolog-inferior-mode is
activated in the buffer and THEN the process itself is run. Relevant code
from prolog-ensure-process function.

      (with-current-buffer (get-buffer-create "*prolog*")
	(prolog-inferior-mode)
...
          (apply 'make-comint-in-buffer "prolog" (current-buffer)
	         (prolog-program-name) nil (prolog-program-switches)))

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

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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#46003; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 20 Jan 2021 08:33:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 20 03:33:22 2021
Received: from localhost ([127.0.0.1]:52772 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1l28vZ-0007cc-MN
	for submit <at> debbugs.gnu.org; Wed, 20 Jan 2021 03:33:21 -0500
Received: from lists.gnu.org ([209.51.188.17]:33530)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <progscriptclone@HIDDEN>) id 1l28o1-0007PO-UE
 for submit <at> debbugs.gnu.org; Wed, 20 Jan 2021 03:25:35 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:35976)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <progscriptclone@HIDDEN>)
 id 1l28o1-0008D8-Lc
 for bug-gnu-emacs@HIDDEN; Wed, 20 Jan 2021 03:25:33 -0500
Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]:53005)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <progscriptclone@HIDDEN>)
 id 1l28nz-0007R5-Pt
 for bug-gnu-emacs@HIDDEN; Wed, 20 Jan 2021 03:25:33 -0500
Received: by mail-pj1-x102b.google.com with SMTP id kx7so1724169pjb.2
 for <bug-gnu-emacs@HIDDEN>; Wed, 20 Jan 2021 00:25:30 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=to:from:subject:message-id:date:mime-version:content-language
 :content-transfer-encoding;
 bh=E/B5J4dKkFVtMed7t8m9bit0TahjPTuNXAXVV5qSR8c=;
 b=AA6l4F2hydSw84Kas0yrJ59vD9CjxVKz398Z5KDbyS2SzUbFwyClO+fRP9+vavXxOt
 J9AKZ7t2/7OdjZU8Fh7DnP7NtaqAHbYp3G7IFNQ2ihZtw5rZrM1zhX16W5cGlHyCMFrK
 IIM931DEgGa5zXLhjy/eQ+szNub/G5iscNJbMZuYC1yrBcDtGhZ6bOBlTb0H6Ce90VXO
 A4wNiTZqScN2CaVUmXA6VpTcrHy7M/R9yvvH1KDjShM2cThZLYCRvzva+JtHauAA8SiA
 /9LHCAkP1/dFnZK9NFgB7sysL0Ecz0irQ+kooXhTBiOiDVYjk4bmN9k4bOB+LMCfHj8d
 XdHw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:to:from:subject:message-id:date:mime-version
 :content-language:content-transfer-encoding;
 bh=E/B5J4dKkFVtMed7t8m9bit0TahjPTuNXAXVV5qSR8c=;
 b=s/CgjWFS2cnqmn5tiMgI81iAu8q/2e4I+kNxBmMOCRRsRHmZ4pl2DPQwSjXgAP28NH
 E8OSx7y90T0Fsmc0ogYaYI3dEdxQJ4r8QjKSmbqnmLfY51aqfeqzKWEk/dNna5k6KJhP
 YVrF+PP5q2gOsOJ9f0deUPDOFoACwltTGaukNXVGTukJdiCj6R7PyhsRwbtdnsW5hq1/
 ZqeUTnXu1J85s2bIGMg7f0IFAVgSfkvK7D7ytFhIXcYNsjS24pi0hSF9uOS+O5ijeSP7
 OgArpFI30dt468PHJFO+s0UutosyU0SxReDq/5HjinFI+50eBeo9cmCHvPw35Tidhwze
 RmQQ==
X-Gm-Message-State: AOAM530vIcGpKruSnqvFTsSHT+hTN5ZKn2l2YcTO849qHd6OO9fbST22
 lUnqR09nFgViB0P5C2r3nn2wZM9WWr0=
X-Google-Smtp-Source: ABdhPJxL8zA86BKKAWCsm7QHtcC5kJ3/b4V5ggvrFvZUV9gw8Q+5lkLBfJ/FDUPtGCGmppwdvecpGw==
X-Received: by 2002:a17:90a:2f8f:: with SMTP id
 t15mr4372718pjd.184.1611131129283; 
 Wed, 20 Jan 2021 00:25:29 -0800 (PST)
Received: from [10.0.2.15] ([61.6.232.49])
 by smtp.gmail.com with ESMTPSA id fh7sm1559985pjb.43.2021.01.20.00.25.27
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 20 Jan 2021 00:25:28 -0800 (PST)
To: bug-gnu-emacs@HIDDEN
From: Tim Lee <progscriptclone@HIDDEN>
Subject: prolog-mode: inferior prolog process not available when
 prolog-inferior-mode-hook is run
Message-ID: <4049adea-058e-f97a-ad4a-3727d2a1db98@HIDDEN>
Date: Wed, 20 Jan 2021 16:26:45 +0800
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Received-SPF: pass client-ip=2607:f8b0:4864:20::102b;
 envelope-from=progscriptclone@HIDDEN; helo=mail-pj1-x102b.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Wed, 20 Jan 2021 03:33:20 -0500
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

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.




Acknowledgement sent to Tim Lee <progscriptclone@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#46003; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 27 Jan 2021 06:15:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.