[elpa] externals/ement 03d411a177: Add: SSO support

2023-05-30 Thread ELPA Syncer
branch: externals/ement
commit 03d411a1778179dd1b68b404059e84508a2c1fd8
Author: Adam Porter 
Commit: Adam Porter 

Add: SSO support

Closes .

Co-developed-by: Jeffrey Stoffers 
---
 README.org |   3 ++
 ement.el   | 164 +++--
 2 files changed, 107 insertions(+), 60 deletions(-)

diff --git a/README.org b/README.org
index 6397dbcdc6..1570f19c08 100644
--- a/README.org
+++ b/README.org
@@ -298,6 +298,9 @@ Note that, while ~matrix-client~ remains usable, and 
probably will for some time
 
 ** 0.10-pre
 
+*Additions*
++ Support for Single Sign-On (SSO) authentication.  
([[https://github.com/alphapapa/ement.el/issues/24][#24]].  Thanks to 
[[https://github.com/Necronian][Jeffrey Stoffers]] for development, and to 
[[https://github.com/phil-s][Phil Sainty]], [[https://github.com/FrostyX][Jakub 
Kadlčík]], and [[https://github.com/oneingan][Juanjo Presa]] for testing.)
+
 *Changes*
 
 + Activating a space in the room list uses ~ement-view-space~ (which shows a 
directory of rooms in the space) instead of ~ement-view-room~ (which shows 
events in the space, which is generally not useful).
diff --git a/ement.el b/ement.el
index aed01dfd13..10b958021b 100644
--- a/ement.el
+++ b/ement.el
@@ -184,6 +184,11 @@ handled (e.g. how to be notified)."
   :type 'hook
   :options '(ement-interrupted-sync-message ement-interrupted-sync-warning))
 
+(defcustom ement-sso-server-port 4567
+  "TCP port used for local HTTP server for SSO logins.
+It shouldn't usually be necessary to change this."
+  :type 'integer)
+
  Commands
 
 ;;;###autoload
@@ -205,8 +210,7 @@ the port, e.g.
   \"http://localhost:8080\"";
   (interactive (if current-prefix-arg
;; Force new session.
-   (list :user-id (read-string "User ID: ")
- :password (read-passwd "Password: "))
+   (list :user-id (read-string "User ID: "))
  ;; Use known session.
  (unless ement-sessions
;; Read sessions from disk.
@@ -215,66 +219,106 @@ the port, e.g.
  (error (display-warning 'ement (format "Unable to read 
session data from disk (%s).  Prompting to log in again."
 
(error-message-string err))
  (cl-case (length ement-sessions)
-   (0 (list :user-id (read-string "User ID: ")
-:password (read-passwd "Password: ")))
+   (0 (list :user-id (read-string "User ID: ")))
(1 (list :session (cdar ement-sessions)))
(otherwise (list :session (ement-complete-session))
-  (cl-labels ((new-session
-   () (unless (string-match (rx bos "@" (group (1+ (not (any 
":" ; Username
-":" (group (optional (1+ (not (any 
blank)) ; Server name
-user-id)
-(user-error "Invalid user ID format: use 
@USERNAME:SERVER"))
-   (let* ((username (match-string 1 user-id))
-  (server-name (match-string 2 user-id))
-  (uri-prefix (or uri-prefix (ement--hostname-uri 
server-name)))
-  (user (make-ement-user :id user-id :username username))
-  (server (make-ement-server :name server-name :uri-prefix 
uri-prefix))
-  (transaction-id (ement--initial-transaction-id))
-  (initial-device-display-name (format "Ement.el: %s@%s"
-   ;; Just to be extra 
careful:
-   (or user-login-name 
"[unknown user-login-name]")
-   (or (system-name) 
"[unknown system-name]")))
-  (device-id (secure-hash 'sha256 
initial-device-display-name)))
- (make-ement-session :user user :server server :transaction-id 
transaction-id
- :device-id device-id 
:initial-device-display-name initial-device-display-name
- :events (make-hash-table :test #'equal
-  (password-login
-   () (pcase-let* (((cl-struct ement-session user device-id 
initial-device-display-name) session)
-   ((cl-struct ement-user id) user)
-   (data (ement-alist "type" "m.login.password"
-  "identifier"
-  (ement-alist "type" 
"m.id.user"
-   "user" id)
-  "password" password
-

[elpa] externals/modus-themes b4ef90bb95: Update to version 4.2.0

2023-05-30 Thread ELPA Syncer
branch: externals/modus-themes
commit b4ef90bb950b820a3bf316d7b212320a5b2f84d7
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Update to version 4.2.0
---
 CHANGELOG.org | 330 +-
 doc/modus-themes.info | 269 
 doc/modus-themes.org  |  42 +++
 modus-themes.el   |   2 +-
 4 files changed, 475 insertions(+), 168 deletions(-)

diff --git a/CHANGELOG.org b/CHANGELOG.org
index df2325a1aa..805599b748 100644
--- a/CHANGELOG.org
+++ b/CHANGELOG.org
@@ -15,6 +15,326 @@ For further details, please consult these additional 
resources:
 + Manual :: 
 + Screenshots :: 
 
+* 4.2.0
+:PROPERTIES:
+:CUSTOM_ID: h:29370d83-23c4-415b-afbf-ad85d4296c86
+:END:
+
+** I won a Google award for the Modus themes
+:PROPERTIES:
+:CUSTOM_ID: h:1ffc8660-511d-4fa8-aff4-11da8246a186
+:END:
+
+Report here: .
+
+This is not a "change" per se, but it is worth documenting here.  It
+shows how important accessibility can be in empowering people to use
+their computer and, in our case, to exercise their software freedoms.
+
+The Modus themes tend to one aspect of accessibility.  They do not
+exhaust the topic, though they should at least raise awareness about
+the significance of tending to the usability needs of everyone.  The
+effort I put into documenting the themes (and my other packages)
+should be understood in this light as a means of helping people enjoy
+their software freedom by learning how to use and extend the program
+in question.
+
+** New tritanopia-optimised themes
+:PROPERTIES:
+:CUSTOM_ID: h:b92706b0-9d53-4015-8916-9db3c0c87068
+:END:
+
+I have created a pair of light and dark themes that are intended for
+people with blue-yellow colour deficiency (tritanopia).  These are
+~modus-operandi-tritanopia~ (light) and ~modus-vivendi-tritanopia~
+(dark).  Screenshots of all the Modus themes are available on my
+website: .
+
+The entire collection is now described in the manual as follows:
+
+#+begin_quote
+The Modus themes consist of eight themes, divided into four subgroups.
+
+- Main themes :: ~modus-operandi~ is the project's main light theme,
+  while ~modus-vivendi~ is its dark counterpart.  These two themes are
+  part of the project since its inception.  They are designed to cover
+  a broad range of needs and are, in the opinion of the author, the
+  reference for what a highly legible "default" theme should look
+  like.
+
+- Tinted themes :: ~modus-operandi-tinted~ and ~modus-vivendi-tinted~
+  are variants of the two main themes.  They slightly tone down the
+  intensity of the background and provide a bit more color variety.
+  ~modus-operandi-tinted~ has a set of base tones that are shades of
+  light ochre (earthly colors), while ~modus-vivendi-tinted~ gives a
+  night sky impression.
+
+- Deuteranopia themes :: ~modus-operandi-deuteranopia~ and its
+  companion ~modus-vivendi-deuteranopia~ are optimized for users with
+  red-green color deficiency.  This means that they do not use red and
+  green hues for color-coding purposes, such as for diff removed and
+  added lines.  Instead, they implement colors that are discernible by
+  users with deueteranopia or deuteranomaly (mostly yellow and blue
+  hues).
+
+- Tritanopia themes :: ~modus-operandi-tritanopia~ and its counterpart
+  ~modus-vivendi-tritanopia~ are optimized for users with blue-yellow
+  color deficiency.  The idea is the same as with the deuteranopia
+  variants: color coding relies only on hues that are accessible to
+  people with tritanopia or tritanomaly, namely, shades of red and
+  cyan.
+#+end_quote
+
+** Recalibrated the "graph" colours in all themes
+:PROPERTIES:
+:CUSTOM_ID: h:60bb2797-2db6-4d47-9d27-7d1f32291707
+:END:
+
+The new palette subset improves the contrast of all the relevant
+colours when presented side-by-side.  These are most notably used by
+the ~org-habit~ consistency graph, which is displayed in the Org
+agenda.  The deuteranopia and tritanopia themes have their own bespoke
+colours for this purpose, due to their specific requirements for
+colour coding (e.g. they cannot use green).
+
+** Faces or face groups
+:PROPERTIES:
+:CUSTOM_ID: h:4b68159e-d998-4781-b202-74a3dcc8ae8e
+:END:
+
+- Introduced a subtle 3D effect for clickable buttons, replacing the
+  previous 2D design.  I realised the flat style creates ambiguity
+  between the button and the text fields.  This happens, for example,
+  with =M-x customize-variable= for ~org-capture-templates~ which has
+  lots of button and text field combinations.  The added sense of
+  depth helps with the usability of these buttons because it makes
+  them unambiguous.  Personally, I prefer the 2D approach, but here we
+  have a trade-off between usability and 

[elpa] externals/plz a0a6d62335: Fix: (plz--sentinel) Skip HTTP redirect headers

2023-05-30 Thread ELPA Syncer
branch: externals/plz
commit a0a6d623352aa1caee722c16649190611a253cbc
Author: Adam Porter 
Commit: Adam Porter 

Fix: (plz--sentinel) Skip HTTP redirect headers

When using ":as 'response", we call curl with "--dump-header -" so we
can parse the headers of the response, but this causes curl to dump
the headers of any intermediate HTTP redirect responses as well, so
now we skip those headers.
---
 README.org|  1 +
 plz.el| 10 ++
 plz.info  | 29 +++--
 tests/test-plz.el | 22 ++
 4 files changed, 48 insertions(+), 14 deletions(-)

diff --git a/README.org b/README.org
index 2a486f0806..01f2faa1e6 100644
--- a/README.org
+++ b/README.org
@@ -184,6 +184,7 @@ You may also clear a queue with ~plz-clear~, which cancels 
any active or queued
 
 *Fixes*
 + Function ~plz~'s docstring now mentions that the ~:body~ argument may also 
be a buffer (an intentional feature that was accidentally undocumented).
++ Handle HTTP 301 redirects when using ~:as 'response~.
 
 ** 0.5.4
 
diff --git a/plz.el b/plz.el
index c66f486e89..f746d6a45e 100644
--- a/plz.el
+++ b/plz.el
@@ -686,6 +686,7 @@ node `(elisp) Sentinels').  Kills the buffer before 
returning."
  ;; Curl exited normally: check HTTP status code.
  (goto-char (point-min))
  (plz--skip-proxy-headers)
+ (while (plz--skip-redirect-headers))
  (pcase (plz--http-status)
((and status (guard (<= 200 status 299)))
 ;; Any 2xx response is considered successful.
@@ -741,6 +742,15 @@ node `(elisp) Sentinels').  Kills the buffer before 
returning."
 (unless (re-search-forward "\r\n\r\n" nil t)
   (signal 'plz-http-error '("plz--response: End of proxy headers not 
found")))
 
+(defun plz--skip-redirect-headers ()
+  "Skip HTTP redirect headers in current buffer."
+  (when (and (looking-at plz-http-response-status-line-regexp)
+ (member (string-to-number (match-string 2)) '(301 302 307 308)))
+;; Skip redirect headers ("--dump-header" forces redirect headers to be 
included
+;; even when used with "--location").
+(unless (re-search-forward "\r\n\r\n" nil t)
+  (signal 'plz-http-error '("plz--response: End of redirect headers not 
found")
+
 (cl-defun plz--response (&key (decode-p t))
   "Return response structure for HTTP response in current buffer.
 When DECODE-P is non-nil, decode the response body automatically
diff --git a/plz.info b/plz.info
index 357e1c98a9..188f54f350 100644
--- a/plz.info
+++ b/plz.info
@@ -307,6 +307,7 @@ File: README.info,  Node: 06-pre,  Next: 054,  Up: Changelog
• Function ‘plz’’s docstring now mentions that the ‘:body’ argument
  may also be a buffer (an intentional feature that was accidentally
  undocumented).
+   • Handle HTTP 301 redirects when using ‘:as 'response’.
 
 
 File: README.info,  Node: 054,  Next: 053,  Prev: 06-pre,  Up: Changelog
@@ -493,20 +494,20 @@ Node: Queueing6848
 Node: Tips8106
 Node: Changelog8407
 Node: 06-pre8665
-Node: 0549212
-Node: 0539459
-Node: 0529775
-Node: 0519982
-Node: 0510234
-Node: 0410440
-Node: 0311346
-Node: 02111794
-Node: 0211943
-Node: 0112074
-Node: Credits12170
-Node: Development12536
-Node: Copyright assignment13050
-Node: License13638
+Node: 0549277
+Node: 0539524
+Node: 0529840
+Node: 05110047
+Node: 0510299
+Node: 0410505
+Node: 0311411
+Node: 02111859
+Node: 0212008
+Node: 0112139
+Node: Credits12235
+Node: Development12601
+Node: Copyright assignment13115
+Node: License13703
 
 End Tag Table
 
diff --git a/tests/test-plz.el b/tests/test-plz.el
index f78f6e4417..5c3facc9ed 100644
--- a/tests/test-plz.el
+++ b/tests/test-plz.el
@@ -352,6 +352,28 @@
 (plz-deftest plz-500-errors ()
   (should-error (plz 'get "https://httpbin.org/status/500";)))
 
+; Redirects
+
+(plz-deftest plz-301-redirects ()
+  (plz-test-get-response
+   (plz 'get 
"https://httpbin.org/redirect-to?url=https%3A%2F%2Fhttpbin.org/get&status_code=301";
+ :as 'response :then 'sync)))
+
+(plz-deftest plz-302-redirects ()
+  (plz-test-get-response
+   (plz 'get 
"https://httpbin.org/redirect-to?url=https%3A%2F%2Fhttpbin.org/get&status_code=302";
+ :as 'response :then 'sync)))
+
+(plz-deftest plz-307-redirects ()
+  (plz-test-get-response
+   (plz 'get 
"https://httpbin.org/redirect-to?url=https%3A%2F%2Fhttpbin.org/get&status_code=307";
+ :as 'response :then 'sync)))
+
+(plz-deftest plz-308-redirects ()
+  (plz-test-get-response
+   (plz 'get 
"https://httpbin.org/redirect-to?url=https%3A%2F%2Fhttpbin.org/get&status_code=308";
+ :as 'response :then 'sync)))
+
 ; Errors
 
 (plz-deftest plz-get-curl-error nil



[elpa] externals/tramp fc8bfababd: Tramp ELPA version 2.6.0.5 released

2023-05-30 Thread ELPA Syncer
branch: externals/tramp
commit fc8bfababd07ac9fa1e338782a16ffb1f756ae04
Author: Michael Albinus 
Commit: Michael Albinus 

Tramp ELPA version 2.6.0.5 released
---
 README  |  4 +--
 test/tramp-tests.el | 82 +
 texi/trampver.texi  |  2 +-
 tramp-compat.el |  1 +
 tramp-crypt.el  |  7 -
 tramp-fuse.el   |  7 +++--
 tramp-sh.el | 63 
 tramp-smb.el| 10 ---
 tramp.el| 78 +-
 trampver.el |  6 ++--
 10 files changed, 140 insertions(+), 120 deletions(-)

diff --git a/README b/README
index e1588106e1..c8a52d9a71 100644
--- a/README
+++ b/README
@@ -22,11 +22,11 @@ installed with, you must recompile the package:
 
• Remove all byte-compiled Tramp files
 
-  $ rm -f ~/.emacs.d/elpa/tramp-2.6.0.4/tramp*.elc
+  $ rm -f ~/.emacs.d/elpa/tramp-2.6.0.5/tramp*.elc
 
• Start Emacs with Tramp’s source files
 
-  $ emacs -L ~/.emacs.d/elpa/tramp-2.6.0.4 -l tramp
+  $ emacs -L ~/.emacs.d/elpa/tramp-2.6.0.5 -l tramp
 
  This should not give you the error.
 
diff --git a/test/tramp-tests.el b/test/tramp-tests.el
index 396adaa95b..c956e54c0c 100644
--- a/test/tramp-tests.el
+++ b/test/tramp-tests.el
@@ -66,7 +66,6 @@
 (defvar ange-ftp-make-backup-files)
 (defvar tramp-connection-properties)
 (defvar tramp-copy-size-limit)
-(defvar tramp-display-escape-sequence-regexp)
 (defvar tramp-fuse-remove-hidden-files)
 (defvar tramp-fuse-unmount-on-cleanup)
 (defvar tramp-inline-compress-start-size)
@@ -4725,7 +4724,7 @@ This tests also `make-symbolic-link', `file-truename' and 
`add-name-to-file'."
  tramp-prefix-format hop
  (substring-no-properties
  method 0 (min 2 (length method
-  ,(concat tramp-prefix-format method-string)
+  ,(concat tramp-prefix-format hop method-string)
   ,method-string)))
  ;; Complete user name.
  (unless (tramp-string-empty-or-nil-p user)
@@ -4734,7 +4733,7 @@ This tests also `make-symbolic-link', `file-truename' and 
`add-name-to-file'."
  (substring-no-properties
  user 0 (min 2 (length user
   ,(concat
- tramp-prefix-format method-string user-string)
+ tramp-prefix-format hop method-string user-string)
   ,user-string)))
  ;; Complete host name.
  (unless (tramp-string-empty-or-nil-p host)
@@ -4744,9 +4743,9 @@ This tests also `make-symbolic-link', `file-truename' and 
`add-name-to-file'."
 (substring-no-properties
  host 0 (min 2 (length host
   (,(concat
- tramp-prefix-format method-string host-string)
+ tramp-prefix-format hop method-string host-string)
,(concat
- tramp-prefix-format method-string
+ tramp-prefix-format hop method-string
  user-string host-string))
   ,host-string)))
  ;; Complete user and host name.
@@ -4758,7 +4757,7 @@ This tests also `make-symbolic-link', `file-truename' and 
`add-name-to-file'."
 (substring-no-properties
  host 0 (min 2 (length host
   ,(concat
- tramp-prefix-format method-string
+ tramp-prefix-format hop method-string
 user-string host-string)
   ,host-string)
 
@@ -4916,8 +4915,7 @@ This tests also `make-symbolic-link', `file-truename' and 
`add-name-to-file'."
(if (bufferp destination) destination (current-buffer))
  ;; "ls" could produce colorized output.
  (goto-char (point-min))
- (while (re-search-forward
- tramp-display-escape-sequence-regexp nil t)
+ (while (re-search-forward ansi-color-control-seq-regexp nil t)
(replace-match "" nil nil))
  (should
   (string-equal (if destination (format "%s\n" fnnd) "")
@@ -4931,8 +4929,7 @@ This tests also `make-symbolic-link', `file-truename' and 
`add-name-to-file'."
(if (bufferp destination) destination (current-buffer))
  ;; "ls" could produce colorized output.
  (goto-char (point-min))
- (while (re-search-forward
- tramp-display-escape-seq

[elpa] externals/plz 4114e23d88: Fix: (plz--skip-redirect-headers)

2023-05-30 Thread ELPA Syncer
branch: externals/plz
commit 4114e23d88626a34c1189d48a63442f26472554d
Author: Adam Porter 
Commit: Adam Porter 

Fix: (plz--skip-redirect-headers)

Thanks to Phil Sainty's (@phil-s) comment:
.
---
 plz.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/plz.el b/plz.el
index f746d6a45e..07b343539a 100644
--- a/plz.el
+++ b/plz.el
@@ -748,8 +748,8 @@ node `(elisp) Sentinels').  Kills the buffer before 
returning."
  (member (string-to-number (match-string 2)) '(301 302 307 308)))
 ;; Skip redirect headers ("--dump-header" forces redirect headers to be 
included
 ;; even when used with "--location").
-(unless (re-search-forward "\r\n\r\n" nil t)
-  (signal 'plz-http-error '("plz--response: End of redirect headers not 
found")
+(or (re-search-forward "\r\n\r\n" nil t)
+(signal 'plz-http-error '("plz--response: End of redirect headers not 
found")
 
 (cl-defun plz--response (&key (decode-p t))
   "Return response structure for HTTP response in current buffer.



[nongnu] elpa/evil be736b8dbc: Support p and # ex-substitute flags

2023-05-30 Thread ELPA Syncer
branch: elpa/evil
commit be736b8dbc468d53e6cb3e76db66c1141330b030
Author: Tom Dalziel 
Commit: Tom Dalziel <33435574+tomd...@users.noreply.github.com>

Support p and # ex-substitute flags
---
 evil-commands.el | 25 +
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/evil-commands.el b/evil-commands.el
index 6ad0073479..2bcf08593a 100644
--- a/evil-commands.el
+++ b/evil-commands.el
@@ -3854,6 +3854,25 @@ reveal.el. OPEN-SPOTS is a local version of 
`reveal-open-spots'."
 ;; Remove the overlay from the list of open spots.
 (overlay-put ol 'reveal-invisible nil)
 
+(defun evil--ex-substitute-final-message (nreplaced flags)
+  "Display message according to replacements and flags.
+If FLAGS contains `p' or `#' and NREPLACED is more than 0, print the last line
+to the echo area.  Otherwise, print the number of replacements made or found."
+  (let ((replaced-any (< 0 nreplaced)))
+(cond
+ ((and replaced-any (memq ?p flags))
+  (message "%s" (buffer-substring (line-beginning-position)
+  (line-end-position
+ ((and replaced-any (memq ?# flags))
+  (message "%s %s" (propertize (number-to-string (line-number-at-pos))
+   'face 'line-number-current-line)
+   (buffer-substring (line-beginning-position)
+ (line-end-position
+ (t (message "%s %d occurrence%s"
+ (if (memq ?n flags) "Found" "Replaced")
+ nreplaced
+ (if (/= nreplaced 1) "s" ""))
+
 (evil-define-operator evil-ex-substitute
   (beg end pattern replacement flags)
   "The Ex substitute command.
@@ -3989,10 +4008,8 @@ reveal.el. OPEN-SPOTS is a local version of 
`reveal-open-spots'."
   (when use-reveal
 (evil-revert-reveal reveal-open-spots)))
 
-(message "%s %d occurrence%s"
- (if count-only "Found" "Replaced")
- nreplaced
- (if (/= nreplaced 1) "s" ""))
+(evil--ex-substitute-final-message nreplaced flags)
+
 (if (and (= 0 nreplaced) evil-ex-point)
 (goto-char evil-ex-point)
   (evil-first-non-blank



[nongnu] elpa/spacemacs-theme 319ad1cd6a: support goggles

2023-05-30 Thread ELPA Syncer
branch: elpa/spacemacs-theme
commit 319ad1cd6aa05dcb43e4edca50eca339892e0865
Author: nashamri 
Commit: nashamri 

support goggles
---
 spacemacs-theme.el | 5 +
 1 file changed, 5 insertions(+)

diff --git a/spacemacs-theme.el b/spacemacs-theme.el
index 2ad99e1e02..7bfdf40de4 100644
--- a/spacemacs-theme.el
+++ b/spacemacs-theme.el
@@ -513,6 +513,11 @@ to 'auto, tags may not be properly aligned. "
  `(gnus-header-subject ((,class (:foreground ,func :inherit bold
  `(gnus-summary-cancelled ((,class (:background ,war :foreground ,bg1
 
+; goggles
+ `(goggles-added ((,class (:background ,green-bg-s
+ `(goggles-changed ((,class (:background ,blue-bg-s
+ `(goggles-removed ((,class (:background ,red-bg-s
+
 ; guide-key
  `(guide-key/highlight-command-face ((,class (:foreground ,base
  `(guide-key/key-face ((,class (:foreground ,keyword



[nongnu] elpa/sweeprolog 0bb2a103bb 1/2: ADDED: command for inserting example usage comments

2023-05-30 Thread ELPA Syncer
branch: elpa/sweeprolog
commit 0bb2a103bb5e279024fe385702484eb92bd35cb6
Author: Eshel Yaron 
Commit: Eshel Yaron 

ADDED: command for inserting example usage comments

* sweeprolog.el (sweeprolog-top-level-example-mode): New minor mode.
(sweeprolog-make-example-usage-comment): New command.
(sweeprolog-mode-map): Bind it.

* README.org (Example Usage Comments): New section.
---
 README.org| 36 +++
 sweeprolog.el | 79 +++
 2 files changed, 115 insertions(+)

diff --git a/README.org b/README.org
index 286463297a..6d43662cd5 100644
--- a/README.org
+++ b/README.org
@@ -1511,6 +1511,42 @@ documented in [[info:emacs#Text][Commands for Human 
Languages]], which see.
 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]].
 
+** Example Usage Comments
+:PROPERTIES:
+:CUSTOM_ID: usage-comments
+:DESCRIPTION: Commands for inserting comments that show example usage of your 
code
+:ALT_TITLE: Usage Comments
+:END:
+
+Beyond documenting your code with =PlDoc= comments as described in
+[[#sweeprolog-pldoc][Documenting Predicates]], you might want to have comments 
in your source
+code that shows example usage of some predicate.  Creating such
+comments usually involves posting queries in a Prolog top-level,
+copying the queries and their results into the relevant source code
+buffer, and formatting them as comments.  Sweep provides the following
+command to streamline this process:
+
+#+FINDEX: sweeprolog-make-example-usage-comment
+- Key: C-c C-% (sweeprolog-make-example-usage-comment) :: Start a
+  new top-level for recording example usage.  When you finish
+  interacting with the top-level its contents are formatted as a
+  comment in the buffer and position where you invoked this command.
+
+The command ~sweeprolog-make-example-usage-comment~, bound to ~C-c
+C-%~ in ~sweeprolog-mode~ buffers, creates and switches to a new
+top-level buffer for recording example usage that you want to
+demonstrate.  The /example usage top-level/ is a regular top-level
+buffer (see [[*The Prolog Top-Level][The Prolog Top-Level]]), except that it's 
tied to the
+specific position in the source buffer where you invoke this command.
+You can post queries in the example usage top-level and edit it
+freely, then type ~C-c C-q~ in to quit the top-level buffer and format
+its contents as a comment in the source buffer.
+
+You can have multiple example usage top-levels for different parts of
+your code at the same time.  To display the source position where you
+created a certain usage example top-level buffer by, type ~C-c C-b~ in
+that buffer.
+
 ** Displaying Predicate Documentation
 :PROPERTIES:
 :CUSTOM_ID: eldoc-integration
diff --git a/sweeprolog.el b/sweeprolog.el
index c90c30da06..240d26404f 100644
--- a/sweeprolog.el
+++ b/sweeprolog.el
@@ -448,6 +448,7 @@ use `autoload/2' for all added directives."
 #'sweeprolog-show-diagnostics
   #'flymake-show-diagnostics-buffer))
 (define-key map (kbd "C-c C-&") #'sweeprolog-async-goal)
+(define-key map (kbd "C-c C-%") #'sweeprolog-make-example-usage-comment)
 (define-key map (kbd "C-c C--") #'sweeprolog-decrement-numbered-variables)
 (define-key map (kbd "C-c C-+") #'sweeprolog-increment-numbered-variables)
 (define-key map (kbd "C-M-^")   #'kill-backward-up-list)
@@ -518,6 +519,13 @@ use `autoload/2' for all added directives."
 map)
   "Keymap for moving to next hole with TAB.")
 
+(defvar sweeprolog-top-level-example-mode-map
+  (let ((map (make-sparse-keymap)))
+(define-key map (kbd "C-c C-b") 
#'sweeprolog-top-level-example-display-source)
+(define-key map (kbd "C-c C-q") #'sweeprolog-top-level-example-done)
+map)
+  "Keymap for example top-level buffer.")
+
  Menu bar
 
 (easy-menu-define sweeprolog-menu (list sweeprolog-mode-map
@@ -605,6 +613,8 @@ use `autoload/2' for all added directives."
 (defvar-local sweeprolog-top-level-thread-id nil
   "Prolog top-level thread ID corresponding to this buffer.")
 
+(defvar-local sweeprolog-top-level-example-marker nil)
+
 (defvar-local sweeprolog--buffer-last-modified-time nil)
 
 (defvar-local sweeprolog--buffer-modified nil)
@@ -6433,6 +6443,75 @@ Return nil if POS is not the beginning of a macro 
invocation."
   (unless (sweeprolog-expand-macro-at-pos point)
 (user-error "No macro invocation at point")))
 
+(define-minor-mode sweeprolog-top-level-example-mode
+  "Minor mode for example top-level sessions.
+This mode is enabled in top-level buffers created by
+\\[sweeprolog-make-example-usage-comment]."
+  :lighter " Example"
+  :group 'sweeprolog)
+
+(defun sweeprolog-top-level-example-display-source ()
+  "Pop to the source position where this example session was started.
+This is the position where
+`sweeprolog-make-example-

[nongnu] elpa/sweeprolog updated (bdf3429fe1 -> 390b76c4c6)

2023-05-30 Thread ELPA Syncer
elpasync pushed a change to branch elpa/sweeprolog.

  from  bdf3429fe1 Announce recent changes in NEWS.org and bump version to 
0.18.1
   new  0bb2a103bb ADDED: command for inserting example usage comments
   new  390b76c4c6 Announce recent changes in NEWS.org and bump version to 
0.18.2


Summary of changes:
 NEWS.org  |  9 +++
 README.org| 36 ++
 sweeprolog.el | 81 ++-
 3 files changed, 125 insertions(+), 1 deletion(-)



[nongnu] elpa/sweeprolog 390b76c4c6 2/2: Announce recent changes in NEWS.org and bump version to 0.18.2

2023-05-30 Thread ELPA Syncer
branch: elpa/sweeprolog
commit 390b76c4c6c5f20e502e59ed817ab1ee0f951455
Author: Eshel Yaron 
Commit: Eshel Yaron 

Announce recent changes in NEWS.org and bump version to 0.18.2
---
 NEWS.org  | 9 +
 sweeprolog.el | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/NEWS.org b/NEWS.org
index 483e70dca8..0bae0248ca 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -11,6 +11,15 @@ SWI-Prolog in Emacs.
 For further details, please consult the manual:
 [[https://eshelyaron.com/sweep.html][https://eshelyaron.com/sweep.html]].
 
+* Version 0.18.2 on 2023-05-30
+
+** New command ~sweeprolog-make-example-usage-comment~
+
+This command, bound to ~C-c C-%~ in ~sweeprolog-mode~ buffers, lets
+you capture and insert top-level interaction logs demonstrating your
+code's usage as source code comments.  See the new "Example Usage
+Comments" in the manual for more details.
+
 * Version 0.18.1 on 2023-05-26
 
 ** Support for SWI-Prolog's new macros mechanism
diff --git a/sweeprolog.el b/sweeprolog.el
index 240d26404f..2ac05503e4 100644
--- a/sweeprolog.el
+++ b/sweeprolog.el
@@ -6,7 +6,7 @@
 ;; Maintainer: Eshel Yaron <~eshel/d...@lists.sr.ht>
 ;; Keywords: prolog languages extensions
 ;; URL: https://git.sr.ht/~eshel/sweep
-;; Package-Version: 0.18.1
+;; Package-Version: 0.18.2
 ;; Package-Requires: ((emacs "28.1"))
 
 ;; This file is NOT part of GNU Emacs.



[nongnu] elpa/devil 2925d977fe: Fix definition of special key ", "

2023-05-30 Thread ELPA Syncer
branch: elpa/devil
commit 2925d977feaaf5ae1520aeba70be1e4d34884c73
Author: Susam Pal 
Commit: Susam Pal 

Fix definition of special key ", "

Commit 60f6968 broke the invocation of special key `, RET` which is
meant to insert comma followed by newline. Prior to that commit,
typing `, ` produced the Devil key sequence `, RET` which was
defined as a special key. However with that commit, typing `, `
now produces the Devil key sequence `, `.  Therefore, the
special key definition needs to be updated from `, RET` to `, `.
---
 CHANGES.org | 5 +
 devil.el| 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/CHANGES.org b/CHANGES.org
index ae849f0bd6..b2414f69ff 100644
--- a/CHANGES.org
+++ b/CHANGES.org
@@ -16,6 +16,11 @@
 
 - Customising =devil-key= also updates the mode's keymap.
 
+*** Fixed
+
+- Fix special key sequence =, = which was broken by the
+  previous release of version 0.4.0.
+
 ** Version 0.4.0 (2023-05-27)
 :PROPERTIES:
 :CUSTOM_ID: 0.4.0
diff --git a/devil.el b/devil.el
index c47b9789e3..5380c24847 100644
--- a/devil.el
+++ b/devil.el
@@ -4,7 +4,7 @@
 
 ;; Author: Susam Pal 
 ;; Maintainer: Susam Pal 
-;; Version: 0.4.0
+;; Version: 0.5.0.pre1
 ;; Package-Requires: ((emacs "24.4"))
 ;; Keywords: convenience, abbrev
 ;; URL: https://github.com/susam/devil
@@ -113,7 +113,7 @@ activated using the given KEY-SEQUENCE."
 (defvar devil-special-keys
   (list (cons "%k %k" (lambda () (interactive) (devil-run-key "%k")))
 (cons "%k SPC" (lambda () (interactive) (devil-run-key "%k SPC")))
-(cons "%k RET" (lambda () (interactive) (devil-run-key "%k RET"
+(cons "%k " (lambda () (interactive) (devil-run-key "%k 
RET"
   "Special Devil keys that are executed as soon as they are typed.
 
 The value of this variable is an alist where each key represents