emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ediprolog 5f960e4 5/7: * ediprolog/ediprolog.el (edipro


From: Stefan Monnier
Subject: [elpa] externals/ediprolog 5f960e4 5/7: * ediprolog/ediprolog.el (ediprolog-version): Bump to 1.2
Date: Sun, 29 Nov 2020 16:57:31 -0500 (EST)

branch: externals/ediprolog
commit 5f960e49a88002bf96697e77eb541f75712d2f25
Author: Markus Triska <triska@metalevel.at>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * ediprolog/ediprolog.el (ediprolog-version): Bump to 1.2
    
    (ediprolog-query): Use undo-amalgamate-change-group when available.
    (ediprolog-remove-interactions, ediprolog-consult): Improve docstring.
---
 ediprolog.el | 35 +++++++++++++++++++++--------------
 1 file changed, 21 insertions(+), 14 deletions(-)

diff --git a/ediprolog.el b/ediprolog.el
index 448a157..bb581fc 100644
--- a/ediprolog.el
+++ b/ediprolog.el
@@ -1,10 +1,11 @@
 ;;; ediprolog.el --- Emacs Does Interactive Prolog
 
-;; Copyright (C) 2006, 2007, 2008, 2009, 2012, 2013  Free Software Foundation, 
Inc.
+;; Copyright (C) 2006-2009, 2012-2013, 2016-2017  Free Software Foundation, 
Inc.
 
-;; Author: Markus Triska <markus.triska@gmx.at>
+;; Author: Markus Triska <triska@metalevel.at>
 ;; Keywords: languages, processes
-;; Version: 1.1
+;; Version: 1.2
+;; Homepage: https://www.metalevel.at/ediprolog/
 
 ;; This file is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
@@ -62,9 +63,10 @@
 ;; unblock Emacs and continue with other work. To resume interaction
 ;; with the Prolog process, use M-x ediprolog-toplevel RET.
 
-;; If you press F10 when point is NOT on a query, the buffer content
+;; If you press F10 when point is *not* on a query, the buffer content
 ;; is consulted in the Prolog process, and point is moved to the first
-;; error (if any).
+;; error (if any).  In transient mark mode, if the region is active,
+;; only the text in the region is consulted.
 
 ;; For convenience, the most recent interactions with the Prolog
 ;; process are logged in the buffer "*ediprolog-history*".
@@ -82,11 +84,11 @@
 ;;   C-u F10       first consult buffer, then evaluate query (if any)
 ;;   C-u C-u F10   like C-u F10, with a new process
 
-;; Tested with SWI-Prolog 5.6.55 + Emacs 21.2, 22.3, 23.1 and 24.3
+;; Tested with SWI-Prolog 7.3.21 + Emacs 22.1, 23.4, 24.5, 25.1 and 26.0
 
 ;;; Code:
 
-(defconst ediprolog-version "0.9z")
+(defconst ediprolog-version "1.2")
 
 (defgroup ediprolog nil
   "Transparent interaction with SWI-Prolog."
@@ -101,7 +103,7 @@
 
 (defcustom ediprolog-program-switches nil
   "List of switches passed to the Prolog process. Example:
-(\"-G128M\" \"-O\")"
+'(\"-G128M\" \"-O\")"
   :group 'ediprolog
   :type '(repeat string))
 
@@ -344,13 +346,18 @@ arguments, equivalent to `ediprolog-remove-interactions'."
                    ;; omit trailing whitespace
                    (+ (point) (skip-chars-backward "\t "))
                  (error "Missing `.' at the end of this query")))
-           (query (buffer-substring-no-properties from to)))
+           (query (buffer-substring-no-properties from to))
+           (handle (and (fboundp 'prepare-change-group)
+                        (fboundp 'undo-amalgamate-change-group)
+                        (cons t (prepare-change-group)))))
       (end-of-line)
       (insert "\n" ediprolog-indent-prefix ediprolog-prefix)
       (ediprolog-interact
        (format "%s\n" (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))
 
 ;;;###autoload
@@ -424,8 +431,8 @@ want to resume interaction with the toplevel."
 (defun ediprolog-remove-interactions ()
   "Remove all lines starting with `ediprolog-prefix' from buffer.
 
-In transient mark mode, the function operates on the region if it
-is active."
+In transient mark mode, if the region is active, the function
+operates on the region."
   (interactive)
   (save-excursion
     (save-restriction
@@ -443,8 +450,8 @@ non-nil, start a new process. Otherwise use the existing 
process,
 if any. In case of errors, point is moved to the position of the
 first error, and the mark is left at the previous position.
 
-In transient mark mode, the function operates on the region if it
-is active."
+In transient mark mode, if the region is active, the function
+operates on the region."
   (interactive)
   (when (string= (buffer-name) ediprolog-consult-buffer)
     (error "Cannot consult the consult buffer"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]