[elpa] externals-release/org df4a5d86d8: org-fold: Fix isearch when `org-fold-core-style' is 'overlays

2023-01-16 Thread ELPA Syncer
branch: externals-release/org
commit df4a5d86d8e483f8780e0af1274c4529a4cd967c
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

org-fold: Fix isearch when `org-fold-core-style' is 'overlays

* lisp/org-fold-core.el (org-fold-core--isearch-show): Make sure that
the actual isearch match is revealed.  This relies on undocumented
behavior of isearch that point is at the match when
'isearch-open-invisible is called.
(org-fold-core-region): Disable 'isearch-open-invisible-temporary
features when `org-fold-core-style' is 'overlays.  This is to work
around the undocumented requirement of isearch to _not_ delete the
overlay passed to 'isearch-open-invisible-temporary function.  Since
`org-fold-show-set-visibility' may destroy overlays arbitrarily, we
cannot currently support isearch `org-fold-show-context-detail' in
full.

Reported-by: Matt Lundin 
Link: https://orgmode.org/list/87zgb6tk6h.fsf@localhost
---
 lisp/org-fold-core.el | 21 ++---
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/lisp/org-fold-core.el b/lisp/org-fold-core.el
index 0855e6f39c..027ff92158 100644
--- a/lisp/org-fold-core.el
+++ b/lisp/org-fold-core.el
@@ -1003,7 +1003,13 @@ If SPEC-OR-ALIAS is omitted and FLAG is nil, unfold 
everything in the region."
(overlay-put o (org-fold-core--property-symbol-get-create 
spec) spec)
(overlay-put o 'invisible spec)
(overlay-put o 'isearch-open-invisible 
#'org-fold-core--isearch-show)
-   (overlay-put o 'isearch-open-invisible-temporary 
#'org-fold-core--isearch-show-temporary))
+   ;; FIXME: Disabling to work around Emacs bug#60399
+   ;; and https://orgmode.org/list/87zgb6tk6h.fsf@localhost.
+   ;; The proper fix will require making sure that
+   ;; `org-fold-core-isearch-open-function' does not
+   ;; delete the overlays used by isearch.
+   ;; (overlay-put o 'isearch-open-invisible-temporary 
#'org-fold-core--isearch-show-temporary)
+   )
   (put-text-property from to 
(org-fold-core--property-symbol-get-create spec) spec)
   (put-text-property from to 'isearch-open-invisible 
#'org-fold-core--isearch-show)
   (put-text-property from to 'isearch-open-invisible-temporary 
#'org-fold-core--isearch-show-temporary)
@@ -1131,16 +1137,9 @@ This function is intended to be used as 
`isearch-filter-predicate'."
   "Clear `org-fold-core--isearch-local-regions'."
   (clrhash org-fold-core--isearch-local-regions))
 
-(defun org-fold-core--isearch-show (region)
-  "Reveal text in REGION found by isearch.
-REGION can also be an overlay in current buffer."
-  (when (overlayp region)
-(setq region (cons (overlay-start region)
-   (overlay-end region
-  (org-with-point-at (car region)
-(while (< (point) (cdr region))
-  (funcall org-fold-core-isearch-open-function (car region))
-  (goto-char (org-fold-core-next-visibility-change (point) (cdr region) 
'ignore-hidden)
+(defun org-fold-core--isearch-show (_)
+  "Reveal text at point found by isearch."
+  (funcall org-fold-core-isearch-open-function (point)))
 
 (defun org-fold-core--isearch-show-temporary (region hide-p)
   "Temporarily reveal text in REGION.



[elpa] externals/org updated (25dd206a0e -> 889b8cc2fd)

2023-01-16 Thread ELPA Syncer
elpasync pushed a change to branch externals/org.

  from  25dd206a0e Merge branch 'bugfix'
   new  df4a5d86d8 org-fold: Fix isearch when `org-fold-core-style' is 
'overlays
   new  889b8cc2fd Merge branch 'bugfix'


Summary of changes:
 lisp/org-fold-core.el | 21 ++---
 1 file changed, 10 insertions(+), 11 deletions(-)



[elpa] externals/org 889b8cc2fd: Merge branch 'bugfix'

2023-01-16 Thread ELPA Syncer
branch: externals/org
commit 889b8cc2fd8ca6d7fc914697ee878d1d699c2faf
Merge: 25dd206a0e df4a5d86d8
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

Merge branch 'bugfix'
---
 lisp/org-fold-core.el | 21 ++---
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/lisp/org-fold-core.el b/lisp/org-fold-core.el
index cfbf74db47..027ff92158 100644
--- a/lisp/org-fold-core.el
+++ b/lisp/org-fold-core.el
@@ -1003,7 +1003,13 @@ If SPEC-OR-ALIAS is omitted and FLAG is nil, unfold 
everything in the region."
(overlay-put o (org-fold-core--property-symbol-get-create 
spec) spec)
(overlay-put o 'invisible spec)
(overlay-put o 'isearch-open-invisible 
#'org-fold-core--isearch-show)
-   (overlay-put o 'isearch-open-invisible-temporary 
#'org-fold-core--isearch-show-temporary))
+   ;; FIXME: Disabling to work around Emacs bug#60399
+   ;; and https://orgmode.org/list/87zgb6tk6h.fsf@localhost.
+   ;; The proper fix will require making sure that
+   ;; `org-fold-core-isearch-open-function' does not
+   ;; delete the overlays used by isearch.
+   ;; (overlay-put o 'isearch-open-invisible-temporary 
#'org-fold-core--isearch-show-temporary)
+   )
   (put-text-property from to 
(org-fold-core--property-symbol-get-create spec) spec)
   (put-text-property from to 'isearch-open-invisible 
#'org-fold-core--isearch-show)
   (put-text-property from to 'isearch-open-invisible-temporary 
#'org-fold-core--isearch-show-temporary)
@@ -1131,16 +1137,9 @@ This function is intended to be used as 
`isearch-filter-predicate'."
   "Clear `org-fold-core--isearch-local-regions'."
   (clrhash org-fold-core--isearch-local-regions))
 
-(defun org-fold-core--isearch-show (region)
-  "Reveal text in REGION found by isearch.
-REGION can also be an overlay in current buffer."
-  (when (overlayp region)
-(setq region (cons (overlay-start region)
-   (overlay-end region
-  (let ((pos (car region)))
-(while (< pos (cdr region))
-  (funcall org-fold-core-isearch-open-function (car region))
-  (setq pos (org-fold-core-next-visibility-change pos (cdr region) 
'ignore-hidden)
+(defun org-fold-core--isearch-show (_)
+  "Reveal text at point found by isearch."
+  (funcall org-fold-core-isearch-open-function (point)))
 
 (defun org-fold-core--isearch-show-temporary (region hide-p)
   "Temporarily reveal text in REGION.



[nongnu] elpa/doc-show-inline 3dcd1bab4a: Cleanup: reformat with updated elisp-autofmt

2023-01-16 Thread ELPA Syncer
branch: elpa/doc-show-inline
commit 3dcd1bab4afdefb8c85c92fd9d05157b51a0c258
Author: Campbell Barton 
Commit: Campbell Barton 

Cleanup: reformat with updated elisp-autofmt
---
 doc-show-inline.el | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/doc-show-inline.el b/doc-show-inline.el
index ccee4b0dde..afb80b8136 100644
--- a/doc-show-inline.el
+++ b/doc-show-inline.el
@@ -383,14 +383,12 @@ the point should not be moved by this function."
 (let* ((default-color (face-attribute 'default :background))
(default-tint
 (doc-show-inline--color-highlight
- default-color
- doc-show-inline-face-background-highlight)))
+ default-color doc-show-inline-face-background-highlight)))
   ;; Ensure there is some change, otherwise tint in the opposite direction.
   (when (equal default-color default-tint)
 (setq default-tint
   (doc-show-inline--color-highlight
-   default-color
-   (- doc-show-inline-face-background-highlight
+   default-color (- doc-show-inline-face-background-highlight
   (set-face-attribute 'doc-show-inline-face nil :background 
default-tint
 
 (defun doc-show-inline--overlays-remove (&optional pos-beg pos-end)
@@ -751,8 +749,7 @@ XREF-BACKEND is the back-end used to find this symbol."
(list
 :background
 (nth
- doc-show-inline--idle-overlays-debug-index
- doc-show-inline--idle-overlays-debug-colors)
+ doc-show-inline--idle-overlays-debug-index 
doc-show-inline--idle-overlays-debug-colors)
 :extend t)
 
 (defun doc-show-inline--timer-callback-or-disable (this-timer buf)
@@ -799,9 +796,7 @@ XREF-BACKEND is the back-end used to find this symbol."
 ;; ensuring it is only disabled on successful completion.
 ;; Pass a nil function here, set the function & arguments below.
 (run-with-idle-timer
- doc-show-inline-idle-delay
- t
- #'doc-show-inline--timer-callback-or-disable))
+ doc-show-inline-idle-delay t 
#'doc-show-inline--timer-callback-or-disable))
 
   (timer-set-function doc-show-inline--idle-timer 
#'doc-show-inline--timer-callback-or-disable
   (list



[nongnu] elpa/evil-numbers ee2c0279ea: Cleanup: reformat with updated elisp-autofmt

2023-01-16 Thread ELPA Syncer
branch: elpa/evil-numbers
commit ee2c0279ea3eaa84cf92cdd0c9527de4a5113b04
Author: Campbell Barton 
Commit: Campbell Barton 

Cleanup: reformat with updated elisp-autofmt
---
 evil-numbers.el | 47 +--
 1 file changed, 9 insertions(+), 38 deletions(-)

diff --git a/evil-numbers.el b/evil-numbers.el
index 9fd5ec85cb..59f3bdabb3 100644
--- a/evil-numbers.el
+++ b/evil-numbers.el
@@ -93,9 +93,7 @@
   :group 'convenience)
 
 (define-obsolete-variable-alias
-  'evil-numbers/padDefault
-  'evil-numbers-pad-default
-  "evil-numbers v0.6")
+  'evil-numbers/padDefault 'evil-numbers-pad-default "evil-numbers v0.6")
 
 (defcustom evil-numbers-pad-default nil
   "Whether numbers are padded by default."
@@ -282,21 +280,13 @@ LIMIT: Point which will not be stepped past."
   (and (eq
 1
 (evil-numbers--skip-chars-impl
- ch-sep-optional
- nil
- dir
- 1
- limit))
+ ch-sep-optional nil dir 1 limit))
(progn
  ;; Note counted towards 'skipped'
  ;; as this character is to be ignored entirely.
  (setq skipped-next
(evil-numbers--skip-chars-impl
-ch-skip
-nil
-dir
-ch-num
-limit))
+ch-skip nil dir ch-num limit))
  (unless (zerop skipped-next)
(setq point-next (point))
;; Found (apply `point-new').
@@ -351,22 +341,14 @@ Each item in MATCH-CHARS is a cons pair.
  ((integerp ch-num)
   (let ((skipped
  (evil-numbers--skip-chars-impl
-  ch-skip
-  ch-sep-optional
-  dir
-  ch-num
-  limit)))
+  ch-skip ch-sep-optional dir ch-num limit)))
 (when do-check
   (unless (eq skipped ch-num)
 (throw 'result nil)
  ((eq ch-num '+)
   (let ((skipped
  (evil-numbers--skip-chars-impl
-  ch-skip
-  ch-sep-optional
-  dir
-  most-positive-fixnum
-  limit)))
+  ch-skip ch-sep-optional dir most-positive-fixnum limit)))
 (when do-check
   (unless (>= skipped 1)
 (throw 'result nil)
@@ -375,11 +357,7 @@ Each item in MATCH-CHARS is a cons pair.
  ;; Skip these characters if they exist.
  ((eq ch-num '*)
   (evil-numbers--skip-chars-impl
-   ch-skip
-   ch-sep-optional
-   dir
-   most-positive-fixnum
-   limit))
+   ch-skip ch-sep-optional dir most-positive-fixnum limit))
  ((eq ch-num '\?)
   (evil-numbers--skip-chars-impl ch-skip ch-sep-optional dir 1 limit))
  (t
@@ -461,11 +439,7 @@ replacing it by the result of NUMBER-XFORM-FN and return 
non-nil."
  ;; Skip backwards (as needed), there may be no
  ;; characters to skip back, so don't check the result.
  (evil-numbers--match-from-skip-chars
-  match-chars
-  -1
-  beg
-  nil
-  nil)
+  match-chars -1 beg nil nil)
  ;; Skip forwards from the beginning, setting match data.
  (evil-numbers--match-from-skip-chars match-chars 1 end t t))
 
@@ -479,8 +453,7 @@ replacing it by the result of NUMBER-XFORM-FN and return 
non-nil."
  (str-prev
   (funcall decode-fn
(concat
-(match-string sign-group)
-(match-string num-group
+(match-string sign-group) (match-string num-group
 
  (str-prev-strip
   (cond
@@ -518,9 +491,7 @@ replacing it by the result of NUMBER-XFORM-FN and return 
non-nil."
   (unless (string-equal str-prev str-prev-strip)
 (setq str-next
   (evil-numbers--strip-chars-apply
-   str-prev
-   str-next
-   sep-char
+   str-prev str-next sep-char
 
 ;; Replace the sign (as needed).
 (cond



[nongnu] elpa/org-journal 2f220a06e3 2/2: Merge pull request #408 from mrvdb/issue406

2023-01-16 Thread ELPA Syncer
branch: elpa/org-journal
commit 2f220a06e3bf6bfa5cda00ebd44817a7b2fd7b76
Merge: c84f1a7719 7eae39adf2
Author: Bastian Bechtold 
Commit: GitHub 

Merge pull request #408 from mrvdb/issue406

Add note for issue #406 in README.org
---
 README.org | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/README.org b/README.org
index 931a61ee38..da3e938412 100644
--- a/README.org
+++ b/README.org
@@ -111,6 +111,8 @@ installation should be trivial:
 
 Then add =(require 'org-journal)= to your =.emacs=.
 
+*Note!* If you are using =org-mode= version 9.6 consider customizing the 
variable =org-element-use-cache= and setting it to =nil= to workaround 
[[https://github.com/bastibe/org-journal/issues/406][an issue where journal 
items are not properly carried over to the next day]]
+
 ** Quickstart
 
 Doing =M-x org-journal-new-entry= will immediately create a journal



[nongnu] elpa/org-journal 7eae39adf2 1/2: Add note for issue #406 in README.org

2023-01-16 Thread ELPA Syncer
branch: elpa/org-journal
commit 7eae39adf2585080c8848771b0d8d83516c350a0
Author: Marcel van der Boom 
Commit: Marcel van der Boom 

Add note for issue #406 in README.org
---
 README.org | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/README.org b/README.org
index 931a61ee38..da3e938412 100644
--- a/README.org
+++ b/README.org
@@ -111,6 +111,8 @@ installation should be trivial:
 
 Then add =(require 'org-journal)= to your =.emacs=.
 
+*Note!* If you are using =org-mode= version 9.6 consider customizing the 
variable =org-element-use-cache= and setting it to =nil= to workaround 
[[https://github.com/bastibe/org-journal/issues/406][an issue where journal 
items are not properly carried over to the next day]]
+
 ** Quickstart
 
 Doing =M-x org-journal-new-entry= will immediately create a journal



[nongnu] elpa/scroll-on-drag 8cab41b40b: Cleanup: reformat with updated elisp-autofmt

2023-01-16 Thread ELPA Syncer
branch: elpa/scroll-on-drag
commit 8cab41b40bc0216bad1bd6996257e444a88ca593
Author: Campbell Barton 
Commit: Campbell Barton 

Cleanup: reformat with updated elisp-autofmt
---
 scroll-on-drag.el | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/scroll-on-drag.el b/scroll-on-drag.el
index 307ef2bb8c..2df1bfca61 100644
--- a/scroll-on-drag.el
+++ b/scroll-on-drag.el
@@ -325,10 +325,7 @@ Returns true when scrolling took place, otherwise nil."
  ;; Smooth-Scrolling.
  (scroll-on-drag-smooth
   (scroll-on-drag--scroll-by-pixels
-   this-window
-   this-frame-char-height
-   delta-scaled
-   t)
+   this-window this-frame-char-height delta-scaled t)
   (when (>= (point) point-of-last-line)
 (set-window-vscroll this-window 0 t))
   (setq do-draw t))



[nongnu] elpa/undo-fu updated (d59bba01de -> 0e22308de8)

2023-01-16 Thread ELPA Syncer
elpasync pushed a change to branch elpa/undo-fu.

  from  d59bba01de Cleanup: add fill-column local variable
   new  3d1851522b Fix #17: correct undo limits in readme
   new  0e22308de8 Fix #17 correct limits (again)


Summary of changes:
 readme.rst | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)



[nongnu] elpa/undo-fu 0e22308de8 2/2: Fix #17 correct limits (again)

2023-01-16 Thread ELPA Syncer
branch: elpa/undo-fu
commit 0e22308de8337a9291ddd589edae167d458fbe77
Author: Campbell Barton 
Commit: Campbell Barton 

Fix #17 correct limits (again)
---
 readme.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/readme.rst b/readme.rst
index 8728fd61b9..89395e9f71 100644
--- a/readme.rst
+++ b/readme.rst
@@ -147,7 +147,7 @@ This example sets the limit to 64mb,
 
 .. code-block:: elisp
 
-   (setq undo-limit 671088640) ; 64mb.
+   (setq undo-limit 67108864) ; 64mb.
(setq undo-strong-limit 100663296) ; 96mb.
(setq undo-outer-limit 1006632960) ; 960mb.
 



[nongnu] elpa/undo-fu 3d1851522b 1/2: Fix #17: correct undo limits in readme

2023-01-16 Thread ELPA Syncer
branch: elpa/undo-fu
commit 3d1851522bc9958e8efdbbf87e7f3ec006bf4e41
Author: Campbell Barton 
Commit: Campbell Barton 

Fix #17: correct undo limits in readme
---
 readme.rst | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/readme.rst b/readme.rst
index 3c852c0dca..8728fd61b9 100644
--- a/readme.rst
+++ b/readme.rst
@@ -147,9 +147,9 @@ This example sets the limit to 64mb,
 
 .. code-block:: elisp
 
-   (setq undo-limit 6710886400) ;; 64mb.
-   (setq undo-strong-limit 100663296) ;; 96mb.
-   (setq undo-outer-limit 1006632960) ;; 960mb.
+   (setq undo-limit 671088640) ; 64mb.
+   (setq undo-strong-limit 100663296) ; 96mb.
+   (setq undo-outer-limit 1006632960) ; 960mb.
 
 
 Other Packages



[nongnu] elpa/undo-fu-session 26137114b1: Cleanup: reformat with updated elisp-autofmt

2023-01-16 Thread ELPA Syncer
branch: elpa/undo-fu-session
commit 26137114b1fa99c6370398a6586447b2e9132340
Author: Campbell Barton 
Commit: Campbell Barton 

Cleanup: reformat with updated elisp-autofmt
---
 undo-fu-session.el | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/undo-fu-session.el b/undo-fu-session.el
index 4497175fa7..4e32240142 100755
--- a/undo-fu-session.el
+++ b/undo-fu-session.el
@@ -511,9 +511,7 @@ Argument PENDING-LIST an `pending-undo-list' compatible 
list."
   (setq emacs-pending-undo-list (undo-fu-session--encode 
pending-undo-list))
   (setq emacs-undo-equiv-table
 (undo-fu-session--equivtable-encode
- undo-equiv-table
- buffer-undo-list
- pending-undo-list
+ undo-equiv-table buffer-undo-list pending-undo-list
 
 (setq content-header
   (list (cons 'buffer-size (buffer-size)) (cons 'buffer-checksum 
(sha1 buffer



[elpa] externals/compat 4c42b9c68c 3/4: Add test for directory-empty-p

2023-01-16 Thread ELPA Syncer
branch: externals/compat
commit 4c42b9c68c0aeea8c6da3b5ec8abc4b0352df6dd
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add test for directory-empty-p
---
 compat-28.el| 2 +-
 compat-tests.el | 9 +
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/compat-28.el b/compat-28.el
index 6aef33d8ce..29a7942155 100644
--- a/compat-28.el
+++ b/compat-28.el
@@ -546,7 +546,7 @@ See also `file-name-sans-extension'."
  (t
   (concat (file-name-sans-extension filename) "." extn)
 
-(compat-defun directory-empty-p (dir) ;; 
+(compat-defun directory-empty-p (dir) ;; 
   "Return t if DIR names an existing directory containing no other files.
 Return nil if DIR does not name a directory, or if there was
 trouble determining whether DIR is a directory or empty.
diff --git a/compat-tests.el b/compat-tests.el
index a12ba12def..a83f48f216 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -1131,6 +1131,15 @@
   (should (directory-name-p "dir/subdir/"))
   (should-not (directory-name-p "dir/subdir")))
 
+(ert-deftest directory-empty-p ()
+  (let ((name (make-temp-name "compat-tests")))
+(make-directory name)
+(should (directory-empty-p name))
+(make-empty-file (file-name-concat name "file"))
+(should-not (directory-empty-p name))
+(delete-file (file-name-concat name "file"))
+(delete-directory name)))
+
 (ert-deftest make-empty-file ()
   (let ((name (make-temp-name "compat-tests")))
 (should-not (file-exists-p name))



[elpa] externals/compat cd9e563ea0 1/4: Drop JSON support for now (libjansson)

2023-01-16 Thread ELPA Syncer
branch: externals/compat
commit cd9e563ea036595b3def00f83d2aa9d4a12b7c06
Author: Daniel Mendler 
Commit: Daniel Mendler 

Drop JSON support for now (libjansson)

I have not taken this decision lightly. There are currently no
consumers of the backported JSON api, which allows us to take this
measure. The problem is that backporting the libjansson API on top of
json.el is non-trivial and led to numerous problems:

1. There is a significant mismatch between the libjansson API and the
json.el API.

2. The libjansson API did not support RFC 8259 when it was introduced
in 27 This was corrected in 28, which requires Compat to provide two
compatibility versions for the json functions.

3. The `json-serialize' compatibility function was very inefficient,
since it has to walk and copy the entire object tree in order to
repair certain objects for the consumption by `json-encode'. This adds
slowness on top of the already slow json.el implementation.

4. `json-parse-buffer' (RFC 8259) modifies the buffer in order to
support toplevel object parsing and relies on undo to restore the
buffer state. This will not work for read-only buffers and for buffers
with disable undo and will have other undesired side effects.

5. The performance of libjansson and json.el are too different. It
will be unexpected if a backported API is suddenly much slower as
expected. This leads to performance bugs downstream.

For now the JSON support lives in the json branch. We can reinstate it
slowly and on-demand if necessary. However experience with the
`string-pixel-width' function showed that we have to be careful when
backports are much slower than the original function due to
performance bugs.
---
 NEWS.org|   1 +
 compat-28.el|  53 ---
 compat-tests.el |  60 -
 compat.el   | 202 
 compat.texi | 101 
 5 files changed, 1 insertion(+), 416 deletions(-)

diff --git a/NEWS.org b/NEWS.org
index 3dbf4c9ee4..f5a314ad4b 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -4,6 +4,7 @@
 
 - Add tests.
 - Add links from compatibility definitions to tests.
+- Drop JSON parsing support (libjansson API).
 - compat-26: Add ~buffer-hash~.
 - compat-27: Add ~fixnump~ and ~bignump~.
 - compat-27: Add ~with-minibuffer-selected-window~.
diff --git a/compat-28.el b/compat-28.el
index 8219633772..6aef33d8ce 100644
--- a/compat-28.el
+++ b/compat-28.el
@@ -150,59 +150,6 @@ If COUNT is non-nil and a natural number, the function will
   (setf (nthcdr count files) nil))
 files))
 
- Defined in json.c
-
-;; TODO Check interaction with conditionally defined json functions
-(compat-defun json-serialize (object &rest args) ;; 
-  "Handle top-level JSON values (RFC 8259)."
-  :explicit t
-  :cond (= 27 emacs-major-version)
-  (if (or (listp object) (vectorp object))
-  (apply #'json-serialize object args)
-(substring (json-serialize (list object)) 1 -1)))
-
-;; TODO Check interaction with conditionally defined json functions
-(compat-defun json-insert (object &rest args) ;; 
-  "Handle top-level JSON values (RFC 8259)."
-  :explicit t
-  :cond (= 27 emacs-major-version)
-  (if (or (listp object) (vectorp object))
-  (apply #'json-insert object args)
-(insert (apply #'compat--json-serialize object args
-
-;; TODO Check interaction with conditionally defined json functions
-(compat-defun json-parse-string (string &rest args) ;; 
-  "Handle top-level JSON values (RFC 8259)."
-  :explicit t
-  :cond (= 27 emacs-major-version)
-  (if (string-match-p "\\`[[:space:]]*[[{]" string)
-  (apply #'json-parse-string string args)
-;; Wrap the string in an array, and extract the value back using
-;; `elt', to ensure that no matter what the value of `:array-type'
-;; is we can access the first element.
-(elt (apply #'json-parse-string (concat "[" string "]") args) 0)))
-
-;; TODO Check interaction with conditionally defined json functions
-(compat-defun json-parse-buffer (&rest args) ;; 
-  "Handle top-level JSON values (RFC 8259)."
-  :explicit t
-  :cond (= 27 emacs-major-version)
-  (if (looking-at-p "[[:space:]]*[[{]")
-  (apply #'json-parse-buffer args)
-(catch 'escape
-  (atomic-change-group
-(with-syntax-table
-(let ((st (make-syntax-table)))
-  (modify-syntax-entry ?\" "\"" st)
-  (modify-syntax-entry ?. "_" st)
-  st)
-  (let ((inhibit-read-only t))
-(save-excursion
-(insert "[")
-(forward-sexp 1)
-(insert "]"
-(throw 'escape (elt (apply #'json-parse-buffer args) 0))
-
  xfaces.c
 
 (compat-defun color-values-from-color-spec (spec) ;; 

diff --git a/compat-tests.el b/compat-tests.el
index e71f2e4230..a6f19388da 100644
--- a/compat-tests.el

[elpa] externals/compat 6ffb3be674 2/4: Add tests for make-empty-file and dolist-with-progress-reporter

2023-01-16 Thread ELPA Syncer
branch: externals/compat
commit 6ffb3be674ee6b66641c252ec80bbb7ecd6ad67b
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add tests for make-empty-file and dolist-with-progress-reporter
---
 compat-27.el|  4 ++--
 compat-tests.el | 20 
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/compat-27.el b/compat-27.el
index 03b228f082..9a74a4d5b8 100644
--- a/compat-27.el
+++ b/compat-27.el
@@ -207,7 +207,7 @@ CONDITION can also be a list of error conditions."
   (declare (debug t) (indent 1))
   `(condition-case nil (progn ,@body) (,condition nil)))
 
-(compat-defmacro dolist-with-progress-reporter (spec reporter-or-message &rest 
body) ;; 
+(compat-defmacro dolist-with-progress-reporter (spec reporter-or-message &rest 
body) ;; 
   "Loop over a list and report progress in the echo area.
 Evaluate BODY with VAR bound to each car from LIST, in turn.
 Then evaluate RESULT to get return value, default nil.
@@ -462,7 +462,7 @@ REMOTE is non-nil, search on the remote host indicated by
 (when (stringp res) (file-local-name res)))
 (executable-find command)))
 
-(compat-defun make-empty-file (filename &optional parents) ;; 
+(compat-defun make-empty-file (filename &optional parents) ;; 

   "Create an empty file FILENAME.
 Optional arg PARENTS, if non-nil then creates parent dirs as needed."
   (when (and (file-exists-p filename) (null parents))
diff --git a/compat-tests.el b/compat-tests.el
index a6f19388da..a12ba12def 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -80,6 +80,18 @@
 (setq list (funcall sym list "first" 1 #'string=))
 (should (eq (compat-call plist-get list "first" #'string=) 1
 
+(ert-deftest dolist-with-progress-reporter ()
+  (let (y)
+(should-equal
+ (dolist-with-progress-reporter (x '(1 2 3) y) "Reporter"
+   (push x y))
+ '(3 2 1)))
+  (let (y)
+(should-equal
+ (dolist-with-progress-reporter (x '(1 2 3) y) (make-progress-reporter 
"Reporter")
+   (push x y))
+ '(3 2 1
+
 (ert-deftest with-minibuffer-selected-window ()
   (let (ran)
 (should-not (minibuffer-selected-window))
@@ -1119,6 +1131,14 @@
   (should (directory-name-p "dir/subdir/"))
   (should-not (directory-name-p "dir/subdir")))
 
+(ert-deftest make-empty-file ()
+  (let ((name (make-temp-name "compat-tests")))
+(should-not (file-exists-p name))
+(make-empty-file name)
+(should-equal 0 (file-attribute-size (file-attributes name)))
+(should (file-exists-p name))
+(delete-file name)))
+
 (ert-deftest mounted-file-systems ()
   (should-not (string-match-p mounted-file-systems "/etc/"))
   (should (string-match-p mounted-file-systems "/mnt/")))



[elpa] externals/compat updated (45ae45a6d1 -> 0967dbf2de)

2023-01-16 Thread ELPA Syncer
elpasync pushed a change to branch externals/compat.

  from  45ae45a6d1 Fix compat-tests links
   new  cd9e563ea0 Drop JSON support for now (libjansson)
   new  6ffb3be674 Add tests for make-empty-file and 
dolist-with-progress-reporter
   new  4c42b9c68c Add test for directory-empty-p
   new  0967dbf2de Add test for thing-at-mouse


Summary of changes:
 NEWS.org|   1 +
 compat-27.el|   4 +-
 compat-28.el|  63 ++
 compat-tests.el |  98 +++
 compat.el   | 202 
 compat.texi | 101 
 6 files changed, 46 insertions(+), 423 deletions(-)



[elpa] externals/compat 0967dbf2de 4/4: Add test for thing-at-mouse

2023-01-16 Thread ELPA Syncer
branch: externals/compat
commit 0967dbf2decbeabe3421430b4a37f94e9da25505
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add test for thing-at-mouse
---
 compat-28.el| 8 
 compat-tests.el | 9 +
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/compat-28.el b/compat-28.el
index 29a7942155..b04b75c3ed 100644
--- a/compat-28.el
+++ b/compat-28.el
@@ -678,20 +678,20 @@ just the selected frame."
 
  Defined in thingatpt.el
 
-(compat-defun thing-at-mouse (event thing &optional no-properties) ;; 

+(compat-defun thing-at-mouse (event thing &optional no-properties) ;; 

   "Return the THING at mouse click.
 Like `thing-at-point', but tries to use the event
 where the mouse button is clicked to find a thing nearby."
-  :feature thingatpt
+  ;; No :feature specified, since the function is autoloaded.
   (save-excursion
 (mouse-set-point event)
 (thing-at-point thing no-properties)))
 
-(compat-defun bounds-of-thing-at-mouse (event thing) ;; 
+(compat-defun bounds-of-thing-at-mouse (event thing) ;; 

   "Determine start and end locations for THING at mouse click given by EVENT.
 Like `bounds-of-thing-at-point', but tries to use the position in EVENT
 where the mouse button is clicked to find the thing nearby."
-  :feature thingatpt
+  ;; No :feature specified, since the function is autoloaded.
   (save-excursion
 (mouse-set-point event)
 (bounds-of-thing-at-point thing)))
diff --git a/compat-tests.el b/compat-tests.el
index a83f48f216..08ea45ed23 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -80,6 +80,15 @@
 (setq list (funcall sym list "first" 1 #'string=))
 (should (eq (compat-call plist-get list "first" #'string=) 1
 
+(ert-deftest thing-at-mouse ()
+  (save-window-excursion
+(with-temp-buffer
+  (let ((event `(mouse-1 (,(selected-window) 1 (0 . 0) 0
+(set-window-buffer nil (current-buffer))
+(insert "http://emacs.org/";)
+(should-equal "http://emacs.org/"; (thing-at-mouse event 'url))
+(should-equal '(1 . 18) (bounds-of-thing-at-mouse event 'url))
+
 (ert-deftest dolist-with-progress-reporter ()
   (let (y)
 (should-equal



[elpa] externals-release/org 12bcd322d0: Improve documentation for agenda starting day

2023-01-16 Thread ELPA Syncer
branch: externals-release/org
commit 12bcd322d0b0da4fe9e56cfd83f3e7f09a19233a
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

Improve documentation for agenda starting day

* doc/org-manual.org (Weekly/daily agenda):
* lisp/org-agenda.el (org-agenda-start-on-weekday):
(org-agenda-start-day): Document that `org-agenda-start-on-weekday'
takes precedence over `org-agenda-start-day' when agenda span is 7 or
14 days.

Reported-by: Eppo Math 
Link: https://orgmode.org/list/878ri67plt.fsf@localhost
---
 doc/org-manual.org | 4 +++-
 lisp/org-agenda.el | 9 +++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index cc822bfb70..2f169b3f81 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -8788,7 +8788,9 @@ a ~day~, ~week~, ~month~ or ~year~.  For weekly agendas, 
the default
 is to start on the previous Monday (see
 ~org-agenda-start-on-weekday~).  You can also set the start date using
 a date shift: =(setq org-agenda-start-day "+10d")= starts the agenda
-ten days from today in the future.
+ten days from today in the future.  ~org-agenda-start-on-weekday~
+takes precedence over ~org-agenda-start-day~ in weekly and bi-weekly
+agendas.
 
 Remote editing from the agenda buffer means, for example, that you can
 change the dates of deadlines and appointments from the agenda buffer.
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 66b08adf53..b5f0ab1385 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -1184,7 +1184,9 @@ Custom commands can set this variable in the options 
section."
   "Non-nil means start the overview always on the specified weekday.
 0 denotes Sunday, 1 denotes Monday, etc.
 When nil, always start on the current day.
-Custom commands can set this variable in the options section."
+Custom commands can set this variable in the options section.
+
+This variable only applies when agenda spans either 7 or 14 days."
   :group 'org-agenda-daily/weekly
   :type '(choice (const :tag "Today" nil)
 (integer :tag "Weekday No.")))
@@ -4357,7 +4359,10 @@ This check for agenda markers in all agenda buffers 
currently active."
 Custom commands can set this variable in the options section.
 This is usually a string like \"2007-11-01\", \"+2d\" or any other
 input allowed when reading a date through the Org calendar.
-See the docstring of `org-read-date' for details.")
+See the docstring of `org-read-date' for details.
+
+This variable has no effect when `org-agenda-start-on-weekday' is set
+and agenda spans 7 or 14 days.")
 (defvar org-starting-day nil) ; local variable in the agenda buffer
 (defvar org-arg-loc nil) ; local variable
 



[elpa] externals/org updated (889b8cc2fd -> 30dfafac34)

2023-01-16 Thread ELPA Syncer
elpasync pushed a change to branch externals/org.

  from  889b8cc2fd Merge branch 'bugfix'
   new  12bcd322d0 Improve documentation for agenda starting day
   new  30dfafac34 Merge branch 'bugfix'


Summary of changes:
 doc/org-manual.org | 4 +++-
 lisp/org-agenda.el | 9 +++--
 2 files changed, 10 insertions(+), 3 deletions(-)



[elpa] externals/org 30dfafac34: Merge branch 'bugfix'

2023-01-16 Thread ELPA Syncer
branch: externals/org
commit 30dfafac34209a0bb42cdce62f055c22a7874a75
Merge: 889b8cc2fd 12bcd322d0
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

Merge branch 'bugfix'
---
 doc/org-manual.org | 4 +++-
 lisp/org-agenda.el | 9 +++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 4466af8e4c..5217e647d0 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -8792,7 +8792,9 @@ a ~day~, ~week~, ~month~ or ~year~.  For weekly agendas, 
the default
 is to start on the previous Monday (see
 ~org-agenda-start-on-weekday~).  You can also set the start date using
 a date shift: =(setq org-agenda-start-day "+10d")= starts the agenda
-ten days from today in the future.
+ten days from today in the future.  ~org-agenda-start-on-weekday~
+takes precedence over ~org-agenda-start-day~ in weekly and bi-weekly
+agendas.
 
 Remote editing from the agenda buffer means, for example, that you can
 change the dates of deadlines and appointments from the agenda buffer.
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 87517d0410..7f3794e014 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -1184,7 +1184,9 @@ Custom commands can set this variable in the options 
section."
   "Non-nil means start the overview always on the specified weekday.
 0 denotes Sunday, 1 denotes Monday, etc.
 When nil, always start on the current day.
-Custom commands can set this variable in the options section."
+Custom commands can set this variable in the options section.
+
+This variable only applies when agenda spans either 7 or 14 days."
   :group 'org-agenda-daily/weekly
   :type '(choice (const :tag "Today" nil)
 (integer :tag "Weekday No.")))
@@ -4359,7 +4361,10 @@ This check for agenda markers in all agenda buffers 
currently active."
 Custom commands can set this variable in the options section.
 This is usually a string like \"2007-11-01\", \"+2d\" or any other
 input allowed when reading a date through the Org calendar.
-See the docstring of `org-read-date' for details.")
+See the docstring of `org-read-date' for details.
+
+This variable has no effect when `org-agenda-start-on-weekday' is set
+and agenda spans 7 or 14 days.")
 (defvar org-starting-day nil) ; local variable in the agenda buffer
 (defvar org-arg-loc nil) ; local variable
 



[elpa] externals/pyim 3833fd7a24: pyim-cstring-to-pinyin--from-dcache: deal with / in code.

2023-01-16 Thread ELPA Syncer
branch: externals/pyim
commit 3833fd7a241972d7442bd1cff2f5b1ba529e23df
Author: Feng Shu 
Commit: Feng Shu 

pyim-cstring-to-pinyin--from-dcache: deal with / in code.
---
 pyim-cstring.el | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/pyim-cstring.el b/pyim-cstring.el
index 5f8c27cb85..1d1e4df051 100644
--- a/pyim-cstring.el
+++ b/pyim-cstring.el
@@ -133,7 +133,11 @@ BUG: 当 STRING 中包含其它标点符号,并且设置 SEPERATER 时,结
  (pinyins-list
   (mapcar (lambda (str)
 (if (pyim-string-match-p "\\cc" str)
-(when-let ((code (car (pyim-dcache-get str 
'(word2code)
+(when-let ((code (cl-find-if-not
+  (lambda (c)
+;; 注意:Pinyin 词库中不包含 "/" 字符。
+(string-match-p c "/"))
+  (pyim-dcache-get str '(word2code)
   (split-string code "-"))
   (list str)))
   string-parts)))



[nongnu] elpa/diff-ansi 213612dcd8: Cleanup: reformat with updated elisp-autofmt

2023-01-16 Thread ELPA Syncer
branch: elpa/diff-ansi
commit 213612dcd8d556cb63aeb6c0b5e03da064ffc3b3
Author: Campbell Barton 
Commit: Campbell Barton 

Cleanup: reformat with updated elisp-autofmt
---
 diff-ansi.el | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/diff-ansi.el b/diff-ansi.el
index 5ba7540966..44109eb7cc 100644
--- a/diff-ansi.el
+++ b/diff-ansi.el
@@ -599,8 +599,7 @@ Optional keywords in KEYWORDS.
 ('delta
  (append
   (list
-   "delta"
-   (format "--width=%d" (window-body-width (get-buffer-window 
(current-buffer)
+   "delta" (format "--width=%d" (window-body-width (get-buffer-window 
(current-buffer)
   diff-ansi-extra-args-for-delta))
 ('diff-so-fancy (append (list "diff-so-fancy") 
diff-ansi-extra-args-for-diff-so-fancy))
 ('ydiff
@@ -720,8 +719,7 @@ Store the result in TARGET-BUF when non-nil."
 (diff-ansi--with-advice #'timer-activate :override (lambda (&rest _) 
nil)
 (setq diff-ansi--ansi-color-timer (run-at-time 
0.0 0.001 nil))
 (timer-set-function
- diff-ansi--ansi-color-timer
- #'diff-ansi-progressive-highlight-impl
+ diff-ansi--ansi-color-timer 
#'diff-ansi-progressive-highlight-impl
  (list
   (current-buffer)
   beg



[nongnu] elpa/evil 8a05eb99c6: Implement n, x, o, b, r options in :sort

2023-01-16 Thread ELPA Syncer
branch: elpa/evil
commit 8a05eb99c6ee60eb502a2c586fa2e771a513c417
Author: Nathaniel Nicandro 
Commit: Axel Forsman 

Implement n, x, o, b, r options in :sort

Co-authored-by: Axel Forsman 
---
 evil-commands.el | 124 +--
 evil-tests.el|  35 +++-
 2 files changed, 128 insertions(+), 31 deletions(-)

diff --git a/evil-commands.el b/evil-commands.el
index e6c1c10fd6..eec7038604 100644
--- a/evil-commands.el
+++ b/evil-commands.el
@@ -4228,45 +4228,109 @@ Default position is the beginning of the buffer."
   (message "%d lines --%s--" nlines perc
 
 (defvar sort-fold-case)
-(evil-define-operator evil-ex-sort (beg end &optional options reverse)
+(evil-define-operator evil-ex-sort (beg end &optional args reverse)
   "The Ex sort command.
-\[BEG,END]sort[!] [i][u]
+\[BEG,END]sort[!] [/PATTERN/] [b][i][u][r][n][x][o]
 The following additional options are supported:
 
   * i   ignore case
   * u   remove duplicate lines
+  * r   sort the contents of pattern
+  * n   sort by the first decimal number
+  * x   sort by the first hexadecimal number (with optional \"0x\" prefix)
+  * o   sort by the first octal number
+  * b   sort by the first binary number
 
-The 'bang' argument means to sort in reverse order."
+If a pattern is supplied without supplying the \"r\" option, sort
+the contents of the lines after skipping the pattern.
+If the pattern is empty, the last search pattern is used instead.
+
+The \"!\" argument means to sort in reverse order."
   :motion mark-whole-buffer
   :move-point nil
   (interactive "")
-  (let ((beg (copy-marker beg))
-(end (copy-marker end))
-sort-fold-case uniq)
-(dolist (opt (append options nil))
-  (cond
-   ((eq opt ?i) (setq sort-fold-case t))
-   ((eq opt ?u) (setq uniq t))
-   (t (user-error "Unsupported sort option: %c" opt
-(sort-lines reverse beg end)
-(when uniq
-  (let (line prev-line)
-(goto-char beg)
-(while (and (< (point) end) (not (eobp)))
-  (setq line (buffer-substring-no-properties
-  (line-beginning-position)
-  (line-end-position)))
-  (if (and (stringp prev-line)
-   (eq t (compare-strings line nil nil
-  prev-line nil nil
-  sort-fold-case)))
-  (delete-region (progn (forward-line 0) (point))
- (progn (forward-line 1) (point)))
-(setq prev-line line)
-(forward-line 1)
-(goto-char beg)
-(set-marker beg nil)
-(set-marker end nil)))
+  (unless args (setq args ""))
+  (let ((inhibit-field-text-motion t)
+options sort-fold-case unique base sort-pat pat)
+;; Handle arguments like
+;; /[^,]*,/ n
+;; and
+;; nu
+(if (or (zerop (length args)) (memq (aref args 0) '(?i ?n ?x ?o ?b ?u ?r)))
+(setq options args)
+  (setq args (evil-delimited-arguments args 2)
+;; Use last search pattern when an empty pattern is provided
+pat (if (string= (car args) "")
+(evil-ex-pattern-regex evil-ex-search-pattern)
+  (car args))
+options (cadr args)))
+(cl-loop
+ for opt across options do
+ (cond
+  ((eq opt ?i) (setq sort-fold-case t))
+  ((eq opt ?b) (setq base 2))
+  ((eq opt ?o) (setq base 8))
+  ((eq opt ?n) (setq base 10))
+  ((eq opt ?x) (setq base 16))
+  ((eq opt ?r) (setq sort-pat t))
+  ((eq opt ?u) (setq unique t))
+  ((eq opt ? ))
+  (t (user-error "Invalid sort option `%c'" opt
+(evil-with-restriction beg end
+  (goto-char beg)
+  (let ((num-re
+ (cond
+  ((null base) nil)
+  ((= base 2) "[01]+")
+  ((= base 8) "[0-7]+")
+  ((= base 10) "-?[0-9]+")
+  ((= base 16) "\\(-\\)?\\(?:0x\\)?\\([0-9a-f]+\\)")))
+key-end)
+(sort-subr
+ reverse
+ #'forward-line
+ #'end-of-line
+ (lambda ()
+   ;; Find the boundary of the key to match on the line
+   (setq key-end (line-end-position))
+   (and (> (length pat) 0)
+;; When matching a pattern and one doesn't exist on the line,
+;; skip the line
+(re-search-forward pat key-end 'move)
+sort-pat ; Otherwise go to the start of the key
+(progn (setq key-end (point))
+   (goto-char (match-beginning 0
+   ;; Return the key for the line when sorting numbers, otherwise let
+   ;; `sort-subr' extract the key
+   (when base
+ (let ((case-fold-search t))
+   (if (not (re-search-forward num-re key-end t))
+   ;; When sorting numbers and a number doesn't exist on the
+

[nongnu] elpa/spell-fu 9f63b57c33: Cleanup: reformat with updated elisp-autofmt

2023-01-16 Thread ELPA Syncer
branch: elpa/spell-fu
commit 9f63b57c33d3ee74e9f58e089f984b386f8e8449
Author: Campbell Barton 
Commit: Campbell Barton 

Cleanup: reformat with updated elisp-autofmt
---
 spell-fu.el | 27 ---
 1 file changed, 8 insertions(+), 19 deletions(-)

diff --git a/spell-fu.el b/spell-fu.el
index a5175f69a5..44f8031fb8 100644
--- a/spell-fu.el
+++ b/spell-fu.el
@@ -100,9 +100,7 @@ Call `spell-fu-buffer-session-localwords-refresh' after 
run-time modifications."
 (put 'spell-fu-buffer-session-localwords 'safe-local-variable 
#'spell-fu-list-of-strings-p)
 
 (define-obsolete-variable-alias
-  'global-spell-fu-ignore-buffer
-  'spell-fu-global-ignore-buffer
-  "0.4")
+  'global-spell-fu-ignore-buffer 'spell-fu-global-ignore-buffer "0.4")
 
 (defvar-local spell-fu-global-ignore-buffer nil
   "When non-nil, the global mode will not be enabled for this buffer.
@@ -451,8 +449,7 @@ Argument POS return faces at this point."
 (let ((file-test-time (file-attribute-modification-time (file-attributes 
file-test
   (dolist (file-new file-list)
 (when (time-less-p
-   file-test-time
-   (file-attribute-modification-time (file-attributes file-new)))
+   file-test-time (file-attribute-modification-time 
(file-attributes file-new)))
   (throw 'result t)))
   nil)))
 
@@ -680,9 +677,7 @@ This only checks the text matching face rules."
 (let ((word-beg (match-beginning 0))
   (word-end (match-end 0)))
   (spell-fu-check-word
-   word-beg
-   word-end
-   (buffer-substring-no-properties word-beg word-end
+   word-beg word-end (buffer-substring-no-properties 
word-beg word-end
   (widen))
 
 (setq pos-beg point-end-iter)
@@ -1052,8 +1047,7 @@ Return t when the word has been added."
   (interactive (list
 (spell-fu--read-dictionary
  (spell-fu--get-edit-candidate-dictionaries
-  (spell-fu--word-at-point)
-  'add)
+  (spell-fu--word-at-point) 'add)
  "Add to dictionary: ")))
   (let ((word (spell-fu--word-at-point)))
 (cond
@@ -1073,8 +1067,7 @@ Return t when the word has been removed."
   (interactive (list
 (spell-fu--read-dictionary
  (spell-fu--get-edit-candidate-dictionaries
-  (spell-fu--word-at-point)
-  'remove)
+  (spell-fu--word-at-point) 'remove)
  "Remove from dictionary: ")))
   (let ((word (spell-fu--word-at-point)))
 (cond
@@ -1208,8 +1201,7 @@ Return t if the file was updated."
   "*spell-fu word generation errors*"))
   (message
"spell-fu: affix extension for dictionary '%s' failed 
(with language: %S)."
-   dict-name
-   lang))
+   dict-name lang))
 (goto-char (point-min))
 (while (search-forward " " nil t)
   (replace-match "\n"
@@ -1598,9 +1590,7 @@ Argument DICT-FILE is the absolute path to the 
dictionary."
 ;; Set add/remove functions
 (put dict 'add-word (lambda (word) 
(spell-fu--buffer-localwords-add-or-remove word 'add)))
 (put
- dict
- 'remove-word
- (lambda (word) (spell-fu--buffer-localwords-add-or-remove word 'remove)))
+ dict 'remove-word (lambda (word) 
(spell-fu--buffer-localwords-add-or-remove word 'remove)))
 dict))
 
 (defun spell-fu--buffer-localwords-dictionary-test (dict)
@@ -1617,8 +1607,7 @@ Argument DICT-FILE is the absolute path to the 
dictionary."
   (unless has-localwords-dict ; Add dict.
 (setq spell-fu-dictionaries
   (append
-   spell-fu-dictionaries
-   (list (spell-fu-get-buffer-session-localwords-dictionary
+   spell-fu-dictionaries (list 
(spell-fu-get-buffer-session-localwords-dictionary
 (setq do-refresh-cache-table-list t)))
  (t
   (when has-localwords-dict ; Remove dict.



[elpa] externals/compat 9097878541 4/6: null-device: Use file-remote-p

2023-01-16 Thread ELPA Syncer
branch: externals/compat
commit 9097878541161e6c6f4d855b8d250a5a2c156b6e
Author: Daniel Mendler 
Commit: Daniel Mendler 

null-device: Use file-remote-p
---
 compat-28.el | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/compat-28.el b/compat-28.el
index fadbf7e3b7..eb5d2979f2 100644
--- a/compat-28.el
+++ b/compat-28.el
@@ -625,12 +625,9 @@ onwards does."
 
  Defined in files-x.el
 
-(declare-function tramp-tramp-file-p "tramp" (name))
-
 (compat-defun null-device () ;; 
   "Return the best guess for the null device."
-  (require 'tramp)
-  (if (tramp-tramp-file-p default-directory)
+  (if (file-remote-p default-directory)
   "/dev/null"
 null-device))
 



[elpa] externals/compat 425156ccb4 2/6: compat-macs: Rename :cond to :when

2023-01-16 Thread ELPA Syncer
branch: externals/compat
commit 425156ccb474471a5067500318ac521dc18efe58
Author: Daniel Mendler 
Commit: Daniel Mendler 

compat-macs: Rename :cond to :when
---
 compat-macs.el | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/compat-macs.el b/compat-macs.el
index e579eeaacf..1c71db92c2 100644
--- a/compat-macs.el
+++ b/compat-macs.el
@@ -66,10 +66,10 @@ If this is not documented on yourself system, you can check 
\
 The version constraints specified by ATTRS are checked.
 ARGS is a list of keywords which are looked up and passed to FUN."
   (declare (indent 2))
-  (let* ((body (compat--check-attributes attrs `(,@args :cond :feature)))
+  (let* ((body (compat--check-attributes attrs `(,@args :when :feature)))
  (feature (plist-get attrs :feature))
  (attrs `(:body ,body ,@attrs))
- (cond (plist-get attrs :cond)))
+ (cond (plist-get attrs :when)))
 ;; Require feature at compile time
 (when feature
   (when (eq feature 'subr-x)
@@ -130,8 +130,8 @@ under which the definition is generated.
 
 - :feature :: Wrap the definition with `with-eval-after-load'.
 
-- :cond :: Do not install the definition depending on the
-  version.  Instead install the definition if :cond evaluates to
+- :when :: Do not install the definition depending on the
+  version.  Instead install the definition if :when evaluates to
   non-nil."
   (declare (debug (name symbolp [&rest keywordp sexp])))
   (compat--guarded-definition attrs '(:obsolete)
@@ -160,8 +160,8 @@ defined.
 
 - :feature :: Wrap the definition with `with-eval-after-load'.
 
-- :cond :: Do not install the definition depending on the
-  version.  Instead install the definition if :cond evaluates to
+- :when :: Do not install the definition depending on the
+  version.  Instead install the definition if :when evaluates to
   non-nil."
   (declare (debug (&define name (&rest symbolp)
stringp
@@ -192,8 +192,8 @@ definition is generated.
 
 - :feature :: Wrap the definition with `with-eval-after-load'.
 
-- :cond :: Do not install the definition depending on the
-  version.  Instead install the definition if :cond evaluates to
+- :when :: Do not install the definition depending on the
+  version.  Instead install the definition if :when evaluates to
   non-nil."
   (declare (debug (name form stringp [&rest keywordp sexp]))
(doc-string 3) (indent 2))



[elpa] externals/compat 9b787ec578 3/6: Add test for directory-files

2023-01-16 Thread ELPA Syncer
branch: externals/compat
commit 9b787ec578e3526b74db984c197c39dc06dca3ee
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add test for directory-files
---
 compat-28.el| 2 +-
 compat-tests.el | 5 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/compat-28.el b/compat-28.el
index b04b75c3ed..fadbf7e3b7 100644
--- a/compat-28.el
+++ b/compat-28.el
@@ -140,7 +140,7 @@ consider, and are interpreted as in `substring'."
 
  Defined in dired.c
 
-(compat-defun directory-files (directory &optional full match nosort count) ;; 

+(compat-defun directory-files (directory &optional full match nosort count) ;; 

   "Handle additional optional argument COUNT.
 If COUNT is non-nil and a natural number, the function will
  return COUNT number of file names (if so many are present)."
diff --git a/compat-tests.el b/compat-tests.el
index 08ea45ed23..95f0bef531 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -1126,6 +1126,11 @@
   (should-not (equal dir default-directory))
   (should (file-exists-p default-directory)
 
+(ert-deftest directory-files ()
+  (should-not (compat-call directory-files "." nil nil nil 0))
+  (should-equal 1 (length (compat-call directory-files "." nil nil nil 1)))
+  (should-equal 2 (length (compat-call directory-files "." nil nil nil 2
+
 (ert-deftest directory-name-p ()
   (should (directory-name-p "/"))
   (should-not (directory-name-p "/file"))



[elpa] externals/compat 0a56ae09cd 1/6: compat-macs: Expand docstring

2023-01-16 Thread ELPA Syncer
branch: externals/compat
commit 0a56ae09cdaec64a581ab0f403dfe2179da9e3c7
Author: Daniel Mendler 
Commit: Daniel Mendler 

compat-macs: Expand docstring
---
 compat-macs.el | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/compat-macs.el b/compat-macs.el
index 82de765a0e..e579eeaacf 100644
--- a/compat-macs.el
+++ b/compat-macs.el
@@ -130,7 +130,9 @@ under which the definition is generated.
 
 - :feature :: Wrap the definition with `with-eval-after-load'.
 
-- :cond :: Install the definition if :cond evaluates to non-nil."
+- :cond :: Do not install the definition depending on the
+  version.  Instead install the definition if :cond evaluates to
+  non-nil."
   (declare (debug (name symbolp [&rest keywordp sexp])))
   (compat--guarded-definition attrs '(:obsolete)
 (lambda (obsolete)
@@ -158,7 +160,9 @@ defined.
 
 - :feature :: Wrap the definition with `with-eval-after-load'.
 
-- :cond :: Install the definition if :cond evaluates to non-nil."
+- :cond :: Do not install the definition depending on the
+  version.  Instead install the definition if :cond evaluates to
+  non-nil."
   (declare (debug (&define name (&rest symbolp)
stringp
[&rest keywordp sexp]
@@ -188,7 +192,9 @@ definition is generated.
 
 - :feature :: Wrap the definition with `with-eval-after-load'.
 
-- :cond :: Install the definition if :cond evaluates to non-nil."
+- :cond :: Do not install the definition depending on the
+  version.  Instead install the definition if :cond evaluates to
+  non-nil."
   (declare (debug (name form stringp [&rest keywordp sexp]))
(doc-string 3) (indent 2))
   (compat--guarded-definition attrs '(:local :constant)



[elpa] externals/compat updated (0967dbf2de -> 9600545c54)

2023-01-16 Thread ELPA Syncer
elpasync pushed a change to branch externals/compat.

  from  0967dbf2de Add test for thing-at-mouse
   new  0a56ae09cd compat-macs: Expand docstring
   new  425156ccb4 compat-macs: Rename :cond to :when
   new  9b787ec578 Add test for directory-files
   new  9097878541 null-device: Use file-remote-p
   new  99878885e3 compat-28: Drop null-device
   new  9600545c54 Add test for temporary-file-directory


Summary of changes:
 NEWS.org|  3 ++-
 compat-26.el|  2 +-
 compat-28.el| 13 +
 compat-macs.el  | 16 +++-
 compat-tests.el | 16 
 compat.texi | 12 
 6 files changed, 35 insertions(+), 27 deletions(-)



[elpa] externals/compat 9600545c54 6/6: Add test for temporary-file-directory

2023-01-16 Thread ELPA Syncer
branch: externals/compat
commit 9600545c546fcb54147f6e03af9e994376bcde08
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add test for temporary-file-directory
---
 compat-26.el|  2 +-
 compat-tests.el | 11 +++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/compat-26.el b/compat-26.el
index d3a6cac4bf..0670851c07 100644
--- a/compat-26.el
+++ b/compat-26.el
@@ -351,7 +351,7 @@ The returned file name can be used directly as argument of
 name
   (concat (file-remote-p name) "/:" (file-local-name name)
 
-(compat-defun temporary-file-directory () ;; 
+(compat-defun temporary-file-directory () ;; 

   "The directory for writing temporary files.
 In case of a remote `default-directory', this is a directory for
 temporary files on that remote host.  If such a directory does
diff --git a/compat-tests.el b/compat-tests.el
index 95f0bef531..ae54486680 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -1126,6 +1126,17 @@
   (should-not (equal dir default-directory))
   (should (file-exists-p default-directory)
 
+(ert-deftest temporary-file-directory ()
+  (should-equal (temporary-file-directory) temporary-file-directory)
+  (let ((default-directory "/mnt"))
+(should-equal (temporary-file-directory) default-directory))
+  ;; TODO how can we test tramp?
+  ;;(let ((default-directory "/sudo:/"))
+  ;;  (should-equal (temporary-file-directory) temporary-file-directory))
+  ;;(let ((default-directory "/ssh:does-not-exist:/"))
+  ;;  (should-equal (temporary-file-directory) "/ssh:does-not-exist:/tmp/"))
+  )
+
 (ert-deftest directory-files ()
   (should-not (compat-call directory-files "." nil nil nil 0))
   (should-equal 1 (length (compat-call directory-files "." nil nil nil 1)))



[elpa] externals/compat 99878885e3 5/6: compat-28: Drop null-device

2023-01-16 Thread ELPA Syncer
branch: externals/compat
commit 99878885e38744b0a69e5da181c8488726ffd126
Author: Daniel Mendler 
Commit: Daniel Mendler 

compat-28: Drop null-device

This API is currently unused. I first have to understand
`with-connection-local-variables' better. Maybe that macro should be
backported first. The function `null-device' always returns /dev/null
for me. What is the point of this API?
---
 NEWS.org |  3 ++-
 compat-28.el |  8 
 compat.texi  | 12 
 3 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/NEWS.org b/NEWS.org
index f5a314ad4b..04f16b56ef 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -4,7 +4,8 @@
 
 - Add tests.
 - Add links from compatibility definitions to tests.
-- Drop JSON parsing support (libjansson API).
+- BREAKING: Drop JSON parsing support (libjansson API).
+- BREAKING: Drop ~null-device~.
 - compat-26: Add ~buffer-hash~.
 - compat-27: Add ~fixnump~ and ~bignump~.
 - compat-27: Add ~with-minibuffer-selected-window~.
diff --git a/compat-28.el b/compat-28.el
index eb5d2979f2..c58c1d5bc7 100644
--- a/compat-28.el
+++ b/compat-28.el
@@ -623,14 +623,6 @@ onwards does."
 ".#" (file-name-nondirectory filename))
(file-name-directory filename)))
 
- Defined in files-x.el
-
-(compat-defun null-device () ;; 
-  "Return the best guess for the null device."
-  (if (file-remote-p default-directory)
-  "/dev/null"
-null-device))
-
  Defined in minibuffer.el
 
 (compat-defun format-prompt (prompt default &rest format-args) ;; 

diff --git a/compat.texi b/compat.texi
index a92b9f0c70..23ec06cb0e 100644
--- a/compat.texi
+++ b/compat.texi
@@ -1804,12 +1804,6 @@ Return a string containing a lock file name for 
@var{filename}, obeying
 @code{lock-file-name-transforms}.
 @end defun
 
-@c based on lisp/files.el
-@defun null-device
-Return the path to the null device (usually something like
-@file{/dev/null}) on the current system.
-@end defun
-
 @c copied from lisp/calendar/time-date.el
 @defun decoded-time-period time
 Interpret @var{time} as a period and return its length in seconds.  For
@@ -1942,6 +1936,8 @@ Additional Edebug keywords.
 @item
 Shorthand support.
 @item
+The libjansson JSON APIs, e.g., @code{json-parse-string}.
+@item
 The function @code{custom-add-choice}.
 @item
 The function @code{dom-print}.
@@ -1952,8 +1948,6 @@ The function @code{dns-query-asynchronous}.
 @item
 The function @code{get-locale-names}.
 @item
-The function @code{json-available-p}.
-@item
 The function @code{mail-header-parse-addresses-lax}.
 @item
 The function @code{mail-header-parse-address-lax}.
@@ -1970,6 +1964,8 @@ The function @code{syntax-class-to-char}.
 @item
 The function @code{path-separator}.
 @item
+The function @code{null-device}.
+@item
 Any @code{multisession} functionality.
 @end itemize
 



[elpa] externals/compat ab6e9af550 2/2: Bump snapshot version

2023-01-16 Thread ELPA Syncer
branch: externals/compat
commit ab6e9af55036567ec5dcd25d5b447d34ed9b5934
Author: Daniel Mendler 
Commit: Daniel Mendler 

Bump snapshot version
---
 NEWS.org| 2 +-
 compat.el   | 2 +-
 compat.texi | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/NEWS.org b/NEWS.org
index 7e05796f95..e777c9b5c0 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -1,6 +1,6 @@
 #+title: compat.el - Changelog
 
-* Development
+* Development of "Compat" Version 29.1.2.0
 
 - Add tests.
 - Add links from compatibility definitions to tests.
diff --git a/compat.el b/compat.el
index 3e184246b1..32b50020e7 100644
--- a/compat.el
+++ b/compat.el
@@ -4,7 +4,7 @@
 
 ;; Author: Philip Kaludercic , Daniel Mendler 

 ;; Maintainer: Daniel Mendler , Compat Development 
<~pkal/compat-de...@lists.sr.ht>
-;; Version: 29.1.1.1
+;; Version: 29.1.2.0-git
 ;; URL: https://github.com/emacs-compat/compat
 ;; Package-Requires: ((emacs "24.4"))
 ;; Keywords: lisp
diff --git a/compat.texi b/compat.texi
index 23ec06cb0e..65a39ec10a 100644
--- a/compat.texi
+++ b/compat.texi
@@ -31,7 +31,7 @@ modify this GNU manual.”
 @finalout
 @titlepage
 @title "Compat" Manual
-@subtitle For version 29.1.1.1
+@subtitle For version 29.1.2.0
 @author Philip Kaludercic, Daniel Mendler
 @page
 @vskip 0pt plus 1filll
@@ -46,7 +46,7 @@ modify this GNU manual.”
 
 This manual documents the usage of the "Compat" Emacs lisp library,
 the forward-compatibility library for Emacs Lisp, corresponding to
-version 29.1.1.1.
+version 29.1.2.0.
 
 @insertcopying
 @end ifnottex
@@ -115,7 +115,7 @@ The intended use-case for this library is for package 
developers to add
 as a dependency in the header:
 
 @example
-;; Package-Requires: ((emacs "24.4") (compat "29.1.1.1"))
+;; Package-Requires: ((emacs "24.4") (compat "29.1.2.0"))
 @end example
 
 There is no need to depend on @code{emacs} 24.4 specifically.  One can



[elpa] externals/compat updated (9600545c54 -> ab6e9af550)

2023-01-16 Thread ELPA Syncer
elpasync pushed a change to branch externals/compat.

  from  9600545c54 Add test for temporary-file-directory
   new  2f2de43581 Add define-key and keymap-unset tests
   new  ab6e9af550 Bump snapshot version


Summary of changes:
 NEWS.org|  3 ++-
 compat-29.el| 58 ++---
 compat-tests.el | 58 +
 compat.el   |  2 +-
 compat.texi |  6 +++---
 5 files changed, 95 insertions(+), 32 deletions(-)



[elpa] externals/compat 2f2de43581 1/2: Add define-key and keymap-unset tests

2023-01-16 Thread ELPA Syncer
branch: externals/compat
commit 2f2de4358170885d2247a89d395944eb14467177
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add define-key and keymap-unset tests
---
 NEWS.org|  1 +
 compat-29.el| 58 ++---
 compat-tests.el | 58 +
 3 files changed, 90 insertions(+), 27 deletions(-)

diff --git a/NEWS.org b/NEWS.org
index 04f16b56ef..7e05796f95 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -6,6 +6,7 @@
 - Add links from compatibility definitions to tests.
 - BREAKING: Drop JSON parsing support (libjansson API).
 - BREAKING: Drop ~null-device~.
+- compat-29: Fix and test ~define-key~ with REMOVE argument.
 - compat-26: Add ~buffer-hash~.
 - compat-27: Add ~fixnump~ and ~bignump~.
 - compat-27: Add ~with-minibuffer-selected-window~.
diff --git a/compat-29.el b/compat-29.el
index 2ae3b766ca..7b53d59d5c 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -151,30 +151,6 @@ This function does not move point.  Also see 
`line-end-position'."
   (let ((inhibit-field-text-motion t))
 (line-end-position n)))
 
- Defined in keymap.c
-
-(compat-defun define-key (keymap key def &optional remove) ;; 
-  "Handle optional argument REMOVE."
-  :explicit t
-  (if remove
-  (let ((prev (lookup-key keymap key))
-(parent (memq 'key (cdr keymap)))
-fresh entry)
-(when prev
-  ;; IMPROVEME: Kind of a hack to avoid relying on the specific
-  ;; behaviour of how `define-key' changes KEY before inserting
-  ;; it into the map.
-  (define-key keymap key (setq fresh (make-symbol "fresh")))
-  (setq entry (rassq fresh (cdr keymap)))
-  (if (> (length (memq entry (cdr keymap)))
- (length parent))
-  ;; Ensure that we only remove an element in the current
-  ;; keymap and not a parent, by ensuring that `entry' is
-  ;; located before `parent'.
-  (ignore (setcdr keymap (delq entry (cdr keymap
-(define-key keymap key prev
-(define-key keymap key def)))
-
  Defined in subr.el
 
 (compat-defmacro with-memoization (place &rest code) ;; 

@@ -646,7 +622,7 @@ DEFINITION is anything that can be a key's definition:
 (setq definition (key-parse definition)))
   (define-key keymap (key-parse key) definition))
 
-(compat-defun keymap-unset (keymap key &optional remove) ;; 
+(compat-defun keymap-unset (keymap key &optional remove) ;; 

   "Remove key sequence KEY from KEYMAP.
 KEY is a string that satisfies `key-valid-p'.
 
@@ -688,7 +664,7 @@ NOTE: The compatibility version is not a command."
   (use-local-map (setq map (make-sparse-keymap
 (keymap-set map key command)))
 
-(compat-defun keymap-global-unset (key &optional remove) ;; 
+(compat-defun keymap-global-unset (key &optional remove) ;; 

   "Remove global binding of KEY (if any).
 KEY is a string that satisfies `key-valid-p'.
 
@@ -698,7 +674,7 @@ instead of unsetting it.  See `keymap-unset' for details.
 NOTE: The compatibility version is not a command."
   (keymap-unset (current-global-map) key remove))
 
-(compat-defun keymap-local-unset (key &optional remove) ;; 
+(compat-defun keymap-local-unset (key &optional remove) ;; 

   "Remove local binding of KEY (if any).
 KEY is a string that satisfies `key-valid-p'.
 
@@ -994,6 +970,34 @@ command exists in this specific map, but it doesn't have 
the
  ,@(nreverse props))
 defvar-form
 
+ Defined in keymap.c
+
+(compat-defun define-key (keymap key def &optional remove) ;; 

+  "Handle optional argument REMOVE."
+  :explicit t
+  (if (not remove)
+  (define-key keymap key def)
+;; Canonicalize key
+(setq key (key-parse (key-description key)))
+(define-key keymap key nil)
+;; Split M-key in ESC key
+(setq key (mapcan (lambda (k)
+(if (and (integerp k) (/= (logand k ?\M-\0) 0))
+(list ?\e (logxor k ?\M-\0))
+  (list k)))
+  key))
+;; Delete single keys directly
+(if (length= key 1)
+(delete key keymap)
+  ;; Lookup submap and delete key from there
+  (let ((submap (lookup-key keymap (vconcat (butlast key)
+(unless (keymapp submap)
+  (error "Not a keymap for %s" key))
+(when (symbolp submap)
+  (setq submap (symbol-function submap)))
+(delete (last key) submap)))
+def))
+
  Defined in button.el
 
 (compat-defun button--properties (callback data help-echo) ;; 

diff --git a/compat-tests.el b/compat-tests.el
index ae54486680..93288c08f3 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -658,6 +658,64 @@
   (should-equal (keymap-global-lookup "C-x C-f") #'find-file)
   (should-equal (keymap-global-lookup "C-c") #'mode-specific-command-prefix))
 
+(ert-deftest keymap-unset ()
+  (let ((map (make-sparse-keymap)))
+(de

[elpa] externals/pyim 0d17895ef2: Update message.

2023-01-16 Thread ELPA Syncer
branch: externals/pyim
commit 0d17895ef2e1d091080dacc3a72ecbb3bd7580ff
Author: Feng Shu 
Commit: Feng Shu 

Update message.
---
 pyim-process.el |  2 +-
 pyim.el | 16 
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/pyim-process.el b/pyim-process.el
index 35ff7cde88..5985e2ca5e 100644
--- a/pyim-process.el
+++ b/pyim-process.el
@@ -975,7 +975,7 @@ SILENT 设置为 t 是,不显示提醒信息。"
   (when-let* ((string (pyim-cstring-at-point (or number 2
 (pyim-process-create-word string)
 (unless silent
-  (message "将词条: %S 加入词库。" string
+  (message "PYIM: 将词条 %S 加入词库。" string
 
 (defun pyim-process--trigger-call-function-p ()
   "当光标之前是中文但不是标点符号时,返回 t."
diff --git a/pyim.el b/pyim.el
index 38b13c38d0..96b2e782cd 100644
--- a/pyim.el
+++ b/pyim.el
@@ -283,11 +283,11 @@ REFRESH-COMMON-DCACHE 已经废弃,不要再使用了。"
   (when (region-active-p)
 (let ((string (buffer-substring-no-properties (region-beginning) 
(region-end
   (if (> (length string) 6)
-  (error "词条太长")
+  (error "PYIM: 所选词条太长。")
 (if (not (string-match-p "^\\cc+\\'" string))
-(error "不是纯中文字符串")
+(error "PYIM: 所选词条包含非中文字符。")
   (pyim-process-create-word string)
-  (message "将词条: %S 插入 personal file。" string)))
+  (message "PYIM: 将词条 %S 加入词库。" string)))
   (deactivate-mark)
   ;; NOTE: 这里必须返回 t, 因为这个函数的返回结果会被用来做为判断条件。
   t)))
@@ -389,7 +389,7 @@ FILE 的格式与 `pyim-dcache-export' 生成的文件格式相同,
 (when (and word (not (pyim-string-match-p "\\CC" word)))
   (pyim-process-delete-word word)))
   (forward-line 1)))
-  (message "pyim: 批量删词完成!"))
+  (message "PYIM: 批量删词完成!"))
 
 (defun pyim-delete-last-word ()
   "从个人词库中删除最新创建的词条。"
@@ -397,7 +397,7 @@ FILE 的格式与 `pyim-dcache-export' 生成的文件格式相同,
   (let ((word (pyim-process-last-created-word)))
 (when word
   (pyim-process-delete-word word)
-  (message "pyim: 从个人词库中删除词条 “%s” !" word
+  (message "PYIM: 将词条 %S 从个人词库中删除!" word
 
 (defalias 'pyim-delete-word-at-point
   #'pyim-process-delete-word-at-point)
@@ -412,14 +412,14 @@ FILE 的格式与 `pyim-dcache-export' 生成的文件格式相同,
   (when (and (< (length string) 6)
  (> (length string) 0))
 (pyim-process-delete-word string)
-(message "将词条: %S 从 personal 缓冲中删除。" string)
+(message "将词条 %S 从个人词库中删除。" string)
 (deactivate-mark
(t (let ((words (completing-read-multiple
 "请选择需要删除的词条(可多选): "
 (pyim-process-last-created-words
 (dolist (word words)
   (pyim-process-delete-word word)
-  (message "将词条: %S 从 personal 缓冲中删除。" word))
+  (message "将词条 %S 从个人词库中删除。" word))
 
 ;; ** 选词功能
 (defun pyim-select-word-simple ()
@@ -576,7 +576,7 @@ FILE 的格式与 `pyim-dcache-export' 生成的文件格式相同,
   (or (pyim-create-word-from-selection)
   (pyim-process-trigger-feature-run-p)
   (pyim-process-feed-entered-at-point-into-pyim)
-  (message "PYIM: `pyim-convert-string-at-point' did nothing.")))
+  (message "PYIM: 命令 `pyim-convert-string-at-point' 没有起作用!")))
 
 (defun pyim--activate-pyim ()
   "如果当前输入法设置为 pyim, 就激活它。"



[elpa] externals/consult 497a5ebaf2 1/3: consult--invisible-open-temporarily: Store regions in a variable

2023-01-16 Thread ELPA Syncer
branch: externals/consult
commit 497a5ebaf23db2c9d4630752e56ed76e4d70a5df
Author: Daniel Mendler 
Commit: Daniel Mendler 

consult--invisible-open-temporarily: Store regions in a variable

This may introduce problems if the buffer changes in the meantime but
it should help with slow preview in large Org buffers. See #708 and
---
 consult.el | 22 +++---
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/consult.el b/consult.el
index e86be83c86..0029a99724 100644
--- a/consult.el
+++ b/consult.el
@@ -6,7 +6,7 @@
 ;; Maintainer: Daniel Mendler 
 ;; Created: 2020
 ;; Version: 0.31
-;; Package-Requires: ((emacs "27.1") (compat "29.1.1.0"))
+;; Package-Requires: ((emacs "27.1") (compat "29.1.1.1"))
 ;; Homepage: https://github.com/minad/consult
 
 ;; This file is part of GNU Emacs.
@@ -534,6 +534,9 @@ We use invalid characters outside the Unicode range.")
 (defvar-local consult--focus-lines-overlays nil
   "Overlays used by `consult-focus-lines'.")
 
+(defvar-local consult--org-fold-regions nil
+  "Stored regions for the org-fold API.")
+
  Customization helper
 
 (defun consult--customize-put (cmds prop form)
@@ -1359,14 +1362,14 @@ See `isearch-open-necessary-overlays' and 
`isearch-open-overlay-temporary'."
   ;; efficiently.  We obtain all regions in the whole buffer in order to
   ;; restore them.  A better show API would return all the applied
   ;; modifications such that we can restore the ones which got modified.
-  (let ((regions (delq nil (org-fold-core-get-regions
-:with-markers t :from (point-min) :to 
(point-max)
+  (progn
+(with-memoization consult--org-fold-regions
+  (delq nil (org-fold-core-get-regions
+ :with-markers t :from (point-min) :to (point-max
 (org-fold-show-set-visibility 'canonical)
 (list (lambda ()
-(pcase-dolist (`(,beg ,end ,spec) regions)
-  (org-fold-core-region beg end t spec)
-  (when (markerp beg) (set-marker beg nil))
-  (when (markerp end) (set-marker end nil))
+(pcase-dolist (`(,beg ,end ,spec) consult--org-fold-regions)
+  (org-fold-core-region beg end t spec)
 (let (restore)
   (dolist (ov (overlays-in (pos-bol) (pos-eol)))
 (let ((inv (overlay-get ov 'invisible)))
@@ -1422,6 +1425,11 @@ The function can be used as the `:state' argument of 
`consult--read'."
 overlays invisible)
 (set-marker-insertion-type saved-max t) ;; Grow when text is inserted
 (lambda (action cand)
+  (when (eq action 'return)
+(pcase-dolist (`(,beg ,end ,_) consult--org-fold-regions)
+  (when (markerp beg) (set-marker beg nil))
+  (when (markerp end) (set-marker end nil)))
+(kill-local-variable 'consult--org-fold-regions))
   (when (eq action 'preview)
 (mapc #'funcall invisible)
 (mapc #'delete-overlay overlays)



[elpa] externals/consult 7c47909b0e 2/3: Improve consult--invisible-open-temporarily

2023-01-16 Thread ELPA Syncer
branch: externals/consult
commit 7c47909b0ee5c53e42cf0e10110cfd57dadefb3b
Author: Daniel Mendler 
Commit: Daniel Mendler 

Improve consult--invisible-open-temporarily
---
 consult.el | 24 
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/consult.el b/consult.el
index 0029a99724..3949ccbdde 100644
--- a/consult.el
+++ b/consult.el
@@ -1363,9 +1363,22 @@ See `isearch-open-necessary-overlays' and 
`isearch-open-overlay-temporary'."
   ;; restore them.  A better show API would return all the applied
   ;; modifications such that we can restore the ones which got modified.
   (progn
-(with-memoization consult--org-fold-regions
-  (delq nil (org-fold-core-get-regions
- :with-markers t :from (point-min) :to (point-max
+(unless consult--org-fold-regions
+  (setq consult--org-fold-regions
+(delq nil (org-fold-core-get-regions
+   :with-markers t :from (point-min) :to (point-max
+  (when consult--org-fold-regions
+(let ((hook (make-symbol 
"consult--invisible-open-temporarily-cleanup"))
+  (buffer (current-buffer)))
+  (fset hook (lambda ()
+   (remove-hook 'minibuffer-exit-hook hook)
+   (when (buffer-live-p buffer)
+ (with-current-buffer buffer
+   (pcase-dolist (`(,beg ,end ,_) 
consult--org-fold-regions)
+ (when (markerp beg) (set-marker beg nil))
+ (when (markerp end) (set-marker end nil)))
+   (kill-local-variable 
'consult--org-fold-regions)
+  (add-hook 'minibuffer-exit-hook hook
 (org-fold-show-set-visibility 'canonical)
 (list (lambda ()
 (pcase-dolist (`(,beg ,end ,spec) consult--org-fold-regions)
@@ -1425,11 +1438,6 @@ The function can be used as the `:state' argument of 
`consult--read'."
 overlays invisible)
 (set-marker-insertion-type saved-max t) ;; Grow when text is inserted
 (lambda (action cand)
-  (when (eq action 'return)
-(pcase-dolist (`(,beg ,end ,_) consult--org-fold-regions)
-  (when (markerp beg) (set-marker beg nil))
-  (when (markerp end) (set-marker end nil)))
-(kill-local-variable 'consult--org-fold-regions))
   (when (eq action 'preview)
 (mapc #'funcall invisible)
 (mapc #'delete-overlay overlays)



[elpa] externals/consult updated (be2d8781d9 -> fae9b50d88)

2023-01-16 Thread ELPA Syncer
elpasync pushed a change to branch externals/consult.

  from  be2d8781d9 Prefer if-let/when-let
   new  497a5ebaf2 consult--invisible-open-temporarily: Store regions in a 
variable
   new  7c47909b0e Improve consult--invisible-open-temporarily
   new  fae9b50d88 Improve consult--invisible-open-temporarily


Summary of changes:
 consult.el | 32 +---
 1 file changed, 25 insertions(+), 7 deletions(-)



[elpa] externals/consult fae9b50d88 3/3: Improve consult--invisible-open-temporarily

2023-01-16 Thread ELPA Syncer
branch: externals/consult
commit fae9b50d88e991452d5a32a41c2b8452aa1a914d
Author: Daniel Mendler 
Commit: Daniel Mendler 

Improve consult--invisible-open-temporarily
---
 consult.el | 24 +---
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/consult.el b/consult.el
index 3949ccbdde..d533045f8b 100644
--- a/consult.el
+++ b/consult.el
@@ -1368,17 +1368,19 @@ See `isearch-open-necessary-overlays' and 
`isearch-open-overlay-temporary'."
 (delq nil (org-fold-core-get-regions
:with-markers t :from (point-min) :to (point-max
   (when consult--org-fold-regions
-(let ((hook (make-symbol 
"consult--invisible-open-temporarily-cleanup"))
-  (buffer (current-buffer)))
-  (fset hook (lambda ()
-   (remove-hook 'minibuffer-exit-hook hook)
-   (when (buffer-live-p buffer)
- (with-current-buffer buffer
-   (pcase-dolist (`(,beg ,end ,_) 
consult--org-fold-regions)
- (when (markerp beg) (set-marker beg nil))
- (when (markerp end) (set-marker end nil)))
-   (kill-local-variable 
'consult--org-fold-regions)
-  (add-hook 'minibuffer-exit-hook hook
+(let ((hook (make-symbol 
"consult--invisible-open-temporarily-cleanup")))
+  (fset hook (apply-partially #'run-at-time 0 nil
+  (lambda (buffer)
+(when (buffer-live-p buffer)
+  (with-current-buffer buffer
+(pcase-dolist (`(,beg ,end ,_) 
consult--org-fold-regions)
+  (when (markerp beg) 
(set-marker beg nil))
+  (when (markerp end) 
(set-marker end nil)))
+(kill-local-variable 
'consult--org-fold-regions
+  (current-buffer)))
+  (when-let (win (active-minibuffer-window))
+(with-current-buffer (window-buffer win)
+  (add-hook 'minibuffer-exit-hook hook nil 'local))
 (org-fold-show-set-visibility 'canonical)
 (list (lambda ()
 (pcase-dolist (`(,beg ,end ,spec) consult--org-fold-regions)



[elpa] externals/compat 009e33bbc9: Add test for file-has-changed-p

2023-01-16 Thread ELPA Syncer
branch: externals/compat
commit 009e33bbc9084c63ad3e81b778855025826a0845
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add test for file-has-changed-p
---
 compat-29.el|  8 
 compat-tests.el | 26 --
 2 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/compat-29.el b/compat-29.el
index 7b53d59d5c..f8a6630f95 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -410,11 +410,11 @@ to `default-directory', and the result will also be 
relative."
  (t
   parent
 
-(compat-defvar file-has-changed-p--hash-table ;; 
+(compat-defvar file-has-changed-p--hash-table ;; 

(make-hash-table :test #'equal)
   "Internal variable used by `file-has-changed-p'.")
 
-(compat-defun file-has-changed-p (file &optional tag) ;; 
+(compat-defun file-has-changed-p (file &optional tag) ;; 

   "Return non-nil if FILE has changed.
 The size and modification time of FILE are compared to the size
 and modification time of the same FILE during a previous
@@ -431,8 +431,8 @@ the symbol of the calling function, for example."
   (file-attribute-modification-time fileattr
  (sym (concat (symbol-name tag) "@" file))
  (cachedattr (gethash sym file-has-changed-p--hash-table)))
- (when (not (equal attr cachedattr))
-   (puthash sym attr file-has-changed-p--hash-table
+(when (not (equal attr cachedattr))
+  (puthash sym attr file-has-changed-p--hash-table
 
  Defined in keymap.el
 
diff --git a/compat-tests.el b/compat-tests.el
index 93288c08f3..e79cff2187 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -1215,7 +1215,7 @@
   (should-not (directory-name-p "dir/subdir")))
 
 (ert-deftest directory-empty-p ()
-  (let ((name (make-temp-name "compat-tests")))
+  (let ((name (make-temp-name "/tmp/compat-tests")))
 (make-directory name)
 (should (directory-empty-p name))
 (make-empty-file (file-name-concat name "file"))
@@ -1224,7 +1224,7 @@
 (delete-directory name)))
 
 (ert-deftest make-empty-file ()
-  (let ((name (make-temp-name "compat-tests")))
+  (let ((name (make-temp-name "/tmp/compat-tests")))
 (should-not (file-exists-p name))
 (make-empty-file name)
 (should-equal 0 (file-attribute-size (file-attributes name)))
@@ -1252,6 +1252,28 @@
   (should-equal (expand-file-name "bar/.#b") (make-lock-file-name "bar/b"))
   (should-equal (expand-file-name "bar/.#foo") (make-lock-file-name 
"bar/foo")))
 
+(ert-deftest file-has-changed-p ()
+  (let ((name (make-temp-file "/tmp/compat-tests")))
+(should (file-has-changed-p name))
+(should-not (file-has-changed-p name))
+(should-not (file-has-changed-p name))
+(should (file-has-changed-p name 'tag1))
+(should-not (file-has-changed-p name 'tag1))
+(should-not (file-has-changed-p name 'tag1))
+(with-temp-buffer
+  (insert "changed")
+  (write-region (point-min) (point-max) name))
+(should (file-has-changed-p name))
+(should-not (file-has-changed-p name))
+(should-not (file-has-changed-p name))
+(should (file-has-changed-p name 'tag1))
+(should-not (file-has-changed-p name 'tag1))
+(should-not (file-has-changed-p name 'tag1))
+(should (file-has-changed-p name 'tag2))
+(should-not (file-has-changed-p name 'tag2))
+(should-not (file-has-changed-p name 'tag2))
+(delete-file name)))
+
 (ert-deftest file-attribute-getters ()
   (let ((attrs '(type link-number user-id group-id access-time 
modification-time
  status-change-time size modes unspecified inode-number 
device-number)))



[elpa] externals/compat 04666aacc7 1/3: Add tests for match-buffers and buffer-match-p

2023-01-16 Thread ELPA Syncer
branch: externals/compat
commit 04666aacc7e5d435be5359066e2bdc82b8e88eef
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add tests for match-buffers and buffer-match-p
---
 compat-29.el|  4 ++--
 compat-tests.el | 28 
 2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/compat-29.el b/compat-29.el
index f8a6630f95..86ea558490 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -189,7 +189,7 @@ signalled.  If NOERROR, the non-loop parts of the chain is 
returned."
  (push func chain))
chain
 
-(compat-defun buffer-match-p (condition buffer-or-name &optional arg) ;; 

+(compat-defun buffer-match-p (condition buffer-or-name &optional arg) ;; 

   "Return non-nil if BUFFER-OR-NAME matches CONDITION.
 CONDITION is either:
 - the symbol t, to always match,
@@ -245,7 +245,7 @@ CONDITION is either:
 (throw 'match t)))
 (funcall match (list condition
 
-(compat-defun match-buffers (condition &optional buffers arg) ;; 
+(compat-defun match-buffers (condition &optional buffers arg) ;; 

   "Return a list of buffers that match CONDITION.
 See `buffer-match' for details on CONDITION.  By default all
 buffers are checked, this can be restricted by passing an
diff --git a/compat-tests.el b/compat-tests.el
index e79cff2187..8ba281960d 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -80,6 +80,34 @@
 (setq list (funcall sym list "first" 1 #'string=))
 (should (eq (compat-call plist-get list "first" #'string=) 1
 
+(ert-deftest buffer-match-p ()
+  (with-current-buffer (get-buffer-create "*compat-test-buffer*")
+(js-mode))
+  (let ((b "*compat-test-buffer*"))
+(should (buffer-match-p t b))
+(should-not (buffer-match-p nil b))
+(should (buffer-match-p "compat" b))
+(should (buffer-match-p #'always b))
+(should-not (buffer-match-p #'ignore b))
+(should (buffer-match-p '(derived-mode . prog-mode) b))
+(should-not (buffer-match-p '(derived-mode . text-mode) b))
+(should (buffer-match-p '(major-mode . js-mode) b))
+(should-not (buffer-match-p '(major-mode . prog-mode) b))
+(should (buffer-match-p '(not (major-mode . prog-mode)) b))
+(should (buffer-match-p '(and (major-mode . js-mode) "compat" t) b))
+(should (buffer-match-p '(or (major-mode . css-mode) "foo" t) b
+
+(ert-deftest match-buffers ()
+  (let ((b1 (get-buffer-create "*compat-buffer-js*"))
+(b2 (get-buffer-create "*compat-buffer-css*"))
+(b3 (get-buffer-create "*compat-buffer-text*")))
+  (with-current-buffer b1 (js-mode))
+  (with-current-buffer b2 (css-mode))
+  (with-current-buffer b3 (text-mode))
+  (should-equal (list b2 b1)
+(match-buffers '(or (major-mode . css-mode) (major-mode . 
js-mode))
+   (list b1 b2 b3)
+
 (ert-deftest thing-at-mouse ()
   (save-window-excursion
 (with-temp-buffer



[elpa] externals/compat f7acde710a 2/3: compat-tests: Do not load modes

2023-01-16 Thread ELPA Syncer
branch: externals/compat
commit f7acde710a1e0e610f1063a38817a91be74ed848
Author: Daniel Mendler 
Commit: Daniel Mendler 

compat-tests: Do not load modes
---
 compat-tests.el | 34 --
 1 file changed, 20 insertions(+), 14 deletions(-)

diff --git a/compat-tests.el b/compat-tests.el
index 8ba281960d..169fc35948 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -81,31 +81,37 @@
 (should (eq (compat-call plist-get list "first" #'string=) 1
 
 (ert-deftest buffer-match-p ()
-  (with-current-buffer (get-buffer-create "*compat-test-buffer*")
-(js-mode))
-  (let ((b "*compat-test-buffer*"))
+  (let ((b "*compat-test-buffer*")
+(child-mode (make-symbol "child"))
+(parent-mode (make-symbol "parent")))
+(put child-mode 'derived-mode-parent parent-mode)
+(with-current-buffer (get-buffer-create b)
+  (setq major-mode child-mode))
 (should (buffer-match-p t b))
 (should-not (buffer-match-p nil b))
 (should (buffer-match-p "compat" b))
 (should (buffer-match-p #'always b))
 (should-not (buffer-match-p #'ignore b))
-(should (buffer-match-p '(derived-mode . prog-mode) b))
+(should (buffer-match-p `(derived-mode . ,parent-mode) b))
 (should-not (buffer-match-p '(derived-mode . text-mode) b))
-(should (buffer-match-p '(major-mode . js-mode) b))
+(should (buffer-match-p `(major-mode . ,child-mode) b))
 (should-not (buffer-match-p '(major-mode . prog-mode) b))
 (should (buffer-match-p '(not (major-mode . prog-mode)) b))
-(should (buffer-match-p '(and (major-mode . js-mode) "compat" t) b))
-(should (buffer-match-p '(or (major-mode . css-mode) "foo" t) b
+(should (buffer-match-p `(and (major-mode . ,child-mode) "compat" t) b))
+(should (buffer-match-p `(or (major-mode . prog-mode) "foo" t) b
 
 (ert-deftest match-buffers ()
-  (let ((b1 (get-buffer-create "*compat-buffer-js*"))
-(b2 (get-buffer-create "*compat-buffer-css*"))
-(b3 (get-buffer-create "*compat-buffer-text*")))
-  (with-current-buffer b1 (js-mode))
-  (with-current-buffer b2 (css-mode))
-  (with-current-buffer b3 (text-mode))
+  (let ((b1 (get-buffer-create "*compat-buffer1*"))
+(b2 (get-buffer-create "*compat-buffer2*"))
+(b3 (get-buffer-create "*compat-buffer3*"))
+(m1 (make-symbol "mode1"))
+(m2 (make-symbol "mode2"))
+(m3 (make-symbol "mode3")))
+  (with-current-buffer b1 (setq major-mode m1))
+  (with-current-buffer b2 (setq major-mode m2))
+  (with-current-buffer b3 (setq major-mode m3))
   (should-equal (list b2 b1)
-(match-buffers '(or (major-mode . css-mode) (major-mode . 
js-mode))
+(match-buffers `(or (major-mode . ,m1) (major-mode . ,m2))
(list b1 b2 b3)
 
 (ert-deftest thing-at-mouse ()



[elpa] externals/compat updated (009e33bbc9 -> eb20a30f45)

2023-01-16 Thread ELPA Syncer
elpasync pushed a change to branch externals/compat.

  from  009e33bbc9 Add test for file-has-changed-p
   new  04666aacc7 Add tests for match-buffers and buffer-match-p
   new  f7acde710a compat-tests: Do not load modes
   new  eb20a30f45 Add test for keymap-set-after


Summary of changes:
 compat-29.el|  6 +++---
 compat-tests.el | 43 +++
 2 files changed, 46 insertions(+), 3 deletions(-)



[elpa] externals/compat eb20a30f45 3/3: Add test for keymap-set-after

2023-01-16 Thread ELPA Syncer
branch: externals/compat
commit eb20a30f456c30ff03c39c046f6c9eff2ab17525
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add test for keymap-set-after
---
 compat-29.el| 2 +-
 compat-tests.el | 9 +
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/compat-29.el b/compat-29.el
index 86ea558490..a01d466e15 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -716,7 +716,7 @@ in a cleaner way with command remapping, like this:
(substitute-key-definition-key defn olddef newdef prefix1 keymap))
  scan)))
 
-(compat-defun keymap-set-after (keymap key definition &optional after) ;; 

+(compat-defun keymap-set-after (keymap key definition &optional after) ;; 

   "Add binding in KEYMAP for KEY => DEFINITION, right after AFTER's binding.
 This is like `keymap-set' except that the binding for KEY is placed
 just after the binding for the event AFTER, instead of at the beginning
diff --git a/compat-tests.el b/compat-tests.el
index 169fc35948..61b2e8fc54 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -419,6 +419,15 @@
   (should-equal compat-tests--map-1 compat-tests--map-3)
   (should-equal compat-tests--map-1 compat-tests--map-4))
 
+(ert-deftest keymap-set-after ()
+  (let ((map (make-sparse-keymap)))
+(define-key-after map "d" 'd "a")
+(define-key-after map "a" 'a)
+(define-key-after map "b" 'b)
+(define-key-after map "c" 'c)
+(define-key-after map "d" 'd "b") ;; TODO the after argument has no 
effect?!
+(should-equal map '(keymap (?a . a) (?b . b) (?c . c) (?d . d)
+
 (ert-deftest key-parse ()
   (should-equal (key-parse "f") [?f])
   (should-equal (key-parse "X") [?X])



[nongnu] elpa/org-superstar 29dbbc48ac: Add feature to use Superstar for item bullets only.

2023-01-16 Thread ELPA Syncer
branch: elpa/org-superstar
commit 29dbbc48ac925f36cc1636b36b4a3ccb3588e17f
Author: D. Williams 
Commit: D. Williams 

Add feature to use Superstar for item bullets only.

See Issue #36.
---
 README.org   |  3 ++-
 org-superstar.el | 36 +---
 2 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/README.org b/README.org
index 82ff047883..161aa95f0d 100644
--- a/README.org
+++ b/README.org
@@ -217,7 +217,8 @@ used, allowing the user to inherit the level-dependent 
default look.
 
 *** ~org-superstar-prettify-item-bullets~
 Exactly as it says on the tin.  Set this variable to ~nil~ to stop
-~org-superstar-mode~ from prettifying lists.
+~org-superstar-mode~ from prettifying lists.  If set to the symbol
+~only~, this disables prettifying Org headings entirely.
 
 *** Fast Plain List Items
 The default syntax-checking done to ensure only actual plain list
diff --git a/org-superstar.el b/org-superstar.el
index fe0f8a70a2..a48292c53d 100644
--- a/org-superstar.el
+++ b/org-superstar.el
@@ -362,11 +362,15 @@ raise an error."
 Each type of plain list bullet is associated with a
 corresponding UTF8 character in ‘org-superstar-item-bullet-alist’.
 
+If set to the symbol ‘only’, disable fontifying headlines entirely.
+This takes precedence over all other customizations.
+
 You should call ‘org-superstar-restart’ after changing this
 variable for your changes to take effect."
   :group 'org-superstar
   :type '(choice (const :tag "Enable item bullet fontification" t)
- (const :tag "Disable item bullet fontification" nil)))
+ (const :tag "Disable item bullet fontification" nil)
+ (const :tag "Exclusively fontify item bullets" only)))
 
 (defcustom org-superstar-special-todo-items nil
   "Non-nil means use special bullets for TODO items.
@@ -833,21 +837,23 @@ cleanup routines."
 `(,@(when org-superstar-prettify-item-bullets
   '(("^[ \t]*?\\(?:\\(?1:[-+]\\)\\|[ \t]\\(?1:\\*\\)\\) "
  (1 (org-superstar--prettify-ibullets)
-  ("^\\(?3:\\**?\\)\\(?2:\\*?\\)\\(?1:\\*\\) "
-   (1 (org-superstar--prettify-main-hbullet) prepend)
-   ,@(unless (or org-hide-leading-stars
- org-superstar-remove-leading-stars)
-   '((3 (org-superstar--prettify-leading-hbullets)
-t)
- (2 (org-superstar--prettify-other-lbullet)
-t)))
-   ,@(when org-superstar-remove-leading-stars
-   '((3 (org-superstar--make-invisible 3))
- (2 (org-superstar--make-invisible 2
-   ,@(when (featurep 'org-inlinetask)
-   '((2 (org-superstar--prettify-other-hbullet)
-prepend
+  ,@(unless (eq org-superstar-prettify-item-bullets 'only)
+  `(("^\\(?3:\\**?\\)\\(?2:\\*?\\)\\(?1:\\*\\) "
+ (1 (org-superstar--prettify-main-hbullet) prepend)
+ ,@(unless (or org-hide-leading-stars
+   org-superstar-remove-leading-stars)
+ '((3 (org-superstar--prettify-leading-hbullets)
+  t)
+   (2 (org-superstar--prettify-other-lbullet)
+  t)))
+ ,@(when org-superstar-remove-leading-stars
+ '((3 (org-superstar--make-invisible 3))
+   (2 (org-superstar--make-invisible 2
+ ,@(when (featurep 'org-inlinetask)
+ '((2 (org-superstar--prettify-other-hbullet)
+  prepend))
   ,@(when (and (featurep 'org-inlinetask)
+   (not (eq org-superstar-prettify-item-bullets 'only))
org-inlinetask-show-first-star
(not org-superstar-remove-leading-stars))
   '(("^\\(?4:\\*\\)\\(?:\\*\\{2,\\}\\) "



[elpa] externals/compat 7c2de84d68 2/3: compat-27: Add missing declare-function

2023-01-16 Thread ELPA Syncer
branch: externals/compat
commit 7c2de84d68b4169f115dc9208aa37cf583cd8d34
Author: Daniel Mendler 
Commit: Daniel Mendler 

compat-27: Add missing declare-function
---
 compat-27.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/compat-27.el b/compat-27.el
index 26e557d270..12209ce7e7 100644
--- a/compat-27.el
+++ b/compat-27.el
@@ -493,6 +493,7 @@ Optional arg PARENTS, if non-nil then creates parent dirs 
as needed."
  Defined in package.el
 
 (declare-function lm-header "lisp-mnt")
+(declare-function macroexp-file-name nil)
 
 (compat-defun package-get-version () ;; 
   "Return the version number of the package in which this is used.



[elpa] externals/compat updated (eb20a30f45 -> fcb99b1b1e)

2023-01-16 Thread ELPA Syncer
elpasync pushed a change to branch externals/compat.

  from  eb20a30f45 Add test for keymap-set-after
   new  d81a132d2f Add test for package-get-version
   new  7c2de84d68 compat-27: Add missing declare-function
   new  fcb99b1b1e Add test for keymap-substitute


Summary of changes:
 compat-27.el| 10 --
 compat-29.el|  2 +-
 compat-tests.el | 25 -
 3 files changed, 25 insertions(+), 12 deletions(-)



[elpa] externals/compat d81a132d2f 1/3: Add test for package-get-version

2023-01-16 Thread ELPA Syncer
branch: externals/compat
commit d81a132d2fd0f5fec08486ed5222b8e1d0402560
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add test for package-get-version
---
 compat-27.el| 9 +++--
 compat-tests.el | 5 +
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/compat-27.el b/compat-27.el
index 9a74a4d5b8..26e557d270 100644
--- a/compat-27.el
+++ b/compat-27.el
@@ -494,20 +494,17 @@ Optional arg PARENTS, if non-nil then creates parent dirs 
as needed."
 
 (declare-function lm-header "lisp-mnt")
 
-(compat-defun package-get-version () ;; 
+(compat-defun package-get-version () ;; 
   "Return the version number of the package in which this is used.
 Assumes it is used from an Elisp file placed inside the top-level directory
 of an installed ELPA package.
 The return value is a string (or nil in case we can’t find it)."
-  :feature package
+  ;; No :feature since the function is autoloaded.
   ;; In a sense, this is a lie, but it does just what we want: precompute
   ;; the version at compile time and hardcodes it into the .elc file!
   (declare (pure t))
   ;; Hack alert!
-  (let ((file
- (or (and (boundp 'byte-compile-current-file) 
byte-compile-current-file)
- load-file-name
- buffer-file-name)))
+  (let ((file (or (macroexp-file-name) buffer-file-name)))
 (cond
  ((null file) nil)
  ;; Packages are normally installed into directories named "-",
diff --git a/compat-tests.el b/compat-tests.el
index 61b2e8fc54..0f520c8ee1 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -80,6 +80,11 @@
 (setq list (funcall sym list "first" 1 #'string=))
 (should (eq (compat-call plist-get list "first" #'string=) 1
 
+(defconst compat-tests--version (package-get-version))
+(ert-deftest package-get-version ()
+  (should (stringp compat-tests--version))
+  (should-equal 29 (car (version-to-list compat-tests--version
+
 (ert-deftest buffer-match-p ()
   (let ((b "*compat-test-buffer*")
 (child-mode (make-symbol "child"))



[elpa] externals/compat fcb99b1b1e 3/3: Add test for keymap-substitute

2023-01-16 Thread ELPA Syncer
branch: externals/compat
commit fcb99b1b1e910565baccafed7dc4d1aacdc993b7
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add test for keymap-substitute
---
 compat-29.el|  2 +-
 compat-tests.el | 20 +++-
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/compat-29.el b/compat-29.el
index a01d466e15..adca2179e1 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -685,7 +685,7 @@ NOTE: The compatibility version is not a command."
   (when (current-local-map)
 (keymap-unset (current-local-map) key remove)))
 
-(compat-defun keymap-substitute (keymap olddef newdef &optional oldmap prefix) 
;; 
+(compat-defun keymap-substitute (keymap olddef newdef &optional oldmap prefix) 
;; 
   "Replace OLDDEF with NEWDEF for any keys in KEYMAP now defined as OLDDEF.
 In other words, OLDDEF is replaced with NEWDEF wherever it appears.
 Alternatively, if optional fourth argument OLDMAP is specified, we redefine
diff --git a/compat-tests.el b/compat-tests.el
index 0f520c8ee1..793eeed5a4 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -426,13 +426,23 @@
 
 (ert-deftest keymap-set-after ()
   (let ((map (make-sparse-keymap)))
-(define-key-after map "d" 'd "a")
-(define-key-after map "a" 'a)
-(define-key-after map "b" 'b)
-(define-key-after map "c" 'c)
-(define-key-after map "d" 'd "b") ;; TODO the after argument has no 
effect?!
+(keymap-set-after map "d" 'd "a")
+(keymap-set-after map "a" 'a)
+(keymap-set-after map "b" 'b)
+(keymap-set-after map "c" 'c)
+(keymap-set-after map "d" 'd "b") ;; TODO the after argument has no 
effect?!
 (should-equal map '(keymap (?a . a) (?b . b) (?c . c) (?d . d)
 
+(ert-deftest keymap-substitute ()
+  (let ((map (define-keymap
+   "C-x C-f" #'find-file
+   "s-f" #'find-file
+   "C-x b" #'switch-to-buffer)))
+(keymap-substitute map #'find-file 'ffap)
+(should-equal (keymap-lookup map "C-x b") #'switch-to-buffer)
+(should-equal (keymap-lookup map "C-x C-f") 'ffap)
+(should-equal (keymap-lookup map "s-f") 'ffap)))
+
 (ert-deftest key-parse ()
   (should-equal (key-parse "f") [?f])
   (should-equal (key-parse "X") [?X])



[nongnu] elpa/org-superstar 54c81c27dd: Update bug_report.md

2023-01-16 Thread ELPA Syncer
branch: elpa/org-superstar
commit 54c81c27dde2a6dc461bb064e79a8b2089093a2e
Author: D. Williams 
Commit: GitHub 

Update bug_report.md
---
 .github/ISSUE_TEMPLATE/bug_report.md | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/.github/ISSUE_TEMPLATE/bug_report.md 
b/.github/ISSUE_TEMPLATE/bug_report.md
index 80067e3102..3cf137acb5 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -7,4 +7,10 @@ assignees: integral-dw
 
 ---
 
-If your problem causes something visual (e.g. a bullet not showing/showing 
incorrectly), be sure to provide a screenshot and ideally the name of the font 
you are using.  To inspect details about how Emacs presents a given character, 
navigate towards it and enter either `C-u C-x =` or `C-u M-x 
what-cursor-position`, which will provide us with plenty of information 
regarding how Emacs set up the affected character for display.  __Be sure to 
delete this text before submission!__
+If your problem causes something visual (e.g. a bullet not showing/showing 
incorrectly), be sure to provide a screenshot and ideally the name of the font 
you are using.  To inspect details about how Emacs presents a given character, 
navigate towards it and enter either `C-u C-x =` or `C-u M-x 
what-cursor-position`, which will provide us with plenty of information 
regarding how Emacs set up the affected character for display.  
+ __Please also provide a minimum working example if possible.  It generally 
helps to:__
+
+1. Start from `emacs --no-init`
+2. Possibly provide a minimum working example including a simplified version 
of your init that reproduces the issue.
+
+ __Be sure to delete this text before submission!__



[nongnu] elpa/typescript-mode 4fcb459481 2/2: Merge pull request #182 from jdufresne/tsx

2023-01-16 Thread ELPA Syncer
branch: elpa/typescript-mode
commit 4fcb4594819caf472ae42ea068a1c7795cf07f46
Merge: 4e10fd7973 7675bab5f2
Author: Jostein Kjønigsen 
Commit: GitHub 

Merge pull request #182 from jdufresne/tsx

Add .tsx to auto-mode-alist
---
 typescript-mode-general-tests.el | 8 
 typescript-mode.el   | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/typescript-mode-general-tests.el b/typescript-mode-general-tests.el
index d013ac3eba..65aa07440a 100644
--- a/typescript-mode-general-tests.el
+++ b/typescript-mode-general-tests.el
@@ -18,6 +18,14 @@
   (indent-region (point-min) (point-max) nil)
   (untabify (point-min) (point-max)))
 
+(ert-deftest auto-mode-alist-ts ()
+  (find-file (make-temp-file load-file-name nil ".ts"))
+  (should (string-equal "typescript-mode" major-mode)))
+
+(ert-deftest auto-mode-alist-tsx ()
+  (find-file (make-temp-file load-file-name nil ".tsx"))
+  (should (string-equal "typescript-mode" major-mode)))
+
 (ert-deftest indentation-reference-document-is-reflowed-correctly ()
   (with-temp-buffer
 (insert-file-contents "test-files/indentation-reference-document.ts")
diff --git a/typescript-mode.el b/typescript-mode.el
index bcb7f19c89..aa7e5b2234 100644
--- a/typescript-mode.el
+++ b/typescript-mode.el
@@ -3119,7 +3119,7 @@ Key bindings:
  (folding-add-to-marks-list 'typescript-mode "// {{{" "// }}}" )))
 
 ;;;###autoload
-(add-to-list 'auto-mode-alist '("\\.ts\\'" . typescript-mode))
+(add-to-list 'auto-mode-alist '("\\.tsx?\\'" . typescript-mode))
 
 (provide 'typescript-mode)
 



[nongnu] elpa/typescript-mode 7675bab5f2 1/2: Add .tsx to auto-mode-alist

2023-01-16 Thread ELPA Syncer
branch: elpa/typescript-mode
commit 7675bab5f2427f16424a8b531cfb10ffe29c2ef3
Author: Jon Dufresne 
Commit: Jon Dufresne 

Add .tsx to auto-mode-alist

Add out-of-the-box support for using typescript-mode on *.tsx files.
Avoids repetitive manual configuration for end users.
---
 typescript-mode-general-tests.el | 8 
 typescript-mode.el   | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/typescript-mode-general-tests.el b/typescript-mode-general-tests.el
index 8522eedeec..eda77f7dce 100644
--- a/typescript-mode-general-tests.el
+++ b/typescript-mode-general-tests.el
@@ -18,6 +18,14 @@
   (indent-region (point-min) (point-max) nil)
   (untabify (point-min) (point-max)))
 
+(ert-deftest auto-mode-alist-ts ()
+  (find-file (make-temp-file load-file-name nil ".ts"))
+  (should (string-equal "typescript-mode" major-mode)))
+
+(ert-deftest auto-mode-alist-tsx ()
+  (find-file (make-temp-file load-file-name nil ".tsx"))
+  (should (string-equal "typescript-mode" major-mode)))
+
 (ert-deftest indentation-reference-document-is-reflowed-correctly ()
   (with-temp-buffer
 (insert-file-contents "test-files/indentation-reference-document.ts")
diff --git a/typescript-mode.el b/typescript-mode.el
index 47f8fa90f6..b3f2824efe 100644
--- a/typescript-mode.el
+++ b/typescript-mode.el
@@ -3119,7 +3119,7 @@ Key bindings:
  (folding-add-to-marks-list 'typescript-mode "// {{{" "// }}}" )))
 
 ;;;###autoload
-(add-to-list 'auto-mode-alist '("\\.ts\\'" . typescript-mode))
+(add-to-list 'auto-mode-alist '("\\.tsx?\\'" . typescript-mode))
 
 (provide 'typescript-mode)
 



[elpa] main c1d9ed9a2b: * elpa-packages (substitute): New package

2023-01-16 Thread Protesilaos Stavrou
branch: main
commit c1d9ed9a2b6952acef55f4837e4ebd1acde55182
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

* elpa-packages (substitute): New package
---
 elpa-packages | 4 
 1 file changed, 4 insertions(+)

diff --git a/elpa-packages b/elpa-packages
index 216400adaf..d5df16cd84 100644
--- a/elpa-packages
+++ b/elpa-packages
@@ -705,6 +705,10 @@
   :auto-sync t)
  (ssh-deploy   :url "https://github.com/cjohansson/emacs-ssh-deploy";)
  (stream   :url nil)
+ (substitute   :url "https://git.sr.ht/~protesilaos/substitute";
+  :auto-sync t
+  :readme "README.md"
+  :ignored-files ("COPYING"))
  (svg  :core ("lisp/svg.el"))
  (svg-clock:url nil)
  (svg-lib  :url "https://github.com/rougier/svg-lib";



[elpa] externals/compat 47953b014f 6/6: Add test for file-backup-file-names

2023-01-16 Thread ELPA Syncer
branch: externals/compat
commit 47953b014f3023c9ff791afd73ba040f3043200b
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add test for file-backup-file-names
---
 compat-28.el|  2 +-
 compat-tests.el | 11 +++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/compat-28.el b/compat-28.el
index c58c1d5bc7..64cfcd7913 100644
--- a/compat-28.el
+++ b/compat-28.el
@@ -594,7 +594,7 @@ the leading `-' char."
(if (zerop (logand   1 mode)) ?- ?x)
  (if (zerop (logand   1 mode)) ?T ?t
 
-(compat-defun file-backup-file-names (filename) ;; 
+(compat-defun file-backup-file-names (filename) ;; 

   "Return a list of backup files for FILENAME.
 The list will be sorted by modification time so that the most
 recent files are first."
diff --git a/compat-tests.el b/compat-tests.el
index d8aab1c049..dee44693ae 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -1232,6 +1232,17 @@
   (should-equal t (always 1));; single argument
   (should-equal t (always 1 2 3 4))) ;; multiple arguments
 
+(ert-deftest file-backup-file-names ()
+  (let ((file (make-temp-file "compat-tests")) backups)
+(should-not (file-backup-file-names file))
+(push (concat file "~") backups)
+(make-empty-file (car backups))
+(should-equal backups (file-backup-file-names file))
+(sleep-for 1) ;; FIXME Slowing down the test suite here is not great.
+(push (concat file ".~1~") backups)
+(make-empty-file (car backups))
+(should-equal backups (file-backup-file-names file
+
 (ert-deftest make-nearby-temp-file ()
   ;; TODO Test tramp remote directory.
   (let ((file1 (make-nearby-temp-file "compat-tests"))



[elpa] externals/compat 394028541e 3/6: Add test for exec-path

2023-01-16 Thread ELPA Syncer
branch: externals/compat
commit 394028541e1326e9cd138b93c134bfec7506f8f1
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add test for exec-path
---
 compat-27.el| 46 --
 compat-tests.el | 11 ---
 2 files changed, 28 insertions(+), 29 deletions(-)

diff --git a/compat-27.el b/compat-27.el
index 41686f340a..0dbad6ed57 100644
--- a/compat-27.el
+++ b/compat-27.el
@@ -413,37 +413,31 @@ in all cases, since that is the standard symbol for byte."
   (if (string= prefixed-unit "") "" (or space ""))
   prefixed-unit
 
-(compat-defun exec-path () ;; 
+(compat-defun exec-path () ;; 
   "Return list of directories to search programs to run in remote subprocesses.
 The remote host is identified by `default-directory'.  For remote
 hosts that do not support subprocesses, this returns nil.
 If `default-directory' is a local directory, this function returns
 the value of the variable `exec-path'."
-  (cond
-   ((let ((handler (find-file-name-handler default-directory 'exec-path)))
-  ;; FIXME: The handler was added in 27.1, and this compatibility
-  ;; function only applies to versions of Emacs before that.
-  (when handler
-(condition-case nil
-(funcall handler 'exec-path)
-  (error nil)
-   ((file-remote-p default-directory)
-;; TODO: This is not completely portable, even if "sh" and
-;; "getconf" should be provided on every POSIX system, the chance
-;; of this not working are greater than zero.
-;;
-;; FIXME: This invokes a shell process every time exec-path is
-;; called.  It should instead be cached on a host-local basis.
-(with-temp-buffer
-  (if (condition-case nil
-  (zerop (process-file "sh" nil t nil "-c" "getconf PATH"))
-(file-missing t))
-  (list "/bin" "/usr/bin")
-(let (path)
-  (while (re-search-forward "\\([^:]+?\\)[\n:]" nil t)
-(push (match-string 1) path))
-  (nreverse path)
-   (exec-path)))
+  ;; NOTE: We cannot use the 'exec-path file name handler here since it didn't
+  ;; exist before Emacs 27.1.
+  (if (file-remote-p default-directory)
+  ;; TODO: This is not completely portable, even if "sh" and
+  ;; "getconf" should be provided on every POSIX system, the chance
+  ;; of this not working are greater than zero.
+  ;;
+  ;; FIXME: This invokes a shell process every time exec-path is
+  ;; called.  It should instead be cached on a host-local basis.
+  (with-temp-buffer
+(if (condition-case nil
+(zerop (process-file "sh" nil t nil "-c" "getconf PATH"))
+  (file-missing t))
+(list "/bin" "/usr/bin")
+  (let (path)
+(while (re-search-forward "\\([^:]+?\\)[\n:]" nil t)
+  (push (match-string 1) path))
+(nreverse path
+exec-path))
 
 (compat-defun executable-find (command &optional remote) ;; 

   "Search for COMMAND in `exec-path' and return the absolute file name.
diff --git a/compat-tests.el b/compat-tests.el
index 5d035f5b15..f1b630f30f 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -1235,9 +1235,14 @@
 (ert-deftest executable-find ()
   (should (member (executable-find "sh") '("/usr/bin/sh" "/bin/sh")))
   (should (member (executable-find "ls") '("/usr/bin/ls" "/bin/ls")))
-  ;; TODO These dummy calls are executed locally, test Tramp!
-  (should (member (compat-call executable-find "sh" t) '("/usr/bin/sh" 
"/bin/sh")))
-  (should (member (compat-call executable-find "ls" t) '("/usr/bin/ls" 
"/bin/ls"
+  (let ((default-directory (format "/sudo:%s@localhost:/" user-login-name)))
+(should (member (compat-call executable-find "sh" t) '("/usr/bin/sh" 
"/bin/sh")))
+(should (member (compat-call executable-find "ls" t) '("/usr/bin/ls" 
"/bin/ls")
+
+(ert-deftest exec-path ()
+  (should-equal (exec-path) exec-path)
+  (let ((default-directory (format "/sudo:%s@localhost:/" user-login-name)))
+(should (file-directory-p (car (exec-path))
 
 (ert-deftest with-existing-directory ()
   (let ((dir (make-temp-name "/tmp/not-exist-")))



[elpa] externals/compat updated (fcb99b1b1e -> 47953b014f)

2023-01-16 Thread ELPA Syncer
elpasync pushed a change to branch externals/compat.

  from  fcb99b1b1e Add test for keymap-substitute
   new  aea1ccfa92 Update documentation, test coverage is now 100%.
   new  b93ab4c0e0 Add test for executable-find
   new  394028541e Add test for exec-path
   new  041122b305 Update NEWS
   new  74ec2c1c56 Add test for make-nearby-temp-file
   new  47953b014f Add test for file-backup-file-names


Summary of changes:
 NEWS.org|  8 
 compat-26.el|  2 +-
 compat-27.el|  4 ++--
 compat-28.el|  2 +-
 compat-tests.el | 59 +++--
 compat.texi | 10 --
 6 files changed, 61 insertions(+), 24 deletions(-)



[elpa] externals/compat 74ec2c1c56 5/6: Add test for make-nearby-temp-file

2023-01-16 Thread ELPA Syncer
branch: externals/compat
commit 74ec2c1c56ec178ac5b4cd47fb3b7837ebb8f942
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add test for make-nearby-temp-file
---
 compat-26.el|  2 +-
 compat-27.el| 44 +---
 compat-tests.el | 18 ++
 3 files changed, 44 insertions(+), 20 deletions(-)

diff --git a/compat-26.el b/compat-26.el
index 0670851c07..3502f66db8 100644
--- a/compat-26.el
+++ b/compat-26.el
@@ -368,7 +368,7 @@ the variable `temporary-file-directory' is returned."
   default-directory
 temporary-file-directory
 
-(compat-defun make-nearby-temp-file (prefix &optional dir-flag suffix) ;; 

+(compat-defun make-nearby-temp-file (prefix &optional dir-flag suffix) ;; 

   "Create a temporary file as close as possible to `default-directory'.
 If PREFIX is a relative file name, and `default-directory' is a
 remote file name or located on a mounted file systems, the
diff --git a/compat-27.el b/compat-27.el
index 0dbad6ed57..04c4b5b66d 100644
--- a/compat-27.el
+++ b/compat-27.el
@@ -419,25 +419,31 @@ The remote host is identified by `default-directory'.  
For remote
 hosts that do not support subprocesses, this returns nil.
 If `default-directory' is a local directory, this function returns
 the value of the variable `exec-path'."
-  ;; NOTE: We cannot use the 'exec-path file name handler here since it didn't
-  ;; exist before Emacs 27.1.
-  (if (file-remote-p default-directory)
-  ;; TODO: This is not completely portable, even if "sh" and
-  ;; "getconf" should be provided on every POSIX system, the chance
-  ;; of this not working are greater than zero.
-  ;;
-  ;; FIXME: This invokes a shell process every time exec-path is
-  ;; called.  It should instead be cached on a host-local basis.
-  (with-temp-buffer
-(if (condition-case nil
-(zerop (process-file "sh" nil t nil "-c" "getconf PATH"))
-  (file-missing t))
-(list "/bin" "/usr/bin")
-  (let (path)
-(while (re-search-forward "\\([^:]+?\\)[\n:]" nil t)
-  (push (match-string 1) path))
-(nreverse path
-exec-path))
+  (cond
+   ((let ((handler (find-file-name-handler default-directory 'exec-path)))
+  ;; FIXME: The handler was added in 27.1, and this compatibility
+  ;; function only applies to versions of Emacs before that.
+  (when handler
+(condition-case nil
+(funcall handler 'exec-path)
+  (error nil)
+   ((file-remote-p default-directory)
+;; TODO: This is not completely portable, even if "sh" and
+;; "getconf" should be provided on every POSIX system, the chance
+;; of this not working are greater than zero.
+;;
+;; FIXME: This invokes a shell process every time exec-path is
+;; called.  It should instead be cached on a host-local basis.
+(with-temp-buffer
+  (if (condition-case nil
+  (zerop (process-file "sh" nil t nil "-c" "getconf PATH"))
+(file-missing t))
+  (list "/bin" "/usr/bin")
+(let (path)
+  (while (re-search-forward "\\([^:]+?\\)[\n:]" nil t)
+(push (match-string 1) path))
+  (nreverse path)
+   (exec-path)))
 
 (compat-defun executable-find (command &optional remote) ;; 

   "Search for COMMAND in `exec-path' and return the absolute file name.
diff --git a/compat-tests.el b/compat-tests.el
index f1b630f30f..d8aab1c049 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -1232,15 +1232,33 @@
   (should-equal t (always 1));; single argument
   (should-equal t (always 1 2 3 4))) ;; multiple arguments
 
+(ert-deftest make-nearby-temp-file ()
+  ;; TODO Test tramp remote directory.
+  (let ((file1 (make-nearby-temp-file "compat-tests"))
+(file2 (make-nearby-temp-file "compat-tests" nil "suffix"))
+(dir (make-nearby-temp-file "compat-tests" t)))
+(should (string-suffix-p "suffix" file2))
+(should (file-regular-p file1))
+(should (file-regular-p file2))
+(should (file-directory-p dir))
+(should-equal (file-name-directory file1) temporary-file-directory)
+(should-equal (file-name-directory file2) temporary-file-directory)
+(should-equal (file-name-directory dir) temporary-file-directory)
+(delete-file file1)
+(delete-file file2)
+(delete-directory dir)))
+
 (ert-deftest executable-find ()
   (should (member (executable-find "sh") '("/usr/bin/sh" "/bin/sh")))
   (should (member (executable-find "ls") '("/usr/bin/ls" "/bin/ls")))
+  ;; TODO Test tramp remote directory.
   (let ((default-directory (format "/sudo:%s@localhost:/" user-login-name)))
 (should (member (compat-call executable-find "sh" t) '("/usr/bin/sh" 
"/bin/sh")))
 (should (member (compat-call executable-find "ls" t) '("/usr/bin/ls" 
"/bin/ls")
 
 (ert-deftest exec-path ()
   (should-equal (exec-path) exec-path)
+  ;; TODO Tes

[elpa] externals/compat b93ab4c0e0 2/6: Add test for executable-find

2023-01-16 Thread ELPA Syncer
branch: externals/compat
commit b93ab4c0e0cb7de245af18c675d4cfe53a3dac0a
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add test for executable-find
---
 compat-27.el| 2 +-
 compat-tests.el | 9 -
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/compat-27.el b/compat-27.el
index 12209ce7e7..41686f340a 100644
--- a/compat-27.el
+++ b/compat-27.el
@@ -445,7 +445,7 @@ the value of the variable `exec-path'."
   (nreverse path)
(exec-path)))
 
-(compat-defun executable-find (command &optional remote) ;; 
+(compat-defun executable-find (command &optional remote) ;; 

   "Search for COMMAND in `exec-path' and return the absolute file name.
 Return nil if COMMAND is not found anywhere in `exec-path'.  If
 REMOTE is non-nil, search on the remote host indicated by
diff --git a/compat-tests.el b/compat-tests.el
index 4da2e121d9..5d035f5b15 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -1232,6 +1232,13 @@
   (should-equal t (always 1));; single argument
   (should-equal t (always 1 2 3 4))) ;; multiple arguments
 
+(ert-deftest executable-find ()
+  (should (member (executable-find "sh") '("/usr/bin/sh" "/bin/sh")))
+  (should (member (executable-find "ls") '("/usr/bin/ls" "/bin/ls")))
+  ;; TODO These dummy calls are executed locally, test Tramp!
+  (should (member (compat-call executable-find "sh" t) '("/usr/bin/sh" 
"/bin/sh")))
+  (should (member (compat-call executable-find "ls" t) '("/usr/bin/ls" 
"/bin/ls"
+
 (ert-deftest with-existing-directory ()
   (let ((dir (make-temp-name "/tmp/not-exist-")))
 (let ((default-directory dir))
@@ -1244,7 +1251,7 @@
   (should-equal (temporary-file-directory) temporary-file-directory)
   (let ((default-directory "/mnt"))
 (should-equal (temporary-file-directory) default-directory))
-  ;; TODO how can we test tramp?
+  ;; TODO Implement Tramp test
   ;;(let ((default-directory "/sudo:/"))
   ;;  (should-equal (temporary-file-directory) temporary-file-directory))
   ;;(let ((default-directory "/ssh:does-not-exist:/"))



[elpa] externals/compat aea1ccfa92 1/6: Update documentation, test coverage is now 100%.

2023-01-16 Thread ELPA Syncer
branch: externals/compat
commit aea1ccfa92f4b61911e37d8b0bb011807dd451fe
Author: Daniel Mendler 
Commit: Daniel Mendler 

Update documentation, test coverage is now 100%.
---
 NEWS.org|  2 +-
 compat-tests.el | 16 +++-
 compat.texi | 10 --
 3 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/NEWS.org b/NEWS.org
index e777c9b5c0..f80257ccb7 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -2,7 +2,7 @@
 
 * Development of "Compat" Version 29.1.2.0
 
-- Add tests.
+- All compatibility functions are covered by tests!
 - Add links from compatibility definitions to tests.
 - BREAKING: Drop JSON parsing support (libjansson API).
 - BREAKING: Drop ~null-device~.
diff --git a/compat-tests.el b/compat-tests.el
index 793eeed5a4..4da2e121d9 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -19,15 +19,13 @@
 
 ;; Tests for compatibility functions from compat.el.
 ;;
-;; Note that not all functions have tests yet.  Grep the Compat code for
-;;  labels.  If you intend to use a function, which doesn't have
-;; tests yet, please contribute tests here.  NO GUARANTEES ARE MADE FOR
-;; FUNCTIONS WITHOUT TESTS.
-
-;; Functions which are tested are marked with a link to the testsuite.  The
-;; link type `compat-tests' must be registered first by evaluating the
-;; following code.  If you intend to work on the test suite you can add
-;; this code to your init.el.
+;; Note that all functions are covered by tests. When new functions are
+;; added to Compat, they must come with test coverage!
+
+;; Functions are marked with a link to the testsuite.  The link type
+;; `compat-tests' must be registered first by evaluating the following
+;; code.  If you intend to work on the test suite you can add this code to
+;; your init.el.
 ;;
 ;; (require 'ol)
 ;; (org-link-set-parameters
diff --git a/compat.texi b/compat.texi
index 65a39ec10a..433bb723e1 100644
--- a/compat.texi
+++ b/compat.texi
@@ -166,12 +166,10 @@ compatibility functions.
 
 If you intend to use a compatibility function in your code it is
 strongly recommended that you check the tests in
-@file{compat-tests.el}.  Alternatively grep the Compat code for
- labels.  There you will find the supported calling
-convention, which is guaranteed to work on the supported Emacs
-versions. We ensure this using continuous integration.  If a function
-is not tested yet in @file{compat-tests.el} NO GUARANTEES CAN BE MADE.
-You are invited to contribute tests in this case
+@file{compat-tests.el} to see the supported calling conventions, which
+are guaranteed to work on the supported Emacs versions. We ensure this
+using continuous integration. All functions provided by Compat are
+covered by the testsuite.
 
 It is recommended to subscribe to the
 @uref{https://lists.sr.ht/~pkal/compat-announce, compat-announce}



[elpa] externals/compat 041122b305 4/6: Update NEWS

2023-01-16 Thread ELPA Syncer
branch: externals/compat
commit 041122b3057752a761f2e54b5d52adcd2136f8ad
Author: Daniel Mendler 
Commit: Daniel Mendler 

Update NEWS
---
 NEWS.org | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/NEWS.org b/NEWS.org
index f80257ccb7..1587864c6f 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -6,7 +6,6 @@
 - Add links from compatibility definitions to tests.
 - BREAKING: Drop JSON parsing support (libjansson API).
 - BREAKING: Drop ~null-device~.
-- compat-29: Fix and test ~define-key~ with REMOVE argument.
 - compat-26: Add ~buffer-hash~.
 - compat-27: Add ~fixnump~ and ~bignump~.
 - compat-27: Add ~with-minibuffer-selected-window~.
@@ -15,6 +14,7 @@
 - compat-28: Add ~subr-native-elisp-p~.
 - compat-28: Add ~bounds-of-thing-at-mouse~.
 - compat-29: Add ~with-buffer-unmodified-if-unchanged~.
+- compat-29: Fix and test ~define-key~ with REMOVE argument.
 
 * Release of "Compat" Version 29.1.1.1
 
@@ -64,8 +64,8 @@
   ~file-name-concat~, ~replace-regexp-in-region~, ~replace-string-in-region~.
 - Add new Emacs 29 APIs. Some of them are still untested and may change. If you
   intend to use an Emacs 29 API please be careful and if possible contribute
-  test cases. All untested functions are marked as ~~ in the Compat
-  code. Over time tests for all functions will be added gradually.
+  test cases. All untested functions are marked in the Compat code. Over time
+  tests for all functions will be added gradually.
 - Add the macros ~compat-call~ and ~compat-function~ to call compatibility
   functions. Since Compat avoids overwriting already existing functions, we 
must
   define separate compatibility function definitions for functions which 
changed



[elpa] externals/substitute 2fa0edaa5a 29/39: Fix below/above way of identifying current target

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit 2fa0edaa5ada0bc8d1af032bd082a8adee2fb0d9
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Fix below/above way of identifying current target
---
 substitute.el | 28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/substitute.el b/substitute.el
index 551c4db2b4..b792d98bfc 100644
--- a/substitute.el
+++ b/substitute.el
@@ -33,6 +33,8 @@
 
 ;;; Code:
 
+(require 'thingatpt)
+
 (defgroup substitute nil
   "Efficiently replace targets in the buffer or context."
   :group 'editing)
@@ -119,25 +121,23 @@ Pass to it the TARGET and SCOPE arguments."
target
scope))
 
-;; FIXME 2023-01-15: There still are cases where "current and
-;; above/below" miss the current target.
 (defun substitute--scope-current-and-below (target)
-  "Position point to match current TARGET and all below."
+  "Position point to match current TARGET and below."
   (widen)
-  (cond
-   ((looking-at target)
-(goto-char (match-beginning 0)))
-   ((save-excursion (looking-back target (beginning-of-line)))
-(goto-char (match-beginning 0)
+  (if-let* (((region-active-p))
+(bounds (region-bounds)))
+  (goto-char (caar bounds))
+(thing-at-point-looking-at target)
+(goto-char (match-beginning 0
 
 (defun substitute--scope-current-and-above (target)
-  "Position point to match current TARGET and all above."
+  "Position point to match current TARGET and above."
   (widen)
-  (cond
-   ((looking-at target)
-(goto-char (match-end 0)))
-   ((save-excursion (looking-back target (beginning-of-line)))
-(goto-char (match-end 0)
+  (if-let* (((region-active-p))
+(bounds (region-bounds)))
+  (goto-char (caadr bounds))
+(thing-at-point-looking-at target)
+(goto-char (match-end 0
 
 (defun substitute--scope-current-defun ()
   "Position point to the top after `narrow-to-defun'."



[elpa] externals/substitute 591d6df15b 38/39: Expand README; add video demo

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit 591d6df15b485a697a26fcc6cb3e0ba1cfc57cdb
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Expand README; add video demo
---
 README.md | 88 +--
 1 file changed, 74 insertions(+), 14 deletions(-)

diff --git a/README.md b/README.md
index e879fbc2fe..b119573262 100644
--- a/README.md
+++ b/README.md
@@ -1,19 +1,72 @@
 # Substitute (substitute.el)
 
-Read: .
-
 Efficiently replace targets in the buffer or context.
 
-Sample configuration:
+**Video demo:** 

+
++ Package name (GNU ELPA): `substitute`
++ Git repo on SourceHut: 
+  - Mirrors:
++ GitHub: 
++ GitLab: 
++ Mailing list: 
++ Backronym: Some Utilities Built to Substitute Targets Independent of
+  Their Utterances, Thoroughly and Easily.
+
+## Overview
+
+Substitute is a set of commands that perform text replacement (i)
+throughout the buffer, (ii) limited to the current definition (per
+`narrow-to-defun`), (iii) from point to the end of the buffer, and
+(iv) from point to the beginning of the buffer.
+
+These substitutions are meant to be as quick as possible and, as such,
+differ from the standard `query-replace` (which I still use).  The
+provided commands prompt for substitute text and perform the
+substitution outright.
+
+The substitution prompt mentions the target-to-be-substituted.  It is
+possible to use the "future history" at this prompt (by typing `M-n`
+with the default key bindings for the `next-history-element` command).
+This populates the prompt with the text of the target.  As such, if we
+want to operate on `FOO` to make it `FOO-BAR`, we use `M-n` and then
+append `-BAR`.
+
+By default, the design is visually austere: the substitution prompt
+informs the user about the target but otherwise does not highlight
+anything.  The post-substitution stage is also silent, with no report
+on how many occurrences were replaced.  This can be changed so that
+the substitution prompt highlights occurrences (like `isearch`) and
+the post-substitution stage prints an informative message on what
+changed and where.  Refer to the "Sample configuration" further below.
+
+The substitution commands behave the same way except for their scope
+of application.  What they have in common is how they identify the
+target of the substitution: it is either the symbol at point or the
+text within the boundaries of the active region.  The differences in
+scope are as follows:
+
+1. `substitute-target-in-buffer`: Substitute the target across the
+   entire buffer.
+2. `substitute-target-in-defun`: Substitute the target only in the
+   current definition (per `narrow-to-defun`).
+3. `substitute-target-below-point`: Substitute the target from point
+   to the end of the buffer (alias
+   `substitute-target-to-end-of-buffer`).
+4. `substitute-target-above-point`: Substitute the target from point
+   to the beginning of the buffer (alias
+   `substitute-target-to-beginning-of-buffer`).
+
+## Sample configuration
 
 ```elisp
 (require 'substitute)
 
-;; If you like visual feedback on matching target.  Default is nil.
+;; If you like visual feedback on the matching target.  Default is nil.
 (setq substitute-highlight t)
 
-;; If you want a message reporting the matches that changed.  We don't
-;; do it by default
+;; If you want a message reporting the matches that changed in the
+;; given context.  We don't do it by default.
 (add-hook 'substitute-post-replace-hook #'substitute-report-operation)
 
 ;; We do not bind any keys.  This is just an idea.  The mnemonic is
@@ -25,11 +78,18 @@ Sample configuration:
   (define-key map (kbd "M-# b") #'substitute-target-in-buffer))
 ```
 
-+ Package name (GNU ELPA): `substitute` (not available yet)
-+ Git repo on SourceHut: 
-  - Mirrors:
-+ GitHub: 
-+ GitLab: 
-+ Mailing list: 
-+ Backronym: Some Utilities Built to Substitute Targets Independent of
-  Their Utterances, Thoroughly and Easily.
+## Why this instead of `multiple-cursors` or `iedit`
+
+What I do not like about those packages is that they are visually
+"busy".  Oftentimes, I want to perform a replacement in some context
+with multiple occurrences of a given target.  Using either of those
+echoes my input across all occurrences, resulting in a dance of sorts
+within the buffer as texts moves around.  I find that disorienting.
+Beside that, I do not need the visual feedback as I already know what
+I want to do: the default minimalist presentation of `subst

[elpa] externals/substitute 18c9830a5c 36/39: Rename private function for clarity

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit 18c9830a5c6d5831404920d1e5322e8510204106
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Rename private function for clarity
---
 substitute.el | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/substitute.el b/substitute.el
index 23be368ce9..219e7aceda 100644
--- a/substitute.el
+++ b/substitute.el
@@ -76,7 +76,7 @@ Possible meaningful values for SCOPE are:
 ('defun "in the current DEFUN")
 (_ "across the BUFFER")))
 
-(defun substitute--pretty-target (target)
+(defun substitute--prettify-target-description (target)
   "Remove regexp delimiters from TARGET.
 Use this to produce a more readable version of TARGET for prompts
 and related."
@@ -91,7 +91,7 @@ and related."
 
 (defun substitute--prompt-without-highlight (target scope)
   "Prompt for string while referencing TARGET and SCOPE."
-  (let ((pretty-target (substitute--pretty-target target)))
+  (let ((pretty-target (substitute--prettify-target-description target)))
 (read-string
  (format "Replace `%s' %s with: "
  (propertize pretty-target 'face 'error)
@@ -104,7 +104,7 @@ and related."
   "Prompt for string while referencing TARGET and SCOPE.
 Highlight the TARGET's matching occurences per the user option
 `substitute-highlight'."
-  (let ((pretty-target (substitute--pretty-target target)))
+  (let ((pretty-target (substitute--prettify-target-description target)))
 (unwind-protect
 (progn
   (highlight-regexp target (substitute--determine-face))
@@ -237,7 +237,7 @@ boundaries." doc)
   "Print message of substitution.
 Report COUNTth substitutions of TARGET with SUB in SCOPE."
   (message "Substituted `%s' with `%s' %d times %s"
-   (propertize (substitute--pretty-target target) 'face 'error)
+   (propertize (substitute--prettify-target-description target) 'face 
'error)
(propertize sub 'face 'success)
count
(propertize scope 'face 'warning)))



[elpa] externals/substitute 73a1904ea4 24/39: Do not check for fn in 'while' loop

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit 73a1904ea4521f9bf149f658950b6ed7252622c4
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Do not check for fn in 'while' loop

We only want to perform the test once, not per iteration.
---
 substitute.el | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/substitute.el b/substitute.el
index 51014e1d64..b3023e21d4 100644
--- a/substitute.el
+++ b/substitute.el
@@ -163,14 +163,12 @@ Pass to it the TARGET and SCOPE arguments."
 (defun substitute--operate (target sub &optional scope)
   "Substitute TARGET with SUB in SCOPE.
 This is the subroutine of `substitute-target' and related."
-  (let (count)
+  (let ((count)
+(search-fn (if (eq scope 'above) 're-search-backward 
're-search-forward)))
 (save-excursion
   (save-restriction
 (substitute--setup-scope target scope)
-(while (funcall (if (eq scope 'above)
-'re-search-backward
-  're-search-forward)
-target nil t)
+(while (funcall search-fn target nil t)
   (push (match-string-no-properties 0) count)
   (replace-match sub nil t
 (run-hook-with-args 'substitute-post-replace-hook



[elpa] externals/substitute 3f2e429e2d 32/39: Refine substitute-command macro

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit 3f2e429e2d21f431d9b6c89c582c56282b51dcd3
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Refine substitute-command macro
---
 substitute.el | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/substitute.el b/substitute.el
index 4a04ce0041..82a3daa2f9 100644
--- a/substitute.el
+++ b/substitute.el
@@ -185,7 +185,7 @@ Report a `user-error' if no target is found."
(t (or (format "\\_<%s\\_>" (thing-at-point 'symbol t))
   (user-error "No substitution target at point")
 
-(defmacro substitute-command (fn doc scope)
+(defmacro substitute-command (fn doc &optional scope)
   "Produce substitute command using FN, DOC, and SCOPE."
   `(defun ,fn (target sub)
  ,(format
@@ -199,14 +199,13 @@ boundaries." doc)
  (interactive
   (let ((target (substitute--target)))
 (list target
-  (substitute--prompt target current-prefix-arg
+  (substitute--prompt target ,scope
  (substitute--operate target sub ,scope)))
 
 ;;;###autoload
 (substitute-command
  substitute-target-in-buffer
- "throughout the buffer"
- nil)
+ "throughout the buffer")
 
 ;;;###autoload
 (substitute-command



[elpa] externals/substitute f5b7b373b1 30/39: Make link to blog easier to find

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit f5b7b373b19496ef802f1c88cf9b48b5499b7c82
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Make link to blog easier to find
---
 README.md | 2 +-
 substitute.el | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 560ec93b62..e879fbc2fe 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 # Substitute (substitute.el)
 
-⚠️ WORK-IN-PROGRESS ⚠️ Read: 
.
+Read: .
 
 Efficiently replace targets in the buffer or context.
 
diff --git a/substitute.el b/substitute.el
index b792d98bfc..80e844a532 100644
--- a/substitute.el
+++ b/substitute.el
@@ -26,7 +26,7 @@
 
 ;;; Commentary:
 ;;
-;; WORK-IN-PROGRESS.
+;; Read: 
.
 ;;
 ;; Some Utilities Built to Substitute Targets Independent of Their
 ;; Utterances, Thoroughly and Easily.



[elpa] externals/substitute b8cd86b7b8 28/39: Add FIXME

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit b8cd86b7b8ba61d6d25dc3237c95e20b68c564fe
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Add FIXME
---
 substitute.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/substitute.el b/substitute.el
index 9808d973fd..551c4db2b4 100644
--- a/substitute.el
+++ b/substitute.el
@@ -119,6 +119,8 @@ Pass to it the TARGET and SCOPE arguments."
target
scope))
 
+;; FIXME 2023-01-15: There still are cases where "current and
+;; above/below" miss the current target.
 (defun substitute--scope-current-and-below (target)
   "Position point to match current TARGET and all below."
   (widen)



[elpa] externals/substitute cd757fd209 27/39: Remove needless lambdas

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit cd757fd20901611e9113e357e0fc2d0fa70f8228
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Remove needless lambdas
---
 substitute.el | 47 +--
 1 file changed, 21 insertions(+), 26 deletions(-)

diff --git a/substitute.el b/substitute.el
index 0de8732de3..9808d973fd 100644
--- a/substitute.el
+++ b/substitute.el
@@ -121,44 +121,39 @@ Pass to it the TARGET and SCOPE arguments."
 
 (defun substitute--scope-current-and-below (target)
   "Position point to match current TARGET and all below."
-  (lambda ()
-(widen)
-(cond
- ((looking-at target)
-  (goto-char (match-beginning 0)))
- ((save-excursion (looking-back target (beginning-of-line)))
-  (goto-char (match-beginning 0))
+  (widen)
+  (cond
+   ((looking-at target)
+(goto-char (match-beginning 0)))
+   ((save-excursion (looking-back target (beginning-of-line)))
+(goto-char (match-beginning 0)
 
 (defun substitute--scope-current-and-above (target)
   "Position point to match current TARGET and all above."
-  (lambda ()
-(widen)
-(cond
- ((looking-at target)
-  (goto-char (match-end 0)))
- ((save-excursion (looking-back target (beginning-of-line)))
-  (goto-char (match-end 0))
+  (widen)
+  (cond
+   ((looking-at target)
+(goto-char (match-end 0)))
+   ((save-excursion (looking-back target (beginning-of-line)))
+(goto-char (match-end 0)
 
 (defun substitute--scope-current-defun ()
   "Position point to the top after `narrow-to-defun'."
-  (lambda ()
-(narrow-to-defun)
-(goto-char (point-min
+  (narrow-to-defun)
+  (goto-char (point-min)))
 
 (defun substitute--scope-top-of-buffer ()
   "Position point to the top of the buffer."
-  (lambda ()
-(widen)
-(goto-char (point-min
+  (widen)
+  (goto-char (point-min)))
 
 (defun substitute--setup-scope (target scope)
   "Derive SCOPE for TARGET."
-  (funcall
-   (pcase scope
- ('below (substitute--scope-current-and-below target))
- ('above (substitute--scope-current-and-above target))
- ('defun (substitute--scope-current-defun))
- (_ (substitute--scope-top-of-buffer)
+  (pcase scope
+('below (substitute--scope-current-and-below target))
+('above (substitute--scope-current-and-above target))
+('defun (substitute--scope-current-defun))
+(_ (substitute--scope-top-of-buffer
 
 (defun substitute--operate (target sub &optional scope)
   "Substitute TARGET with SUB in SCOPE.



[elpa] externals/substitute af3472dc34 33/39: Do not operate on nil thing

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit af3472dc3486a8fdda397c6e2fb46b39cee57192
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Do not operate on nil thing
---
 substitute.el | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/substitute.el b/substitute.el
index 82a3daa2f9..15bc38a0a5 100644
--- a/substitute.el
+++ b/substitute.el
@@ -182,8 +182,10 @@ Report a `user-error' if no target is found."
   (cond
((region-active-p)
 (buffer-substring-no-properties (region-beginning) (region-end)))
-   (t (or (format "\\_<%s\\_>" (thing-at-point 'symbol t))
-  (user-error "No substitution target at point")
+   (t
+(if-let ((thing (thing-at-point 'symbol t)))
+(format "\\_<%s\\_>" thing)
+  (user-error "No substitution target at point")
 
 (defmacro substitute-command (fn doc &optional scope)
   "Produce substitute command using FN, DOC, and SCOPE."



[elpa] externals/substitute 673c22fe54 35/39: Rename private function for clarity and move it further up

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit 673c22fe5401229a861cf814327897c3d585ae69
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Rename private function for clarity and move it further up
---
 substitute.el | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/substitute.el b/substitute.el
index e85adb2bba..23be368ce9 100644
--- a/substitute.el
+++ b/substitute.el
@@ -82,6 +82,13 @@ Use this to produce a more readable version of TARGET for 
prompts
 and related."
   (replace-regexp-in-string "_<\\(?1:.*?\\)_>" "\\1" target))
 
+(defun substitute--determine-face ()
+  "Return face to highlight target of substitute."
+  (if-let* ((face 'lazy-highlight)
+(facep face))
+  face
+'secondary-selection))
+
 (defun substitute--prompt-without-highlight (target scope)
   "Prompt for string while referencing TARGET and SCOPE."
   (let ((pretty-target (substitute--pretty-target target)))
@@ -93,13 +100,6 @@ and related."
  'substitute--history
  pretty-target)))
 
-(defun substitute--highlight-face ()
-  "Return face to highlight target of substitute."
-  (if-let* ((face 'lazy-highlight)
-(facep face))
-  face
-'secondary-selection))
-
 (defun substitute--prompt-with-highlight (target scope)
   "Prompt for string while referencing TARGET and SCOPE.
 Highlight the TARGET's matching occurences per the user option
@@ -107,7 +107,7 @@ Highlight the TARGET's matching occurences per the user 
option
   (let ((pretty-target (substitute--pretty-target target)))
 (unwind-protect
 (progn
-  (highlight-regexp target (substitute--highlight-face))
+  (highlight-regexp target (substitute--determine-face))
   (substitute--prompt-without-highlight pretty-target scope))
   (unhighlight-regexp target
 



[elpa] externals/substitute 8b1d32af46 04/39: Use pretty target in substitute-report-operation

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit 8b1d32af46ec916e4cfce0ab08d6d86b0c29cfc5
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Use pretty target in substitute-report-operation
---
 substitute.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/substitute.el b/substitute.el
index 558af1d509..ae64f26b86 100644
--- a/substitute.el
+++ b/substitute.el
@@ -205,7 +205,7 @@ NARROW prefix argument."
   "Print message of substitution.
 Report COUNTth substitutions of TARGET with SUB in SCOPE."
   (message "Substituted `%s' with `%s' %d times %s"
-   (propertize target 'face 'error)
+   (propertize (substitute--pretty-target target) 'face 'error)
(propertize sub 'face 'success)
count
(propertize scope 'face 'warning)))



[elpa] externals/substitute 731cb688e2 39/39: Bump version to trigger GNU ELPA build

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit 731cb688e2c4312f3b1e19a01e685ba08cedd124
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Bump version to trigger GNU ELPA build
---
 substitute.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/substitute.el b/substitute.el
index f985dfa15f..85bcea487f 100644
--- a/substitute.el
+++ b/substitute.el
@@ -6,7 +6,7 @@
 ;; Maintainer: Protesilaos Stavrou General Issues 
<~protesilaos/general-iss...@lists.sr.ht>
 ;; URL: https://git.sr.ht/~protesilaos/substitute
 ;; Mailing-List: https://lists.sr.ht/~protesilaos/general-issues
-;; Version: 0.1.1
+;; Version: 0.1.2
 ;; Package-Requires: ((emacs "27.1"))
 
 ;; This file is NOT part of GNU Emacs.



[elpa] externals/substitute 87fc9cb145 05/39: Abstract positioning and fix issues with targeting

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit 87fc9cb145ba2a6a1bd08942d5df0fef3a7a4bc8
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Abstract positioning and fix issues with targeting

The previous positioning was problematic as it would miss the current
target depending on where the point was.
---
 substitute.el | 32 +---
 1 file changed, 29 insertions(+), 3 deletions(-)

diff --git a/substitute.el b/substitute.el
index ae64f26b86..ae93ff12ec 100644
--- a/substitute.el
+++ b/substitute.el
@@ -123,6 +123,32 @@ Pass to it the TARGET and SCOPE arguments."
target
scope))
 
+(defun substitute--current-and-below-motion (target)
+  "Position point to match current TARGET and all below."
+  (lambda ()
+(widen)
+(cond
+ ((looking-at target)
+  (goto-char (match-beginning 0)))
+ ((save-excursion (looking-back target (beginning-of-line)))
+  (goto-char (match-beginning 0))
+
+(defun substitute--current-and-above-motion (target)
+  "Position point to match current TARGET and all above."
+  (lambda ()
+(widen)
+(cond
+ ((looking-at target)
+  (goto-char (match-end 0)))
+ ((save-excursion (looking-back target (beginning-of-line)))
+  (goto-char (match-end 0))
+
+(defun substitute--current-defun ()
+  "Position point to the after after `narrow-to-defun'."
+  (lambda ()
+(narrow-to-defun)
+(goto-char (point-min
+
 (defun substitute--operate (target sub &optional scope)
   "Substitute TARGET with SUB in SCOPE.
 This is the subroutine of `substitute-target' and related."
@@ -132,10 +158,10 @@ This is the subroutine of `substitute-target' and 
related."
 (let ((search 're-search-forward)
   (narrow (lambda () (widen) (goto-char (point-min)
   (pcase scope
-('below (setq narrow (lambda () (forward-sexp -1) (widen
+('below (setq narrow (substitute--current-and-below-motion 
target)))
 ('above (setq search 're-search-backward
-  narrow (lambda () (forward-sexp 1) (widen
-('defun (setq narrow (lambda () (narrow-to-defun) (goto-char 
(point-min))
+  narrow (substitute--current-and-above-motion 
target)))
+('defun (setq narrow (substitute--current-defun
   (funcall narrow)
   (while (funcall search target nil t)
 (push (match-string-no-properties 0) count)



[elpa] externals/substitute af56e87099 31/39: Refine how description of scope is made

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit af56e8709911a88595f786c49ffb786d9f99ee7c
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Refine how description of scope is made
---
 substitute.el | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/substitute.el b/substitute.el
index 80e844a532..4a04ce0041 100644
--- a/substitute.el
+++ b/substitute.el
@@ -61,20 +61,20 @@ For a reference function, see 
`substitute-report-operation'."
 (defvar substitute--history '()
   "Minibuffer history for substitution commands.")
 
-(defun substitute--scope (scope)
+(defun substitute--scope-description (scope)
   "Return string that describes SCOPE in plain terms.
 
 Possible meaningful values for SCOPE are:
 
 - `below' :: from point to the end of the buffer.
 - `above' :: from point to the beginning of the buffer.
-- nil :: across the whole buffer.
-- non-nil :: limit to the current defun per `narrow-to-defun'."
+- `defun' :: limit to the current defun per `narrow-to-defun'.
+- nil :: across the whole buffer."
   (pcase scope
 ('below "from point to the END of the buffer")
 ('above "from point to the BEGINNING of the buffer")
-('nil "across the BUFFER")
-(_ "in the current DEFUN")))
+('defun "in the current DEFUN")
+(_ "across the BUFFER")))
 
 (defun substitute--pretty-target (target)
   "Remove regexp delimiters from TARGET.
@@ -88,7 +88,7 @@ and related."
 (read-string
  (format "Replace `%s' %s with: "
  (propertize pretty-target 'face 'error)
- (substitute--scope scope))
+ (substitute--scope-description scope))
  nil
  'substitute--history
  pretty-target)))
@@ -170,7 +170,7 @@ This is the subroutine of `substitute-target' and related."
   (replace-match sub nil t
 (run-hook-with-args 'substitute-post-replace-hook
 target sub (length count)
-(substitute--scope scope
+(substitute--scope-description scope
 
 (defun substitute--target ()
   "Return target or report an error.



[elpa] externals/substitute 8ac3904158 23/39: Simplify substitute--setup-scope

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit 8ac39041584b01524408fc5ed9fa71dfb0c01b8d
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Simplify substitute--setup-scope
---
 substitute.el | 13 ++---
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/substitute.el b/substitute.el
index 841a3d4b77..51014e1d64 100644
--- a/substitute.el
+++ b/substitute.el
@@ -153,13 +153,12 @@ Pass to it the TARGET and SCOPE arguments."
 
 (defun substitute--setup-scope (target scope)
   "Derive SCOPE for TARGET."
-  (let (scope-fn)
-(pcase scope
-  ('below (setq scope-fn (substitute--scope-current-and-below target)))
-  ('above (setq scope-fn (substitute--scope-current-and-above target)))
-  ('defun (setq scope-fn (substitute--scope-current-defun)))
-  (_ (setq scope-fn (substitute--scope-top-of-buffer
-(funcall scope-fn)))
+  (funcall
+   (pcase scope
+ ('below (substitute--scope-current-and-below target))
+ ('above (substitute--scope-current-and-above target))
+ ('defun (substitute--scope-current-defun))
+ (_ (substitute--scope-top-of-buffer)
 
 (defun substitute--operate (target sub &optional scope)
   "Substitute TARGET with SUB in SCOPE.



[elpa] externals/substitute 9ddf421c55 34/39: Rename private function for clarity

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit 9ddf421c550eeb885208a84cb560668e23eae7aa
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Rename private function for clarity
---
 substitute.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/substitute.el b/substitute.el
index 15bc38a0a5..e85adb2bba 100644
--- a/substitute.el
+++ b/substitute.el
@@ -172,7 +172,7 @@ This is the subroutine of `substitute-target' and related."
 target sub (length count)
 (substitute--scope-description scope
 
-(defun substitute--target ()
+(defun substitute--determine-target ()
   "Return target or report an error.
 If the region is active, the target of the substitute is the text
 within the region's boundaries.  Otherwise the target is the
@@ -199,7 +199,7 @@ is a string that is provided at the minibuffer prompt.
 If the region is active, TARGET is the text within the region's
 boundaries." doc)
  (interactive
-  (let ((target (substitute--target)))
+  (let ((target (substitute--determine-target)))
 (list target
   (substitute--prompt target ,scope
  (substitute--operate target sub ,scope)))



[elpa] externals/substitute 86423acf44 37/39: Use correct word in a couple of places

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit 86423acf445ab23255f0890d1bac751138235f4b
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Use correct word in a couple of places
---
 substitute.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/substitute.el b/substitute.el
index 219e7aceda..f985dfa15f 100644
--- a/substitute.el
+++ b/substitute.el
@@ -93,7 +93,7 @@ and related."
   "Prompt for string while referencing TARGET and SCOPE."
   (let ((pretty-target (substitute--prettify-target-description target)))
 (read-string
- (format "Replace `%s' %s with: "
+ (format "Substitute `%s' %s with: "
  (propertize pretty-target 'face 'error)
  (substitute--scope-description scope))
  nil
@@ -191,7 +191,7 @@ Report a `user-error' if no target is found."
   "Produce substitute command using FN, DOC, and SCOPE."
   `(defun ,fn (target sub)
  ,(format
-   "Replace TARGET with SUB %s.
+   "Substitute TARGET with SUB %s.
 
 When called interactively, TARGET is the symbol at point and SUB
 is a string that is provided at the minibuffer prompt.



[elpa] externals/substitute fd60c0da63 08/39: Mention substitute-report-operation in hook doc string

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit fd60c0da632c5ddf3046ccfd75c5f671c3af8603
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Mention substitute-report-operation in hook doc string
---
 substitute.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/substitute.el b/substitute.el
index 4287ba7035..976dfffe97 100644
--- a/substitute.el
+++ b/substitute.el
@@ -50,7 +50,9 @@ of the substitution."
 (defcustom substitute-post-replace-hook nil
   "Special hook to run after a substitution command.
 Every function is called with four arguments: TARGET, SUB, COUNT,
-and SCOPE."
+and SCOPE.
+
+For a reference function, see `substitute-report-operation'."
   :group 'substitute
   :type 'hook)
 



[elpa] externals/substitute b73b62df77 10/39: Add initial version of the README

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit b73b62df770ed6a685bbc83d64ce4da49d37f75d
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Add initial version of the README
---
 README.md | 35 +++
 1 file changed, 35 insertions(+)

diff --git a/README.md b/README.md
new file mode 100644
index 00..0af9cfae6a
--- /dev/null
+++ b/README.md
@@ -0,0 +1,35 @@
+# Substitute (substitute.el)
+
+⚠️ WORK-IN-PROGRESS ⚠️
+
+Efficiently replace targets in the buffer or context.
+
+Sample configuration:
+
+```elisp
+(require 'substitute)
+
+;; If you like visual feedback on matching target.  Default is nil.
+(setq substitute-highlight t)
+
+;; If you want a message reporting the matches that changed.  We don't
+;; do it by default
+(add-hook 'substitute-post-replace-hook #'substitute-report-operation)
+
+;; We do not bind any keys.  This is just an idea.  The mnemonic is
+;; that M-# (or M-S-3) is close to M-% (or M-S-5).
+(let ((map global-map))
+  (define-key map (kbd "M-# s") #'substitute-target-below-point)
+  (define-key map (kbd "M-# r") #'substitute-target-above-point)
+  (define-key map (kbd "M-# d") #'substitute-target-in-function)
+  (define-key map (kbd "M-# M-#") #'substitute-target))
+```
+
++ Package name (GNU ELPA): `substitute` (not available yet)
++ Git repo on SourceHut: 
+  - Mirrors:
++ GitHub: 
++ GitLab: 
++ Mailing list: 
++ Backronym: Some Utilities Built to Substitute Things Independent of
+  Their Utterances, Thoroughly and Easily.



[nongnu] elpa/eat 96dfb50d84: Allow modifying semi-char key exceptions

2023-01-16 Thread ELPA Syncer
branch: elpa/eat
commit 96dfb50d84468da36c4ca33b2d0f9774c5efefcd
Author: Akib Azmain Turja 
Commit: Akib Azmain Turja 

Allow modifying semi-char key exceptions

* eat.el (eat-semi-char-non-bound-keys)
(eat-eshell-semi-char-non-bound-keys): New user option.
* eat.el (eat--prepare-semi-char-mode-map)
(eat--eshell-prepare-semi-char-mode-map): New function.
* eat.el (eat-semi-char-mode-map): Use
'eat--prepare-semi-char-mode-map' to make the keymap.
* eat.el (eat-eshell-semi-char-mode-map): Use
'eat--eshell-prepare-semi-char-mode-map' to make the keymap.
---
 eat.el | 77 ++
 1 file changed, 59 insertions(+), 18 deletions(-)

diff --git a/eat.el b/eat.el
index 5689679310..11ab738a7c 100644
--- a/eat.el
+++ b/eat.el
@@ -157,6 +157,44 @@ FUNCTION  Call FUNCTION with the command and arguments 
(using
   :type 'boolean
   :group 'eat-eshell)
 
+(defcustom eat-semi-char-non-bound-keys
+  '([?\C-x] [?\C-\\] [?\C-q] [?\C-g] [?\C-h] [?\e ?\C-c] [?\C-u]
+[?\e ?x] [?\e ?:] [?\e ?!] [?\e ?&])
+  "List of keys not bound in Eat \"semi-char\" mode.
+
+Keys appearing in this list are not bound to send the key to terminal.
+Eat might still bound them to do something else (for example, changing
+keybinding mode).
+
+Each element is a vector of form [KEY] or [?\e KEY], meaning KEY or
+M-KEY shouldn't be bound.  KEY shouldn't contain Meta (Alt) modifier."
+  :type '(repeat sexp)
+  :set (lambda (sym val)
+ (set-default-toplevel-value sym val)
+ (when (boundp 'eat-semi-char-mode-map)
+   (setq eat-semi-char-mode-map
+ (eat--prepare-semi-char-mode-map
+  :group 'eat-ui)
+
+(defcustom eat-eshell-semi-char-non-bound-keys
+  '([?\C-\\] [?\C-x] [?\C-g] [?\C-h] [?\e ?\C-c] [?\C-u] [?\C-q]
+[?\e ?x] [?\e ?:] [?\e ?!] [?\e ?&])
+  "List of keys not bound in Eat-Eshell \"semi-char\" mode.
+
+Keys appearing in this list are not bound to send the key to terminal.
+Eat might still bound them to do something else (for example, changing
+keybinding mode).
+
+Each element is a vector of form [KEY] or [?\e KEY], meaning KEY or
+M-KEY shouldn't be bound.  KEY shouldn't contain Meta (Alt) modifier."
+  :type '(repeat sexp)
+  :set (lambda (sym val)
+ (set-default-toplevel-value sym val)
+ (when (boundp 'eat-eshell-semi-char-mode-map)
+   (setq eat-eshell-semi-char-mode-map
+ (eat--eshell-prepare-semi-char-mode-map
+  :group 'eat-eshell)
+
 (defcustom eat-enable-directory-tracking t
   "Non-nil means do directory tracking.
 
@@ -4820,13 +4858,12 @@ STRING and ARG are passed to `yank-pop', which see."
 map)
   "Keymap for Eat mode.")
 
-(defvar eat-semi-char-mode-map
+(defun eat--prepare-semi-char-mode-map ()
+  "Prepare `eat-semi-char-mode-map'."
   (let ((map (eat-term-make-keymap
-  #'eat-self-input
-  '(:ascii :arrow :navigation)
-  '( [?\C-\\] [?\C-q] [?\C-c] [?\C-x] [?\C-g] [?\C-h]
- [?\e ?\C-c] [?\C-u] [?\C-q] [?\e ?x] [?\e ?:]
- [?\e ?!] [?\e ?&] [?\C-y] [?\e ?y]
+  #'eat-self-input '(:ascii :arrow :navigation)
+  `([?\C-c] [?\C-q] [?\C-y] [?\e ?y]
+,@eat-semi-char-non-bound-keys
 (define-key map [?\C-q] #'eat-quoted-input)
 (define-key map [?\C-y] #'eat-yank)
 (define-key map [?\M-y] #'eat-yank-from-kill-ring)
@@ -4834,13 +4871,15 @@ STRING and ARG are passed to `yank-pop', which see."
 (define-key map [?\C-c ?\C-e] #'eat-emacs-mode)
 (define-key map [remap insert-char] #'eat-input-char)
 (define-key map [xterm-paste] #'eat-xterm-paste)
-map)
+map))
+
+(defvar eat-semi-char-mode-map (ignore-errors
+ (eat--prepare-semi-char-mode-map))
   "Keymap for Eat semi-char mode.")
 
 (defvar eat-char-mode-map
   (let ((map (eat-term-make-keymap
-  #'eat-self-input
-  '(:ascii :arrow :navigation :function)
+  #'eat-self-input '(:ascii :arrow :navigation :function)
   '([?\e ?\C-m]
 (define-key map [?\C-\M-m] #'eat-semi-char-mode)
 (define-key map [xterm-paste] #'eat-xterm-paste)
@@ -5461,26 +5500,28 @@ PROGRAM can be a shell command."
 map)
   "Keymap for Eat Eshell \"emacs\" mode.")
 
-(defvar eat-eshell-semi-char-mode-map
+(defun eat--eshell-prepare-semi-char-mode-map ()
+  "Prepare `eat-eshell-semi-char-mode-map'."
   (let ((map (eat-term-make-keymap
-  #'eat-self-input
-  '(:ascii :arrow :navigation)
-  '( [?\C-\\] [?\C-q] [?\C-c] [?\C-x] [?\C-g] [?\C-h]
- [?\e ?\C-c] [?\C-u] [?\C-q] [?\e ?x] [?\e ?:]
- [?\e ?!] [?\e ?&] [?\C-y] [?\e ?y]
+  #'eat-self-input '(:ascii :arrow :navigation)
+  `([?\C-c] [?\C-q] [?\C-y] [?\e ?y]
+,@eat-eshell-semi-char-non-bound-keys
 (define-key map [?\C-q] #'

[elpa] branch externals/substitute created (now 731cb688e2)

2023-01-16 Thread ELPA Syncer
elpasync pushed a change to branch externals/substitute.

at  731cb688e2 Bump version to trigger GNU ELPA build

This branch includes the following new commits:

   new  511a45bbbc Add initial version of substitute.el (WORK-IN-PROGRESS)
   new  2eedda90bf Add COPYING and gitignore
   new  e5a012fd15 Reference correct symbol in doc string
   new  8b1d32af46 Use pretty target in substitute-report-operation
   new  87fc9cb145 Abstract positioning and fix issues with targeting
   new  ff63ce986f Use more descriptive name for local variable
   new  fd991c2e8c Tweak one doc string format
   new  fd60c0da63 Mention substitute-report-operation in hook doc string
   new  deb7d28b9e Change substitute-highlight default value and fix typo
   new  b73b62df77 Add initial version of the README
   new  be5b7f3e71 Streamline all commands with a macro
   new  3c91a4a100 Define aliases for two commands
   new  11b4277bfe Remove obsolete symbol from doc strings
   new  b665f84d4b Reuse code in substitute--prompt-with-highlight
   new  89c3389e1c Rename local variable for clarity
   new  45096c23d2 Update symbol of command for clarity
   new  cdb23ab35c Reference blog post in the README
   new  e90152fc90 Bump version for package-vc-rebuild to do its job
   new  a1382f1860 Tweak substitute backronym
   new  8431c6b54d Make local variables less verbose
   new  f45d238078 Add missing word in doc string
   new  178453e3a4 Rename scope functions; make code cleaner
   new  8ac3904158 Simplify substitute--setup-scope
   new  73a1904ea4 Do not check for fn in 'while' loop
   new  e55a121666 Make minor formatting change
   new  0c3e1c79ca Add indentation in one place
   new  cd757fd209 Remove needless lambdas
   new  b8cd86b7b8 Add FIXME
   new  2fa0edaa5a Fix below/above way of identifying current target
   new  f5b7b373b1 Make link to blog easier to find
   new  af56e87099 Refine how description of scope is made
   new  3f2e429e2d Refine substitute-command macro
   new  af3472dc34 Do not operate on nil thing
   new  9ddf421c55 Rename private function for clarity
   new  673c22fe54 Rename private function for clarity and move it further 
up
   new  18c9830a5c Rename private function for clarity
   new  86423acf44 Use correct word in a couple of places
   new  591d6df15b Expand README; add video demo
   new  731cb688e2 Bump version to trigger GNU ELPA build




[elpa] externals/substitute e5a012fd15 03/39: Reference correct symbol in doc string

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit e5a012fd15af073a7884576a20840b113fe9af9f
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Reference correct symbol in doc string
---
 substitute.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/substitute.el b/substitute.el
index aa9a4f3174..558af1d509 100644
--- a/substitute.el
+++ b/substitute.el
@@ -180,7 +180,7 @@ to the current function by using `narrow-to-defun'."
 ;;;###autoload
 (defun substitute-target-in-function ()
   "Replace target at point in the scope of the currenct function.
-This is the same as calling `narrow' before
+This is the same as calling `narrow-to-defun' before
 `substitute-target' OR invoking the latter command with its
 NARROW prefix argument."
   (interactive)



[elpa] externals/substitute be5b7f3e71 11/39: Streamline all commands with a macro

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit be5b7f3e7193206e080b860d1a25cb72af04d9e8
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Streamline all commands with a macro
---
 README.md |  2 +-
 substitute.el | 63 ---
 2 files changed, 31 insertions(+), 34 deletions(-)

diff --git a/README.md b/README.md
index 0af9cfae6a..f3e0b08c64 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@ Sample configuration:
   (define-key map (kbd "M-# s") #'substitute-target-below-point)
   (define-key map (kbd "M-# r") #'substitute-target-above-point)
   (define-key map (kbd "M-# d") #'substitute-target-in-function)
-  (define-key map (kbd "M-# M-#") #'substitute-target))
+  (define-key map (kbd "M-# b") #'substitute-target-in-buffer))
 ```
 
 + Package name (GNU ELPA): `substitute` (not available yet)
diff --git a/substitute.el b/substitute.el
index 8fecdafc35..93c2df63f0 100644
--- a/substitute.el
+++ b/substitute.el
@@ -185,49 +185,46 @@ Report a `user-error' if no target is found."
(t (or (format "\\_<%s\\_>" (thing-at-point 'symbol t))
   (user-error "No substitution target at point")
 
-;;;###autoload
-(defun substitute-target (target sub &optional narrow)
-  "Replace TARGET with SUB throughout the buffer.
+(defmacro substitute-command (fn doc scope)
+  "Produce substitute command using FN, DOC, and SCOPE."
+  `(defun ,fn (target sub)
+ ,(format
+  "Replace TARGET with SUB %s.
 
-When called interactively, TARGET is the target at point and
-SUB is a string that is provided at the minibuffer
-prompt.
+When called interactively, TARGET is the symbol at point and SUB
+is a string that is provided at the minibuffer prompt.
 
 If the region is active, TARGET is the text within the region's
-boundaries.
+boundaries." doc)
+ (interactive
+  (let ((target (substitute--target)))
+(list target
+  (substitute--prompt target current-prefix-arg
+ (substitute--operate target sub ,scope)))
 
-With optional NARROW as a prefix argument, limit the substitution
-to the current function by using `narrow-to-defun'."
-  (interactive
-   (let ((target (substitute--target)))
- (list target
-   (substitute--prompt target current-prefix-arg)
-   current-prefix-arg)))
-  (substitute--operate target sub (when narrow 'defun)))
+;;;###autoload
+(substitute-command
+ substitute-target-in-buffer
+ "throughout the buffer"
+ nil)
 
 ;;;###autoload
-(defun substitute-target-in-function ()
-  "Replace target at point in the scope of the currenct function.
-This is the same as calling `narrow-to-defun' before
-`substitute-target' OR invoking the latter command with its
-NARROW prefix argument."
-  (interactive)
-  (let ((target (substitute--target)))
-(substitute--operate target (substitute--prompt target 'defun) 'defun)))
+(substitute-command
+ substitute-target-in-function
+ "in the defun (per `narrow-to-defun')"
+ 'defun)
 
 ;;;###autoload
-(defun substitute-target-below-point ()
-  "Replace target from point to the end of the buffer."
-  (interactive)
-  (let ((target (substitute--target)))
-(substitute--operate target (substitute--prompt target 'below) 'below)))
+(substitute-command
+ substitute-target-below-point
+ "to the end of the buffer"
+ 'below)
 
 ;;;###autoload
-(defun substitute-target-above-point ()
-  "Replace target from point to the end of the buffer."
-  (interactive)
-  (let ((target (substitute--target)))
-(substitute--operate target (substitute--prompt target 'above) 'above)))
+(substitute-command
+ substitute-target-above-point
+ "to the beginning of the buffer"
+ 'above)
 
 (defun substitute-report-operation (target sub count scope)
   "Print message of substitution.



[elpa] externals/substitute 511a45bbbc 01/39: Add initial version of substitute.el (WORK-IN-PROGRESS)

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit 511a45bbbc8d672311e5d5f62467aca5ddc4b293
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Add initial version of substitute.el (WORK-IN-PROGRESS)
---
 substitute.el | 214 ++
 1 file changed, 214 insertions(+)

diff --git a/substitute.el b/substitute.el
new file mode 100644
index 00..aa9a4f3174
--- /dev/null
+++ b/substitute.el
@@ -0,0 +1,214 @@
+;;; substitute.el --- Efficiently replace targets in the buffer or context -*- 
lexical-binding: t -*-
+
+;; Copyright (C) 2023  Free Software Foundation, Inc.
+
+;; Author: Protesilaos Stavrou 
+;; Maintainer: Protesilaos Stavrou General Issues 
<~protesilaos/general-iss...@lists.sr.ht>
+;; URL: https://git.sr.ht/~protesilaos/substitute
+;; Mailing-List: https://lists.sr.ht/~protesilaos/general-issues
+;; Version: 0.1.0
+;; Package-Requires: ((emacs "27.1"))
+
+;; This file is NOT part of GNU Emacs.
+
+;; 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
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; This program 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 this program.  If not, see .
+
+;;; Commentary:
+;;
+;; WORK-IN-PROGRESS.
+;;
+;; Some Utilities Built to Substitute Things Independent of Their
+;; Utterances, Thoroughly and Easily.
+
+;;; Code:
+
+(defgroup substitute nil
+  "Efficiently replace targets in the buffer or context."
+  :group 'editing)
+
+(defcustom substitute-highlight t
+  "If non-nil, highlight target during prompt for its substitute.
+
+If nil, do not highlight anything: just pormpt for a substitute.
+
+At any rate, always specify at the minibuffer prompt the target
+of the substitution."
+  :group 'substitute
+  :type 'boolean)
+
+(defcustom substitute-post-replace-hook nil
+  "Special hook to run after a substitution command.
+Every function is called with four arguments: TARGET, SUB, COUNT,
+and SCOPE."
+  :group 'substitute
+  :type 'hook)
+
+(defvar substitute--history '()
+  "Minibuffer history for `substitute-replace-target'.")
+
+(defun substitute--scope (scope)
+  "Return string that describes SCOPE in plain terms.
+
+Possible meaningful values for SCOPE are:
+
+- `below' :: from point to the end of the buffer.
+- `above' :: from point to the beginning of the buffer.
+- nil :: across the whole buffer.
+- non-nil :: limit to the current defun per `narrow-to-defun'."
+  (pcase scope
+('below "from point to the END of the buffer")
+('above "from point to the BEGINNING of the buffer")
+('nil "across the BUFFER")
+(_ "in the current DEFUN")))
+
+(defun substitute--pretty-target (target)
+  "Remove regexp delimiters from TARGET.
+Use this to produce a more readable version of TARGET for prompts
+and related."
+  (replace-regexp-in-string "_<\\(?1:.*?\\)_>" "\\1" target))
+
+(defun substitute--prompt-without-highlight (target scope)
+  "Prompt for string while referencing TARGET and SCOPE.
+Substantiate the interactivity of `substitute-replace-target'."
+  (let ((pretty-target (substitute--pretty-target target)))
+(read-string
+ (format "Replace `%s' %s with: "
+ (propertize pretty-target 'face 'error)
+ (substitute--scope scope))
+ nil
+ 'substitute--history
+ pretty-target)))
+
+(defun substitute--highlight-face ()
+  "Return face to highlight target of substitute."
+  (if-let* ((face 'lazy-highlight)
+(facep face))
+  face
+'secondary-selection))
+
+(defun substitute--prompt-with-highlight (target scope)
+  "Prompt for string while referencing TARGET and SCOPE.
+Substantiate the interactivity of `substitute-replace-target'."
+  (let ((pretty-target (substitute--pretty-target target)))
+(unwind-protect
+(progn
+  (highlight-regexp target (substitute--highlight-face))
+  (read-string
+   (format "Replace `%s' %s with: "
+   (propertize pretty-target 'face 'error)
+   (substitute--scope scope))
+   nil
+   'substitute--history
+   pretty-target))
+  (unhighlight-regexp target
+
+(defun substitute--prompt (target scope)
+  "Return appropriate prompt based on `substitute-highlight'.
+Pass to it the TARGET and SCOPE arguments."
+  (funcall
+   (if substitute-highlight
+   'substitute--prompt-with-highlight
+ 'substitute--prompt-without-highlight)
+   target
+   scope))
+
+(defun substitute--operate (target sub &optional scope)
+  "Substitute TARGET with SUB in SCOPE.
+This is

[elpa] externals/substitute 2eedda90bf 02/39: Add COPYING and gitignore

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit 2eedda90bf88588a7a5f2b27f71dab5f2422ab20
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Add COPYING and gitignore
---
 .gitignore |   3 +
 COPYING| 674 +
 2 files changed, 677 insertions(+)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00..cb62d01d0e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+*.elc
+*-autoloads.el
+*-pkg.el
diff --git a/COPYING b/COPYING
new file mode 100644
index 00..2e63a33302
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,674 @@
+GNU GENERAL PUBLIC LICENSE
+   Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. 
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+   TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" th

[elpa] externals/substitute deb7d28b9e 09/39: Change substitute-highlight default value and fix typo

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit deb7d28b9e1ce5f0dc2cc0ab6f987350a620667a
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Change substitute-highlight default value and fix typo
---
 substitute.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/substitute.el b/substitute.el
index 976dfffe97..8fecdafc35 100644
--- a/substitute.el
+++ b/substitute.el
@@ -37,10 +37,10 @@
   "Efficiently replace targets in the buffer or context."
   :group 'editing)
 
-(defcustom substitute-highlight t
+(defcustom substitute-highlight nil
   "If non-nil, highlight target during prompt for its substitute.
 
-If nil, do not highlight anything: just pormpt for a substitute.
+If nil, do not highlight anything: just prompt for a substitute.
 
 At any rate, always specify at the minibuffer prompt the target
 of the substitution."



[elpa] externals/substitute 178453e3a4 22/39: Rename scope functions; make code cleaner

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit 178453e3a44016391cf6f41d55753fb24221a69f
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Rename scope functions; make code cleaner
---
 substitute.el | 40 ++--
 1 file changed, 26 insertions(+), 14 deletions(-)

diff --git a/substitute.el b/substitute.el
index 6105c1c63c..841a3d4b77 100644
--- a/substitute.el
+++ b/substitute.el
@@ -119,7 +119,7 @@ Pass to it the TARGET and SCOPE arguments."
target
scope))
 
-(defun substitute--current-and-below-motion (target)
+(defun substitute--scope-current-and-below (target)
   "Position point to match current TARGET and all below."
   (lambda ()
 (widen)
@@ -129,7 +129,7 @@ Pass to it the TARGET and SCOPE arguments."
  ((save-excursion (looking-back target (beginning-of-line)))
   (goto-char (match-beginning 0))
 
-(defun substitute--current-and-above-motion (target)
+(defun substitute--scope-current-and-above (target)
   "Position point to match current TARGET and all above."
   (lambda ()
 (widen)
@@ -139,29 +139,41 @@ Pass to it the TARGET and SCOPE arguments."
  ((save-excursion (looking-back target (beginning-of-line)))
   (goto-char (match-end 0))
 
-(defun substitute--current-defun ()
+(defun substitute--scope-current-defun ()
   "Position point to the top after `narrow-to-defun'."
   (lambda ()
 (narrow-to-defun)
 (goto-char (point-min
 
+(defun substitute--scope-top-of-buffer ()
+  "Position point to the top of the buffer."
+  (lambda ()
+(widen)
+(goto-char (point-min
+
+(defun substitute--setup-scope (target scope)
+  "Derive SCOPE for TARGET."
+  (let (scope-fn)
+(pcase scope
+  ('below (setq scope-fn (substitute--scope-current-and-below target)))
+  ('above (setq scope-fn (substitute--scope-current-and-above target)))
+  ('defun (setq scope-fn (substitute--scope-current-defun)))
+  (_ (setq scope-fn (substitute--scope-top-of-buffer
+(funcall scope-fn)))
+
 (defun substitute--operate (target sub &optional scope)
   "Substitute TARGET with SUB in SCOPE.
 This is the subroutine of `substitute-target' and related."
   (let (count)
 (save-excursion
   (save-restriction
-(let ((search-fn 're-search-forward)
-  (scope-fn (lambda () (widen) (goto-char (point-min)
-  (pcase scope
-('below (setq scope-fn (substitute--current-and-below-motion 
target)))
-('above (setq search-fn 're-search-backward
-  scope-fn (substitute--current-and-above-motion 
target)))
-('defun (setq scope-fn (substitute--current-defun
-  (funcall scope-fn)
-  (while (funcall search-fn target nil t)
-(push (match-string-no-properties 0) count)
-(replace-match sub nil t)
+(substitute--setup-scope target scope)
+(while (funcall (if (eq scope 'above)
+'re-search-backward
+  're-search-forward)
+target nil t)
+  (push (match-string-no-properties 0) count)
+  (replace-match sub nil t
 (run-hook-with-args 'substitute-post-replace-hook
 target sub (length count)
 (substitute--scope scope



[elpa] externals/substitute b665f84d4b 14/39: Reuse code in substitute--prompt-with-highlight

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit b665f84d4b042a968c079c336c56761078cc92af
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Reuse code in substitute--prompt-with-highlight
---
 substitute.el | 11 +++
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/substitute.el b/substitute.el
index f029b96845..58a53dd358 100644
--- a/substitute.el
+++ b/substitute.el
@@ -100,18 +100,13 @@ and related."
 
 (defun substitute--prompt-with-highlight (target scope)
   "Prompt for string while referencing TARGET and SCOPE.
-Substantiate the interactivity of `substitute-replace-target'."
+Highlight the TARGET's matching occurences per the user option
+`substitute-highlight'."
   (let ((pretty-target (substitute--pretty-target target)))
 (unwind-protect
 (progn
   (highlight-regexp target (substitute--highlight-face))
-  (read-string
-   (format "Replace `%s' %s with: "
-   (propertize pretty-target 'face 'error)
-   (substitute--scope scope))
-   nil
-   'substitute--history
-   pretty-target))
+  (substitute--prompt-without-highlight pretty-target scope))
   (unhighlight-regexp target
 
 (defun substitute--prompt (target scope)



[elpa] externals/substitute 8431c6b54d 20/39: Make local variables less verbose

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit 8431c6b54dc83cd010567b5bbf44346c6f19cd05
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Make local variables less verbose
---
 substitute.el | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/substitute.el b/substitute.el
index 810a74a66c..d948eaa3dd 100644
--- a/substitute.el
+++ b/substitute.el
@@ -151,15 +151,15 @@ This is the subroutine of `substitute-target' and 
related."
   (let (count)
 (save-excursion
   (save-restriction
-(let ((search-direction-function 're-search-forward)
-  (scope-function (lambda () (widen) (goto-char (point-min)
+(let ((search-fn 're-search-forward)
+  (scope-fn (lambda () (widen) (goto-char (point-min)
   (pcase scope
-('below (setq scope-function (substitute--current-and-below-motion 
target)))
-('above (setq search-direction-function 're-search-backward
-  scope-function (substitute--current-and-above-motion 
target)))
-('defun (setq scope-function (substitute--current-defun
-  (funcall scope-function)
-  (while (funcall search-direction-function target nil t)
+('below (setq scope-fn (substitute--current-and-below-motion 
target)))
+('above (setq search-fn 're-search-backward
+  scope-fn (substitute--current-and-above-motion 
target)))
+('defun (setq scope-fn (substitute--current-defun
+  (funcall scope-fn)
+  (while (funcall search-fn target nil t)
 (push (match-string-no-properties 0) count)
 (replace-match sub nil t)
 (run-hook-with-args 'substitute-post-replace-hook



[elpa] externals/substitute 89c3389e1c 15/39: Rename local variable for clarity

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit 89c3389e1c58109cb35998782dd22196de78ed7f
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Rename local variable for clarity
---
 substitute.el | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/substitute.el b/substitute.el
index 58a53dd358..4a854795c8 100644
--- a/substitute.el
+++ b/substitute.el
@@ -152,13 +152,13 @@ This is the subroutine of `substitute-target' and 
related."
 (save-excursion
   (save-restriction
 (let ((search-direction-function 're-search-forward)
-  (narrow (lambda () (widen) (goto-char (point-min)
+  (scope-function (lambda () (widen) (goto-char (point-min)
   (pcase scope
-('below (setq narrow (substitute--current-and-below-motion 
target)))
+('below (setq scope-function (substitute--current-and-below-motion 
target)))
 ('above (setq search-direction-function 're-search-backward
-  narrow (substitute--current-and-above-motion 
target)))
-('defun (setq narrow (substitute--current-defun
-  (funcall narrow)
+  scope-function (substitute--current-and-above-motion 
target)))
+('defun (setq scope-function (substitute--current-defun
+  (funcall scope-function)
   (while (funcall search-direction-function target nil t)
 (push (match-string-no-properties 0) count)
 (replace-match sub nil t)



[elpa] externals/substitute e55a121666 25/39: Make minor formatting change

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit e55a121af3fefc42c4289001418152da5d1c
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Make minor formatting change
---
 substitute.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/substitute.el b/substitute.el
index b3023e21d4..e1fde40781 100644
--- a/substitute.el
+++ b/substitute.el
@@ -163,8 +163,8 @@ Pass to it the TARGET and SCOPE arguments."
 (defun substitute--operate (target sub &optional scope)
   "Substitute TARGET with SUB in SCOPE.
 This is the subroutine of `substitute-target' and related."
-  (let ((count)
-(search-fn (if (eq scope 'above) 're-search-backward 
're-search-forward)))
+  (let ((search-fn (if (eq scope 'above) 're-search-backward 
're-search-forward))
+count)
 (save-excursion
   (save-restriction
 (substitute--setup-scope target scope)



[elpa] externals/substitute f45d238078 21/39: Add missing word in doc string

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit f45d2380786f8f4c50f1bb1ceb05e89ec9b8112d
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Add missing word in doc string
---
 substitute.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/substitute.el b/substitute.el
index d948eaa3dd..6105c1c63c 100644
--- a/substitute.el
+++ b/substitute.el
@@ -140,7 +140,7 @@ Pass to it the TARGET and SCOPE arguments."
   (goto-char (match-end 0))
 
 (defun substitute--current-defun ()
-  "Position point to the after after `narrow-to-defun'."
+  "Position point to the top after `narrow-to-defun'."
   (lambda ()
 (narrow-to-defun)
 (goto-char (point-min



[elpa] externals/substitute ff63ce986f 06/39: Use more descriptive name for local variable

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit ff63ce986fe587e244f9e0def810872d2cb30a40
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Use more descriptive name for local variable
---
 substitute.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/substitute.el b/substitute.el
index ae93ff12ec..cb9735eb86 100644
--- a/substitute.el
+++ b/substitute.el
@@ -155,15 +155,15 @@ This is the subroutine of `substitute-target' and 
related."
   (let (count)
 (save-excursion
   (save-restriction
-(let ((search 're-search-forward)
+(let ((search-direction-function 're-search-forward)
   (narrow (lambda () (widen) (goto-char (point-min)
   (pcase scope
 ('below (setq narrow (substitute--current-and-below-motion 
target)))
-('above (setq search 're-search-backward
+('above (setq search-direction-function 're-search-backward
   narrow (substitute--current-and-above-motion 
target)))
 ('defun (setq narrow (substitute--current-defun
   (funcall narrow)
-  (while (funcall search target nil t)
+  (while (funcall search-direction-function target nil t)
 (push (match-string-no-properties 0) count)
 (replace-match sub nil t)
 (run-hook-with-args 'substitute-post-replace-hook



[elpa] externals/substitute 45096c23d2 16/39: Update symbol of command for clarity

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit 45096c23d22958b86be8eb7f2af3609ac1dbc0f4
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Update symbol of command for clarity
---
 README.md | 2 +-
 substitute.el | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index f3e0b08c64..734835ac4a 100644
--- a/README.md
+++ b/README.md
@@ -21,7 +21,7 @@ Sample configuration:
 (let ((map global-map))
   (define-key map (kbd "M-# s") #'substitute-target-below-point)
   (define-key map (kbd "M-# r") #'substitute-target-above-point)
-  (define-key map (kbd "M-# d") #'substitute-target-in-function)
+  (define-key map (kbd "M-# d") #'substitute-target-in-defun)
   (define-key map (kbd "M-# b") #'substitute-target-in-buffer))
 ```
 
diff --git a/substitute.el b/substitute.el
index 4a854795c8..9e3e48e9f4 100644
--- a/substitute.el
+++ b/substitute.el
@@ -204,7 +204,7 @@ boundaries." doc)
 
 ;;;###autoload
 (substitute-command
- substitute-target-in-function
+ substitute-target-in-defun
  "in the defun (per `narrow-to-defun')"
  'defun)
 



[elpa] externals/substitute fd991c2e8c 07/39: Tweak one doc string format

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit fd991c2e8cc34f608342e78abf48226294bc35d3
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Tweak one doc string format
---
 substitute.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/substitute.el b/substitute.el
index cb9735eb86..4287ba7035 100644
--- a/substitute.el
+++ b/substitute.el
@@ -64,7 +64,7 @@ Possible meaningful values for SCOPE are:
 
 - `below' :: from point to the end of the buffer.
 - `above' :: from point to the beginning of the buffer.
-- nil :: across the whole buffer.
+- nil :: across the whole buffer.
 - non-nil :: limit to the current defun per `narrow-to-defun'."
   (pcase scope
 ('below "from point to the END of the buffer")



[elpa] externals/substitute 3c91a4a100 12/39: Define aliases for two commands

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit 3c91a4a10063d1d0624eacb88a0e92749db52c7a
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Define aliases for two commands
---
 substitute.el | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/substitute.el b/substitute.el
index 93c2df63f0..c24b4d0c61 100644
--- a/substitute.el
+++ b/substitute.el
@@ -220,12 +220,18 @@ boundaries." doc)
  "to the end of the buffer"
  'below)
 
+(defalias 'substitute-target-to-end-of-buffer
+  'substitute-target-below-point)
+
 ;;;###autoload
 (substitute-command
  substitute-target-above-point
  "to the beginning of the buffer"
  'above)
 
+(defalias 'substitute-target-to-beginning-of-buffer
+  'substitute-target-below-point)
+
 (defun substitute-report-operation (target sub count scope)
   "Print message of substitution.
 Report COUNTth substitutions of TARGET with SUB in SCOPE."



[elpa] externals/substitute e90152fc90 18/39: Bump version for package-vc-rebuild to do its job

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit e90152fc90547e84b5ff7013a11fd404d9b0c99a
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Bump version for package-vc-rebuild to do its job
---
 substitute.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/substitute.el b/substitute.el
index 9e3e48e9f4..01ec463416 100644
--- a/substitute.el
+++ b/substitute.el
@@ -6,7 +6,7 @@
 ;; Maintainer: Protesilaos Stavrou General Issues 
<~protesilaos/general-iss...@lists.sr.ht>
 ;; URL: https://git.sr.ht/~protesilaos/substitute
 ;; Mailing-List: https://lists.sr.ht/~protesilaos/general-issues
-;; Version: 0.1.0
+;; Version: 0.1.1
 ;; Package-Requires: ((emacs "27.1"))
 
 ;; This file is NOT part of GNU Emacs.



[elpa] externals/substitute cdb23ab35c 17/39: Reference blog post in the README

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit cdb23ab35c95483be5a7687a8cdc1cd2ff0a7f29
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Reference blog post in the README
---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 734835ac4a..10b11b011a 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 # Substitute (substitute.el)
 
-⚠️ WORK-IN-PROGRESS ⚠️
+⚠️ WORK-IN-PROGRESS ⚠️ Read: 
.
 
 Efficiently replace targets in the buffer or context.
 



[elpa] externals/substitute 0c3e1c79ca 26/39: Add indentation in one place

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit 0c3e1c79ca6cd4f654ac82709af2d5108bf21cd3
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Add indentation in one place
---
 substitute.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/substitute.el b/substitute.el
index e1fde40781..0de8732de3 100644
--- a/substitute.el
+++ b/substitute.el
@@ -192,7 +192,7 @@ Report a `user-error' if no target is found."
   "Produce substitute command using FN, DOC, and SCOPE."
   `(defun ,fn (target sub)
  ,(format
-  "Replace TARGET with SUB %s.
+   "Replace TARGET with SUB %s.
 
 When called interactively, TARGET is the symbol at point and SUB
 is a string that is provided at the minibuffer prompt.



[elpa] externals/substitute 11b4277bfe 13/39: Remove obsolete symbol from doc strings

2023-01-16 Thread ELPA Syncer
branch: externals/substitute
commit 11b4277bfe5e661f04630be40ea2129c7e1d57d4
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Remove obsolete symbol from doc strings
---
 substitute.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/substitute.el b/substitute.el
index c24b4d0c61..f029b96845 100644
--- a/substitute.el
+++ b/substitute.el
@@ -57,7 +57,7 @@ For a reference function, see `substitute-report-operation'."
   :type 'hook)
 
 (defvar substitute--history '()
-  "Minibuffer history for `substitute-replace-target'.")
+  "Minibuffer history for substitution commands.")
 
 (defun substitute--scope (scope)
   "Return string that describes SCOPE in plain terms.
@@ -81,8 +81,7 @@ and related."
   (replace-regexp-in-string "_<\\(?1:.*?\\)_>" "\\1" target))
 
 (defun substitute--prompt-without-highlight (target scope)
-  "Prompt for string while referencing TARGET and SCOPE.
-Substantiate the interactivity of `substitute-replace-target'."
+  "Prompt for string while referencing TARGET and SCOPE."
   (let ((pretty-target (substitute--pretty-target target)))
 (read-string
  (format "Replace `%s' %s with: "



  1   2   >