[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] scratch/ediprolog ebd79c0abd 26/31: enable faithful processing of
From: |
Stefan Monnier |
Subject: |
[elpa] scratch/ediprolog ebd79c0abd 26/31: enable faithful processing of multiline queries for Scryer Prolog |
Date: |
Sun, 2 Oct 2022 17:01:39 -0400 (EDT) |
branch: scratch/ediprolog
commit ebd79c0abdc05a752c947e333551d808e3933046
Author: Markus Triska <triska@metalevel.at>
Commit: Markus Triska <triska@metalevel.at>
enable faithful processing of multiline queries for Scryer Prolog
---
ediprolog.el | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/ediprolog.el b/ediprolog.el
index fd91d4061e..c5213454d1 100644
--- a/ediprolog.el
+++ b/ediprolog.el
@@ -1,6 +1,6 @@
;;; ediprolog.el --- Emacs Does Interactive Prolog
-;; Copyright (C) 2006-2021 Markus Triska
+;; Copyright (C) 2006-2022 Markus Triska
;; Author: Markus Triska <triska@metalevel.at>
;; Keywords: languages, processes
@@ -52,11 +52,11 @@
;; Queries start with "?-" or ":-", possibly preceded by "%" and
;; whitespace. An example of a query is (without leading ";;"):
;;
-;; %?- member(X, [a,b,c]).
+;; %?- member(X, "abc").
;;
;; If you press F10 when point is on that query, you get:
;;
-;; %?- member(X, [a,b,c]).
+;; %?- member(X, "abc").
;; %@ X = a
;; %@ ; X = b
;; %@ ; X = c
@@ -92,7 +92,7 @@
;;; Code:
-(defconst ediprolog-version "2.2-PRE2")
+(defconst ediprolog-version "2.2-PRE4")
(defgroup ediprolog nil
"Transparent interaction with Prolog."
@@ -369,9 +369,19 @@ arguments, equivalent to `ediprolog-remove-interactions'."
(end-of-line)
(insert "\n" ediprolog-indent-prefix ediprolog-prefix)
(ediprolog-interact
- (format "%s\n" (mapconcat #'identity
+ (format "%s\n"
+ (if (eq ediprolog-system 'scryer)
+ ;; Scryer Prolog emits no additional indicators
+ ;; when a query spans multiple lines, so we send
+ ;; the query verbatim.
+ query
+ ;; For other Prolog systems, we merge the query into
+ ;; a single line. The drawback of this approach is
+ ;; that single-line comments at the end of a line are
+ ;; not handled correctly.
+ (mapconcat #'identity
;; `%' can precede each query line
- (split-string query "\n[ \t%]*") " ")))
+ (split-string query "\n[ \t%]*") " "))))
(when handle
(undo-amalgamate-change-group (cdr handle))))
t))
- [elpa] scratch/ediprolog ade75de9ae 07/31: table formatting, (continued)
- [elpa] scratch/ediprolog ade75de9ae 07/31: table formatting, Stefan Monnier, 2022/10/02
- [elpa] scratch/ediprolog 51a610ebc2 08/31: formatting and layout of Emacs commands, Stefan Monnier, 2022/10/02
- [elpa] scratch/ediprolog 1c8b127701 02/31: initial revision, Stefan Monnier, 2022/10/02
- [elpa] scratch/ediprolog f1b2480f46 12/31: preparing version 1.2, Stefan Monnier, 2022/10/02
- [elpa] scratch/ediprolog 2b348c3161 15/31: describe screenshot, Stefan Monnier, 2022/10/02
- [elpa] scratch/ediprolog 9c4c80ad4a 21/31: improve compatibility with older Emacs versions, Stefan Monnier, 2022/10/02
- [elpa] scratch/ediprolog e75c0ddfc4 30/31: Merge Jun 8 2020 commit '751119cfee9' into externals/ediprolog, Stefan Monnier, 2022/10/02
- [elpa] scratch/ediprolog 751119cfee 22/31: update Scryer Prolog answer, Stefan Monnier, 2022/10/02
- [elpa] scratch/ediprolog 8ba8786386 18/31: clarify installation, Stefan Monnier, 2022/10/02
- [elpa] scratch/ediprolog 5fd08fe19a 23/31: improve compatibility with older Emacs versions, Stefan Monnier, 2022/10/02
- [elpa] scratch/ediprolog ebd79c0abd 26/31: enable faithful processing of multiline queries for Scryer Prolog,
Stefan Monnier <=
- [elpa] scratch/ediprolog 6f94bf2368 19/31: add link to video, Stefan Monnier, 2022/10/02
- [elpa] scratch/ediprolog 8b554e63aa 24/31: document Scryer Prolog default setting, Stefan Monnier, 2022/10/02
- [elpa] scratch/ediprolog 4b265d2fb5 09/31: add a note distinguishing buffer content and file, Stefan Monnier, 2022/10/02
- [elpa] scratch/ediprolog 3f8ab3eea0 10/31: wording, Stefan Monnier, 2022/10/02
- [elpa] scratch/ediprolog dc0e51ba57 29/31: ediprolog 2.2: support newer Scryer Prolog versions, and smaller improvements, Stefan Monnier, 2022/10/02
- [elpa] scratch/ediprolog 34f7aa545c 04/31: transition to markdown, Stefan Monnier, 2022/10/02
- [elpa] scratch/ediprolog 943f7c2a48 01/31: initial revision, Stefan Monnier, 2022/10/02
- [elpa] scratch/ediprolog 68024b9f08 13/31: point to further information, Stefan Monnier, 2022/10/02
- [elpa] scratch/ediprolog d30bc3dd59 17/31: explain installation of ediprolog via GNU ELPA, Stefan Monnier, 2022/10/02
- [elpa] scratch/ediprolog c4d0834457 16/31: link to PceProlog, Stefan Monnier, 2022/10/02