1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-25 10:47:00 +00:00

Port run-prolog EMACS to SWI-Prolog 7.2.3

* lisp/progmodes/prolog.el (prolog-ensure-process):
Work around incompatibility of SWI-Prolog 7.2.3 and earlier
with the new way of dealing with the EMACS and INSIDE_EMACS
environment variables.
This commit is contained in:
Paul Eggert 2016-04-10 22:47:03 -07:00
parent 0e7bcec103
commit 9b1aab91fc

View File

@ -1374,8 +1374,20 @@ the variable `prolog-prompt-regexp'."
() ()
(with-current-buffer (get-buffer-create "*prolog*") (with-current-buffer (get-buffer-create "*prolog*")
(prolog-inferior-mode) (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
;; obsolescent, so set INFERIOR. Newer versions of SWI-Prolog should
;; know about INSIDE_EMACS (which replaced EMACS) and should not need
;; this hack.
(let ((process-environment
(if (getenv "INFERIOR")
process-environment
(cons "INFERIOR=yes" process-environment))))
(apply 'make-comint-in-buffer "prolog" (current-buffer) (apply 'make-comint-in-buffer "prolog" (current-buffer)
(prolog-program-name) nil (prolog-program-switches)) (prolog-program-name) nil (prolog-program-switches)))
(unless prolog-system (unless prolog-system
;; Setup auto-detection. ;; Setup auto-detection.
(setq-local (setq-local