[elpa] externals/eglot 15b00c6400: Rework "What is Eglot?" introductory manual section

2022-10-02 Thread ELPA Syncer
branch: externals/eglot
commit 15b00c640093f83a5dd9e0f95aa44b664efe3828
Author: João Távora 
Commit: João Távora 

Rework "What is Eglot?" introductory manual section

* MANUAL.md (What is Eglot?): Rework.

* NEWS.md: Mention new manual.
---
 MANUAL.md | 33 -
 NEWS.md   |  2 ++
 2 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/MANUAL.md b/MANUAL.md
index cba0e71c7c..20f3d74fd6 100644
--- a/MANUAL.md
+++ b/MANUAL.md
@@ -26,29 +26,28 @@ Eglot -- *E*macs Poly*glot* -- is the Emacs LSP client that 
stays out
 of your way.
 
 The [Language Server Protocol (LSP)][language-server-protocol] defines
-standardized communication between *client programs*, typically source
-code editors, and *server programs*, which analyze that source code on
-behalf of the clients.
-
-LSP enables a single language server to be useful in many different
+standardized communication between source code editors and language
+server programs, which analyze that source code on behalf of the
 editors.
 
-Likewise, many different language servers exist, each specializing in
-a different programming language.  LSP enables a single editor to
-speak to all of them.
+Using Eglot, Emacs may be enriched with a language server and its
+findings, such as the location of functions calls, types of variables,
+class definitions or syntactic mistakes.  This enables new editing
+features and significantly enhances Emacs existing features such as
+[automatic code completion, go-to definition, at-point documentation,
+automatic refactoring, diagnostics, and more][readme-pretty-gifs].
 
-Server programs advertise the results of their analysis to the client,
-such as where in the source code there is a call to a specific
-function, a variable definition or a syntactic mistake.  Clients
-present these results to the user without specific knowledge of the
-language.  As the user edits, creates and deletes source file clients
+As the user edits, creates and deletes source files, clients
 continuously inform the server of this, so that the server can update
 its analysis.
 
-When using Emacs as a source code editor, combining Eglot with a
-suitable language server program enables many common useful features
-such as [completion, go-to definition, at-point documentation,
-diagnostics, etc.][readme-pretty-gifs].
+LSP enables a single language server to be useful to many different
+editors and a single editor to speak to many different language
+servers.
+
+As long as there is a server language to connect to, Eglot doesn't
+require Emacs to know anything about a particular programming language
+to enable these features.
 
 ## Setting up Eglot
 
diff --git a/NEWS.md b/NEWS.md
index a4883329f6..ef00302e22 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,5 +1,7 @@
 # (upcoming)
 
+ Manual now lives in a separate MANUAL.md file
+
  Support for "single server, multiple modes" ([#681][github#681])
 
 Previously, if an entry such as `((c++-mode c-mode) . ("clangd)")` was



[nongnu] elpa/php-mode 29bbf49cd5: Update Cask

2022-10-02 Thread ELPA Syncer
branch: elpa/php-mode
commit 29bbf49cd54b9528e8645809029558903fba601c
Author: USAMI Kenta 
Commit: USAMI Kenta 

Update Cask
---
 Cask | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Cask b/Cask
index d992fad3ff..e847468562 100644
--- a/Cask
+++ b/Cask
@@ -1,10 +1,12 @@
-(package "php-mode" "1.24.0" "Major mode for editing PHP code")
+(package "php-mode" "1.24.1" "Major mode for editing PHP code")
 (source melpa)
 
 (package-file "lisp/php-mode.el")
 
 (files
  "lisp/php.el"
+ "lisp/php-complete.el"
+ "lisp/php-defs.el"
  "lisp/php-face.el"
  "lisp/php-project.el"
  "lisp/php-local-manual.el"



[elpa] externals/detached 53be9af04c: Fix bug in detached-list-sessions

2022-10-02 Thread ELPA Syncer
branch: externals/detached
commit 53be9af04c8ad3ab4b5f9cb451f6e40621b4c89c
Author: Niklas Eklund 
Commit: Niklas Eklund 

Fix bug in detached-list-sessions

When calling the command multiple times, while the buffer was present
in a window it incorrectly created a new window.
---
 detached-list.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/detached-list.el b/detached-list.el
index 050b75e161..d1fe0047f4 100644
--- a/detached-list.el
+++ b/detached-list.el
@@ -444,7 +444,9 @@ If prefix-argument is provided unmark instead of mark."
   "Open list of `detached'."
   (interactive)
   (if-let* ((existing-buffer (detached-list--get-list-mode-buffer))
-(window (display-buffer existing-buffer 
detached-list-display-buffer-action)))
+(window (or
+ (get-buffer-window existing-buffer)
+ (display-buffer existing-buffer 
detached-list-display-buffer-action
   (progn
 (select-window window)
 (detached-list--revert-sessions))



[elpa] externals/rcirc-color e34c4a6e33: Bump version number in rcirc-color

2022-10-02 Thread Lars Ingebrigtsen
branch: externals/rcirc-color
commit e34c4a6e338633808774c259e8bbd272351dbf4f
Author: Lars Ingebrigtsen 
Commit: Lars Ingebrigtsen 

Bump version number in rcirc-color
---
 rcirc-color.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rcirc-color.el b/rcirc-color.el
index fee36eb901..a197fb82a2 100644
--- a/rcirc-color.el
+++ b/rcirc-color.el
@@ -4,7 +4,7 @@
 
 ;; Author: Alex Schroeder 
 ;; Maintainer: Alex Schroeder 
-;; Version: 0.4.2
+;; Version: 0.4.3
 ;; Package-Requires: ((emacs "24.4"))
 ;; Keywords: comm
 



[nongnu] elpa/evil 8325ba0dee: evil-select-parens selects next pair if not in parens (#1673)

2022-10-02 Thread ELPA Syncer
branch: elpa/evil
commit 8325ba0deeca0953b7957485d33de2188b6ded67
Author: Garklein <63201615+garkl...@users.noreply.github.com>
Commit: GitHub 

evil-select-parens selects next pair if not in parens (#1673)

Co-authored-by: marcolgl 
Co-authored-by: Tom Dalziel 
---
 evil-commands.el |   3 +-
 evil-common.el   | 113 +--
 evil-tests.el|  28 ++
 3 files changed, 99 insertions(+), 45 deletions(-)

diff --git a/evil-commands.el b/evil-commands.el
index d814ad76e5..65d17dd245 100644
--- a/evil-commands.el
+++ b/evil-commands.el
@@ -1477,7 +1477,8 @@ or line COUNT to the top of the window."
  ((memq type '(line screen-line))
   (evil-yank-lines beg end register yank-handler))
  (t
-  (evil-yank-characters beg end register yank-handler)
+  (evil-yank-characters beg end register yank-handler)
+  (goto-char beg)
 
 (evil-define-operator evil-yank-line (beg end type register)
   "Save whole lines into the kill-ring."
diff --git a/evil-common.el b/evil-common.el
index 42290c1476..c0282ce4ab 100644
--- a/evil-common.el
+++ b/evil-common.el
@@ -3403,6 +3403,9 @@ respectively. BEG END TYPE are the currently selected 
(visual)
 range.  If INCLUSIVE is non-nil, OPEN and CLOSE are included in
 the range; otherwise they are excluded.
 
+If you aren't inside a pair of the opening and closing delimiters,
+it jumps you inside the next one. If there isn't one, it errors.
+
 The types of OPEN and CLOSE specify which kind of THING is used
 for parsing with `evil-select-block'. If OPEN and CLOSE are
 characters `evil-up-paren' is used. Otherwise OPEN and CLOSE
@@ -3411,50 +3414,72 @@ must be regular expressions and `evil-up-block' is used.
 If the selection is exclusive, whitespace at the end or at the
 beginning of the selection until the end-of-line or beginning-of-line
 is ignored."
-  ;; we need special linewise exclusive selection
-  (unless inclusive (setq inclusive 'exclusive-line))
-  (cond
-   ((and (characterp open) (characterp close))
-(let ((thing #'(lambda (&optional cnt)
- (evil-up-paren open close cnt)))
-  (bnd (or (bounds-of-thing-at-point 'evil-string)
-   (bounds-of-thing-at-point 'evil-comment)
-   ;; If point is at the opening quote of a string,
-   ;; this must be handled as if point is within the
-   ;; string, i.e. the selection must be extended
-   ;; around the string. Otherwise
-   ;; `evil-select-block' might do the wrong thing
-   ;; because it accidentally moves point inside the
-   ;; string (for inclusive selection) when looking
-   ;; for the current surrounding block. (re #364)
-   (and (= (point) (or beg (point)))
-(save-excursion
-  (goto-char (1+ (or beg (point
-  (or (bounds-of-thing-at-point 'evil-string)
-  (bounds-of-thing-at-point 'evil-comment)))
-  (if (not bnd)
-  (evil-select-block thing beg end type count inclusive)
-(or (evil-with-restriction (car bnd) (cdr bnd)
-  (condition-case nil
-  (evil-select-block thing beg end type count inclusive)
-(error nil)))
-(save-excursion
-  (setq beg (or beg (point))
-end (or end (point)))
-  (goto-char (car bnd))
-  (let ((extbeg (min beg (car bnd)))
-(extend (max end (cdr bnd
-(evil-select-block thing
-   extbeg extend
-   type
-   count
-   inclusive
-   (or (< extbeg beg) (> extend end))
-   t)))
-   (t
-(evil-select-block #'(lambda (&optional cnt)
-   (evil-up-block open close cnt))
-   beg end type count inclusive
+  (condition-case nil
+  (progn
+;; we need special linewise exclusive selection
+(unless inclusive (setq inclusive 'exclusive-line))
+(cond
+ ((and (characterp open) (characterp close))
+  (let ((thing #'(lambda (&optional cnt)
+   (evil-up-paren open close cnt)))
+(bnd (or (bounds-of-thing-at-point 'evil-string)
+ (bounds-of-thing-at-point 'evil-comment)
+ ;; If point is at the opening quote of a string,
+ ;; this must be handled as if point is within the
+ ;; string, i.e. the selection must be extended
+ ;; around the string. Otherwise
+ ;; `evil-select-block' might do the wrong thing

[nongnu] elpa/sweeprolog updated (e73520488e -> c1eac3d1ac)

2022-10-02 Thread ELPA Syncer
elpasync pushed a change to branch elpa/sweeprolog.

  from  e73520488e DOC: document new eldoc integration
   new  9352e0deba ADDED: new function sweeprolog-definition-at-point
   new  ef3fdc3b3a ADDED: new command sweeprolog-document-predicate-at-point
   new  f7b919a96c DOC: new manual section "Documenting predicates"
   new  c1eac3d1ac DOC: Add docstrings to some undocumented internal 
functions


Summary of changes:
 README.org|  32 +
 sweep.pl  |  28 +++
 sweeprolog.el | 149 ++
 3 files changed, 189 insertions(+), 20 deletions(-)



[nongnu] elpa/sweeprolog 9352e0deba 1/4: ADDED: new function sweeprolog-definition-at-point

2022-10-02 Thread ELPA Syncer
branch: elpa/sweeprolog
commit 9352e0debab6e354d96a6820e155c0fd168c2fd0
Author: Eshel Yaron 
Commit: Eshel Yaron 

ADDED: new function sweeprolog-definition-at-point
---
 sweep.pl  | 28 
 sweeprolog.el | 58 +-
 2 files changed, 69 insertions(+), 17 deletions(-)

diff --git a/sweep.pl b/sweep.pl
index 41b3618a1d..763bdd003b 100644
--- a/sweep.pl
+++ b/sweep.pl
@@ -37,6 +37,7 @@
 sweep_current_prolog_flags/2,
 sweep_set_prolog_flag/2,
 sweep_documentation/2,
+sweep_definition_at_point/2,
 sweep_file_at_point/2,
 sweep_identifier_at_point/2,
 sweep_expand_file_name/2,
@@ -142,6 +143,33 @@ sweep_colourise_buffer_(Path0, Contents, []) :-
 erase(Ref0),
 erase(Ref1).
 
+sweep_definition_at_point([Contents|Path0], Result) :-
+atom_string(Path, Path0),
+with_buffer_stream(Stream,
+   Contents,
+   sweep_definition_at_point_(Stream, Path, Result)).
+
+:- dynamic sweep_current_defintion_at_point/1.
+
+sweep_definition_at_point_(Stream, Path, [Beg,F,N]) :-
+set_stream(Stream, file_name(Path)),
+retractall(sweep_current_defintion_at_point(_)),
+prolog_colourise_term(Stream, Path,
+  sweep_handle_definition_at_point,
+  []),
+sweep_current_defintion_at_point(Beg-Def),
+(   Def = M:F0/N
+->  term_string(M:F0, F)
+;   Def = F0/N,
+term_string(F0, F)
+).
+
+sweep_handle_definition_at_point(head_term(_Kind, Goal), Beg, _Len) :-
+!,
+pi_head(PI, Goal),
+asserta(sweep_current_defintion_at_point(Beg-PI)).
+sweep_handle_definition_at_point(_, _, _).
+
 
 sweep_file_at_point([Contents,Path0,Point], Result) :-
 atom_string(Path, Path0),
diff --git a/sweeprolog.el b/sweeprolog.el
index 36fe09..408b871d4d 100644
--- a/sweeprolog.el
+++ b/sweeprolog.el
@@ -184,23 +184,25 @@ clause."
 (declare-function sweeprolog-cleanup   "sweep-module")
 
 (defun sweeprolog--ensure-module ()
-  (let ((sweep-module-path (car
-(save-match-data
-  (split-string
-   (shell-command-to-string
-(concat
- (or sweeprolog-swipl-path (executable-find 
"swipl"))
- " -g"
- " write_sweep_module_location"
- " -t"
- " halt"))
-   "\n")
-(condition-case _
-(load sweep-module-path)
-  (file-error (user-error
-   (concat "Failed to locate `sweep-module'. "
-   "Make sure SWI-Prolog is installed "
-   "and up to date"))
+  "Locate and load `sweep-module', unless already loaded."
+  (unless (featurep 'sweep-module)
+(let ((sweep-module-path (car
+  (save-match-data
+(split-string
+ (shell-command-to-string
+  (concat
+   (or sweeprolog-swipl-path (executable-find 
"swipl"))
+   " -g"
+   " write_sweep_module_location"
+   " -t"
+   " halt"))
+ "\n")
+  (condition-case _
+  (load sweep-module-path)
+(file-error (user-error
+ (concat "Failed to locate `sweep-module'. "
+ "Make sure SWI-Prolog is installed "
+ "and up to date")))
 
 (defface sweeprolog-debug-prefix-face
   '((default :inherit shadow))
@@ -2144,6 +2146,28 @@ Interactively, a prefix arg means to prompt for BUFFER."
   (and (looking-at-p (rx bol graph))
(not (nth 8 (syntax-ppss)
 
+(defun sweeprolog-definition-at-point (&optional point)
+  (let* ((p (or point (point)))
+ (beg (save-mark-and-excursion
+(goto-char p)
+(unless (sweeprolog-at-beginning-of-top-term-p)
+  (sweeprolog-beginning-of-top-term))
+(max (1- (point)) (point-min
+ (end (save-mark-and-excursion
+(goto-char p)
+(sweeprolog-end-of-top-term)
+(point)))
+ (contents (buffer-substring-no-properties beg end)))
+(sweeprolog-open-query "user"
+   "sweep"
+   "sweep_definition_at_point"
+   (cons contents
+ (buffer-file-name)))
+(let ((sol (sweeprolog-next-solution)))
+  (sweeprolog-close-query)
+  (when (sweeprolog-true-p sol)
+(cons (+ 

[nongnu] elpa/sweeprolog c1eac3d1ac 4/4: DOC: Add docstrings to some undocumented internal functions

2022-10-02 Thread ELPA Syncer
branch: elpa/sweeprolog
commit c1eac3d1ac63c51e64820fe64a4aebb6e59553e5
Author: Eshel Yaron 
Commit: Eshel Yaron 

DOC: Add docstrings to some undocumented internal functions
---
 sweeprolog.el | 21 ++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/sweeprolog.el b/sweeprolog.el
index f0f526ecad..993fd097cc 100644
--- a/sweeprolog.el
+++ b/sweeprolog.el
@@ -254,6 +254,7 @@ clause."
   win)))
 
 (defun sweeprolog-current-prolog-flags (&optional prefix)
+  "Return the list of defined Prolog flags defined with prefix PREFIX."
   (sweeprolog-open-query "user" "sweep" "sweep_current_prolog_flags" (or 
prefix ""))
   (let ((sol (sweeprolog-next-solution)))
 (sweeprolog-close-query)
@@ -290,18 +291,20 @@ FLAG and VALUE are specified as strings and read as 
Prolog terms."
   (user-error "Setting %s to %s failed!" flag value
 
 (defun sweeprolog-setup-message-hook ()
+  "Setup `thread_message_hook/3' to redirecet Prolog messages."
   (with-current-buffer (get-buffer-create sweeprolog-messages-buffer-name)
 (setq-local window-point-insertion-type t)
 (compilation-minor-mode 1))
   (sweeprolog-open-query "user"
-"sweep"
-"sweep_setup_message_hook"
-nil)
+ "sweep"
+ "sweep_setup_message_hook"
+ nil)
   (let ((sol (sweeprolog-next-solution)))
 (sweeprolog-close-query)
 sol))
 
 (defun sweeprolog-message (message)
+  "Emit the Prolog message MESSAGE to the `sweep' messages buffer."
   (with-current-buffer (get-buffer-create sweeprolog-messages-buffer-name)
 (save-excursion
   (goto-char (point-max))
@@ -329,6 +332,7 @@ FLAG and VALUE are specified as strings and read as Prolog 
terms."
   (newline
 
 (defun sweeprolog-start-prolog-server ()
+  "Start the `sweep' Prolog top-level embedded server."
   (sweeprolog-open-query "user"
  "sweep"
  "sweep_top_level_server"
@@ -339,6 +343,10 @@ FLAG and VALUE are specified as strings and read as Prolog 
terms."
   (setq sweeprolog-prolog-server-port (cdr sol)
 
 (defun sweeprolog-init (&rest args)
+  "Initialize and setup the embedded Prolog runtime.
+
+If specified, ARGS should be a list of string passed to Prolog as
+extra initialization arguments."
   (apply #'sweeprolog-initialize
  (cons (or sweeprolog-swipl-path (executable-find "swipl"))
(append sweeprolog-init-args args)))
@@ -379,6 +387,9 @@ Otherwise set ARGS to nil."
 (defvar-local sweeprolog-buffer-module "user")
 
 (defun sweeprolog-local-predicates-collection (&optional prefix)
+  "Return a list of prediactes accessible in the current buffer.
+
+When non-nil, only predicates whose name contains PREFIX are returned."
   (sweeprolog-open-query "user" "sweep" "sweep_local_predicate_completion"
 (cons sweeprolog-buffer-module
   prefix))
@@ -388,6 +399,7 @@ Otherwise set ARGS to nil."
   (setq sweeprolog-predicate-completion-collection (cdr sol)
 
 (defun sweeprolog-predicates-collection (&optional prefix)
+  "Return a list of prediacte completion candidates matchitng PREFIX."
   (sweeprolog-open-query "user" "sweep" "sweep_predicates_collection" prefix)
   (let ((sol (sweeprolog-next-solution)))
 (sweeprolog-close-query)
@@ -395,6 +407,7 @@ Otherwise set ARGS to nil."
   (cdr sol
 
 (defun sweeprolog-predicate-references (mfn)
+  "Find source locations where the predicate MFN is called."
   (sweeprolog-open-query "user" "sweep" "sweep_predicate_references" mfn)
   (let ((sol (sweeprolog-next-solution)))
 (sweeprolog-close-query)
@@ -402,6 +415,7 @@ Otherwise set ARGS to nil."
   (cdr sol
 
 (defun sweeprolog-predicate-location (mfn)
+  "Return the source location where the predicate MFN is defined."
   (sweeprolog-open-query "user" "sweep" "sweep_predicate_location" mfn)
   (let ((sol (sweeprolog-next-solution)))
 (sweeprolog-close-query)
@@ -409,6 +423,7 @@ Otherwise set ARGS to nil."
   (cdr sol
 
 (defun sweeprolog-predicate-apropos (pattern)
+  "Return a list of predicates whose name resembeles PATTERN."
   (sweeprolog-open-query "user" "sweep" "sweep_predicate_apropos" pattern)
   (let ((sol (sweeprolog-next-solution)))
 (sweeprolog-close-query)



[nongnu] elpa/sweeprolog f7b919a96c 3/4: DOC: new manual section "Documenting predicates"

2022-10-02 Thread ELPA Syncer
branch: elpa/sweeprolog
commit f7b919a96c3034ec72bd5f7331182f2c15d4a6b6
Author: Eshel Yaron 
Commit: Eshel Yaron 

DOC: new manual section "Documenting predicates"
---
 README.org | 32 
 1 file changed, 32 insertions(+)

diff --git a/README.org b/README.org
index c998bc6818..528fb63ea5 100644
--- a/README.org
+++ b/README.org
@@ -682,6 +682,38 @@ To automatically insert the module skeleton when opening 
new files in
 information about =auto-insert= and its customization options, see
 [[info:autotype#Autoinserting][Autoinserting in the Autotyping manual]].
 
+** Documenting predicates
+:PROPERTIES:
+:CUSTOM_ID: sweeprolog-pldoc
+:END:
+
+#+CINDEX: pldoc
+SWI-Prolog predicates can be documented with specially structured
+comments placed above the predicate definition, which are processed by
+the =PlDoc= source documentation system.  Emacs comes with many useful
+commands for specifically intended for working with comments in
+programming languages, which apply also to writing =PlDoc= comments for
+Prolog predicates.  For an overview of the relevant standard Emacs
+commands, see [[info:emacs#Comment Commands][Comment Commands in the Emacs 
manual]].
+
+#+FINDEX: sweeprolog-document-predicate-at-point
+=sweep= also includes a dedicated command called
+=sweeprolog-document-predicate-at-point= for interactively creating
+=PlDoc= comments for predicates in =sweeprolog-mode= buffers.  This
+command, bound by default to =C-c C-d=, finds the beginning of the
+predicate definition under or right above the current cursor location,
+and inserts formatted =PlDoc= comments while prompting the user to
+interactively fill in the argument modes, determinism specification,
+and initial contents of the predicate documentation.
+=sweeprolog-document-predicate-at-point= leaves the cursor at the end of
+the newly inserted documentation comment for the user to extend or
+edit it if needed.  To add another comment line, use =M-j=
+(=comment-indent-new-line=) which starts a new line with the comment
+prefix filled in.  To reformat the current paragraph of =PlDoc= comments, 
=M-q= (=fill-paragraph=).
+
+For more information about =PlDoc= and source documentation in
+SWI-Prolog, see 
[[https://www.swi-prolog.org/pldoc/doc_for?object=section(%27packages/pldoc.html%27)][the
 PlDoc manual]].
+
 ** Displaying predicate documentation
 :PROPERTIES:
 :CUSTOM_ID: eldoc-integration



[nongnu] elpa/sweeprolog ef3fdc3b3a 2/4: ADDED: new command sweeprolog-document-predicate-at-point

2022-10-02 Thread ELPA Syncer
branch: elpa/sweeprolog
commit ef3fdc3b3a5e0051fde419702dd2f30d2e27daca
Author: Eshel Yaron 
Commit: Eshel Yaron 

ADDED: new command sweeprolog-document-predicate-at-point
---
 sweeprolog.el | 70 +++
 1 file changed, 70 insertions(+)

diff --git a/sweeprolog.el b/sweeprolog.el
index 408b871d4d..f0f526ecad 100644
--- a/sweeprolog.el
+++ b/sweeprolog.el
@@ -1662,6 +1662,7 @@ Interactively, a prefix arg means to prompt for BUFFER."
 (define-key map (kbd "C-c C-c") #'sweeprolog-colourise-buffer)
 (define-key map (kbd "C-c C-t") #'sweeprolog-top-level)
 (define-key map (kbd "C-c C-o") #'sweeprolog-find-file-at-point)
+(define-key map (kbd "C-c C-d") #'sweeprolog-document-predicate-at-point)
 (define-key map (kbd "C-M-^")   #'kill-backward-up-list)
 map)
   "Keymap for `sweeprolog-mode'.")
@@ -1679,6 +1680,10 @@ Interactively, a prefix arg means to prompt for BUFFER."
 [ "Insert module template"
   auto-insert
   (eq major-mode 'sweeprolog-mode) ]
+[ "Document current predicate"
+  sweeprolog-document-predicate-at-point
+  (and (eq major-mode 'sweeprolog-mode)
+   (sweeprolog-definition-at-point)) ]
 "--"
 [ "Reset sweep"sweeprolog-restart t ]
 [ "View sweep messages"sweeprolog-view-messages   t ]))
@@ -2168,6 +2173,71 @@ Interactively, a prefix arg means to prompt for BUFFER."
   (when (sweeprolog-true-p sol)
 (cons (+ beg (cadr sol)) (cddr sol))
 
+(defun sweeprolog-insert-pldoc-for-predicate (functor arguments det summary)
+  (insert "\n\n")
+  (forward-char -2)
+  (insert (format "%%!  %s%s is %s.\n%%\n%%   %s"
+  functor
+  (if arguments
+  (concat "(" (mapconcat #'identity arguments ", ") ")")
+"")
+  det
+  summary))
+  (fill-paragraph))
+
+(defun sweeprolog-beginning-of-predicate-at-point (&optional point)
+  "Find the beginning of the predicate definition at or above POINT.
+
+Return a cons cell (FUN . ARI) where FUN is the functor name of
+the defined predicate and ARI is its arity, or nil if there is no
+predicate definition at or directly above POINT."
+  (when-let* ((def (sweeprolog-definition-at-point point)))
+(unless (sweeprolog-at-beginning-of-top-term-p)
+  (sweeprolog-beginning-of-top-term)
+  (backward-char 1))
+(let ((point (point))
+  (fun (cadr def))
+  (ari (caddr def)))
+  (while point
+(sweeprolog-beginning-of-top-term)
+(backward-char 1)
+(if-let* ((ndef (sweeprolog-definition-at-point (point)))
+  (nfun (cadr ndef))
+  (nari (caddr ndef))
+  (same (and (string= fun nfun)
+ (=   ari nari
+(progn (message "%s %s" ndef (point)) (setq point (point)))
+  (goto-char point)
+  (setq point nil)))
+  (cons fun ari
+
+(defun sweeprolog-document-predicate-at-point (point)
+  "Insert PlDoc documentation for the predicate at or above POINT."
+  (interactive "d" sweeprolog-mode)
+  (when-let* ((pred (sweeprolog-beginning-of-predicate-at-point point))
+  (fun  (car pred))
+  (ari  (cdr pred)))
+(let ((cur 1)
+  (arguments nil))
+  (while (<= cur ari)
+(let ((num (pcase cur
+ (1 "First")
+ (2 "Second")
+ (3 "Third")
+ (_ (concat (number-to-string cur) "th")
+  (setq arguments (cons (read-string (concat num " argument: "))
+arguments)))
+(setq cur (1+ cur)))
+  (let ((det (cadr (read-multiple-choice "Determinism: "
+ '((?d "det"   "Succeeds 
exactly once")
+   (?s "semidet"   "Succeeds at 
most once")
+   (?f "failure"   "Always fails")
+   (?n "nondet""Succeeds any 
number of times")
+   (?m "multi" "Succeeds at 
least once")
+   (?u "undefined" "Undefined")
+(summary (read-string "Summary: ")))
+(sweeprolog-insert-pldoc-for-predicate fun arguments det summary)
+
 (defun sweeprolog-file-at-point (&optional point)
   (let* ((p (or point (point)))
  (beg (save-mark-and-excursion



[elpa] scratch/ediprolog 4da46823c9 06/31: use markdown elements for formatting

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit 4da46823c9e11282c0290c384b4d6a7fd45ebc6e
Author: Markus Triska 
Commit: Markus Triska 

use markdown elements for formatting
---
 README.md | 56 ++--
 1 file changed, 30 insertions(+), 26 deletions(-)

diff --git a/README.md b/README.md
index 1f36b48bb3..4420a56bfd 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,9 @@
-ediprolog lets you interact with SWI-Prolog in all Emacs buffers.
+*ediprolog* lets you interact with SWI-Prolog in all Emacs buffers.
 You can consult Prolog programs and evaluate embedded queries.
 
-Installation
-
+#Installation
 
-Copy ediprolog.el to your load-path and add to your .emacs:
+Copy [ediprolog.el](ediprolog.el) to your `load-path` and add to your `.emacs`:
 
 (require 'ediprolog)
 (global-set-key [f10] 'ediprolog-dwim)
@@ -14,49 +13,54 @@ Restart Emacs and customize ediprolog with
 M-x customize-group RET ediprolog RET
 
 
-Usage
-=
+#Usage
 
-The central function is `ediprolog-dwim' (Do What I Mean), which is
+The central function is `ediprolog-dwim` (Do What I Mean), which is
 bound to F10 by the snippet above. Depending on the content at
-point, `ediprolog-dwim' does the "appropriate" thing: If point is
-on a query, F10 sends the query to a Prolog process, and you
+point, `ediprolog-dwim` does the "appropriate" thing: If point is
+on a *query*, F10 sends the query to a Prolog process, and you
 interact with the process in the current buffer as on a terminal.
 Queries start with "?-" or ":-", possibly preceded by "%" and
 whitespace. An example of a query is:
 
-  %?- member(X, [a,b,c]).
+%?- member(X, [a,b,c]).
 
 If you press F10 when point is on that query, you get:
 
-  %?- member(X, [a,b,c]).
-  %@ X = a ;
-  %@ X = b ;
-  %@ X = c ;
-  %@ false.
+%?- member(X, [a,b,c]).
+%@ X = a ;
+%@ X = b ;
+%@ X = c ;
+%@ false.
 
 When waiting for output of the Prolog process, you can press C-g to
 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).
 
 For convenience, the most recent interactions with the Prolog
-process are logged in the buffer "*ediprolog-history*".
+process are logged in the buffer `*ediprolog-history*`.
 
-Use M-x ediprolog-localize RET to make any Prolog process started
+Use **M-x ediprolog-localize RET** to make any Prolog process started
 in the current buffer buffer-local. This way, you can run distinct
-processes simultaneously. Revert with M-x ediprolog-unlocalize RET.
+processes simultaneously. Revert with **M-x ediprolog-unlocalize RET**.
 
-`ediprolog-dwim' with prefix arguments has special meanings:
+`ediprolog-dwim` with prefix arguments has special meanings:
 
-  C-0 F10   kill Prolog process
-  C-1 F10   always consult buffer (even when point is on a query)
-  C-2 F10   always consult buffer, using a new process
-  C-7 F10   equivalent to `ediprolog-toplevel'
-  C-u F10   first consult buffer, then evaluate query (if any)
-  C-u C-u F10   like C-u F10, with a new process
+  | Key Sequence |   Meaning|
+  |--|--|
+  |  C-0 F10 |   kill Prolog process|
+  |  C-1 F10 |   always consult buffer (even when point is on a query)  |
+  |  C-2 F10 |   always consult buffer, using a new process |
+  |  C-7 F10 |   equivalent to `ediprolog-toplevel' |
+  |  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 and 6.6 + Emacs 21.2, 22.3, 23.1 and 24.3
+
+**Screenshot**
+
+![Factorial](factorial.png)



[elpa] branch scratch/ediprolog created (now 7af081ba84)

2022-10-02 Thread Stefan Monnier via
monnier pushed a change to branch scratch/ediprolog.

at  7af081ba84 Merge remote-tracking branch 'upstream/ediprolog/main' 
into externals/ediprolog

This branch includes the following new commits:

   new  943f7c2a48 initial revision
   new  1c8b127701 initial revision
   new  29a8c4a796 wording for README
   new  34f7aa545c transition to markdown
   new  277d0f9e72 add screenshot
   new  4da46823c9 use markdown elements for formatting
   new  ade75de9ae table formatting
   new  51a610ebc2 formatting and layout of Emacs commands
   new  4b265d2fb5 add a note distinguishing buffer content and file
   new  3f8ab3eea0 wording
   new  4fabe53646 ENHANCED: Atomic undo of the whole interaction.
   new  f1b2480f46 preparing version 1.2
   new  68024b9f08 point to further information
   new  70bf2c095a mention project page earlier
   new  2b348c3161 describe screenshot
   new  c4d0834457 link to PceProlog
   new  d30bc3dd59 explain installation of ediprolog via GNU ELPA
   new  8ba8786386 clarify installation
   new  6f94bf2368 add link to video
   new  68a7b83f4d ediprolog 2.0: Scryer Prolog is now the default Prolog 
system
   new  9c4c80ad4a improve compatibility with older Emacs versions
   new  751119cfee update Scryer Prolog answer
   new  5fd08fe19a improve compatibility with older Emacs versions
   new  8b554e63aa document Scryer Prolog default setting
   new  85fae67aea support the latest development version of Scryer Prolog
   new  ebd79c0abd enable faithful processing of multiline queries for 
Scryer Prolog
   new  62ce0025b8 use compact string notation in sample queries
   new  49679a0c44 use library(clpz) and Scryer Prolog interaction in 
screenshot
   new  dc0e51ba57 ediprolog 2.2: support newer Scryer Prolog versions, and 
smaller improvements
   new  e75c0ddfc4 Merge Jun 8 2020 commit '751119cfee9' into 
externals/ediprolog
   new  7af081ba84 Merge remote-tracking branch 'upstream/ediprolog/main' 
into externals/ediprolog




[elpa] scratch/ediprolog 29a8c4a796 03/31: wording for README

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit 29a8c4a79697f6a7e0a324daa3587ac06f85eaff
Author: Markus Triska 
Commit: Markus Triska 

wording for README
---
 README | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/README b/README
index 4ee9da7ad7..1f36b48bb3 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-This lets you interact with SWI-Prolog in all Emacs buffers.
+ediprolog lets you interact with SWI-Prolog in all Emacs buffers.
 You can consult Prolog programs and evaluate embedded queries.
 
 Installation
@@ -23,7 +23,7 @@ point, `ediprolog-dwim' does the "appropriate" thing: If 
point is
 on a query, F10 sends the query to a Prolog process, and you
 interact with the process in the current buffer as on a terminal.
 Queries start with "?-" or ":-", possibly preceded by "%" and
-whitespace. An example of a query is (without leading ";;"):
+whitespace. An example of a query is:
 
   %?- member(X, [a,b,c]).
 
@@ -59,4 +59,4 @@ processes simultaneously. Revert with M-x 
ediprolog-unlocalize RET.
   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 5.6 and 6.6 + Emacs 21.2, 22.3, 23.1 and 24.3



[elpa] scratch/ediprolog 51a610ebc2 08/31: formatting and layout of Emacs commands

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit 51a610ebc2a0f0302927c1940c20c160937ee36c
Author: Markus Triska 
Commit: Markus Triska 

formatting and layout of Emacs commands
---
 README.md | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 7c3f85db1e..23b8cbe7b6 100644
--- a/README.md
+++ b/README.md
@@ -3,6 +3,8 @@
 *ediprolog* lets you interact with SWI-Prolog in all Emacs buffers.
 You can consult Prolog programs and evaluate embedded queries.
 
+**Screenshot**
+
 ![Factorial](factorial.png)
 
 # Installation
@@ -39,7 +41,7 @@ If you press F10 when point is on that query, you get:
 
 When waiting for output of the Prolog process, you can press C-g to
 unblock Emacs and continue with other work. To resume interaction
-with the Prolog process, use M-x ediprolog-toplevel RET.
+with the Prolog process, use **M-x ediprolog-toplevel RET**.
 
 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
@@ -50,7 +52,8 @@ process are logged in the buffer `*ediprolog-history*`.
 
 Use **M-x ediprolog-localize RET** to make any Prolog process started
 in the current buffer buffer-local. This way, you can run distinct
-processes simultaneously. Revert with **M-x ediprolog-unlocalize RET**.
+processes simultaneously. Revert with
+**M-x ediprolog-unlocalize RET**.
 
 `ediprolog-dwim` with prefix arguments has special meanings:
 
@@ -63,4 +66,4 @@ processes simultaneously. Revert with **M-x 
ediprolog-unlocalize RET**.
 |  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 and 6.6 + Emacs 21.2, 22.3, 23.1 and 24.3
+Tested with SWI-Prolog 5.6, 6.6 and 7.2 + Emacs 21.2, 22.3, 23.1 and 24.3.



[elpa] scratch/ediprolog 277d0f9e72 05/31: add screenshot

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit 277d0f9e7249c023a328bfb73bae1e549fb0d659
Author: Markus Triska 
Commit: Markus Triska 

add screenshot
---
 factorial.png | Bin 0 -> 60804 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/factorial.png b/factorial.png
new file mode 100644
index 00..b85c8c0f05
Binary files /dev/null and b/factorial.png differ



[elpa] scratch/ediprolog f1b2480f46 12/31: preparing version 1.2

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit f1b2480f462f2ec8f4eb933d994c67d7678d7d52
Author: Markus Triska 
Commit: Markus Triska 

preparing version 1.2
---
 ediprolog.el | 18 ++
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/ediprolog.el b/ediprolog.el
index 343ad1cb10..a4372ab8ce 100644
--- a/ediprolog.el
+++ b/ediprolog.el
@@ -1,9 +1,10 @@
 ;;; ediprolog.el --- Emacs Does Interactive Prolog
 
-;; Copyright (C) 2006, 2007, 2008, 2009, 2012, 2013, 2016  Markus Triska
+;; Copyright (C) 2006, 2007, 2008, 2009, 2012, 2013, 2016, 2017  Markus Triska
 
 ;; Author: Markus Triska 
 ;; Keywords: languages, processes
+;; 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
@@ -61,9 +62,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*".
@@ -85,7 +87,7 @@
 
 ;;; Code:
 
-(defconst ediprolog-version "1.2-PRE")
+(defconst ediprolog-version "1.2")
 
 (defgroup ediprolog nil
   "Transparent interaction with SWI-Prolog."
@@ -428,8 +430,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
@@ -447,8 +449,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"))



[elpa] scratch/ediprolog e75c0ddfc4 30/31: Merge Jun 8 2020 commit '751119cfee9' into externals/ediprolog

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit e75c0ddfc47f968a4e227f83421abc963287ad12
Merge: 3fa2be14ea 751119cfee
Author: Stefan Monnier 
Commit: Stefan Monnier 

Merge Jun 8 2020 commit '751119cfee9' into externals/ediprolog

This seems to be the commit in the upstream repository that most closely
matches the commit in the elpa.git.
---
 README.md | 101 ++
 ediprolog.el  |   4 +--
 factorial.png | Bin 0 -> 60804 bytes
 3 files changed, 103 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
new file mode 100644
index 00..406a356fd1
--- /dev/null
+++ b/README.md
@@ -0,0 +1,101 @@
+# Introduction
+
+*ediprolog* lets you interact with Prolog in all Emacs buffers.
+You can consult Prolog programs and evaluate embedded queries.
+
+**Project page**:
+
+[**https://www.metalevel.at/ediprolog/**](https://www.metalevel.at/ediprolog/)
+
+**Video**:
+
+[https://www.metalevel.at/prolog/videos/ediprolog](https://www.metalevel.at/prolog/videos/ediprolog)
+
+See also [PceProlog](https://www.metalevel.at/pceprolog/).
+
+# Installation
+
+With Emacs≥24.1, the simplest way to install ediprolog is to use
+Emacs's built-in *package manager* via the key sequence:
+
+M-x package-install RET ediprolog RET
+
+Alternatively, copy [ediprolog.el](ediprolog.el) to your `load-path`
+and add the following form to your `.emacs`, then evaluate the form or
+restart Emacs:
+
+(require 'ediprolog)
+
+After you have installed ediprolog, you can customize it with:
+
+M-x customize-group RET ediprolog RET
+
+The two most important configuration options are:
+
+   - `ediprolog-system`, either `scryer` or `swi`
+   - `ediprolog-program`, the path of the Prolog executable.
+
+# Usage
+
+The central function is `ediprolog-dwim` (Do What I Mean). I recommend
+to bind it to the function key F10 by adding the following
+form to your `.emacs` and evaluating it:
+
+(global-set-key [f10] 'ediprolog-dwim)
+
+In the following, I assume that you have also done this.
+
+Depending on the content at point, `ediprolog-dwim` does the
+"appropriate" thing: If point is on a *query*, it sends the query to a
+Prolog process, and you interact with the process in the current
+buffer as on a terminal. Queries start with "?-" or ":-", possibly
+preceded by "%" and whitespace. An example of a query is:
+
+%?- member(X, [a,b,c]).
+
+If you press F10 when point is on that query, you get:
+
+%?- member(X, [a,b,c]).
+%@X = a
+%@ ;  X = b
+%@ ;  X = c
+%@ ;  false.
+
+When waiting for output of the Prolog process, you can press C-g to
+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 is
+consulted in the Prolog process, and point is moved to the first error
+(if any). You do *not* need to *save* the file beforehand, since
+the *buffer content* (not the file) is consulted.
+
+For convenience, the most recent interactions with the Prolog
+process are logged in the buffer `*ediprolog-history*`.
+
+Use **M-x ediprolog-localize RET** to make any Prolog process started
+in the current buffer buffer-local. This way, you can run distinct
+processes simultaneously. Revert with
+**M-x ediprolog-unlocalize RET**.
+
+`ediprolog-dwim` with prefix arguments has special meanings:
+
+| Key Sequence |   Meaning|
+|--|--|
+|  C-0 F10 |   kill Prolog process|
+|  C-1 F10 |   always consult buffer (even when point is on a query)  |
+|  C-2 F10 |   always consult buffer, using a new process |
+|  C-7 F10 |   equivalent to `ediprolog-toplevel' |
+|  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 Scryer Prolog 0.8.119 and SWI-Prolog 8.1.24, using Emacs
+versions 26.1 and 27.0.50.
+
+# Screenshot
+
+Here is a sample interaction, using
+[CLP(FD) constraints](https://www.metalevel.at/prolog/clpfd) to
+relate a number to its factorial:
+
+![Factorial](factorial.png)
diff --git a/ediprolog.el b/ediprolog.el
index d88d30e80c..503643ddab 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-2022  Free Software Foundation, Inc.
 
 ;; Author: Markus Triska 
 ;; Keywords: languages, processes
@@ -69,7 +69,7 @@
 
 ;; 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).  In transient mark mode, if the region is active,
+;; error (if any). In trans

[elpa] scratch/ediprolog 4fabe53646 11/31: ENHANCED: Atomic undo of the whole interaction.

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit 4fabe53646d98286e500aa96cc27d27ae85639d1
Author: Markus Triska 
Commit: Markus Triska 

ENHANCED: Atomic undo of the whole interaction.

This feature is available in recent Emacs (development) versions.
---
 ediprolog.el | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/ediprolog.el b/ediprolog.el
index 7a1c736341..343ad1cb10 100644
--- a/ediprolog.el
+++ b/ediprolog.el
@@ -1,8 +1,8 @@
 ;;; ediprolog.el --- Emacs Does Interactive Prolog
 
-;; Copyright (C) 2006, 2007, 2008, 2009, 2012, 2013  Markus Triska
+;; Copyright (C) 2006, 2007, 2008, 2009, 2012, 2013, 2016  Markus Triska
 
-;; Author: Markus Triska 
+;; Author: Markus Triska 
 ;; Keywords: languages, processes
 
 ;; This file is free software; you can redistribute it and/or modify
@@ -16,9 +16,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see .
 
 ;;; Commentary:
 
@@ -83,32 +81,29 @@
 ;;   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-PRE")
 
 (defgroup ediprolog nil
   "Transparent interaction with SWI-Prolog."
   :group 'languages
   :group 'processes)
 
-;;;###autoload
 (defcustom ediprolog-program
   (or (executable-find "swipl") (executable-find "pl") "swipl")
   "Program name of the Prolog executable."
   :group 'ediprolog
   :type 'string)
 
-;;;###autoload
 (defcustom ediprolog-program-switches nil
   "List of switches passed to the Prolog process. Example:
 '(\"-G128M\" \"-O\")"
   :group 'ediprolog
   :type '(repeat string))
 
-;;;###autoload
 (defcustom ediprolog-prefix "%@ "
   "String to prepend when inserting output from the Prolog
 process into the buffer."
@@ -348,13 +343,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



[elpa] scratch/ediprolog 6f94bf2368 19/31: add link to video

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit 6f94bf2368a71490539db6020d7e4e9092c35a9c
Author: Markus Triska 
Commit: Markus Triska 

add link to video
---
 README.md | 4 
 1 file changed, 4 insertions(+)

diff --git a/README.md b/README.md
index 03a9b21c91..4cc24a771b 100644
--- a/README.md
+++ b/README.md
@@ -7,6 +7,10 @@ You can consult Prolog programs and evaluate embedded queries.
 
 [**https://www.metalevel.at/ediprolog/**](https://www.metalevel.at/ediprolog/)
 
+**Video**:
+
+[https://www.metalevel.at/prolog/videos/ediprolog](https://www.metalevel.at/prolog/videos/ediprolog)
+
 See also [PceProlog](https://www.metalevel.at/pceprolog/).
 
 # Installation



[elpa] scratch/ediprolog 2b348c3161 15/31: describe screenshot

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit 2b348c3161e68a09e373a04bc2e34d3efa2b283c
Author: Markus Triska 
Commit: Markus Triska 

describe screenshot
---
 README.md | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md
index 281eb7f480..588239a6b6 100644
--- a/README.md
+++ b/README.md
@@ -7,10 +7,6 @@ You can consult Prolog programs and evaluate embedded queries.
 
 [**https://www.metalevel.at/ediprolog/**](https://www.metalevel.at/ediprolog/)
 
-**Screenshot**
-
-![Factorial](factorial.png)
-
 # Installation
 
 Copy [ediprolog.el](ediprolog.el) to your `load-path` and add to your `.emacs`:
@@ -22,6 +18,13 @@ Restart Emacs and customize ediprolog with
 
 M-x customize-group RET ediprolog RET
 
+# Screenshot
+
+Here is a sample interaction, using
+[CLP(FD) constraints](https://www.metalevel.at/prolog/clpfd) to
+relate a number to its factorial:
+
+![Factorial](factorial.png)
 
 # Usage
 



[elpa] scratch/ediprolog ade75de9ae 07/31: table formatting

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit ade75de9aec194a0c8ed97eee3c6a0fdc7e1a1b6
Author: Markus Triska 
Commit: Markus Triska 

table formatting
---
 README.md | 28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/README.md b/README.md
index 4420a56bfd..7c3f85db1e 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,11 @@
+# Introduction
+
 *ediprolog* lets you interact with SWI-Prolog in all Emacs buffers.
 You can consult Prolog programs and evaluate embedded queries.
 
-#Installation
+![Factorial](factorial.png)
+
+# Installation
 
 Copy [ediprolog.el](ediprolog.el) to your `load-path` and add to your `.emacs`:
 
@@ -13,7 +17,7 @@ Restart Emacs and customize ediprolog with
 M-x customize-group RET ediprolog RET
 
 
-#Usage
+# Usage
 
 The central function is `ediprolog-dwim` (Do What I Mean), which is
 bound to F10 by the snippet above. Depending on the content at
@@ -50,17 +54,13 @@ processes simultaneously. Revert with **M-x 
ediprolog-unlocalize RET**.
 
 `ediprolog-dwim` with prefix arguments has special meanings:
 
-  | Key Sequence |   Meaning|
-  |--|--|
-  |  C-0 F10 |   kill Prolog process|
-  |  C-1 F10 |   always consult buffer (even when point is on a query)  |
-  |  C-2 F10 |   always consult buffer, using a new process |
-  |  C-7 F10 |   equivalent to `ediprolog-toplevel' |
-  |  C-u F10 |   first consult buffer, then evaluate query (if any) |
-  |  C-u C-u F10 |   like C-u F10, with a new process   |
+| Key Sequence |   Meaning|
+|--|--|
+|  C-0 F10 |   kill Prolog process|
+|  C-1 F10 |   always consult buffer (even when point is on a query)  |
+|  C-2 F10 |   always consult buffer, using a new process |
+|  C-7 F10 |   equivalent to `ediprolog-toplevel' |
+|  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 and 6.6 + Emacs 21.2, 22.3, 23.1 and 24.3
-
-**Screenshot**
-
-![Factorial](factorial.png)



[elpa] scratch/ediprolog 1c8b127701 02/31: initial revision

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit 1c8b12770100860618a9b70e8cb1ff7becee7393
Author: Markus Triska 
Commit: Markus Triska 

initial revision
---
 README | 62 ++
 1 file changed, 62 insertions(+)

diff --git a/README b/README
new file mode 100644
index 00..4ee9da7ad7
--- /dev/null
+++ b/README
@@ -0,0 +1,62 @@
+This lets you interact with SWI-Prolog in all Emacs buffers.
+You can consult Prolog programs and evaluate embedded queries.
+
+Installation
+
+
+Copy ediprolog.el to your load-path and add to your .emacs:
+
+(require 'ediprolog)
+(global-set-key [f10] 'ediprolog-dwim)
+
+Restart Emacs and customize ediprolog with
+
+M-x customize-group RET ediprolog RET
+
+
+Usage
+=
+
+The central function is `ediprolog-dwim' (Do What I Mean), which is
+bound to F10 by the snippet above. Depending on the content at
+point, `ediprolog-dwim' does the "appropriate" thing: If point is
+on a query, F10 sends the query to a Prolog process, and you
+interact with the process in the current buffer as on a terminal.
+Queries start with "?-" or ":-", possibly preceded by "%" and
+whitespace. An example of a query is (without leading ";;"):
+
+  %?- member(X, [a,b,c]).
+
+If you press F10 when point is on that query, you get:
+
+  %?- member(X, [a,b,c]).
+  %@ X = a ;
+  %@ X = b ;
+  %@ X = c ;
+  %@ false.
+
+When waiting for output of the Prolog process, you can press C-g to
+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
+is consulted in the Prolog process, and point is moved to the first
+error (if any).
+
+For convenience, the most recent interactions with the Prolog
+process are logged in the buffer "*ediprolog-history*".
+
+Use M-x ediprolog-localize RET to make any Prolog process started
+in the current buffer buffer-local. This way, you can run distinct
+processes simultaneously. Revert with M-x ediprolog-unlocalize RET.
+
+`ediprolog-dwim' with prefix arguments has special meanings:
+
+  C-0 F10   kill Prolog process
+  C-1 F10   always consult buffer (even when point is on a query)
+  C-2 F10   always consult buffer, using a new process
+  C-7 F10   equivalent to `ediprolog-toplevel'
+  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



[elpa] scratch/ediprolog 70bf2c095a 14/31: mention project page earlier

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit 70bf2c095a0946c6eec30b7845eaf75e2b5ed3f6
Author: Markus Triska 
Commit: Markus Triska 

mention project page earlier
---
 README.md | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md
index 3b07ae02e3..281eb7f480 100644
--- a/README.md
+++ b/README.md
@@ -3,6 +3,10 @@
 *ediprolog* lets you interact with SWI-Prolog in all Emacs buffers.
 You can consult Prolog programs and evaluate embedded queries.
 
+**Project page**:
+
+[**https://www.metalevel.at/ediprolog/**](https://www.metalevel.at/ediprolog/)
+
 **Screenshot**
 
 ![Factorial](factorial.png)
@@ -68,7 +72,3 @@ processes simultaneously. Revert with
 |  C-u C-u F10 |   like C-u F10, with a new process   |
 
 Tested with SWI-Prolog 5.6, 6.6 and 7.2 + Emacs 21.2, 22.3, 23.1 and 24.3.
-
-More information is available at:
-
-[**https://www.metalevel.at/ediprolog/**](https://www.metalevel.at/ediprolog/)



[elpa] scratch/ediprolog 5fd08fe19a 23/31: improve compatibility with older Emacs versions

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit 5fd08fe19a71876da4cfc21b81fbc04af9890cba
Author: Markus Triska 
Commit: Markus Triska 

improve compatibility with older Emacs versions
---
 ediprolog.el | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/ediprolog.el b/ediprolog.el
index 38a773203b..7ddcc2d654 100644
--- a/ediprolog.el
+++ b/ediprolog.el
@@ -1,6 +1,6 @@
 ;;; ediprolog.el --- Emacs Does Interactive Prolog
 
-;; Copyright (C) 2006-2020  Markus Triska
+;; Copyright (C) 2006-2021  Markus Triska
 
 ;; Author: Markus Triska 
 ;; Keywords: languages, processes
@@ -38,7 +38,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
@@ -92,7 +92,7 @@
 
 ;;; Code:
 
-(defconst ediprolog-version "2.1")
+(defconst ediprolog-version "2.2-PRE")
 
 (defgroup ediprolog nil
   "Transparent interaction with Prolog."
@@ -490,7 +490,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)



[elpa] scratch/ediprolog 34f7aa545c 04/31: transition to markdown

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit 34f7aa545c9c0ef685751dd0fcd2bad881bfd7df
Author: Markus Triska 
Commit: Markus Triska 

transition to markdown
---
 README => README.md | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/README b/README.md
similarity index 100%
rename from README
rename to README.md



[elpa] scratch/ediprolog 751119cfee 22/31: update Scryer Prolog answer

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit 751119cfee9efb52e89d0387d795f3b0c181299d
Author: Markus Triska 
Commit: Markus Triska 

update Scryer Prolog answer
---
 README.md | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index e73f2c0f73..406a356fd1 100644
--- a/README.md
+++ b/README.md
@@ -56,10 +56,10 @@ preceded by "%" and whitespace. An example of a query is:
 If you press F10 when point is on that query, you get:
 
 %?- member(X, [a,b,c]).
-%@ X = a ;
-%@ X = b ;
-%@ X = c ;
-%@ false.
+%@X = a
+%@ ;  X = b
+%@ ;  X = c
+%@ ;  false.
 
 When waiting for output of the Prolog process, you can press C-g to
 unblock Emacs and continue with other work. To resume interaction
@@ -90,7 +90,7 @@ processes simultaneously. Revert with
 |  C-u C-u F10 |   like C-u F10, with a new process   |
 
 Tested with Scryer Prolog 0.8.119 and SWI-Prolog 8.1.24, using Emacs
-version 27.0.50.
+versions 26.1 and 27.0.50.
 
 # Screenshot
 



[elpa] scratch/ediprolog ebd79c0abd 26/31: enable faithful processing of multiline queries for Scryer Prolog

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit ebd79c0abdc05a752c947e333551d808e3933046
Author: Markus Triska 
Commit: Markus Triska 

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 
 ;; 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 4b265d2fb5 09/31: add a note distinguishing buffer content and file

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit 4b265d2fb585528a8ef470ee86c0c8c103bbe09d
Author: Markus Triska 
Commit: Markus Triska 

add a note distinguishing buffer content and file
---
 README.md | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 23b8cbe7b6..3d26a28300 100644
--- a/README.md
+++ b/README.md
@@ -43,9 +43,10 @@ When waiting for output of the Prolog process, you can press 
C-g to
 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
-is consulted in the Prolog process, and point is moved to the first
-error (if any).
+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). Note that you do *not* need to *save* the file, since
+it is the *buffer content* (not the file) that is consulted.
 
 For convenience, the most recent interactions with the Prolog
 process are logged in the buffer `*ediprolog-history*`.



[elpa] scratch/ediprolog 8ba8786386 18/31: clarify installation

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit 8ba8786386a90285cfd2a39bdb763f87422ebd6c
Author: Markus Triska 
Commit: Markus Triska 

clarify installation
---
 README.md | 38 ++
 1 file changed, 22 insertions(+), 16 deletions(-)

diff --git a/README.md b/README.md
index c48fcfd061..03a9b21c91 100644
--- a/README.md
+++ b/README.md
@@ -17,32 +17,30 @@ Emacs's built-in *package manager* via the key 
sequence:
 M-x package-install RET ediprolog RET
 
 Alternatively, copy [ediprolog.el](ediprolog.el) to your `load-path`
-and add to your `.emacs`:
+and add the following form to your `.emacs`, then evaluate the form or
+restart Emacs:
 
 (require 'ediprolog)
-(global-set-key [f10] 'ediprolog-dwim)
 
-Restart Emacs and customize ediprolog with
+After you have installed ediprolog, you can customize it with:
 
 M-x customize-group RET ediprolog RET
 
-# Screenshot
+# Usage
 
-Here is a sample interaction, using
-[CLP(FD) constraints](https://www.metalevel.at/prolog/clpfd) to
-relate a number to its factorial:
+The central function is `ediprolog-dwim` (Do What I Mean). I recommend
+to bind it to the function key F10 by adding the following
+form to your `.emacs` and evaluating it:
 
-![Factorial](factorial.png)
+(global-set-key [f10] 'ediprolog-dwim)
 
-# Usage
+In the following, I assume that you have also done this.
 
-The central function is `ediprolog-dwim` (Do What I Mean), which is
-bound to F10 by the snippet above. Depending on the content at
-point, `ediprolog-dwim` does the "appropriate" thing: If point is
-on a *query*, F10 sends the query to a Prolog process, and you
-interact with the process in the current buffer as on a terminal.
-Queries start with "?-" or ":-", possibly preceded by "%" and
-whitespace. An example of a query is:
+Depending on the content at point, `ediprolog-dwim` does the
+"appropriate" thing: If point is on a *query*, it sends the query to a
+Prolog process, and you interact with the process in the current
+buffer as on a terminal. Queries start with "?-" or ":-", possibly
+preceded by "%" and whitespace. An example of a query is:
 
 %?- member(X, [a,b,c]).
 
@@ -83,3 +81,11 @@ processes simultaneously. Revert with
 |  C-u C-u F10 |   like C-u F10, with a new process   |
 
 Tested with SWI-Prolog 5.6, 6.6 and 7.2 + Emacs 21.2, 22.3, 23.1 and 24.3.
+
+# Screenshot
+
+Here is a sample interaction, using
+[CLP(FD) constraints](https://www.metalevel.at/prolog/clpfd) to
+relate a number to its factorial:
+
+![Factorial](factorial.png)



[elpa] scratch/ediprolog 943f7c2a48 01/31: initial revision

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit 943f7c2a48fbf570ec1da7fbf5bee67934745231
Author: Markus Triska 
Commit: Markus Triska 

initial revision
---
 ediprolog.el | 618 +++
 1 file changed, 618 insertions(+)

diff --git a/ediprolog.el b/ediprolog.el
new file mode 100644
index 00..7a1c736341
--- /dev/null
+++ b/ediprolog.el
@@ -0,0 +1,618 @@
+;;; ediprolog.el --- Emacs Does Interactive Prolog
+
+;; Copyright (C) 2006, 2007, 2008, 2009, 2012, 2013  Markus Triska
+
+;; Author: Markus Triska 
+;; Keywords: languages, processes
+
+;; 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
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; This file is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; These definitions let you interact with SWI-Prolog in all buffers.
+;; You can consult Prolog programs and evaluate embedded queries.
+
+;; Installation
+;; 
+;;
+;; Copy ediprolog.el to your load-path and add to your .emacs:
+;;
+;; (require 'ediprolog)
+;; (global-set-key [f10] 'ediprolog-dwim)
+;;
+;; Restart Emacs and customize ediprolog with
+;;
+;; M-x customize-group RET ediprolog RET
+;;
+
+;; Usage
+;; =
+;;
+;; The central function is `ediprolog-dwim' (Do What I Mean), which is
+;; bound to F10 by the snippet above. Depending on the content at
+;; point, `ediprolog-dwim' does the "appropriate" thing: If point is
+;; on a query, F10 sends the query to a Prolog process, and you
+;; interact with the process in the current buffer as on a terminal.
+;; Queries start with "?-" or ":-", possibly preceded by "%" and
+;; whitespace. An example of a query is (without leading ";;"):
+;;
+;;   %?- member(X, [a,b,c]).
+;;
+;; If you press F10 when point is on that query, you get:
+;;
+;;   %?- member(X, [a,b,c]).
+;;   %@ X = a ;
+;;   %@ X = b ;
+;;   %@ X = c ;
+;;   %@ false.
+;;
+;; When waiting for output of the Prolog process, you can press C-g to
+;; 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
+;; is consulted in the Prolog process, and point is moved to the first
+;; error (if any).
+
+;; For convenience, the most recent interactions with the Prolog
+;; process are logged in the buffer "*ediprolog-history*".
+
+;; Use M-x ediprolog-localize RET to make any Prolog process started
+;; in the current buffer buffer-local. This way, you can run distinct
+;; processes simultaneously. Revert with M-x ediprolog-unlocalize RET.
+
+;; `ediprolog-dwim' with prefix arguments has special meanings:
+;;
+;;   C-0 F10   kill Prolog process
+;;   C-1 F10   always consult buffer (even when point is on a query)
+;;   C-2 F10   always consult buffer, using a new process
+;;   C-7 F10   equivalent to `ediprolog-toplevel'
+;;   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
+
+;;; Code:
+
+(defconst ediprolog-version "0.9z")
+
+(defgroup ediprolog nil
+  "Transparent interaction with SWI-Prolog."
+  :group 'languages
+  :group 'processes)
+
+;;;###autoload
+(defcustom ediprolog-program
+  (or (executable-find "swipl") (executable-find "pl") "swipl")
+  "Program name of the Prolog executable."
+  :group 'ediprolog
+  :type 'string)
+
+;;;###autoload
+(defcustom ediprolog-program-switches nil
+  "List of switches passed to the Prolog process. Example:
+'(\"-G128M\" \"-O\")"
+  :group 'ediprolog
+  :type '(repeat string))
+
+;;;###autoload
+(defcustom ediprolog-prefix "%@ "
+  "String to prepend when inserting output from the Prolog
+process into the buffer."
+  :group 'ediprolog
+  :type 'string)
+
+(defcustom ediprolog-max-history 8
+  "Maximal size of history buffers storing recent interactions, or
+nil to never truncate the history."
+  :group 'ediprolog
+  :type 'sexp)
+
+(defvar ediprolog-process   nil "A Prolog process.")
+
+(defvar ediprolog-temp-buffer   nil
+  "Buffer that temporarily saves process output ")
+
+(defvar ediprolog-seen-prompt   nil
+  "Whether a prompt was (recently) emitted by the Prolog process.")
+
+(defvar ediprolog-read-term nil
+  "Whether the Prolog process waits for the user to enter a term.")
+

[elpa] scratch/ediprolog d30bc3dd59 17/31: explain installation of ediprolog via GNU ELPA

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit d30bc3dd59aec4da5411bf4bf046750361285b13
Author: Markus Triska 
Commit: Markus Triska 

explain installation of ediprolog via GNU ELPA
---
 README.md | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index e537570db9..c48fcfd061 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,13 @@ See also [PceProlog](https://www.metalevel.at/pceprolog/).
 
 # Installation
 
-Copy [ediprolog.el](ediprolog.el) to your `load-path` and add to your `.emacs`:
+With Emacs≥24.1, the simplest way to install ediprolog is to use
+Emacs's built-in *package manager* via the key sequence:
+
+M-x package-install RET ediprolog RET
+
+Alternatively, copy [ediprolog.el](ediprolog.el) to your `load-path`
+and add to your `.emacs`:
 
 (require 'ediprolog)
 (global-set-key [f10] 'ediprolog-dwim)



[elpa] scratch/ediprolog 68024b9f08 13/31: point to further information

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit 68024b9f0879b133caecda3ea3ed1eab8b6bf0d1
Author: Markus Triska 
Commit: Markus Triska 

point to further information
---
 README.md | 4 
 1 file changed, 4 insertions(+)

diff --git a/README.md b/README.md
index f461f59f1f..3b07ae02e3 100644
--- a/README.md
+++ b/README.md
@@ -68,3 +68,7 @@ processes simultaneously. Revert with
 |  C-u C-u F10 |   like C-u F10, with a new process   |
 
 Tested with SWI-Prolog 5.6, 6.6 and 7.2 + Emacs 21.2, 22.3, 23.1 and 24.3.
+
+More information is available at:
+
+[**https://www.metalevel.at/ediprolog/**](https://www.metalevel.at/ediprolog/)



[elpa] scratch/ediprolog 3f8ab3eea0 10/31: wording

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit 3f8ab3eea074b9d2c75dd7eb48a7c242dbf0ad86
Author: Markus Triska 
Commit: Markus Triska 

wording
---
 README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 3d26a28300..f461f59f1f 100644
--- a/README.md
+++ b/README.md
@@ -45,8 +45,8 @@ with the Prolog process, use 
**M-x ediprolog-toplevel RET**.
 
 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). Note that you do *not* need to *save* the file, since
-it is the *buffer content* (not the file) that is consulted.
+(if any). You do *not* need to *save* the file beforehand, since
+the *buffer content* (not the file) is consulted.
 
 For convenience, the most recent interactions with the Prolog
 process are logged in the buffer `*ediprolog-history*`.



[elpa] scratch/ediprolog 7af081ba84 31/31: Merge remote-tracking branch 'upstream/ediprolog/main' into externals/ediprolog

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit 7af081ba84fba5caa25fb6854584e662215ae410
Merge: e75c0ddfc4 dc0e51ba57
Author: Stefan Monnier 
Commit: Stefan Monnier 

Merge remote-tracking branch 'upstream/ediprolog/main' into 
externals/ediprolog
---
 README.md |   8 
 ediprolog.el  |  36 +---
 factorial.png | Bin 60804 -> 39199 bytes
 3 files changed, 29 insertions(+), 15 deletions(-)

diff --git a/README.md b/README.md
index 406a356fd1..fdf591393d 100644
--- a/README.md
+++ b/README.md
@@ -32,7 +32,7 @@ After you have installed ediprolog, you can customize it with:
 
 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
@@ -51,11 +51,11 @@ Prolog process, and you interact with the process in the 
current
 buffer as on a terminal. Queries start with "?-" or ":-", possibly
 preceded by "%" and whitespace. An example of a query is:
 
-%?- 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
@@ -95,7 +95,7 @@ versions 26.1 and 27.0.50.
 # Screenshot
 
 Here is a sample interaction, using
-[CLP(FD) constraints](https://www.metalevel.at/prolog/clpfd) to
+[CLP(ℤ) constraints](https://www.metalevel.at/prolog/clpz) to
 relate a number to its factorial:
 
 ![Factorial](factorial.png)
diff --git a/ediprolog.el b/ediprolog.el
index 503643ddab..033aacd208 100644
--- a/ediprolog.el
+++ b/ediprolog.el
@@ -4,7 +4,7 @@
 
 ;; Author: Markus Triska 
 ;; Keywords: languages, processes
-;; Version: 2.1
+;; Version: 2.2
 ;; Homepage: https://www.metalevel.at/ediprolog/
 
 ;; This file is free software; you can redistribute it and/or modify
@@ -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
@@ -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
@@ -93,7 +93,7 @@
 
 ;;; Code:
 
-(defconst ediprolog-version "2.1")
+(defconst ediprolog-version "2.2")
 
 (defgroup ediprolog nil
   "Transparent interaction with Prolog."
@@ -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
@@ -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))
@@ -491,7 +501,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 ediprol

[elpa] scratch/ediprolog dc0e51ba57 29/31: ediprolog 2.2: support newer Scryer Prolog versions, and smaller improvements

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit dc0e51ba579f2eb26ae0cdc733104e8861f04c10
Author: Markus Triska 
Commit: Markus Triska 

ediprolog 2.2: support newer Scryer Prolog versions, and smaller 
improvements
---
 ediprolog.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ediprolog.el b/ediprolog.el
index c5213454d1..035c7b7443 100644
--- a/ediprolog.el
+++ b/ediprolog.el
@@ -92,7 +92,7 @@
 
 ;;; Code:
 
-(defconst ediprolog-version "2.2-PRE4")
+(defconst ediprolog-version "2.2")
 
 (defgroup ediprolog nil
   "Transparent interaction with Prolog."



[elpa] scratch/ediprolog 8b554e63aa 24/31: document Scryer Prolog default setting

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit 8b554e63aab57951a136abfd66d20f064fb848d8
Author: Markus Triska 
Commit: Markus Triska 

document Scryer Prolog default setting
---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 406a356fd1..9aa9d45def 100644
--- a/README.md
+++ b/README.md
@@ -32,7 +32,7 @@ After you have installed ediprolog, you can customize it with:
 
 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



[elpa] scratch/ediprolog 9c4c80ad4a 21/31: improve compatibility with older Emacs versions

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit 9c4c80ad4aa1ffe2a8b92be61c3b6b2ac647dac5
Author: Markus Triska 
Commit: Markus Triska 

improve compatibility with older Emacs versions
---
 ediprolog.el | 23 +--
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/ediprolog.el b/ediprolog.el
index 9eec6ab386..38a773203b 100644
--- a/ediprolog.el
+++ b/ediprolog.el
@@ -57,10 +57,10 @@
 ;; If you press F10 when point is on that query, you get:
 ;;
 ;;   %?- member(X, [a,b,c]).
-;;   %@ X = a ;
-;;   %@ X = b ;
-;;   %@ X = c ;
-;;   %@ false.
+;;   %@X = a
+;;   %@ ;  X = b
+;;   %@ ;  X = c
+;;   %@ ;  false.
 ;;
 ;; When waiting for output of the Prolog process, you can press C-g to
 ;; unblock Emacs and continue with other work. To resume interaction
@@ -88,11 +88,11 @@
 ;;   C-u C-u F10   like C-u F10, with a new process
 
 ;; Tested with Scryer Prolog 0.8.119 and SWI-Prolog 8.1.24,
-;; using Emacs version 27.0.50.
+;; using Emacs versions 26.1 and 27.0.50.
 
 ;;; Code:
 
-(defconst ediprolog-version "2.0")
+(defconst ediprolog-version "2.1")
 
 (defgroup ediprolog nil
   "Transparent interaction with Prolog."
@@ -512,10 +512,13 @@ operates on the region."
 (re-search-forward "^ERROR.*?:\\([0-9]+\\)" nil t))
   (string-to-number (match-string 1))
 (when line
-  (if (and transient-mark-mode mark-active)
-  (when (fboundp 'line-number-at-pos)
-(goto-line (+ (line-number-at-pos (region-beginning)) line -1)))
-(goto-line line)
+  (let ((p (point)))
+(goto-char (if (and transient-mark-mode mark-active)
+   (region-beginning)
+ (point-min)))
+;; doing this first would affect (region-beginning)
+(push-mark p))
+  (forward-line (1- line)
 
 (defun ediprolog-running ()
   "True iff `ediprolog-process' is a running process."



[elpa] scratch/ediprolog c4d0834457 16/31: link to PceProlog

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit c4d083445746097a91eccf67ee3e9f1dde568fd3
Author: Markus Triska 
Commit: Markus Triska 

link to PceProlog
---
 README.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/README.md b/README.md
index 588239a6b6..e537570db9 100644
--- a/README.md
+++ b/README.md
@@ -7,6 +7,8 @@ You can consult Prolog programs and evaluate embedded queries.
 
 [**https://www.metalevel.at/ediprolog/**](https://www.metalevel.at/ediprolog/)
 
+See also [PceProlog](https://www.metalevel.at/pceprolog/).
+
 # Installation
 
 Copy [ediprolog.el](ediprolog.el) to your `load-path` and add to your `.emacs`:



[elpa] scratch/ediprolog 85fae67aea 25/31: support the latest development version of Scryer Prolog

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit 85fae67aeaede36ba61b0c551aa18617d3b9f797
Author: Markus Triska 
Commit: Markus Triska 

support the latest development version of Scryer Prolog
---
 ediprolog.el | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ediprolog.el b/ediprolog.el
index 7ddcc2d654..fd91d4061e 100644
--- a/ediprolog.el
+++ b/ediprolog.el
@@ -92,7 +92,7 @@
 
 ;;; Code:
 
-(defconst ediprolog-version "2.2-PRE")
+(defconst ediprolog-version "2.2-PRE2")
 
 (defgroup ediprolog nil
   "Transparent interaction with Prolog."
@@ -272,9 +272,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



[elpa] scratch/ediprolog 62ce0025b8 27/31: use compact string notation in sample queries

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit 62ce0025b8e44d0cbb5a782b5c18be72b2662163
Author: Markus Triska 
Commit: Markus Triska 

use compact string notation in sample queries
---
 README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 9aa9d45def..4f79fe4f6a 100644
--- a/README.md
+++ b/README.md
@@ -51,11 +51,11 @@ Prolog process, and you interact with the process in the 
current
 buffer as on a terminal. Queries start with "?-" or ":-", possibly
 preceded by "%" and whitespace. An example of a query is:
 
-%?- 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



[elpa] scratch/ediprolog 68a7b83f4d 20/31: ediprolog 2.0: Scryer Prolog is now the default Prolog system

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit 68a7b83f4dba95abc266c6c81ab40ef275b28da8
Author: Markus Triska 
Commit: Markus Triska 

ediprolog 2.0: Scryer Prolog is now the default Prolog system

Use the `ediprolog-system' configuration option to change systems.
---
 README.md| 10 ++--
 ediprolog.el | 80 
 2 files changed, 62 insertions(+), 28 deletions(-)

diff --git a/README.md b/README.md
index 4cc24a771b..e73f2c0f73 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 # Introduction
 
-*ediprolog* lets you interact with SWI-Prolog in all Emacs buffers.
+*ediprolog* lets you interact with Prolog in all Emacs buffers.
 You can consult Prolog programs and evaluate embedded queries.
 
 **Project page**:
@@ -30,6 +30,11 @@ After you have installed ediprolog, you can customize it 
with:
 
 M-x customize-group RET ediprolog RET
 
+The two most important configuration options are:
+
+   - `ediprolog-system`, either `scryer` or `swi`
+   - `ediprolog-program`, the path of the Prolog executable.
+
 # Usage
 
 The central function is `ediprolog-dwim` (Do What I Mean). I recommend
@@ -84,7 +89,8 @@ processes simultaneously. Revert with
 |  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, 6.6 and 7.2 + Emacs 21.2, 22.3, 23.1 and 24.3.
+Tested with Scryer Prolog 0.8.119 and SWI-Prolog 8.1.24, using Emacs
+version 27.0.50.
 
 # Screenshot
 
diff --git a/ediprolog.el b/ediprolog.el
index a4372ab8ce..9eec6ab386 100644
--- a/ediprolog.el
+++ b/ediprolog.el
@@ -1,6 +1,6 @@
 ;;; ediprolog.el --- Emacs Does Interactive Prolog
 
-;; Copyright (C) 2006, 2007, 2008, 2009, 2012, 2013, 2016, 2017  Markus Triska
+;; Copyright (C) 2006-2020  Markus Triska
 
 ;; Author: Markus Triska 
 ;; Keywords: languages, processes
@@ -21,7 +21,7 @@
 
 ;;; Commentary:
 
-;; These definitions let you interact with SWI-Prolog in all buffers.
+;; These definitions let you interact with Prolog in all buffers.
 ;; You can consult Prolog programs and evaluate embedded queries.
 
 ;; Installation
@@ -36,6 +36,10 @@
 ;;
 ;; M-x customize-group RET ediprolog RET
 ;;
+;; The two most important configuration options are:
+;;
+;;- `ediprolog-system', either 'scryer or 'swi
+;;- `ediprolog-program', the path of the Prolog executable.
 
 ;; Usage
 ;; =
@@ -83,19 +87,30 @@
 ;;   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 7.3.21 + Emacs 22.1, 23.4, 24.5, 25.1 and 26.0
+;; Tested with Scryer Prolog 0.8.119 and SWI-Prolog 8.1.24,
+;; using Emacs version 27.0.50.
 
 ;;; Code:
 
-(defconst ediprolog-version "1.2")
+(defconst ediprolog-version "2.0")
 
 (defgroup ediprolog nil
-  "Transparent interaction with SWI-Prolog."
+  "Transparent interaction with Prolog."
   :group 'languages
   :group 'processes)
 
+
+(defcustom ediprolog-system 'scryer
+  "Prolog system that is used for interaction."
+  :group 'ediprolog
+  :type '(choice (const :tag "Scryer Prolog" :value scryer)
+ (const :tag "SWI Prolog" :value swi)))
+
 (defcustom ediprolog-program
-  (or (executable-find "swipl") (executable-find "pl") "swipl")
+  (or
+   (executable-find "scryer-prolog")
+   (executable-find "swipl")
+   "scryer-prolog")
   "Program name of the Prolog executable."
   :group 'ediprolog
   :type 'string)
@@ -135,10 +150,6 @@ nil to never truncate the history."
 (defvar ediprolog-temp-file nil
   "File name of a temporary file used for consulting the buffer.")
 
-(defvar ediprolog-prompt "?ediprolog- "
-  "Prompt used in the Prolog session. It must differ from the
-default Prolog prompt.")
-
 (defvar ediprolog-consult-buffer "*ediprolog-consult*"
   "Buffer used to display consult output.")
 
@@ -151,6 +162,11 @@ default Prolog prompt.")
 (defvar ediprolog-interrupted   nil
   "True iff waiting for the previous query was interrupted with C-g.")
 
+(defun ediprolog-prompt ()
+  "Prompt used in the Prolog session."
+  (cond ((eq ediprolog-system 'swi) "?ediprolog- ")
+ (t "?- ")))
+
 (defmacro ediprolog-wait-for-prompt-after (&rest forms)
   "Evaluate FORMS and wait for prompt."
   `(progn
@@ -224,13 +240,14 @@ default Prolog prompt.")
 (condition-case nil
 (ediprolog-wait-for-prompt-after
  (setq ediprolog-process
-   (apply #'start-process "ediprolog" (current-buffer) args))
+   (apply #'start-file-process "ediprolog" (current-buffer) args))
  (set-process-sentinel ediprolog-process 'ediprolog-sentinel)
  (set-process-filter ediprolog-process
  'ediprolog-wait-for-prompt-filter)
- (ediprolog-send-string
-  (format "set_prolog_flag(color_term, false),\
-  '$set_prompt'('%s').\n" ediprolog-prompt)))
+

[elpa] scratch/ediprolog 49679a0c44 28/31: use library(clpz) and Scryer Prolog interaction in screenshot

2022-10-02 Thread Stefan Monnier via
branch: scratch/ediprolog
commit 49679a0c4475004bb2bbeb0fd4380a76ef2a8482
Author: Markus Triska 
Commit: Markus Triska 

use library(clpz) and Scryer Prolog interaction in screenshot
---
 README.md |   2 +-
 factorial.png | Bin 60804 -> 39199 bytes
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 4f79fe4f6a..fdf591393d 100644
--- a/README.md
+++ b/README.md
@@ -95,7 +95,7 @@ versions 26.1 and 27.0.50.
 # Screenshot
 
 Here is a sample interaction, using
-[CLP(FD) constraints](https://www.metalevel.at/prolog/clpfd) to
+[CLP(ℤ) constraints](https://www.metalevel.at/prolog/clpz) to
 relate a number to its factorial:
 
 ![Factorial](factorial.png)
diff --git a/factorial.png b/factorial.png
index b85c8c0f05..653a4df7d7 100644
Binary files a/factorial.png and b/factorial.png differ



[elpa] main 39b6223460: * elpa-packages (ediprolog): Set the `:url` since there is an upstream

2022-10-02 Thread Stefan Monnier via
branch: main
commit 39b62234608c6a46d2e9fe3895e7e08f1e2dc20e
Author: Stefan Monnier 
Commit: Stefan Monnier 

* elpa-packages (ediprolog): Set the `:url` since there is an upstream
---
 elpa-packages | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/elpa-packages b/elpa-packages
index daf087277d..8471f70032 100644
--- a/elpa-packages
+++ b/elpa-packages
@@ -251,7 +251,9 @@
   :auto-sync t)
  ("ebdb-gnorb" :url nil)
  ("ebdb-i18n-chn"  :url nil)
- ("ediprolog"  :url nil)
+ ("ediprolog"  :url "https://github.com/triska/ediprolog";
+  :readme "README.md"
+  :auto-sync t)
  ("eev":url "https://github.com/edrx/eev.git";
   :branch "UTF-8" :auto-sync t)
  ("ef-themes"  :url "https://git.sr.ht/~protesilaos/ef-themes";



[nongnu] elpa/org-mime cc00afcf02: ox-html is required

2022-10-02 Thread ELPA Syncer
branch: elpa/org-mime
commit cc00afcf0291633324364c1c83bfe2833cfdc1bf
Author: Chen Bin 
Commit: Chen Bin 

ox-html is required
---
 org-mime.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/org-mime.el b/org-mime.el
index ce46740dcc..c0154f4594 100644
--- a/org-mime.el
+++ b/org-mime.el
@@ -6,7 +6,7 @@
 ;; Maintainer: Chen Bin 
 ;; Keywords: mime, mail, email, html
 ;; Homepage: http://github.com/org-mime/org-mime
-;; Version: 0.3.1
+;; Version: 0.3.2
 ;; Package-Requires: ((emacs "25.1"))
 
 ;; This file is not part of GNU Emacs.
@@ -126,6 +126,7 @@
 (require 'outline)
 (require 'org)
 (require 'ox-org)
+(require 'ox-html)
 (require 'message)
 
 (defcustom org-mime-beautify-quoted-mail-p t



[elpa] externals/denote c33872507f 3/4: Add cross links for the backlink commands

2022-10-02 Thread ELPA Syncer
branch: externals/denote
commit c33872507f50edb00829efe4afde4df7530c08e9
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Add cross links for the backlink commands
---
 README.org | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/README.org b/README.org
index 1bbbd89d10..1d39c6c2ea 100644
--- a/README.org
+++ b/README.org
@@ -1353,6 +1353,10 @@ certain executables to the relevant environment variable.
 
 [[#h:42f6b07e-5956-469a-8294-17f9cf62eb2b][Why do I get "Search failed with 
status 1" when I search for backlinks?]]
 
+Backlinks can also be visited by using minibuffer completion.  The
+command is ~denote-link-find-backlink~, which is part of
+{{{development-version}}} ([[#h:1bc2adad-dca3-4878-b9f0-b105d5dec6f4][Visiting 
linked files via the minibuffer]]).
+
 ** Writing metanotes
 :PROPERTIES:
 :CUSTOM_ID: h:6060a7e6-f179-4d42-a9de-a9968aaebecc
@@ -1409,7 +1413,10 @@ with only the files of the current minibuffer session).
 
 #+findex: denote-link-find-backlink
 To visit backlinks to the current note via the minibuffer, use
-~denote-link-find-backlink~.
+~denote-link-find-backlink~.  This is an alternative to placing
+backlinks in a dedicated buffer 
([[#h:c73f1f68-e214-49d5-b369-e694f6a5d708][The backlinks' buffer]]).
+
+[ The ~denote-link-find-backlink~ is part of {{{development-version}}}. ]
 
 ** Miscellaneous information about links
 :PROPERTIES:



[elpa] externals/denote updated (226fa78f4e -> 8c7d48858c)

2022-10-02 Thread ELPA Syncer
elpasync pushed a change to branch externals/denote.

  from  226fa78f4e Change a couple 'user-error' symbols to 'message'
   new  45a5897d98 Add missing colon sign in prompt
   new  56c3953166 Add denote-link-find-backlink command
   new  c33872507f Add cross links for the backlink commands
   new  8c7d48858c Tweak key bindings in sample configuration


Summary of changes:
 README.org | 14 +-
 denote.el  | 16 +++-
 2 files changed, 28 insertions(+), 2 deletions(-)



[elpa] externals/denote 56c3953166 2/4: Add denote-link-find-backlink command

2022-10-02 Thread ELPA Syncer
branch: externals/denote
commit 56c39531669c75ca1b076c80f82f65ee66ca4b78
Author: EFLS <>
Commit: Protesilaos Stavrou 

Add denote-link-find-backlink command

Variation on denote-link-find-file, but for visiting backlinks to the 
current
note via the minibuffer.
---
 README.org |  4 
 denote.el  | 14 ++
 2 files changed, 18 insertions(+)

diff --git a/README.org b/README.org
index b136642e13..1bbbd89d10 100644
--- a/README.org
+++ b/README.org
@@ -1407,6 +1407,10 @@ the =embark= package will be able to work its magic such 
as in exporting
 the list into a filtered Dired buffer (i.e. a familiar Dired listing
 with only the files of the current minibuffer session).
 
+#+findex: denote-link-find-backlink
+To visit backlinks to the current note via the minibuffer, use
+~denote-link-find-backlink~.
+
 ** Miscellaneous information about links
 :PROPERTIES:
 :CUSTOM_ID: h:dd8f2231-8d77-49b9-acc4-af525c68b271
diff --git a/denote.el b/denote.el
index fb7d3a694b..a8734d1be2 100644
--- a/denote.el
+++ b/denote.el
@@ -2268,6 +2268,20 @@ format is always [[denote:IDENTIFIER]]."
  (denote-link--find-file-prompt files
 (user-error "No links found in the current buffer")))
 
+;;;###autoload
+(defun denote-link-find-backlink ()
+  "Use minibuffer completion to visit backlink to current file.
+
+Like `denote-link-find-file', but select backlink to follow."
+  (interactive)
+  (when-let* ((file (buffer-file-name))
+  (id (denote-retrieve-filename-identifier file))
+  (files (denote--retrieve-process-grep id)))
+(find-file
+  (denote-get-path-by-id
+(denote-extract-id-from-string
+  (denote-link--find-file-prompt files))
+
 ;;;###autoload
 (defun denote-link-after-creating (&optional id-only)
   "Create new note in the background and link to it directly.



[elpa] externals/denote 45a5897d98 1/4: Add missing colon sign in prompt

2022-10-02 Thread ELPA Syncer
branch: externals/denote
commit 45a5897d982101bb0bfb409416c61be8893c5a6d
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Add missing colon sign in prompt
---
 denote.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/denote.el b/denote.el
index 0bdddcedf2..fb7d3a694b 100644
--- a/denote.el
+++ b/denote.el
@@ -2252,7 +2252,7 @@ format is always [[denote:IDENTIFIER]]."
   (let ((file-names (mapcar #'denote-get-file-name-relative-to-denote-directory
 files)))
 (completing-read
- "Find linked file "
+ "Find linked file: "
  (denote--completion-table 'file file-names)
  nil t nil 'denote-link--find-file-history)))
 



[elpa] externals/denote 8c7d48858c 4/4: Tweak key bindings in sample configuration

2022-10-02 Thread ELPA Syncer
branch: externals/denote
commit 8c7d48858c97e91df89ab93f8ac183b68e426d25
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Tweak key bindings in sample configuration
---
 README.org | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/README.org b/README.org
index 1d39c6c2ea..bcd960a15e 100644
--- a/README.org
+++ b/README.org
@@ -2247,8 +2247,9 @@ Everything is in place to set up the package.
   ;; `markdown-mode-map', and/or `text-mode-map'.
   (define-key map (kbd "C-c n i") #'denote-link) ; "insert" mnemonic
   (define-key map (kbd "C-c n I") #'denote-link-add-links)
-  (define-key map (kbd "C-c n l") #'denote-link-find-file) ; "list" links
   (define-key map (kbd "C-c n b") #'denote-link-backlinks)
+  (define-key map (kbd "C-c n f f") #'denote-link-find-file)
+  (define-key map (kbd "C-c n f b") #'denote-link-find-backlink)
   ;; Note that `denote-rename-file' can work from any context, not just
   ;; Dired bufffers.  That is why we bind it here to the `global-map'.
   (define-key map (kbd "C-c n r") #'denote-rename-file)



[elpa] externals/engrave-faces updated (6d2bcb72c0 -> 005958481b)

2022-10-02 Thread ELPA Syncer
elpasync pushed a change to branch externals/engrave-faces.

  from  6d2bcb72c0 No need to manually specify defcustom :group
   new  41c5171470 Update copyright dates
   new  005958481b Add fixme note


Summary of changes:
 LICENCE| 4 ++--
 engrave-faces-ansi.el  | 2 +-
 engrave-faces-html.el  | 2 +-
 engrave-faces-latex.el | 2 +-
 engrave-faces.el   | 8 +---
 5 files changed, 10 insertions(+), 8 deletions(-)



[elpa] externals/engrave-faces 41c5171470 1/2: Update copyright dates

2022-10-02 Thread ELPA Syncer
branch: externals/engrave-faces
commit 41c51714703fdceaaa8e6b425eb381be7554544d
Author: TEC 
Commit: TEC 

Update copyright dates
---
 LICENCE| 4 ++--
 engrave-faces-ansi.el  | 2 +-
 engrave-faces-html.el  | 2 +-
 engrave-faces-latex.el | 2 +-
 engrave-faces.el   | 6 +++---
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/LICENCE b/LICENCE
index ac7545857d..dc8da2b3fa 100644
--- a/LICENCE
+++ b/LICENCE
@@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have 
at least
 the "copyright" line and a pointer to where the full notice is found.
 
 Convert font-lock faces to other formats.
-Copyright (C) 2021 Free Software Foundation, Inc.
+Copyright (C) 2021-2022 Free Software Foundation, Inc.
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -652,7 +652,7 @@ Also add information on how to contact you by electronic 
and paper mail.
 If the program does terminal interaction, make it output a short
 notice like this when it starts in an interactive mode:
 
-Engrave Faces  Copyright (C) 2021 Free Software Foundation, Inc.
+Engrave Faces  Copyright (C) 2021-2022 Free Software Foundation, Inc.
 This program comes with ABSOLUTELY NO WARRANTY; for details type Symbol’s 
value as variable is void: showshow c' for details.
 
 The hypothetical commands Symbol’s value as variable is void: showshow c' 
should show the appropriate
diff --git a/engrave-faces-ansi.el b/engrave-faces-ansi.el
index e2a9372db8..b19ca1ee21 100644
--- a/engrave-faces-ansi.el
+++ b/engrave-faces-ansi.el
@@ -1,6 +1,6 @@
 ;;; engrave-faces-ansi.el --- Support for engraving buffers to LaTeX -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2021 Free Software Foundation, Inc.
+;; Copyright (C) 2021-2022 Free Software Foundation, Inc.
 
 ;; This file is part of engrave-faces.
 ;; SPDX-License-Identifier: GPL-3.0-or-later
diff --git a/engrave-faces-html.el b/engrave-faces-html.el
index c4b7a0ccc9..3e173c0734 100644
--- a/engrave-faces-html.el
+++ b/engrave-faces-html.el
@@ -1,6 +1,6 @@
 ;;; engrave-faces-html.el --- Support for engraving buffers to HTML -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2021 Free Software Foundation, Inc.
+;; Copyright (C) 2021-2022 Free Software Foundation, Inc.
 
 ;; This file is part of engrave-faces.
 ;; SPDX-License-Identifier: GPL-3.0-or-later
diff --git a/engrave-faces-latex.el b/engrave-faces-latex.el
index 4d209356b1..bfff564f3d 100644
--- a/engrave-faces-latex.el
+++ b/engrave-faces-latex.el
@@ -1,6 +1,6 @@
 ;;; engrave-faces-latex.el --- Support for engraving buffers to LaTeX -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2021 Free Software Foundation, Inc.
+;; Copyright (C) 2021-2022 Free Software Foundation, Inc.
 
 ;; This file is part of engrave-faces.
 ;; SPDX-License-Identifier: GPL-3.0-or-later
diff --git a/engrave-faces.el b/engrave-faces.el
index 8d29a6b8a3..24dab860ce 100644
--- a/engrave-faces.el
+++ b/engrave-faces.el
@@ -1,9 +1,9 @@
 ;;; engrave-faces.el --- Convert font-lock faces to other formats -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2021 Free Software Foundation, Inc.
+;; Copyright (C) 2021-2022 Free Software Foundation, Inc.
 
-;; Author: TEC 
-;; Maintainer: TEC 
+;; Author: TEC 
+;; Maintainer: TEC 
 ;; Created: January 18, 2021
 ;; Modified: July 10, 2021
 ;; Version: 0.3.1



[elpa] externals/engrave-faces 005958481b 2/2: Add fixme note

2022-10-02 Thread ELPA Syncer
branch: externals/engrave-faces
commit 005958481b04e9e5ae38a4905d6313474ae22e6d
Author: TEC 
Commit: TEC 

Add fixme note
---
 engrave-faces.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/engrave-faces.el b/engrave-faces.el
index 24dab860ce..4b0cfbc86b 100644
--- a/engrave-faces.el
+++ b/engrave-faces.el
@@ -291,6 +291,8 @@ If a POSTPROCESSOR function is provided, it is called 
before saving."
   (let ((prop (get-text-property (point) 
'face)))
 (cond
  ((null prop) 'default)
+ ;; FIXME: Why/where/when does the `face'
+ ;; property take a value (quote X)?
  ((and (listp prop) (eq (car prop) 'quote))
   (eval prop t))
  (t prop)))



[nongnu] elpa/helm 1238115b0c: Allow forcing creation of thumnails with a prefarg

2022-10-02 Thread ELPA Syncer
branch: elpa/helm
commit 1238115b0c5861642dd822da719afd40089e63c9
Author: Thierry Volpiatto 
Commit: Thierry Volpiatto 

Allow forcing creation of thumnails with a prefarg
---
 helm-files.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/helm-files.el b/helm-files.el
index 3768463782..e5d12180cf 100644
--- a/helm-files.el
+++ b/helm-files.el
@@ -4889,7 +4889,8 @@ Special commands:
 (when (or (not thumb-attr)
  (time-less-p (file-attribute-modification-time thumb-attr)
   (file-attribute-modification-time
-   (file-attributes file
+   (file-attributes file)))
+  (or helm-current-prefix-arg current-prefix-arg))
   (image-dired-create-thumb file thumb-file))
 (create-image thumb-file)))
 



[nongnu] elpa/helm-core updated (b2857de250 -> 1238115b0c)

2022-10-02 Thread ELPA Syncer
elpasync pushed a change to branch elpa/helm-core.

  from  b2857de250 Show numbered mode in file info
  adds  1238115b0c Allow forcing creation of thumnails with a prefarg

No new revisions were added by this update.

Summary of changes:
 helm-files.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)



[nongnu] elpa/helm updated (1238115b0c -> ed071b797b)

2022-10-02 Thread ELPA Syncer
elpasync pushed a change to branch elpa/helm.

  from  1238115b0c Allow forcing creation of thumnails with a prefarg
   new  61e5f753c6 Revert "Allow forcing creation of thumnails with a 
prefarg"
   new  5e2a40262f Fix thumnails display with image-dired-thumbnail-storage 
standard
   new  ed071b797b Add command to clear helm-ff-image-dired-thumbnails-cache


Summary of changes:
 helm-files.el | 23 ++-
 1 file changed, 18 insertions(+), 5 deletions(-)



[nongnu] elpa/helm 61e5f753c6 1/3: Revert "Allow forcing creation of thumnails with a prefarg"

2022-10-02 Thread ELPA Syncer
branch: elpa/helm
commit 61e5f753c67f763ee69944694ed603a32090d51b
Author: Thierry Volpiatto 
Commit: Thierry Volpiatto 

Revert "Allow forcing creation of thumnails with a prefarg"

This reverts commit 1238115b0c5861642dd822da719afd40089e63c9.
---
 helm-files.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/helm-files.el b/helm-files.el
index e5d12180cf..3768463782 100644
--- a/helm-files.el
+++ b/helm-files.el
@@ -4889,8 +4889,7 @@ Special commands:
 (when (or (not thumb-attr)
  (time-less-p (file-attribute-modification-time thumb-attr)
   (file-attribute-modification-time
-   (file-attributes file)))
-  (or helm-current-prefix-arg current-prefix-arg))
+   (file-attributes file
   (image-dired-create-thumb file thumb-file))
 (create-image thumb-file)))
 



[nongnu] elpa/helm 5e2a40262f 2/3: Fix thumnails display with image-dired-thumbnail-storage standard

2022-10-02 Thread ELPA Syncer
branch: elpa/helm
commit 5e2a40262f5c8a58d78cf1161f755f6f7b3b1478
Author: Thierry Volpiatto 
Commit: Thierry Volpiatto 

Fix thumnails display with image-dired-thumbnail-storage standard
---
 helm-files.el | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/helm-files.el b/helm-files.el
index 3768463782..4e64cba58f 100644
--- a/helm-files.el
+++ b/helm-files.el
@@ -4860,9 +4860,14 @@ Special commands:
 (cl-pushnew helm-ff-default-directory
 helm-ff--thumbnailed-directories :test 'equal)
 (cl-loop for (disp . img) in candidates
- for type = (helm-acase (file-name-extension img)
-  ("png" 'png)
-  (("jpg" "jpeg") 'jpeg))
+ for imgtype = (helm-acase (file-name-extension img)
+ ("png" 'png)
+ (("jpg" "jpeg") 'jpeg))
+ for type = (if (and imgtype
+ (memq image-dired-thumbnail-storage
+  '(standard standard-large)))
+'png
+  imgtype)
  if type collect
  (let ((thumbnail (plist-get
(cdr 
(helm-ff--image-dired-get-thumbnail-image img))



[nongnu] elpa/helm ed071b797b 3/3: Add command to clear helm-ff-image-dired-thumbnails-cache

2022-10-02 Thread ELPA Syncer
branch: elpa/helm
commit ed071b797bd287733b46ec17799ce6e8d255eef4
Author: Thierry Volpiatto 
Commit: Thierry Volpiatto 

Add command to clear helm-ff-image-dired-thumbnails-cache
---
 helm-files.el | 9 +
 1 file changed, 9 insertions(+)

diff --git a/helm-files.el b/helm-files.el
index 4e64cba58f..3473e48ee8 100644
--- a/helm-files.el
+++ b/helm-files.el
@@ -4920,6 +4920,15 @@ Special commands:
   "\\`[[:multibyte:] ]*" "" (helm-get-selection 
nil t)
 (put 'helm-ff-toggle-thumbnails 'no-helm-mx t)
 
+;;;###autoload
+(defun helm-ff-clear-image-dired-thumbnails-cache ()
+  "Clear `helm-ff-image-dired-thumbnails-cache'.
+You may want to do this after customizing
+`image-dired-thumbnail-storage' which may change the place where
+thumbnail files are stored."
+  (interactive)
+  (clrhash helm-ff-image-dired-thumbnails-cache))
+
 ;;;###autoload
 (defun helm-ff-cleanup-image-dired-dir-and-cache ()
   "Cleanup `image-dired-dir' directory.



[nongnu] elpa/helm-core updated (1238115b0c -> ed071b797b)

2022-10-02 Thread ELPA Syncer
elpasync pushed a change to branch elpa/helm-core.

  from  1238115b0c Allow forcing creation of thumnails with a prefarg
  adds  61e5f753c6 Revert "Allow forcing creation of thumnails with a 
prefarg"
  adds  5e2a40262f Fix thumnails display with image-dired-thumbnail-storage 
standard
  adds  ed071b797b Add command to clear helm-ff-image-dired-thumbnails-cache

No new revisions were added by this update.

Summary of changes:
 helm-files.el | 23 ++-
 1 file changed, 18 insertions(+), 5 deletions(-)