summaryrefslogtreecommitdiff
path: root/lisp/progmodes/prolog.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2009-08-19 17:15:30 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2009-08-19 17:15:30 +0000
commit28930e394d0b542a70aa6ac25956d3b7e035f627 (patch)
treed5d79bfd24fbeb085a6efc157762aa1e3d191357 /lisp/progmodes/prolog.el
parent1373f3bebca225b0416df029c2259f60aa4cb5ef (diff)
downloademacs-28930e394d0b542a70aa6ac25956d3b7e035f627.tar.gz
(inferior-prolog-error-regexp-alist): New var.
(inferior-prolog-mode): Use it. (inferior-prolog-load-file): Reset list of errors.
Diffstat (limited to 'lisp/progmodes/prolog.el')
-rw-r--r--lisp/progmodes/prolog.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el
index b62255fbf91..d422d85b13a 100644
--- a/lisp/progmodes/prolog.el
+++ b/lisp/progmodes/prolog.el
@@ -238,6 +238,11 @@ rigidly along with this one (not yet)."
(defvar inferior-prolog-mode-syntax-table prolog-mode-syntax-table)
(defvar inferior-prolog-mode-abbrev-table prolog-mode-abbrev-table)
+(defvar inferior-prolog-error-regexp-alist
+ ;; GNU Prolog used to not follow the GNU standard format.
+ '(("^\\(.*?\\):\\([0-9]+\\) error: .*(char:\\([0-9]+\\)" 1 2 3)
+ gnu))
+
(declare-function comint-mode "comint")
(declare-function comint-send-string "comint" (process string))
(declare-function comint-send-region "comint" (process start end))
@@ -268,6 +273,9 @@ Return not at end copies rest of line to end and sends it.
\\[comint-interrupt-subjob] interrupts the shell or its current subjob if any.
\\[comint-stop-subjob] stops. \\[comint-quit-subjob] sends quit signal."
(setq comint-prompt-regexp "^| [ ?][- ] *")
+ (set (make-local-variable 'compilation-error-regexp-alist)
+ inferior-prolog-error-regexp-alist)
+ (compilation-shell-minor-mode)
(prolog-mode-variables))
(defvar inferior-prolog-buffer nil)
@@ -357,6 +365,10 @@ With prefix argument \\[universal-prefix], prompt for the program to use."
(save-excursion
(goto-char (- pmark 3))
(looking-at " \\? ")))
+ ;; This is GNU prolog waiting to know whether you want more answers
+ ;; or not (or abort, etc...). The answer is a single char, not
+ ;; a line, so pass this char directly rather than wait for RET to
+ ;; send a whole line.
(comint-send-string proc (string last-command-event))
(call-interactively 'self-insert-command))))
@@ -389,6 +401,7 @@ If COMPILE (prefix arg) is not nil, use compile mode rather than consult mode."
(let ((file buffer-file-name)
(proc (inferior-prolog-process)))
(with-current-buffer (process-buffer proc)
+ (compilation-forget-errors)
(comint-send-string proc (concat "['" (file-relative-name file) "'].\n"))
(pop-to-buffer (current-buffer)))))