all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Markus Triska <triska@metalevel.at>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 58196@debbugs.gnu.org
Subject: bug#58196: 27.0.50; ediprolog 2.2: Please upload the new version to ELPA
Date: Sun, 02 Oct 2022 21:49:45 +0200	[thread overview]
Message-ID: <87tu4mdmzq.fsf@metalevel.at> (raw)
In-Reply-To: <jwvfsg7iehu.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sat, 01 Oct 2022 14:37:13 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Could you merge that history with that of elpa.git?

OK, I have uploaded the changes as a series of patches at:

    https://www.metalevel.at/ediprolog/ediprolog_2_2.patch

For completeness, I also attach the content at the end of this mail, and
I hope this suffices to update the package?

Thank you and all the best,
Markus

From 843ff2613207fdc557a5511d58664bb3859a7efa Mon Sep 17 00:00:00 2001
From: Markus Triska <triska@metalevel.at>
Date: Sun, 2 Oct 2022 21:43:08 +0200
Subject: [PATCH 1/4] improve compatibility with older Emacs versions

---
 ediprolog.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/ediprolog.el b/ediprolog.el
index d88d30e80c..7898660d78 100644
--- a/ediprolog.el
+++ b/ediprolog.el
@@ -1,6 +1,6 @@
 ;;; ediprolog.el --- Emacs Does Interactive Prolog
 
-;; Copyright (C) 2006-2009, 2012-2013, 2016-2017, 2020  Free Software Foundation, Inc.
+;; Copyright (C) 2006-2009, 2012-2013, 2016-2017, 2021  Free Software Foundation, Inc.
 
 ;; Author: Markus Triska <triska@metalevel.at>
 ;; Keywords: languages, processes
@@ -39,7 +39,7 @@
 ;;
 ;; The two most important configuration options are:
 ;;
-;;    - `ediprolog-system', either 'scryer or 'swi
+;;    - `ediprolog-system', either 'scryer (default) or 'swi
 ;;    - `ediprolog-program', the path of the Prolog executable.
 
 ;; Usage
@@ -491,7 +491,11 @@ operates on the region."
             (and buffer-file-name
                  (not (equal (file-remote-p ediprolog-temp-file)
                              (file-remote-p buffer-file-name)))))
-    (setq ediprolog-temp-file (make-nearby-temp-file "ediprolog")))
+    (setq ediprolog-temp-file
+          (funcall (if (fboundp 'make-nearby-temp-file)
+                       'make-nearby-temp-file
+                     'make-temp-file)
+                   "ediprolog")))
   (let ((start (if (and transient-mark-mode mark-active)
                    (region-beginning) (point-min)))
         (end (if (and transient-mark-mode mark-active)
-- 
2.17.2 (Apple Git-113)


From d02540902f2a71e6f1888f9db6845d6adb3c1ae1 Mon Sep 17 00:00:00 2001
From: Markus Triska <triska@metalevel.at>
Date: Sun, 2 Oct 2022 21:45:04 +0200
Subject: [PATCH 2/4] handle answers of recent Scryer Prolog versions

---
 ediprolog.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ediprolog.el b/ediprolog.el
index 7898660d78..a74e5f13a7 100644
--- a/ediprolog.el
+++ b/ediprolog.el
@@ -273,9 +273,9 @@ set_prolog_flag(toplevel_prompt, '%s').\n" (ediprolog-prompt)))))
   ;; success (i.e., consulted without errors), or still an incomplete
   ;; line that starts with a comment character
   (unless (or (string-match "^[\t ]*\\(?:%.*\\)?\\'" str)
-              (let ((success "true."))
-                (and (<= (length str) (length success))
-                     (string= str (substring success 0 (length str))))))
+              (string-prefix-p str "true.")
+              ;; newer versions of Scryer Prolog prepend 3 spaces to "true."
+              (string-prefix-p str "   true."))
     (setq ediprolog-consult-window (display-buffer ediprolog-consult-buffer))
     (set-window-dedicated-p ediprolog-consult-window t)
     (fit-window-to-buffer ediprolog-consult-window (/ (frame-height) 2))))
-- 
2.17.2 (Apple Git-113)


From 6e137449e2b1b711dfba9d04526472a5cd8f9447 Mon Sep 17 00:00:00 2001
From: Markus Triska <triska@metalevel.at>
Date: Sun, 2 Oct 2022 21:46:56 +0200
Subject: [PATCH 3/4] faithful processing of multiline queries when using
 Scryer Prolog

---
 ediprolog.el | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/ediprolog.el b/ediprolog.el
index a74e5f13a7..f44914b60b 100644
--- a/ediprolog.el
+++ b/ediprolog.el
@@ -1,6 +1,6 @@
 ;;; ediprolog.el --- Emacs Does Interactive Prolog
 
-;; Copyright (C) 2006-2009, 2012-2013, 2016-2017, 2021  Free Software Foundation, Inc.
+;; Copyright (C) 2006-2009, 2012-2013, 2016-2017, 2021-2022  Free Software Foundation, Inc.
 
 ;; Author: Markus Triska <triska@metalevel.at>
 ;; Keywords: languages, processes
@@ -53,11 +53,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
@@ -370,9 +370,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))
-- 
2.17.2 (Apple Git-113)


From 22fa75d0f73791a3765e3eebbb552a852091b925 Mon Sep 17 00:00:00 2001
From: Markus Triska <triska@metalevel.at>
Date: Sun, 2 Oct 2022 21:48:03 +0200
Subject: [PATCH 4/4] ediprolog version 2.2

New in this version:

    * handle answers of recent Scryer Prolog versions
    * faithful processing of multiline queries when using Scryer Prolog
    * improved compatibility with older Emacs versions
---
 ediprolog.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ediprolog.el b/ediprolog.el
index f44914b60b..8d36607805 100644
--- a/ediprolog.el
+++ b/ediprolog.el
@@ -93,7 +93,7 @@
 
 ;;; Code:
 
-(defconst ediprolog-version "2.1")
+(defconst ediprolog-version "2.2")
 
 (defgroup ediprolog nil
   "Transparent interaction with Prolog."
-- 
2.17.2 (Apple Git-113)








  reply	other threads:[~2022-10-02 19:49 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-30 16:59 bug#58196: 27.0.50; ediprolog 2.2: Please upload the new version to ELPA Markus Triska
2022-10-01 12:56 ` Lars Ingebrigtsen
2022-10-01 14:57 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-01 17:01   ` Markus Triska
2022-10-01 18:37     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-02 19:49       ` Markus Triska [this message]
2022-10-02 20:07         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-02 20:24           ` Markus Triska
2022-10-02 21:08             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-03  0:43               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-18 14:34 ` bug#58196: Trivial update to ediprolog Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-26 13:26   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-26 13:32     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-27 21:11       ` Markus Triska
2022-10-28  2:08         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-28  3:06           ` Stefan Kangas
2022-10-28  3:35             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-28  6:35             ` Eli Zaretskii
2022-10-28 12:37               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-28  3:09           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-28 16:49             ` Markus Triska
2022-10-28 18:07               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-28 20:01                 ` Stefan Kangas
2022-10-28 20:20                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-28 20:51                     ` Stefan Kangas
2022-10-28 21:54                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-22 16:20 ` Markus Triska
2022-10-22 16:51   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-23  7:29 ` Markus Triska
2022-10-25 19:49   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-10 10:54 ` bug#58196: 27.0.50; ediprolog 2.2: Please upload the new version to ELPA Stefan Kangas
2024-01-10 22:11   ` Markus Triska
2024-01-10 23:18     ` Stefan Kangas
2024-01-14  7:40       ` Markus Triska
2024-01-14 10:17         ` Stefan Kangas

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

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

  git send-email \
    --in-reply-to=87tu4mdmzq.fsf@metalevel.at \
    --to=triska@metalevel.at \
    --cc=58196@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.