[elpa] externals-release/org 58aeb1af15: org-persist-unregister: Fix when ASSOCIATED is 'all

2023-01-03 Thread ELPA Syncer
branch: externals-release/org
commit 58aeb1af15ca8f1c2f215d6da13cf6b141ccf5e9
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

org-persist-unregister: Fix when ASSOCIATED is 'all

* lisp/org-persist.el (org-persist-unregister): Do not try to
normalize 'all ASSOCIATED.  It is not a valid association that should
be handled specially.  Previously, an error was thrown.
---
 lisp/org-persist.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-persist.el b/lisp/org-persist.el
index c3650c167e..336496efbf 100644
--- a/lisp/org-persist.el
+++ b/lisp/org-persist.el
@@ -753,12 +753,12 @@ with `org-persist-write'."
 When ASSOCIATED is `all', unregister CONTAINER everywhere."
   (unless org-persist--index (org-persist--load-index))
   (setq container (org-persist--normalize-container container))
-  (setq associated (org-persist--normalize-associated associated))
   (if (eq associated 'all)
   (mapc (lambda (collection)
   (when (member container (plist-get collection :container))
 (org-persist-unregister container (plist-get collection 
:associated
 org-persist--index)
+(setq associated (org-persist--normalize-associated associated))
 (let ((collection (org-persist--find-index `(:container ,container 
:associated ,associated
   (when collection
 (if (= (length (plist-get collection :container)) 1)



[elpa] externals/org updated (82cc6f0fe8 -> 30314c6038)

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

  from  82cc6f0fe8 Merge branch 'bugfix'
   new  9e5c25ba75 org-persist-unregister: Allow removing related containers
   new  58aeb1af15 org-persist-unregister: Fix when ASSOCIATED is 'all
   new  30314c6038 Merge branch 'bugfix'


Summary of changes:
 lisp/org-persist.el | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)



[elpa] externals/org 9e5c25ba75 1/2: org-persist-unregister: Allow removing related containers

2023-01-03 Thread ELPA Syncer
branch: externals/org
commit 9e5c25ba7522a34a3ffbad518d14fd9efddf6bcf
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

org-persist-unregister: Allow removing related containers

* lisp/org-persist.el (org-persist-unregister): Add new optional key
:remove-related to remove all the containers stored alongside with
CONTAINER in addition to CONTAINER itself.  Update to docstring.
---
 lisp/org-persist.el | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lisp/org-persist.el b/lisp/org-persist.el
index 9df385b82b..43a35e6f4c 100644
--- a/lisp/org-persist.el
+++ b/lisp/org-persist.el
@@ -906,20 +906,22 @@ with `org-persist-write'."
   (add-hook 'kill-buffer-hook #'org-persist-write-all-buffer nil 'local)))
   (when write-immediately (org-persist-write container associated)))
 
-(defun org-persist-unregister (container &optional associated)
+(cl-defun org-persist-unregister (container &optional associated &key 
remove-related)
   "Unregister CONTAINER in ASSOCIATED to be persistent.
-When ASSOCIATED is `all', unregister CONTAINER everywhere."
+When ASSOCIATED is `all', unregister CONTAINER everywhere.
+When REMOVE-RELATED is non-nil, remove all the containers stored with
+the CONTAINER as well."
   (unless org-persist--index (org-persist--load-index))
   (setq container (org-persist--normalize-container container))
   (setq associated (org-persist--normalize-associated associated))
   (if (eq associated 'all)
   (mapc (lambda (collection)
   (when (member container (plist-get collection :container))
-(org-persist-unregister container (plist-get collection 
:associated
+(org-persist-unregister container (plist-get collection 
:associated) :remove-related remove-related)))
 org-persist--index)
 (let ((collection (org-persist--find-index `(:container ,container 
:associated ,associated
   (when collection
-(if (= (length (plist-get collection :container)) 1)
+(if (or remove-related (= (length (plist-get collection :container)) 
1))
 (org-persist--remove-from-index collection)
   (plist-put collection :container
  (remove container (plist-get collection :container)))



[elpa] externals/org 30314c6038 2/2: Merge branch 'bugfix'

2023-01-03 Thread ELPA Syncer
branch: externals/org
commit 30314c60385148de2e44bb6b3319c02d296de170
Merge: 9e5c25ba75 58aeb1af15
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

Merge branch 'bugfix'
---
 lisp/org-persist.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-persist.el b/lisp/org-persist.el
index 43a35e6f4c..20a420929e 100644
--- a/lisp/org-persist.el
+++ b/lisp/org-persist.el
@@ -913,12 +913,12 @@ When REMOVE-RELATED is non-nil, remove all the containers 
stored with
 the CONTAINER as well."
   (unless org-persist--index (org-persist--load-index))
   (setq container (org-persist--normalize-container container))
-  (setq associated (org-persist--normalize-associated associated))
   (if (eq associated 'all)
   (mapc (lambda (collection)
   (when (member container (plist-get collection :container))
 (org-persist-unregister container (plist-get collection 
:associated) :remove-related remove-related)))
 org-persist--index)
+(setq associated (org-persist--normalize-associated associated))
 (let ((collection (org-persist--find-index `(:container ,container 
:associated ,associated
   (when collection
 (if (or remove-related (= (length (plist-get collection :container)) 
1))



[elpa] externals/url-scgi cd479f7717: Update copyright years

2023-01-03 Thread ELPA Syncer
branch: externals/url-scgi
commit cd479f77173fe9671e04e467ca2c279e4faea3d9
Author: Stefan Kangas 
Commit: Stefan Kangas 

Update copyright years
---
 url-scgi-tests.el | 2 +-
 url-scgi.el   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/url-scgi-tests.el b/url-scgi-tests.el
index c0131fcf6d..74c2661504 100644
--- a/url-scgi-tests.el
+++ b/url-scgi-tests.el
@@ -1,6 +1,6 @@
 ;;; url-scgi-tests.el --- Test suite for url-scgi.el -*- lexical-binding: t -*-
 
-;; Copyright (C) 2016-2022 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2023 Free Software Foundation, Inc.
 
 ;; Author: Stefan Kangas 
 
diff --git a/url-scgi.el b/url-scgi.el
index 510495a9e4..0f7b95eee2 100644
--- a/url-scgi.el
+++ b/url-scgi.el
@@ -1,6 +1,6 @@
 ;;; url-scgi.el --- SCGI support for url.el  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2011-2022 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2023 Free Software Foundation, Inc.
 
 ;; Author: Stefan Kangas 
 ;; Version: 0.8



[nongnu] elpa/editorconfig 5a80a5a11e: Drop Emacs 24.x and 25.x (#286)

2023-01-03 Thread ELPA Syncer
branch: elpa/editorconfig
commit 5a80a5a11edf891f29354bcde090918527a80ba2
Author: Jen-Chieh Shen 
Commit: GitHub 

Drop Emacs 24.x and 25.x (#286)

* Drop Emacs 24.x and 25.x

* test(build.yaml): Make fail-fast to false

* Update CI test

* docs: Update changelog

* Revert author information
---
 .github/workflows/build.yaml  |  40 ++--
 .gitignore|   8 ++
 CHANGELOG.md  |   3 +
 Eask  |  20 
 Makefile  |  18 ++--
 editorconfig-conf-mode.el |  20 ++--
 editorconfig-core-handle.el   |  55 ---
 editorconfig-core.el  |  57 ---
 editorconfig-fnmatch.el   |  21 ++--
 editorconfig.el   | 174 ++
 ert-tests/editorconfig-core-handle.el |  40 ++--
 ert-tests/editorconfig-core.el|  39 ++--
 ert-tests/editorconfig-fnmatch.el |  30 +-
 ert-tests/editorconfig.el |  72 --
 ert-tests/metadata.el |  33 ++-
 15 files changed, 352 insertions(+), 278 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 30b6d53c76..8793fee6c8 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -1,4 +1,3 @@

 name: build
 
 on:
@@ -12,30 +11,53 @@ on:
   release:
 types: [published]
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true
+
 jobs:
   test:
-runs-on: ubuntu-latest
+runs-on: ${{ matrix.os }}
 strategy:
+  fail-fast: false
   matrix:
+os: [ubuntu-latest, macos-latest, windows-latest]
 emacs_version:
-  - "24.5"
-  - "25.3"
   - "26.3"
   - "27.2"
   - "28.2"
 experimental: [false]
 include:
-  - emacs_version: snapshot
+  - os: ubuntu-latest
+emacs_version: snapshot
+experimental: true
+  - os: macos-latest
+emacs_version: snapshot
+experimental: true
+  - os: windows-latest
+emacs_version: snapshot
 experimental: true
 continue-on-error: ${{ matrix.experimental }}
+
 steps:
   - name: Checkout
-uses: actions/checkout@v1
+uses: actions/checkout@v3
 with:
   submodules: recursive
+
   - name: Setup Emacs
-uses: purcell/setup-emacs@master
+uses: jcs090218/setup-emacs@master
 with:
   version: ${{ matrix.emacs_version }}
-  - name: Run tests
-run: make check
+
+  - uses: emacs-eask/setup-eask@master
+with:
+  version: 'snapshot'
+
+  - name: Run tests (Unix)
+if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
+run: make check-unix
+
+  - name: Run tests (Windows)
+if: matrix.os == 'windows-latest'
+run: make check-dos
diff --git a/.gitignore b/.gitignore
index f24ee0f685..9a16283ba1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,11 @@
 \#*
 .\#*
 *.autosave
+
+# eask packages
+.eask/
+dist/
+
+# packaging
+*-autoloads.el
+*-pkg.el
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 57dd2f0653..f55cd6c274 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,8 @@ and this project adheres to [Semantic 
Versioning](https://semver.org/spec/v2.0.0
 
 ### Changed
 
+- Drop Emacs 24.x and 25.x ([#286])
+
 ### Deprecated
 
 ### Removed
@@ -270,6 +272,7 @@ and this project adheres to [Semantic 
Versioning](https://semver.org/spec/v2.0.0
 [0.3]: https://github.com/editorconfig/editorconfig-emacs/compare/v0.2...v0.3
 [0.2]: https://github.com/editorconfig/editorconfig-emacs/compare/v0.1...v0.2
 [0.1]: https://github.com/editorconfig/editorconfig-emacs/releases/tag/v0.1
+[#286]: https://github.com/editorconfig/editorconfig-emacs/issues/286
 [#280]: https://github.com/editorconfig/editorconfig-emacs/issues/280
 [#263]: https://github.com/editorconfig/editorconfig-emacs/issues/263
 [#260]: https://github.com/editorconfig/editorconfig-emacs/issues/260
diff --git a/Eask b/Eask
new file mode 100644
index 00..8d32ac56e7
--- /dev/null
+++ b/Eask
@@ -0,0 +1,20 @@
+(package "editorconfig"
+ "0.9.1"
+ "EditorConfig Emacs Plugin")
+
+(website-url "https://github.com/editorconfig/editorconfig-emacs#readme";)
+(keywords "convenience" "editorconfig")
+
+(package-file "editorconfig.el")
+
+(files "editorconfig-*.el")
+
+(script "test" "echo \"Error: no test specified\" && exit 1")
+
+(source "gnu")
+(source "melpa")
+
+(depends-on "emacs" "26.1")
+(depends-on "nadvice")
+
+(setq network-security-level 'low)  ; see 
https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432
diff --git a/Makefile b/Makefile
index 5be903f2d9..963f6de2ed 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,7 @@
 TEXI_CH

[nongnu] elpa/mentor 12e8dc4bbf 1/2: Update copyright year

2023-01-03 Thread ELPA Syncer
branch: elpa/mentor
commit 12e8dc4bbf3090d6042822954d42bdd4682eea0d
Author: Stefan Kangas 
Commit: Stefan Kangas 

Update copyright year
---
 mentor-data.el   | 2 +-
 mentor-files.el  | 2 +-
 mentor-rpc.el| 2 +-
 mentor-trackers.el   | 2 +-
 mentor.el| 2 +-
 test-rtorrent.py | 2 +-
 test/mentor-rpc-tests.el | 2 +-
 test/mentor-tests.el | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/mentor-data.el b/mentor-data.el
index f8a9541b98..42ba42e4eb 100644
--- a/mentor-data.el
+++ b/mentor-data.el
@@ -1,6 +1,6 @@
 ;;; mentor-data.el --- Mentor data structures  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2016-2022 Stefan Kangas.
+;; Copyright (C) 2016-2023 Stefan Kangas
 
 ;; Author: Stefan Kangas 
 
diff --git a/mentor-files.el b/mentor-files.el
index 7b2fe0fadf..3a9d7b282b 100644
--- a/mentor-files.el
+++ b/mentor-files.el
@@ -1,6 +1,6 @@
 ;;; mentor-files.el --- Mentor file view  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2016-2022 Stefan Kangas.
+;; Copyright (C) 2016-2023 Stefan Kangas
 
 ;; Author: Stefan Kangas 
 
diff --git a/mentor-rpc.el b/mentor-rpc.el
index 459b87255c..a43bc8cccf 100644
--- a/mentor-rpc.el
+++ b/mentor-rpc.el
@@ -1,6 +1,6 @@
 ;;; mentor-rpc.el --- Mentor XML-RPC handling  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2016-2022 Stefan Kangas.
+;; Copyright (C) 2016-2023 Stefan Kangas
 
 ;; Author: Stefan Kangas 
 
diff --git a/mentor-trackers.el b/mentor-trackers.el
index 7ae843819b..82b433bb97 100644
--- a/mentor-trackers.el
+++ b/mentor-trackers.el
@@ -1,6 +1,6 @@
 ;;; mentor-trackers.el --- Mentor trackers view  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2020 Jesse Gildersleve.
+;; Copyright (C) 2020-2023 Jesse Gildersleve
 
 ;; Author: Jesse Gildersleve 
 
diff --git a/mentor.el b/mentor.el
index a264a526fe..2096393434 100644
--- a/mentor.el
+++ b/mentor.el
@@ -1,6 +1,6 @@
 ;;; mentor.el --- Frontend for the rTorrent bittorrent client  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2010-2022 Stefan Kangas.
+;; Copyright (C) 2010-2023 Stefan Kangas
 
 ;; Author: Stefan Kangas 
 ;; Maintainer: Stefan Kangas 
diff --git a/test-rtorrent.py b/test-rtorrent.py
index ed55feba38..aaf22b58e3 100755
--- a/test-rtorrent.py
+++ b/test-rtorrent.py
@@ -6,7 +6,7 @@
 # Run as follows:
 # python rtorrent-test.py
 
-# Copyright (C) 2016-2022 Stefan Kangas.
+# Copyright (C) 2016-2023 Stefan Kangas
 #
 # This file is NOT part of GNU Emacs.
 #
diff --git a/test/mentor-rpc-tests.el b/test/mentor-rpc-tests.el
index 4640b79ff2..cf40a2b85c 100644
--- a/test/mentor-rpc-tests.el
+++ b/test/mentor-rpc-tests.el
@@ -1,6 +1,6 @@
 ;;; mentor-rpc-tests.el --- Test suite for mentor-rpc.el -*- lexical-binding: 
t -*-
 
-;; Copyright (C) 2018-2022 Stefan Kangas.
+;; Copyright (C) 2018-2023 Stefan Kangas
 
 ;; Author: Stefan Kangas 
 
diff --git a/test/mentor-tests.el b/test/mentor-tests.el
index e58d739c71..4776c5e891 100644
--- a/test/mentor-tests.el
+++ b/test/mentor-tests.el
@@ -1,6 +1,6 @@
 ;;; mentor-tests.el --- Test suite for mentor.el -*- lexical-binding: t -*-
 
-;; Copyright (C) 2016-2022 Stefan Kangas.
+;; Copyright (C) 2016-2023 Stefan Kangas
 
 ;; Author: Stefan Kangas 
 



[nongnu] elpa/mentor updated (b453874099 -> f51dd4f3f8)

2023-01-03 Thread ELPA Syncer
elpasync pushed a change to branch elpa/mentor.

  from  b453874099 Add codespell action for GitHub CI
   new  12e8dc4bbf Update copyright year
   new  f51dd4f3f8 Prefer HTTPS to HTTP


Summary of changes:
 README.org   | 4 ++--
 mentor-data.el   | 2 +-
 mentor-files.el  | 2 +-
 mentor-rpc.el| 2 +-
 mentor-trackers.el   | 2 +-
 mentor.el| 6 +++---
 test-rtorrent.py | 2 +-
 test/mentor-rpc-tests.el | 2 +-
 test/mentor-tests.el | 7 +--
 9 files changed, 16 insertions(+), 13 deletions(-)



[nongnu] elpa/mentor f51dd4f3f8 2/2: Prefer HTTPS to HTTP

2023-01-03 Thread ELPA Syncer
branch: elpa/mentor
commit f51dd4f3f87c54b7cc92189924b9d873a53f5a75
Author: Stefan Kangas 
Commit: Stefan Kangas 

Prefer HTTPS to HTTP
---
 README.org   | 4 ++--
 mentor.el| 4 ++--
 test/mentor-tests.el | 5 -
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/README.org b/README.org
index 99490c89e6..3fcbb3dc0e 100644
--- a/README.org
+++ b/README.org
@@ -2,7 +2,7 @@
 
 
[[https://elpa.nongnu.org/nongnu/mentor.html][https://elpa.nongnu.org/nongnu/mentor.svg]]
 
-mentor is a [[https://www.gnu.org/software/emacs][GNU Emacs]] frontend for the 
[[http://libtorrent.rakshasa.no/][rTorrent]] bittorrent client.
+mentor is a [[https://www.gnu.org/software/emacs][GNU Emacs]] frontend for the 
[[https://rakshasa.github.io/rtorrent/][rTorrent]] bittorrent client.
 
 By default, it will start and run rTorrent from within Emacs but can also be
 configured to use an external rTorrent instance over XML-RPC.
@@ -124,7 +124,7 @@ It is also possible to connect to rtorrent over http.  
There are instructions on
 configuring this on the 
[[https://github.com/rakshasa/rtorrent/wiki/RPC-Setup-XMLRPC][rtorrent wiki]].
 
 : ;; Alternative 3: Use a web server
-: (setq mentor-rtorrent-external-rpc "http://127.0.0.1:8080/RPC2";)
+: (setq mentor-rtorrent-external-rpc "https://127.0.0.1:8080/RPC2";)
 
 Finally, you can connect directly to rtorrent over scgi.  However, anyone that
 can send rtorrent xmlrpc requests can in all likelihood also execute arbitrary
diff --git a/mentor.el b/mentor.el
index 2096393434..1caa21bf8f 100644
--- a/mentor.el
+++ b/mentor.el
@@ -138,7 +138,7 @@ To connect using a local socket file, use
 start the path with `/' or '~' for it to be recognized as a file
 socket.
 
-To connect using http, use `http://HOST[:PORT]/PATH'.  This would
+To connect using HTTPS, use `https://HOST[:PORT]/PATH'.  This would
 be the case when using a web server in front of rTorrent.
 
 For security reasons, we strongly suggest to use one of the
@@ -148,7 +148,7 @@ scgi_port by specifying `scgi://HOST:PORT'.
 Example values:
 
  (1) ~/.rtorrent-rpc.socket
- (2) http://localhost:8080/RPC2
+ (2) https://localhost:8080/RPC2
  (3) scgi://localhost:5000 [not recommended]"
   :package-version '(mentor . "0.2")
   :group 'mentor
diff --git a/test/mentor-tests.el b/test/mentor-tests.el
index 4776c5e891..b3f772e6e0 100644
--- a/test/mentor-tests.el
+++ b/test/mentor-tests.el
@@ -34,6 +34,7 @@
   (should (equal (mentor-normalize-rpc-url "scgi://~/.rtorrent.rpc")   
"scgi://~/.rtorrent.rpc"))
   (should (equal (mentor-normalize-rpc-url "scgi:///path/to/rtorrent.rpc") 
"scgi:///path/to/rtorrent.rpc"))
   (should (equal (mentor-normalize-rpc-url "http://localhost:8080/RPC";)
"http://localhost:8080/RPC";))
+  (should (equal (mentor-normalize-rpc-url "https://localhost:8080/RPC";)   
"https://localhost:8080/RPC";))
   ;; Add scgi
   (should (equal (mentor-normalize-rpc-url "~/.rtorrent.rpc")   
"scgi://~/.rtorrent.rpc"))
   (should (equal (mentor-normalize-rpc-url "/path/to/rtorrent.rpc") 
"scgi:///path/to/rtorrent.rpc")))
@@ -54,7 +55,9 @@
 
 (ert-deftest mentor-rtorrent-keep-domain-name ()
   (should (equal (mentor-keep-domain-name "http://foo.bar1.com/announce?";)
- "foo.bar1.com")))
+ "foo.bar1.com"))
+  (should (equal (mentor-keep-domain-name "https://baz.bar2.com/announce?";)
+ "baz.bar2.com")))
 
 (ert-deftest mentor-remove-subdomains ()
   (should (equal (mentor-remove-subdomains "foo.bar.baz.com") "baz.com"))



[elpa] externals/inspector 340ffc4582: Better error message

2023-01-03 Thread ELPA Syncer
branch: externals/inspector
commit 340ffc45827ba3501816e1e67957fde543769a46
Author: Mariano Montone 
Commit: Mariano Montone 

Better error message
---
 inspector.el | 4 
 1 file changed, 4 insertions(+)

diff --git a/inspector.el b/inspector.el
index b3665720a1..32a9bce174 100644
--- a/inspector.el
+++ b/inspector.el
@@ -690,6 +690,8 @@ When PRESERVE-HISTORY is T, inspector history is not 
cleared."
 (defun inspector-inspect-debugger-locals ()
   "Inspect local variables of the frame at point in debugger backtrace."
   (interactive)
+  (when (not (backtrace-get-index))
+(error "No backtrace frame at point.  Please move cursor to a backtrace 
frame"))
   (let* ((nframe (debugger-frame-number))
  (locals (backtrace--locals nframe)))
 (inspector-inspect (inspector--alist-to-plist locals
@@ -714,6 +716,8 @@ When PRESERVE-HISTORY is T, inspector history is not 
cleared."
 (defun inspector-inspect-backtrace-frame ()
   "Inspect current frame and locals in debugger backtrace."
   (interactive)
+  (when (not (backtrace-get-index))
+(error "No backtrace frame at point.  Please move cursor to a backtrace 
frame"))
   (let* ((nframe (debugger-frame-number))
  (frames (backtrace-get-frames)))
 (inspector-inspect (nth nframe frames



[nongnu] elpa/php-mode cf9481ccb7: Update copyright notation

2023-01-03 Thread ELPA Syncer
branch: elpa/php-mode
commit cf9481ccb7fbd50847e5a8c1da37f68771c2532e
Author: USAMI Kenta 
Commit: USAMI Kenta 

Update copyright notation
---
 README.ja.md   | 2 +-
 lisp/php-align.el  | 2 +-
 lisp/php-complete.el   | 2 +-
 lisp/php-defs.el   | 2 +-
 lisp/php-face.el   | 2 +-
 lisp/php-flymake.el| 2 +-
 lisp/php-local-manual.el   | 2 +-
 lisp/php-mode-debug.el | 2 +-
 lisp/php-mode.el   | 2 +-
 lisp/php-project.el| 2 +-
 lisp/php.el| 2 +-
 script/data/module_id_prefixes.php | 2 +-
 script/extract_functions.php   | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/README.ja.md b/README.ja.md
index ee1fcf0f9b..783eb3f2b0 100644
--- a/README.ja.md
+++ b/README.ja.md
@@ -310,7 +310,7 @@ PHP Modeは[GNU General Public License Version 3][gpl-v3] 
(GPLv3) でライセ
 このプロジェクトは2017年まで[Eric James Michael Ritz][@ejmr]によりメンテナンスされていました。現在は[Friends 
of Emacs-PHP Development][@emacs-php]コミュニティが引き継いで開発しています。
 
 > ```
-> Copyright (C) 2022  Friends of Emacs-PHP development
+> Copyright (C) 2023  Friends of Emacs-PHP development
 > Copyright (C) 1999, 2000, 2001, 2003, 2004 Turadg Aleahmad
 >   2008 Aaron S. Hawley
 >   2011, 2012, 2013, 2014, 2015, 2016, 2017 Eric James Michael 
 > Ritz
diff --git a/lisp/php-align.el b/lisp/php-align.el
index 6a326cd101..b1ea3bf49d 100644
--- a/lisp/php-align.el
+++ b/lisp/php-align.el
@@ -1,7 +1,7 @@
 ;;; php-align.el --- Alignment configuration for PHP  -*- lexical-binding: t; 
-*-
 
 ;; Copyright (C) 2011  tetsujin (Yusuke Segawa)
-;; Copyright (C) 2022  Friends of Emacs-PHP development
+;; Copyright (C) 2023  Friends of Emacs-PHP development
 
 ;; Author: tetsujin (Yusuke Segawa) 
 ;; Maintainer: USAMI Kenta 
diff --git a/lisp/php-complete.el b/lisp/php-complete.el
index 00c8fdc947..e289943a2f 100644
--- a/lisp/php-complete.el
+++ b/lisp/php-complete.el
@@ -1,6 +1,6 @@
 ;;; php-complete.el --- PHP auto-compiletion functions -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2022  Friends of Emacs-PHP development
+;; Copyright (C) 2023  Friends of Emacs-PHP development
 ;; Copyright (C) 2021, 2022  Free Software Foundation, Inc.
 
 ;; Author: USAMI Kenta 
diff --git a/lisp/php-defs.el b/lisp/php-defs.el
index 3756fce766..fc9e59c812 100644
--- a/lisp/php-defs.el
+++ b/lisp/php-defs.el
@@ -1,6 +1,6 @@
 ;;; php-defs.el --- Provide PHP keyword definitions  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2022  Friends of Emacs-PHP development
+;; Copyright (C) 2023  Friends of Emacs-PHP development
 
 ;; Author: USAMI Kenta 
 ;; Created: 5 Mar 2022
diff --git a/lisp/php-face.el b/lisp/php-face.el
index ccbf416b8b..6fade2409d 100644
--- a/lisp/php-face.el
+++ b/lisp/php-face.el
@@ -1,6 +1,6 @@
 ;;; php-face.el --- Face definitions for PHP script  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2022  Friends of Emacs-PHP development
+;; Copyright (C) 2023  Friends of Emacs-PHP development
 
 ;; Author: USAMI Kenta 
 ;; Created: 5 May 2019
diff --git a/lisp/php-flymake.el b/lisp/php-flymake.el
index 7419867856..822336e589 100644
--- a/lisp/php-flymake.el
+++ b/lisp/php-flymake.el
@@ -1,6 +1,6 @@
 ;;; php-flymake.el --- Flymake backend for PHP   -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2022  Friends of Emacs-PHP development
+;; Copyright (C) 2023  Friends of Emacs-PHP development
 
 ;; Author: USAMI Kenta 
 ;; Created: 5 Mar 2022
diff --git a/lisp/php-local-manual.el b/lisp/php-local-manual.el
index dda26c5dd7..ba4f854ebc 100644
--- a/lisp/php-local-manual.el
+++ b/lisp/php-local-manual.el
@@ -1,6 +1,6 @@
 ;;; php-local-manual.el --- Tools for local PHP manual -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2022  Friends of Emacs-PHP development
+;; Copyright (C) 2023  Friends of Emacs-PHP development
 
 ;; Author: phil-s
 ;; Maintainer: USAMI Kenta 
diff --git a/lisp/php-mode-debug.el b/lisp/php-mode-debug.el
index 31fd98d5f2..9c69e2050b 100644
--- a/lisp/php-mode-debug.el
+++ b/lisp/php-mode-debug.el
@@ -1,6 +1,6 @@
 ;;; php-mode-debug.el --- Debug functions for PHP Mode  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2022  Friends of Emacs-PHP development
+;; Copyright (C) 2023  Friends of Emacs-PHP development
 
 ;; Author: USAMI Kenta 
 ;; URL: https://github.com/emacs-php/php-mode
diff --git a/lisp/php-mode.el b/lisp/php-mode.el
index d55b8653dc..179d5c9040 100644
--- a/lisp/php-mode.el
+++ b/lisp/php-mode.el
@@ -1,6 +1,6 @@
 ;;; php-mode.el --- Major mode for editing PHP code  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2022  Friends of Emacs-PHP development
+;; Copyright (C) 2023  Friends of Emacs-PHP development
 ;; Copyright (C) 1999, 2000, 2001, 2003, 2004 Turadg Aleahmad
 ;;   2008 Aaron S. Hawley
 ;;   2011, 2012, 2013, 2014, 2015, 2016, 2017 Eric James Michael 
Ritz
diff --git a/lisp/php-project.el b/lisp/php-proje

[elpa] main 7dee697079: * elpa-packages (compat): Update URL

2023-01-03 Thread Philip Kaludercic
branch: main
commit 7dee6970794c0850bc0409f950abf7950ef365a7
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

* elpa-packages (compat): Update URL
---
 elpa-packages | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/elpa-packages b/elpa-packages
index 06a919ca7b..62e3a14eb9 100644
--- a/elpa-packages
+++ b/elpa-packages
@@ -160,7 +160,7 @@
  (company-math :url "https://github.com/vspinu/company-math.git";
   :auto-sync t)
  (company-statistics   :url 
"https://github.com/company-mode/company-statistics";)
- (compat   :url "https://git.sr.ht/~pkal/compat";
+ (compat   :url "https://github.com/emacs-compat/compat";
   :doc "compat.texi"
   :auto-sync t)
  (consult  :url "https://github.com/minad/consult";



[elpa] externals/compat 9e0eb5b72f 33/84: Add compat-declare-version to compat-29.el

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 9e0eb5b72f5c9ec8ddfcdc33f16956ad6c29a175
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Add compat-declare-version to compat-29.el
---
 compat-29.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/compat-29.el b/compat-29.el
index f2c967f008..90251726b2 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -29,6 +29,8 @@
 
 (eval-when-compile (require 'compat-macs))
 
+(compat-declare-version "29.1")
+
  Defined in xdisp.c
 
 (compat-defun get-display-property (position prop &optional object properties)



[elpa] externals/compat 87da1d984d 11/84: Begin documenting Emacs 29 support

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 87da1d984dee573e62b78ce7b0223e6027d73132
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Begin documenting Emacs 29 support
---
 compat.texi | 124 
 1 file changed, 124 insertions(+)

diff --git a/compat.texi b/compat.texi
index b6c3d827bb..5793086e5e 100644
--- a/compat.texi
+++ b/compat.texi
@@ -79,6 +79,7 @@ Support
 * Emacs 26.1::   Compatibility support for Emacs 26.1
 * Emacs 27.1::   Compatibility support for Emacs 27.1
 * Emacs 28.1::   Compatibility support for Emacs 28.1
+* Emacs 29.1::   Compatibility support for Emacs 29.1
 
 @end detailmenu
 @end menu
@@ -2246,6 +2247,129 @@ The function @code{syntax-class-to-char}.
 The function @code{path-separator}.
 @end itemize
 
+@node Emacs 29.1
+@section Emacs 29.1
+
+The following functions and macros implemented in 28.1, and are
+@b{not} provided by Compat by default.  You will need to require
+@code{compat-29} for these to be loaded.  Note that due to upstream
+changes, it might happen that there will be the need for changes, so use
+these functions with care.
+
+With the eventual release of Compat 29.1.0.0, these functions will be
+loaded by default:
+
+@c copied from lispref/display.texi
+@defun get-display-property position prop &optional object properties
+This convenience function can be used to get a specific display
+property, no matter whether the @code{display} property is a vector, a
+list or a simple property.  This is like @code{get-text-property}
+(@pxref{Examining Properties,Examining Properties,,elisp,}), but works
+on the @code{display} property only.
+
+@var{position} is the position in the buffer or string to examine, and
+@var{prop} is the @code{display} property to return.  The optional
+@var{object} argument should be either a string or a buffer, and
+defaults to the current buffer.  If the optional @var{properties}
+argument is non-@code{nil}, it should be a @code{display} property,
+and in that case, @var{position} and @var{object} are ignored.  (This
+can be useful if you've already gotten the @code{display} property
+with @code{get-char-property}, for instance (@pxref{Examining
+Properties,Examining
+Properties,,elisp,}).
+@end defun
+
+@c copied from lispref/lists.texi
+@defun take n list
+This function returns the @var{n} first elements of @var{list}.  Essentially,
+it returns the part of @var{list} that @code{nthcdr} skips.
+
+@code{take} returns @var{list} if shorter than @var{n} elements;
+it returns @code{nil} if @var{n} is zero or negative.
+
+@example
+@group
+(take 3 '(a b c d))
+ @result{} (a b c)
+@end group
+@group
+(take 10 '(a b c d))
+ @result{} (a b c d)
+@end group
+@group
+(take 0 '(a b c d))
+ @result{} nil
+@end group
+@end example
+@end defun
+
+@c copied from lispref/lists.texi
+@defun ntake n list
+This is a version of @code{take} that works by destructively modifying
+the list structure of the argument.  That makes it faster, but the
+original value of @var{list} may be lost.
+
+@code{ntake} returns @var{list} unmodified if shorter than @var{n}
+elements; it returns @code{nil} if @var{n} is zero or negative.
+Otherwise, it returns @var{list} truncated to its first @var{n}
+elements.
+
+This means that it is usually a good idea to use the return value and
+not just rely on the truncation effect unless @var{n} is known to be
+positive.
+@end defun
+
+@c copied from lispref/functions.texi
+@defun function-alias-p object &optional noerror
+Checks whether @var{object} is a function alias.  If it is, it returns
+a list of symbols representing the function alias chain, else
+@code{nil}.  For instance, if @code{a} is an alias for @code{b}, and
+@code{b} is an alias for @code{c}:
+
+@example
+(function-alias-p 'a)
+@result{} (b c)
+@end example
+
+If there's a loop in the definitions, an error will be signalled.  If
+@var{noerror} is non-@code{nil}, the non-looping parts of the chain is
+returned instead.
+@end defun
+
+@c copied from lispref/strings.texi
+@defun string-limit string length &optional end coding-system
+If @var{string} is shorter than @var{length} characters, @var{string}
+is returned as is.  Otherwise, return a substring of @var{string}
+consisting of the first @var{length} characters.  If the optional
+@var{end} parameter is given, return a string of the @var{length} last
+characters instead.
+
+If @var{coding-system} is non-@code{nil}, @var{string} will be encoded
+before limiting, and the result will be a unibyte string that's
+shorter than @code{length} bytes.  If @var{string} contains characters
+that are encoded into several bytes (for instance, when using
+@code{utf-8}), the resulting unibyte string is never truncated in the
+middle of a character representation.
+
+This function measures the string length in characters or bytes, and
+thus is generally inappropriate if you need to shorten strings for
+displa

[elpa] externals/compat 29dd29609a 15/84: Prepare compat.el for testing functions from compat-29

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 29dd29609aa64f03028c17c2ed9da872d5472b29
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Prepare compat.el for testing functions from compat-29
---
 compat.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/compat.el b/compat.el
index 2cfd342057..6cfa80bd77 100644
--- a/compat.el
+++ b/compat.el
@@ -46,7 +46,9 @@
   ;; the file (which is disabled by `compat--inhibit-prefixed', so
   ;; that the file can be loaded again at some later point when the
   ;; prefixed definitions are needed).
-  (dolist (vers '(24 25 26 27 28))
+  (dolist (vers (if (bound-and-true-p compat-testing)
+'(24 25 26 27 28 29)
+  '(24 25 26 27 28)))
 (unless (memq (intern (format "compat-%d" vers)) features)
   (load (format "compat-%d%s" vers
 (if (bound-and-true-p compat-testing)



[elpa] externals/compat 71ddb93f75 10/84: Merge branch 'master' into emacs-29

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 71ddb93f7532dac1937b95e2fe648c68fa06e7ab
Merge: 5031a586a3 99d48709ad
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Merge branch 'master' into emacs-29
---
 compat-26.el |   43 ++
 compat-28.el |   33 +-
 compat.texi  | 1922 ++
 3 files changed, 1583 insertions(+), 415 deletions(-)

diff --git a/compat-26.el b/compat-26.el
index 83b89c56c1..76087b8066 100644
--- a/compat-26.el
+++ b/compat-26.el
@@ -627,5 +627,48 @@ If VALUE is nil, PROPERTY is removed from IMAGE."
 (cdr ,image*)
 ,property* ,value*)))
 
+ Defined in rmc.el
+
+;;*UNTESTED
+(compat-defun read-multiple-choice
+(prompt choices &optional _help-string _show-help long-form)
+  "Ask user to select an entry from CHOICES, promting with PROMPT.
+This function allows to ask the user a multiple-choice question.
+
+CHOICES should be a list of the form (KEY NAME [DESCRIPTION]).
+KEY is a character the user should type to select the entry.
+NAME is a short name for the entry to be displayed while prompting
+\(if there's no room, it might be shortened).
+
+If LONG-FORM, do a `completing-read' over the NAME elements in
+CHOICES instead."
+  :note "This is a partial implementation of `read-multiple-choice', that
+among other things doesn't offer any help and ignores the
+optional DESCRIPTION field."
+  (if long-form
+  (let ((options (mapconcat #'cadr choices "/"))
+choice)
+(setq prompt (concat prompt " (" options "): "))
+(setq choice (completing-read prompt (mapcar #'cadr choices) nil t))
+(catch 'found
+  (dolist (option choices)
+(when (string= choice (cadr option))
+  (throw 'found option)))
+  (error "Invalid choice")))
+(let ((options
+   (mapconcat
+(lambda (opt)
+  (format
+   "[%s] %s"
+   (key-description (string (car opt)))
+   (cadr opt)))
+choices " "))
+  choice)
+  (setq prompt (concat prompt " (" options "): "))
+  (while (not (setq choice (assq (read-char prompt) choices)))
+(message "Invalid choice")
+(sit-for 1))
+  choice)))
+
 (compat--inhibit-prefixed (provide 'compat-26))
 ;;; compat-26.el ends here
diff --git a/compat-28.el b/compat-28.el
index 0c399b4823..1b1d6de3d5 100644
--- a/compat-28.el
+++ b/compat-28.el
@@ -285,22 +285,23 @@ and BLUE, is normalized to have its value in [0,65535]."
;; [0] http://www.nic.funet.fi/pub/X11/X11R4/DOCS/color/Xcms.text
;; [1] 
https://gitlab.freedesktop.org/xorg/lib/libx11/-/blob/master/src/xcms/LRGB.c#L1392
((string-match
- (rx bos "rgbi:" (* space)
- (group (? (or "-" "+"))
-(or (: (+ digit) (? "." (* digit)))
-(: "." (+ digit)))
-(? "e" (? (or "-" "+")) (+ digit)))
- "/" (* space)
- (group (? (or "-" "+"))
-(or (: (+ digit) (? "." (* digit)))
-(: "." (+ digit)))
-(? "e" (? (or "-" "+")) (+ digit)))
- "/" (* space)
- (group (? (or "-" "+"))
-(or (: (+ digit) (? "." (* digit)))
-(: "." (+ digit)))
-(? "e" (? (or "-" "+")) (+ digit)))
- eos)
+ ;; (rx bos "rgbi:" (* space)
+ ;; (group (? (or "-" "+"))
+ ;;(or (: (+ digit) (? "." (* digit)))
+ ;;(: "." (+ digit)))
+ ;;(? "e" (? (or "-" "+")) (+ digit)))
+ ;; "/" (* space)
+ ;; (group (? (or "-" "+"))
+ ;;(or (: (+ digit) (? "." (* digit)))
+ ;;(: "." (+ digit)))
+ ;;(? "e" (? (or "-" "+")) (+ digit)))
+ ;; "/" (* space)
+ ;; (group (? (or "-" "+"))
+ ;;(or (: (+ digit) (? "." (* digit)))
+ ;;(: "." (+ digit)))
+ ;;(? "e" (? (or "-" "+")) (+ digit)))
+ ;; eos)
+ 
"\\`rgbi:[[:space:]]*\\([+-]?\\(?:[[:digit:]]+\\(?:\\.[[:digit:]]*\\)?\\|\\.[[:digit:]]+\\)\\(?:e[+-]?[[:digit:]]+\\)?\\)/[[:space:]]*\\([+-]?\\(?:[[:digit:]]+\\(?:\\.[[:digit:]]*\\)?\\|\\.[[:digit:]]+\\)\\(?:e[+-]?[[:digit:]]+\\)?\\)/[[:space:]]*\\([+-]?\\(?:[[:digit:]]+\\(?:\\.[[:digit:]]*\\)?\\|\\.[[:digit:]]+\\)\\(?:e[+-]?[[:digit:]]+\\)?\\)\\'"
  spec)
 (let ((r (round (* (string-to-number (match-string 1 spec)) 65535)))
   (g (round (* (string-to-number (match-string 2 spec)) 65535)))
diff --git a/compat.texi b/compat.texi
index 2335e99721..b6c3d827bb 100644
--- a/compat.texi
+++ b/compat.texi
@@ -95,32 +95,33 @@ Support
 @node Overview
 @section Overview
 
-The objective of Compat is to provide "forwards compatibility"
-library for Emacs Lisp.  T

[elpa] externals/compat 145d344d37 45/84: Add prefixed define-key from Emacs 29.1

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 145d344d374060a64c74d34b91956f67d71832aa
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Add prefixed define-key from Emacs 29.1
---
 compat-29.el| 64 +
 compat-tests.el | 23 +
 compat.texi | 19 +
 3 files changed, 106 insertions(+)

diff --git a/compat-29.el b/compat-29.el
index cd57b2565e..bf313b4b21 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -29,6 +29,7 @@
 ;; - `plist-get'
 ;; - `plist-put'
 ;; - `plist-member'
+;; - `define-key'
 
 ;;; Code:
 
@@ -176,6 +177,69 @@ The value is actually the tail of PLIST whose car is PROP."
   (throw 'found plist))
 (setq plist (cddr plist))
 
+ Defined in keymap.c
+
+(compat-defun define-key (keymap key def &optional remove)
+  "In KEYMAP, define key sequence KEY as DEF.
+This is a legacy function; see `keymap-set' for the recommended
+function to use instead.
+
+KEYMAP is a keymap.
+
+KEY is a string or a vector of symbols and characters, representing a
+sequence of keystrokes and events.  Non-ASCII characters with codes
+above 127 (such as ISO Latin-1) can be represented by vectors.
+Two types of vector have special meanings:
+ [remap COMMAND] remaps any key binding for COMMAND.
+ [t] creates a default definition, which applies to any event with no
+other definition in KEYMAP.
+
+DEF is anything that can be a key's definition:
+ nil (means key is undefined in this keymap),
+ a command (a Lisp function suitable for interactive calling),
+ a string (treated as a keyboard macro),
+ a keymap (to define a prefix key),
+ a symbol (when the key is looked up, the symbol will stand for its
+function definition, which should at that time be one of the above,
+or another symbol whose function definition is used, etc.),
+ a cons (STRING . DEFN), meaning that DEFN is the definition
+(DEFN should be a valid definition in its own right) and
+STRING is the menu item name (which is used only if the containing
+keymap has been created with a menu name, see `make-keymap'),
+ or a cons (MAP . CHAR), meaning use definition of CHAR in keymap MAP,
+ or an extended menu item definition.
+ (See info node `(elisp)Extended Menu Items'.)
+
+If REMOVE is non-nil, the definition will be removed.  This is almost
+the same as setting the definition to nil, but makes a difference if
+the KEYMAP has a parent, and KEY is shadowing the same binding in the
+parent.  With REMOVE, subsequent lookups will return the binding in
+the parent, and with a nil DEF, the lookups will return nil.
+
+If KEYMAP is a sparse keymap with a binding for KEY, the existing
+binding is altered.  If there is no binding for KEY, the new pair
+binding KEY to DEF is added at the front of KEYMAP."
+  :realname compat--define-key-with-remove
+  :prefix 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-defun function-alias-p (func &optional noerror)
diff --git a/compat-tests.el b/compat-tests.el
index c51a2e8041..265b8a26bf 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -2111,6 +2111,29 @@ being compared against."
  3 #'<=)
   (ought nil '(1 :one 2 :two 3 :three) 4 #'<=))
 
+(ert-deftest compat-define-key ()
+  "Check if `define-key' handles the REMOVE argument."
+  (let ((map (make-sparse-keymap))
+(super (make-sparse-keymap)))
+(set-keymap-parent map super)
+(define-key super "a" 'always)
+;; We should be able to command a key that was just bound.
+(define-key map "a" 'ignore)
+(should (eq (lookup-key map "a") 'ignore))
+(should (eq (lookup-key super "a") 'always))
+;; After removing it we should find the key in the parent map.
+(compat-define-key map "a" nil t)
+(should (eq (lookup-key map "a") 'always))
+(should (eq (lookup-key super "a") 'always))
+;; Repeating this shouldn't change the result
+(compat-define-key map "a" 'anything t)
+(should (eq (lookup-key map "a") 'always))
+(should (eq (lookup-key super "a") 'always))
+;; Removing it from the parent map should remove it from the child
+;; map as well.
+

[elpa] externals/compat 9b8799091c 16/84: Add @subsection headers for Emacs 29.1 node

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 9b8799091c5f0f6cee2839ab314a29a009afc8a4
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Add @subsection headers for Emacs 29.1 node
---
 compat.texi | 17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/compat.texi b/compat.texi
index 5793086e5e..cdf089125c 100644
--- a/compat.texi
+++ b/compat.texi
@@ -2250,7 +2250,8 @@ The function @code{path-separator}.
 @node Emacs 29.1
 @section Emacs 29.1
 
-The following functions and macros implemented in 28.1, and are
+@subsection Unprefixed Definitions
+The following functions and macros implemented in 29.1, and are
 @b{not} provided by Compat by default.  You will need to require
 @code{compat-29} for these to be loaded.  Note that due to upstream
 changes, it might happen that there will be the need for changes, so use
@@ -2359,17 +2360,15 @@ display purposes; use @code{truncate-string-to-width} or
 @end defun
 
 
-@c These functions are prefixed with @code{compat} prefix, and will require
-@c manual loading even after the release of Compat 29.1.0.0:
 
-@c Compat does not provide support for the following Lisp features
-@c implemented in 29.1:
 
-@c @itemize
-@c @item
-@c @c Support for XYZ
-@c @end itemize
+@subsection Prefixed Definitions
+These functions are prefixed with @code{compat} prefix, and will require
+manual loading even after the release of Compat 29.1.0.0:
 
+@subsection Missing Definitions
+Compat does not provide support for the following Lisp features
+implemented in 29.1:
 @node Development
 @chapter Development
 



[elpa] externals/compat 2e206a8304 21/84: Add prefixed plist-get from Emacs 29

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 2e206a8304b3fcf3e8d855f5c3dc475bd70f5dd8
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Add prefixed plist-get from Emacs 29
---
 compat-29.el| 19 +++
 compat-tests.el | 10 ++
 compat.texi | 14 ++
 3 files changed, 43 insertions(+)

diff --git a/compat-29.el b/compat-29.el
index af29d96446..3d823ee6aa 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -107,6 +107,25 @@ Unibyte strings are converted to multibyte for comparison."
   (declare (pure t) (side-effect-free t))
   (eq t (compare-strings string1 0 nil string2 0 nil t)))
 
+(compat-defun plist-get (plist prop &optional predicate)
+  "Extract a value from a property list.
+PLIST is a property list, which is a list of the form
+\(PROP1 VALUE1 PROP2 VALUE2...).
+
+This function returns the value corresponding to the given PROP, or
+nil if PROP is not one of the properties on the list.  The comparison
+with PROP is done using PREDICATE, which defaults to `eq'.
+
+This function doesn't signal an error if PLIST is invalid."
+  :prefix t
+  (if (or (null predicate) (eq predicate 'eq))
+  (plist-get plist prop)
+(catch 'found
+  (while (consp plist)
+(when (funcall predicate prop (car plist))
+  (throw 'found (cadr plist)))
+(setq plist (cddr plist))
+
  Defined in subr.el
 
 (compat-defun function-alias-p (func &optional noerror)
diff --git a/compat-tests.el b/compat-tests.el
index 4f91473a85..9ad7651534 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -2037,6 +2037,16 @@ being compared against."
   (ought t "AAA bbb" "aaa bbb")
   (ought t "aaa BBB" "aaa bbb"))
 
+(compat-deftests compat-plist-get
+  (ought 1 '(:one 1 :two 2 :three 3) :one)
+  (ought 2 '(:one 1 :two 2 :three 3) :two)
+  (ought 3 '(:one 1 :two 2 :three 3) :three)
+  (ought nil '(:one 1 :two 2 :three 3) :four)
+  ;; With a custom predicate
+  (ought :one '(1 :one 2 :two 3 :three) 3 #'>)
+  (ought :three '(1 :one 2 :two 3 :three) 3 #'<=)
+  (ought nil '(1 :one 2 :two 3 :three) 4 #'<=))
+
 
 (provide 'compat-tests)
 ;;; compat-tests.el ends here
diff --git a/compat.texi b/compat.texi
index e82badff2a..c4e8aa710f 100644
--- a/compat.texi
+++ b/compat.texi
@@ -2395,6 +2395,20 @@ differences, like @code{char-equal} when 
@code{case-fold-search} is
 These functions are prefixed with @code{compat} prefix, and will require
 manual loading even after the release of Compat 29.1.0.0:
 
+@c copied from lispref/lists.texi
+@defun compat-plist-get plist prop &optional predicate
+This returns the value of the @var{property} property stored in the
+property list @var{plist}.  Comparisons are done with @var{predicate},
+and defaults to @code{eq}.  It accepts a malformed @var{plist}
+argument.  If @var{property} is not found in the @var{plist}, it
+returns @code{nil}.
+
+@xref{Plist Access,,,elisp}.
+
+This compatibility version handles the optional argument
+@var{predicate}.
+@end defun
+
 @subsection Missing Definitions
 Compat does not provide support for the following Lisp features
 implemented in 29.1:



[elpa] externals/compat faeeebe50b 52/84: Remove unused local variable in file-name-absolute-p

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit faeeebe50bfcb3747d15c411d9ef1b793599df5a
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Remove unused local variable in file-name-absolute-p
---
 compat-27.el | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/compat-27.el b/compat-27.el
index bc0e37a356..2581ce7df5 100644
--- a/compat-27.el
+++ b/compat-27.el
@@ -352,11 +352,7 @@ On Unix, absolute file names start with `/'.  In Emacs, an 
absolute
 file name can also start with an initial `~' or `~USER' component,
 where USER is a valid login name."
   ;; See definitions in filename.h
-  (let ((seperator
- (eval-when-compile
-   (if (memq system-type '(cygwin windows-nt ms-dos))
-   "[\\/]" "/")))
-(drive
+  (let ((drive
  (eval-when-compile
(cond
 ((memq system-type '(windows-nt ms-dos))



[elpa] externals/compat 0a84a7c219 48/84: Add add-display-text-property from Emacs 29

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 0a84a7c2195f5dee275072a74b4957fe2ac51774
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Add add-display-text-property from Emacs 29
---
 compat-29.el | 43 +++
 compat.texi  | 10 ++
 2 files changed, 53 insertions(+)

diff --git a/compat-29.el b/compat-29.el
index 0fcd3ad0d6..34b21d6070 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -437,6 +437,49 @@ be marked unmodified, effectively ignoring those changes."
 (equal ,hash (buffer-hash)))
(restore-buffer-modified-p nil
 
+;;* UNTESTED
+(compat-defun add-display-text-property (start end prop value
+   &optional object)
+  "Add display property PROP with VALUE to the text from START to END.
+If any text in the region has a non-nil `display' property, those
+properties are retained.
+
+If OBJECT is non-nil, it should be a string or a buffer.  If nil,
+this defaults to the current buffer."
+  :feature 'subr-x
+  (let ((sub-start start)
+(sub-end 0)
+disp)
+(while (< sub-end end)
+  (setq sub-end (next-single-property-change sub-start 'display object
+ (if (stringp object)
+ (min (length object) end)
+   (min end (point-max)
+  (if (not (setq disp (get-text-property sub-start 'display object)))
+  ;; No old properties in this range.
+  (put-text-property sub-start sub-end 'display (list prop value))
+;; We have old properties.
+(let ((vector nil))
+  ;; Make disp into a list.
+  (setq disp
+(cond
+ ((vectorp disp)
+  (setq vector t)
+  (seq-into disp 'list))
+ ((not (consp (car disp)))
+  (list disp))
+ (t
+  disp)))
+  ;; Remove any old instances.
+  (when-let ((old (assoc prop disp)))
+(setq disp (delete old disp)))
+  (setq disp (cons (list prop value) disp))
+  (when vector
+(setq disp (seq-into disp 'vector)))
+  ;; Finally update the range.
+  (put-text-property sub-start sub-end 'display disp)))
+  (setq sub-start sub-end
+
  Defined in files.el
 
 (compat-defun file-parent-directory (filename)
diff --git a/compat.texi b/compat.texi
index 1c9f1fea94..cb89595c4f 100644
--- a/compat.texi
+++ b/compat.texi
@@ -2289,6 +2289,16 @@ Properties,Examining
 Properties,,elisp,}).
 @end defun
 
+@c copied from lisp/subr-x.el
+@defun add-display-text-property start end prop value &optional object
+Add display property @var{prop} with @var{value} to the text from
+@var{start} to @var{end}.  If any text in the region has a non-nil
+@code{display} property, those properties are retained.
+
+If @var{object} is non-@code{nil}, it should be a string or a buffer.
+If @code{nil}, this defaults to the current buffer.
+@end defun
+
 @c copied from lispref/lists.texi
 @defun take n list
 This function returns the @var{n} first elements of @var{list}.  Essentially,



[elpa] externals/compat b98e7cc868 39/84: Fix gv-expander for compat-alist-get

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit b98e7cc868020a4ede2f330b73bd5aaead147cfd
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Fix gv-expander for compat-alist-get

We had previously used compat-assoc that is not always defined
(e.g. when testing).  By giving compat-assoc a realname, we can access
it in the gv-expander.
---
 compat-26.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/compat-26.el b/compat-26.el
index a21b903b93..a7dcf2e7b1 100644
--- a/compat-26.el
+++ b/compat-26.el
@@ -123,6 +123,7 @@ Equality is defined by the function TESTFN, defaulting to
 `equal'.  TESTFN is called with 2 arguments: a car of an alist
 element and KEY.  With no optional argument, the function behaves
 just like `assoc'."
+  :realname compat--assoc-handle-testfn
   :prefix t
   (if testfn
   (catch 'found
@@ -169,7 +170,7 @@ from the absolute start of the buffer, disregarding the 
narrowing."
 (macroexp-let2 macroexp-copyable-p k key
   (gv-letplace (getter setter) alist
 (macroexp-let2 nil p `(if (and ,testfn (not (eq ,testfn 'eq)))
-  (compat-assoc ,k ,getter ,testfn)
+  (compat--assoc-handle-testfn ,k ,getter 
,testfn)
 (assq ,k ,getter))
   (funcall do (if (null default) `(cdr ,p)
 `(if ,p (cdr ,p) ,default))



[elpa] externals/compat fdae099b00 34/84: Move if-let and related function from subr-x to subr

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit fdae099b002682aac2ffef4a286f3b43f07ba82d
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Move if-let and related function from subr-x to subr

With Emacs 29 these functions have been moved to subr.el, making them
available by default without loading subr-x.
---
 compat-25.el |   6 ++--
 compat-26.el | 108 ---
 2 files changed, 54 insertions(+), 60 deletions(-)

diff --git a/compat-25.el b/compat-25.el
index 60f365ba68..fec59048a4 100644
--- a/compat-25.el
+++ b/compat-25.el
@@ -130,8 +130,6 @@ Equality with KEY is tested by TESTFN, defaulting to `eq'."
 default)))
 (if entry (cdr entry) default)))
 
- Defined in subr-x.el
-
 (compat-defmacro if-let (spec then &rest else)
   "Bind variables according to SPEC and evaluate THEN or ELSE.
 Evaluate each binding in turn, as in `let*', stopping if a
@@ -149,7 +147,6 @@ As a special case, interprets a SPEC of the form \(SYMBOL 
SOMETHING)
 like \((SYMBOL SOMETHING)).  This exists for backward compatibility
 with an old syntax that accepted only one binding."
   :realname compat--if-let
-  :feature 'subr-x
   (declare (indent 2)
(debug ([&or (symbolp form)
 (&rest [&or symbolp (symbolp form) (form)])]
@@ -166,10 +163,11 @@ Evaluate each binding in turn, stopping if a binding 
value is nil.
 If all are non-nil, return the value of the last form in BODY.
 
 The variable list SPEC is the same as in `if-let'."
-  :feature 'subr-x
   (declare (indent 1) (debug if-let))
   `(compat--if-let ,spec ,(macroexp-progn body)))
 
+ Defined in subr-x.el
+
 (compat-defmacro thread-first (&rest forms)
   "Thread FORMS elements as the first argument of their successor.
 Example:
diff --git a/compat-26.el b/compat-26.el
index f712d24e76..a21b903b93 100644
--- a/compat-26.el
+++ b/compat-26.el
@@ -362,6 +362,58 @@ PREFIX is a string, and defaults to \"g\"."
  (1+ gensym-counter)
 (make-symbol (format "%s%d" (or prefix "g") num
 
+(compat-defmacro if-let* (varlist then &rest else)
+  "Bind variables according to VARLIST and evaluate THEN or ELSE.
+This is like `if-let' but doesn't handle a VARLIST of the form
+\(SYMBOL SOMETHING) specially."
+  :realname compat--if-let*
+  (declare (indent 2)
+   (debug ((&rest [&or symbolp (symbolp form) (form)])
+   body)))
+  (let ((empty (make-symbol "s"))
+(last t) list)
+(dolist (var varlist)
+  (push `(,(if (cdr var) (car var) empty)
+  (and ,last ,(or (cadr var) (car var
+list)
+  (when (or (cdr var) (consp (car var)))
+(setq last (caar list
+`(let* ,(nreverse list)
+   (if ,(caar list) ,then ,@else
+
+(compat-defmacro when-let* (varlist &rest body)
+  "Bind variables according to VARLIST and conditionally evaluate BODY.
+This is like `when-let' but doesn't handle a VARLIST of the form
+\(SYMBOL SOMETHING) specially."
+  (declare (indent 1) (debug if-let*))
+  (let ((empty (make-symbol "s"))
+(last t) list)
+(dolist (var varlist)
+  (push `(,(if (cdr var) (car var) empty)
+  (and ,last ,(or (cadr var) (car var
+list)
+  (when (or (cdr var) (consp (car var)))
+(setq last (caar list
+`(let* ,(nreverse list)
+   (when ,(caar list) ,@body
+
+(compat-defmacro and-let* (varlist &rest body)
+  "Bind variables according to VARLIST and conditionally evaluate BODY.
+Like `when-let*', except if BODY is empty and all the bindings
+are non-nil, then the result is non-nil."
+  :feature 'subr-x
+  (declare (indent 1) (debug if-let*))
+  (let ((empty (make-symbol "s"))
+(last t) list)
+(dolist (var varlist)
+  (push `(,(if (cdr var) (car var) empty)
+  (and ,last ,(or (cadr var) (car var
+list)
+  (when (or (cdr var) (consp (car var)))
+(setq last (caar list
+`(let* ,(nreverse list)
+   (if ,(caar list) ,(macroexp-progn (or body '(t)))
+
  Defined in files.el
 
 (declare-function temporary-file-directory nil)
@@ -535,62 +587,6 @@ inode-number and device-number."
   (error "Wrong attribute name '%S'" attr
 (nreverse result)))
 
- Defined in subr-x.el
-
-(compat-defmacro if-let* (varlist then &rest else)
-  "Bind variables according to VARLIST and evaluate THEN or ELSE.
-This is like `if-let' but doesn't handle a VARLIST of the form
-\(SYMBOL SOMETHING) specially."
-  :realname compat--if-let*
-  :feature 'subr-x
-  (declare (indent 2)
-   (debug ((&rest [&or symbolp (symbolp form) (form)])
-   body)))
-  (let ((empty (make-symbol "s"))
-(last t) list)
-(dolist (var varlist)
-  (push `(,(if (cdr var) (car var) empty)
-  (and ,last ,(or (cadr var) (car var
-list)
-  (when (or (cdr var) (consp (car var)))
-(setq last (caar list

[elpa] externals/compat 4a56adbcdf 42/84: Remove references to the deleted "Emacs 24.5" node

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 4a56adbcdf17398cbb2bbe6d6858b7a63ee1f5a1
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Remove references to the deleted "Emacs 24.5" node
---
 compat.texi | 2 --
 1 file changed, 2 deletions(-)

diff --git a/compat.texi b/compat.texi
index 7e057ff283..0caa67467f 100644
--- a/compat.texi
+++ b/compat.texi
@@ -74,7 +74,6 @@ Usage
 Support
 
 * Emacs 24.4::   Compatibility support for Emacs 24.4
-* Emacs 24.5::   Compatibility support for Emacs 24.5
 * Emacs 25.1::   Compatibility support for Emacs 25.1
 * Emacs 26.1::   Compatibility support for Emacs 26.1
 * Emacs 27.1::   Compatibility support for Emacs 27.1
@@ -218,7 +217,6 @@ manage to provide for each Emacs version.
 
 @menu
 * Emacs 24.4::   Compatibility support for Emacs 24.4
-* Emacs 24.5::   Compatibility support for Emacs 24.5
 * Emacs 25.1::   Compatibility support for Emacs 25.1
 * Emacs 26.1::   Compatibility support for Emacs 26.1
 * Emacs 27.1::   Compatibility support for Emacs 27.1



[elpa] externals/compat bb86f3aa3b 37/84: Simplify compat--generate-testable

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit bb86f3aa3b6a3064388030f9fa2c770488b93ee1
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Simplify compat--generate-testable

Remove functionality which is not needed for testing.
---
 compat-tests.el | 42 ++
 1 file changed, 14 insertions(+), 28 deletions(-)

diff --git a/compat-tests.el b/compat-tests.el
index 7a4c0e264f..e4d68ebfdc 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -37,43 +37,29 @@
 (require 'compat-macs)
 
 (defvar compat-current-version)
-(defun compat--generate-testable (name def-fn install-fn check-fn attr type)
+(defun compat--generate-testable (name def-fn _install-fn _check-fn attr _type)
   "Generate a more verbose compatibility definition, fit for testing.
 See `compat-generate-function' for details on the arguments NAME,
 DEF-FN, INSTALL-FN, CHECK-FN, ATTR and TYPE."
-  (let* ((min-version (plist-get attr :min-version))
- (max-version (plist-get attr :max-version))
+  (let* ((realname (or (plist-get attr :realname)
+   (intern (format "compat--%S" name
  (feature (plist-get attr :feature))
- (cond (plist-get attr :cond))
  (version (or (plist-get attr :version)
-  compat-current-version))
- (realname (or (plist-get attr :realname)
-   (intern (format "compat--%S" name
- (body `(progn
-  (unless (or (null (get ',name 'compat-def))
-  (eq (get ',name 'compat-def) ',realname))
-(error "Duplicate compatibility definition: %s (was %s, 
now %s)"
-   ',name (get ',name 'compat-def) ',realname))
-  (put ',name 'compat-def ',realname)
-  ,(funcall install-fn realname version
+  compat-current-version)))
 `(progn
-   (put ',realname 'compat-type ',type)
(put ',realname 'compat-version ,version)
-   (put ',realname 'compat-min-version ,min-version)
-   (put ',realname 'compat-max-version ,max-version)
-   (put ',realname 'compat-doc ,(plist-get attr :note))
-   ,(funcall def-fn realname version)
-   ,(and (plist-get attr :prefix)
- (if feature
- `(progn
-(require ,feature)
-,body)
-   body)
-
-(setq compat--generate-function #'compat--generate-testable)
+   (put ',realname 'compat-min-version
+,(plist-get attr :min-version))
+   (put ',realname 'compat-max-version
+,(plist-get attr :max-version))
+   ,(and feature `(require ,feature))
+   ,(funcall def-fn realname version
+
+;; For testing: (setq compat--generate-function #'compat--generate-testable)
 
 (defvar compat-testing)
-(let ((compat-testing t))
+(let ((compat--generate-function #'compat--generate-testable)
+  (compat-testing t))
   (load "compat.el"))
 
 (defvar compat-test-counter)



[elpa] externals/compat ef5246cf55 38/84: Fix issues related to 'expect' tests

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit ef5246cf5517e3120d75953e091e2e5c77398c29
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Fix issues related to 'expect' tests
---
 compat-tests.el | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/compat-tests.el b/compat-tests.el
index e4d68ebfdc..7ef404e17b 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -116,7 +116,7 @@ being compared against."
  ,(if (consp error-spec)
   `(equal res ',error-spec)
 `(eq (car res) ',error-spec)
- (and (fboundp compat)
+ (if (fboundp compat)
   `(ert-set-test
 ',comp-test
 (make-ert-test
@@ -124,11 +124,12 @@ being compared against."
  :tags '(,name)
  :body (lambda ()
  (should
-  (let ((res (should-error (,name ,@args) :type 
',error-type)))
+  (let ((res (should-error (,compat ,@args) :type 
',error-type)))
 (should
  ,(if (consp error-spec)
   `(equal res ',error-spec)
-`(eq (car res) ',error-spec))
+`(eq (car res) ',error-spec
+  (warn "Missing compat definition %S" compat)))
 
 (defmacro compat-deftests (name &rest body)
   "Test NAME in BODY."
@@ -138,7 +139,7 @@ being compared against."
  (real-name (if (consp name) (car name) name))
  (compat-name (if (consp name)
   (cadr name)
-(intern (format "compat--%s" real-name
+(intern (format "compat--%S" real-name
  (env (list
(cons 'ought (compat--ought real-name compat-name))
(cons 'expect (compat--expect real-name compat-name)



[elpa] externals/compat 518067a7d6 58/84: Copy edebug specification for and-let* from if-let*

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 518067a7d6766e05317de9d56fc8abfe1f6dde7d
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Copy edebug specification for and-let* from if-let*
---
 compat-26.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/compat-26.el b/compat-26.el
index bd8f341cbf..bcfd893fe8 100644
--- a/compat-26.el
+++ b/compat-26.el
@@ -404,7 +404,9 @@ This is like `when-let' but doesn't handle a VARLIST of the 
form
 Like `when-let*', except if BODY is empty and all the bindings
 are non-nil, then the result is non-nil."
   :feature 'subr-x
-  (declare (indent 1) (debug if-let*))
+  (declare (indent 1)
+   (debug ((&rest [&or symbolp (symbolp form) (form)])
+   body)))
   (let ((empty (make-symbol "s"))
 (last t) list)
 (dolist (var varlist)



[elpa] externals/compat 59cd42a912 60/84: Generate test names without double-dashes

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 59cd42a912e32e3b11afd81788309ce9c3dfca7f
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Generate test names without double-dashes
---
 compat-tests.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/compat-tests.el b/compat-tests.el
index 265b8a26bf..5c5c4f2df0 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -97,8 +97,8 @@ being compared against."
 COMPAT is the name of the compatibility function the behaviour is
 being compared against."
   (lambda (error-spec &rest args)
-(let ((real-test (intern (format "%s-%04d-actual/expect" compat 
compat-test-counter)))
-  (comp-test (intern (format "%s-%04d-compat/expect" compat 
compat-test-counter)))
+(let ((real-test (intern (format "compat-%s-%04d-actual/expect" name 
compat-test-counter)))
+  (comp-test (intern (format "compat-%s-%04d-compat/expect" name 
compat-test-counter)))
   (error-type (if (consp error-spec) (car error-spec) error-spec)))
   (setq compat-test-counter (1+ compat-test-counter))
   (macroexp-progn



[elpa] externals/compat b888c2fb49 53/84: Replace when-let with expansions in compat-29

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit b888c2fb493d8d71b93a3d5b40e092bddba0afef
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Replace when-let with expansions in compat-29
---
 compat-29.el | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/compat-29.el b/compat-29.el
index 32783b58f7..0cd5ab3bad 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -473,8 +473,8 @@ this defaults to the current buffer."
  (t
   disp)))
   ;; Remove any old instances.
-  (when-let ((old (assoc prop disp)))
-(setq disp (delete old disp)))
+  (let ((old (assoc prop disp)))
+(when old (setq disp (delete old disp
   (setq disp (cons (list prop value) disp))
   (when vector
 (setq disp (seq-into disp 'vector)))
@@ -894,8 +894,9 @@ The binding is probably a symbol with a function definition.
 If optional argument ACCEPT-DEFAULT is non-nil, recognize default
 bindings; see the description of `keymap-lookup' for more details
 about this."
-  (when-let ((map (current-local-map)))
-(compat--keymap-lookup map keys accept-default)))
+  (let ((map (current-local-map)))
+(when map
+  (compat--keymap-lookup map keys accept-default
 
 ;;* UNTESTED
 (compat-defun keymap-global-lookup (keys &optional accept-default _message)



[elpa] externals/compat b0f8f6eaac 61/84: Remove realname for ntake

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit b0f8f6eaacaff69e8fb75e15eccf99ea3da586fe
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Remove realname for ntake
---
 compat-29.el | 1 -
 1 file changed, 1 deletion(-)

diff --git a/compat-29.el b/compat-29.el
index 64aa3a78d7..7d3f26b401 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -97,7 +97,6 @@ WINDOW."
 If N is zero or negative, return nil.
 If N is greater or equal to the length of LIST, return LIST unmodified.
 Otherwise, return LIST after truncating it."
-  :realname compat--ntake-elisp
   (and (> n 0) (let ((cons (nthcdr (1- n) list)))
  (when cons (setcdr cons nil))
  list)))



[elpa] externals/compat b4f38aa5ab 55/84: Copy if-let/if-let* definitions into if-let/when-let

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit b4f38aa5abb750ad2ffab96ad50902277edb2089
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Copy if-let/if-let* definitions into if-let/when-let
---
 compat-25.el | 26 --
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/compat-25.el b/compat-25.el
index d0df7d8a96..339de654ce 100644
--- a/compat-25.el
+++ b/compat-25.el
@@ -155,7 +155,16 @@ with an old syntax that accepted only one binding."
  (not (listp (car spec
 ;; Adjust the single binding case
 (setq spec (list spec)))
-  `(compat--if-let* ,spec ,then ,(macroexp-progn else)))
+  (let ((empty (make-symbol "s"))
+(last t) list)
+(dolist (var spec)
+  (push `(,(if (cdr var) (car var) empty)
+  (and ,last ,(or (cadr var) (car var
+list)
+  (when (or (cdr var) (consp (car var)))
+(setq last (caar list
+`(let* ,(nreverse list)
+   (if ,(caar list) ,then ,@else
 
 (compat-defmacro when-let (spec &rest body)
   "Bind variables according to SPEC and conditionally evaluate BODY.
@@ -167,7 +176,20 @@ The variable list SPEC is the same as in `if-let'."
(debug ([&or (symbolp form)
 (&rest [&or symbolp (symbolp form) (form)])]
body)))
-  `(compat--if-let ,spec ,(macroexp-progn body)))
+  (when (and (<= (length spec) 2)
+ (not (listp (car spec
+;; Adjust the single binding case
+(setq spec (list spec)))
+  (let ((empty (make-symbol "s"))
+(last t) list)
+(dolist (var spec)
+  (push `(,(if (cdr var) (car var) empty)
+  (and ,last ,(or (cadr var) (car var
+list)
+  (when (or (cdr var) (consp (car var)))
+(setq last (caar list
+`(let* ,(nreverse list)
+   (if ,(caar list) ,(macroexp-progn body)
 
  Defined in subr-x.el
 



[elpa] externals/compat 97cecbc1c0 54/84: Replace seq-into with concrete implementations in compat-29

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 97cecbc1c03672762a32726de6226598a03920b4
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Replace seq-into with concrete implementations in compat-29
---
 compat-29.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/compat-29.el b/compat-29.el
index 0cd5ab3bad..a492fe1001 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -467,7 +467,7 @@ this defaults to the current buffer."
 (cond
  ((vectorp disp)
   (setq vector t)
-  (seq-into disp 'list))
+  (append disp nil))
  ((not (consp (car disp)))
   (list disp))
  (t
@@ -477,7 +477,7 @@ this defaults to the current buffer."
 (when old (setq disp (delete old disp
   (setq disp (cons (list prop value) disp))
   (when vector
-(setq disp (seq-into disp 'vector)))
+(setq disp (vconcat disp)))
   ;; Finally update the range.
   (put-text-property sub-start sub-end 'display disp)))
   (setq sub-start sub-end



[elpa] externals/compat 3f3f2e44d5 43/84: Split compat-insert-into-buffer into multiple tests

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 3f3f2e44d50f7ea00f06be8e9d4929735b6fde77
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Split compat-insert-into-buffer into multiple tests
---
 compat-tests.el | 17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/compat-tests.el b/compat-tests.el
index 9e1fefab71..c51a2e8041 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -355,9 +355,8 @@ being compared against."
   (ought t 1)  ;single argument
   (ought t 1 2 3 4))  ;multiple arguments
 
-(ert-deftest compat-insert-into-buffer ()
-  "Check if `insert-into-buffer' was implemented correctly."
-  ;; Without optional compat--arguments
+(ert-deftest compat-insert-into-buffer-1 ()
+  "Check if `insert-into-buffer' can handle no optional argument."
   (with-temp-buffer
 (let ((other (current-buffer)))
   (insert "abc")
@@ -372,8 +371,10 @@ being compared against."
(with-temp-buffer
  (insert "def")
  (insert-into-buffer other))
-   (should (string= (buffer-string) "abcdef")
-  ;; With one optional argument
+   (should (string= (buffer-string) "abcdef"))
+
+(ert-deftest compat-insert-into-buffer-2 ()
+  "Check if `insert-into-buffer' handles one optional argument."
   (with-temp-buffer
 (let ((other (current-buffer)))
   (insert "abc")
@@ -388,8 +389,10 @@ being compared against."
(with-temp-buffer
  (insert "def")
  (insert-into-buffer other 2))
-   (should (string= (buffer-string) "abcef")
-  ;; With two optional arguments
+   (should (string= (buffer-string) "abcef"))
+
+(ert-deftest compat-insert-into-buffer-3 ()
+  "Check if `insert-into-buffer' handles two optional arguments."
   (with-temp-buffer
 (let ((other (current-buffer)))
   (insert "abc")



[elpa] externals/compat 835b4301b4 62/84: Add 'pure' and 'side-effect-free' properties to take

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 835b4301b4f2a6de02e9dacf0215857753018ab3
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Add 'pure' and 'side-effect-free' properties to take
---
 compat-29.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/compat-29.el b/compat-29.el
index 7d3f26b401..65a300c78f 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -105,6 +105,7 @@ Otherwise, return LIST after truncating it."
   "Return the first N elements of LIST.
 If N is zero or negative, return nil.
 If N is greater or equal to the length of LIST, return LIST (or a copy)."
+  (declare (pure t) (side-effect-free t))
   (let (copy)
 (while (and (< 0 n) list)
   (push (pop list) copy)



[elpa] externals/compat 3bd425a0d6 67/84: Prevent compat-macs.el from being byte compiled

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 3bd425a0d682c310e54b06e929a3e495b6487c9d
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Prevent compat-macs.el from being byte compiled

It appears that having an outdated compat-macs.el loaded can cause
issues when updating between versions with new macros.
---
 compat-macs.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compat-macs.el b/compat-macs.el
index 2e8b38e74e..66b531be40 100644
--- a/compat-macs.el
+++ b/compat-macs.el
@@ -1,4 +1,4 @@
-;;; compat-macs.el --- Compatibility Macros   -*- lexical-binding: t; 
-*-
+;;; compat-macs.el --- Compatibility Macros   -*- lexical-binding: t; 
no-byte-compile: t; -*-
 
 ;; Copyright (C) 2021, 2022 Free Software Foundation, Inc.
 



[elpa] externals/compat e13ca90cd7 12/84: Rewrite legacy compat-test definitions

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit e13ca90cd71a1b24b92cdd98f077458c105e5051
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Rewrite legacy compat-test definitions
---
 compat-tests.el | 289 +---
 1 file changed, 171 insertions(+), 118 deletions(-)

diff --git a/compat-tests.el b/compat-tests.el
index 178f1ab4d7..313e3a3eab 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -74,22 +74,12 @@ DEF-FN, INSTALL-FN, CHECK-FN, ATTR and TYPE."
(put ',realname 'compat-max-version ,max-version)
(put ',realname 'compat-doc ,(plist-get attr :note))
,(funcall def-fn realname version)
-   (,@(cond
-   ((or (and min-version
- (version< emacs-version min-version))
-(and max-version
- (version< max-version emacs-version)))
-'(compat--ignore))
-   ((plist-get attr :prefix)
-'(compat--inhibit-prefixed))
-   ((and version (version<= version emacs-version) (not cond))
-'(compat--ignore))
-   (`(when (and ,(if cond cond t)
-,(funcall check-fn)
-,(if feature
- ;; See https://nullprogram.com/blog/2018/02/22/:
- `(eval-after-load ,feature `(funcall ',(lambda () ,body)))
-   body)
+   ,(and (plist-get attr :prefix)
+ (if feature
+ `(progn
+(require ,feature)
+,body)
+   body)
 
 (setq compat--generate-function #'compat--generate-testable)
 
@@ -117,13 +107,14 @@ being compared against."
  :name ',real-test
  :tags '(,name)
  :body (lambda () (should (equal ,result (,name 
,@args)))
- (and (fboundp compat)
-  `(ert-set-test
-',comp-test
-(make-ert-test
- :name ',comp-test
- :tags '(,name)
- :body (lambda () (should (equal ,result (,compat 
,@args
+ (if (fboundp compat)
+ `(ert-set-test
+   ',comp-test
+   (make-ert-test
+:name ',comp-test
+:tags '(,name)
+:body (lambda () (should (equal ,result (,compat 
,@args))
+   (warn "Missing compat definition %S" compat)))
 
 (defun compat--expect (name compat)
   "Implementation for the `expect' macro for NAME.
@@ -1830,7 +1821,8 @@ being compared against."
 
 (compat-deftests subr-primitive-p
   (ought t (symbol-function 'identity))   ;function from fns.c
-  (ought nil (symbol-function 'match-string)) ;function from subr.el
+  (unless (fboundp 'subr-native-elisp-p)
+(ought nil (symbol-function 'match-string))) ;function from subr.el
   (ought nil (symbol-function 'defun));macro from subr.el
   (ought nil nil))
 
@@ -1853,115 +1845,161 @@ being compared against."
   (ought nil -1 nil)
   (ought nil -1 (list 1 2 3 4 5)))
 
-(ert-deftest compat-string-limit ()
-  "Check if `compat-string-limit' was implemented properly."
-  (compat-test string-limit
-(compat--should "" "" 0)
-(compat--should "" "" 1)
-(compat--should "" "" 100)
-(compat--should "" "1234567890" 0)
-(compat--should "1" "1234567890" 1)
-(compat--should "12" "1234567890" 2)
-(compat--should "123456789" "1234567890" 9)
-(compat--should "1234567890" "1234567890" 10)
-(compat--should "1234567890" "1234567890" 11)
-(compat--should "1234567890" "1234567890" 20)
-(compat--should "a" "a\U00010f98z" 1)
-(compat--should "a𐾘" "a\U00010f98z" 2)
-(compat--should "a𐾘z" "a\U00010f98z" 3)
-(compat--should "a𐾘z" "a\U00010f98z" 4)
-(compat--should [] [1 2 3] 0)
-(compat--should [1] [1 2 3] 1)
-(compat--should [1 2] [1 2 3] 2)
-(compat--should [1 2 3] [1 2 3] 3)
-(compat--should [1 2 3] [1 2 3] 4)
-(compat--error wrong-type-argument "abc" -1)
-(compat--error wrong-type-argument "abc" 'a)
-(compat--error wrong-type-argument 'a 2)
-(compat--error wrong-type-argument 'a 'b)))
-
-(ert-deftest compat-function-alias-p ()
-  "Check if `compat--function-alias-p' was implemented properly."
-  (let* ((f (gensym))
- (g (gensym)) (h (gensym))
- (a (gensym)) (b (gensym)))
-(defalias f #'ignore)
-(defalias g f)
-(defalias h g)
-(defalias a b)
-(defalias b a)
-
-(compat-test function-alias-p
-  (compat--should nil nil)
-  (compat--should nil "")
-  (compat--should nil #'ignore)
-  (compat--should nil #'ignore)
-  (compat--should (list #'ignore) f)
-  (compat--should (list f #'ignore) g)
-  (compat--should (list g f #'ignore) h)
-  (compat--error cyclic-function-indirection a)
-  (compat--should (list b) a t
-
-(ert-deftest compat-get-display-property ()
-  "Check if `compat-

[elpa] externals/compat 11c9917215 51/84: Declare alist-get for usage in compat-alist-get

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 11c9917215728886be78ad2d61ff460aa19ceecf
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Declare alist-get for usage in compat-alist-get
---
 compat-26.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/compat-26.el b/compat-26.el
index d823a75b61..b1ea51771c 100644
--- a/compat-26.el
+++ b/compat-26.el
@@ -156,6 +156,7 @@ from the absolute start of the buffer, disregarding the 
narrowing."
 
 (declare-function compat--alist-get-full-elisp "compat-25"
   (key alist &optional default remove testfn))
+(declare-function alist-get nil (key alist &optional default remove))
 (compat-defun alist-get (key alist &optional default remove testfn)
   "Handle TESTFN manually."
   :realname compat--alist-get-handle-testfn



[elpa] externals/compat c177ff5e83 17/84: Reuse ntake in take definition

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit c177ff5e83e26ee721a9e5c33b6d7e6b2dc110fa
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Reuse ntake in take definition
---
 compat-29.el | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/compat-29.el b/compat-29.el
index 0ac82bbe76..5ec5680311 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -65,6 +65,7 @@ the properties at POSITION."
 If N is zero or negative, return nil.
 If N is greater or equal to the length of LIST, return LIST unmodified.
 Otherwise, return LIST after truncating it."
+  :realname compat--ntake-elisp
   (and (> n 0) (let ((cons (nthcdr (1- n) list)))
  (when cons (setcdr cons nil))
  list)))
@@ -73,10 +74,7 @@ Otherwise, return LIST after truncating it."
   "Return the first N elements of LIST.
 If N is zero or negative, return nil.
 If N is greater or equal to the length of LIST, return LIST (or a copy)."
-  (setq list (copy-sequence list))  ;FIXME: only copy as much as necessary
-  (and (> n 0) (let ((cons (nthcdr (1- n) list)))
- (when cons (setcdr cons nil))
- list)))
+  (compat--ntake-elisp n (copy-sequence list)))  ;FIXME: only copy as much 
as necessary
 
  Defined in subr.el
 



[elpa] externals/compat 59e50fc7f4 71/84: Remove compat-macs.el from the list of files to byte-compile

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 59e50fc7f49c034bb7aaacf6f0ac6b64c6064eca
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Remove compat-macs.el from the list of files to byte-compile

This might be bad for static analysis, but prevents .elc files from
being created when this is not expected.
---
 Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 37700c0903..81f0334930 100644
--- a/Makefile
+++ b/Makefile
@@ -4,8 +4,7 @@
 
 EMACS = emacs
 MAKEINFO = makeinfo
-BYTEC = compat-macs.elc \
-   compat-help.elc \
+BYTEC = compat-help.elc \
compat-font-lock.elc \
compat-24.elc \
compat-25.elc \



[elpa] externals/compat 043e3d71b5 79/84: Always load compat-29

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 043e3d71b5c876b028a39afd6796a2aa9b694b65
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Always load compat-29
---
 compat.el | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/compat.el b/compat.el
index fe634e7a68..ab490cbc98 100644
--- a/compat.el
+++ b/compat.el
@@ -47,9 +47,7 @@
   ;; the file (which is disabled by `compat--inhibit-prefixed', so
   ;; that the file can be loaded again at some later point when the
   ;; prefixed definitions are needed).
-  (dolist (vers (if (bound-and-true-p compat-testing)
-'(24 25 26 27 28 29)
-  '(24 25 26 27 28)))
+  (dolist (vers '(24 25 26 27 28 29))
 (unless (memq (intern (format "compat-%d" vers)) features)
   (load (format "compat-%d%s" vers
 (if (bound-and-true-p compat-testing)



[elpa] externals/compat 8b3d3ea5c8 32/84: Merge branch 'master' into emacs-29.1

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 8b3d3ea5c8e4d36324c2642b3329582575e93813
Merge: 252d33e897 36bc169cc0
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Merge branch 'master' into emacs-29.1
---
 compat-27.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/compat-27.el b/compat-27.el
index 99a1d33d83..bc0e37a356 100644
--- a/compat-27.el
+++ b/compat-27.el
@@ -405,8 +405,8 @@ Uses the `derived-mode-parent' property of the symbol to 
trace backwards.
 If you just want to check `major-mode', use `derived-mode-p'."
   :realname compat--provided-mode-derived-p
   ;; If MODE is an alias, then look up the real mode function first.
-  (when-let ((alias (symbol-function mode)))
-(when (symbolp alias)
+  (let ((alias (symbol-function mode)))
+(when (and alias (symbolp alias))
   (setq mode alias)))
   (while
   (and



[elpa] externals/compat 4710da5fa7 28/84: Add file-parent-directory from Emacs 29

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 4710da5fa7cca4d8df3da40093cc57bd1a78ee03
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Add file-parent-directory from Emacs 29
---
 compat-29.el| 20 
 compat-tests.el |  9 +
 compat.texi | 12 
 3 files changed, 41 insertions(+)

diff --git a/compat-29.el b/compat-29.el
index 8af82913ce..9538e99c72 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -361,5 +361,25 @@ be marked unmodified, effectively ignoring those changes."
 (equal ,hash (buffer-hash)))
(restore-buffer-modified-p nil
 
+ Defined in files.el
+
+(compat-defun file-parent-directory (filename)
+  "Return the directory name of the parent directory of FILENAME.
+If FILENAME is at the root of the filesystem, return nil.
+If FILENAME is relative, it is interpreted to be relative
+to `default-directory', and the result will also be relative."
+  (let* ((expanded-filename (expand-file-name filename))
+ (parent (file-name-directory (directory-file-name 
expanded-filename
+(cond
+ ;; filename is at top-level, therefore no parent
+ ((or (null parent)
+  (file-equal-p parent expanded-filename))
+  nil)
+ ;; filename is relative, return relative parent
+ ((not (file-name-absolute-p filename))
+  (file-relative-name parent))
+ (t
+  parent
+
 (provide 'compat-29)
 ;;; compat-29.el ends here
diff --git a/compat-tests.el b/compat-tests.el
index 567be85797..e88092312d 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -2016,6 +2016,15 @@ being compared against."
   (ought t "~root/")
   (ought t "~root/file"))
 
+(compat-deftests file-parent-directory;assuming unix
+  (ought nil "/")
+  (ought "/" "/dir")
+  (ought "./" "dir")
+  (ought "file/to/" "file/to/dir")
+  (ought "file/to/" "file/to/dir/")
+  (ought "/file/to/" "/file/to/dir")
+  (ought "/file/to/" "/file/to/dir/"))
+
 (compat-deftests string-equal-ignore-case
   (ought t "" "")
   (ought t "a" "a")
diff --git a/compat.texi b/compat.texi
index e35065883c..35a78ca7b5 100644
--- a/compat.texi
+++ b/compat.texi
@@ -2498,6 +2498,18 @@ etc. -- will not be noticed, and the buffer will still 
be marked
 unmodified, effectively ignoring those changes.
 @end defmac
 
+@c copied from lispref/files.texi
+@defun file-parent-directory filename
+This function returns the directory name of the parent directory of
+@var{filename}.  If @var{filename} is at the root directory of the
+filesystem, it returns @code{nil}.  A relative @var{filename} is
+assumed to be relative to @code{default-directory}, and the return
+value will also be relative in that case.  If the return value is
+non-@code{nil}, it ends in a slash.
+
+@xref{Directory Names,,,elisp}.
+@end defun
+
 
 
 @subsection Prefixed Definitions



[elpa] externals/compat e370f9b7e7 25/84: Add match-buffers from Emacs 29

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit e370f9b7e7b2bfa679010ea37f03acc01a8ca4ea
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Add match-buffers from Emacs 29
---
 compat-29.el | 14 ++
 compat.texi  | 12 
 2 files changed, 26 insertions(+)

diff --git a/compat-29.el b/compat-29.el
index cf1ed41404..757f9e76ee 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -250,6 +250,20 @@ CONDITION is either:
 (throw 'match t)))
 (funcall match (list condition
 
+;;* UNTESTED
+(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
+optional argument BUFFERS, set to a list of buffers to check.
+ARG is passed to `buffer-match', for predicate conditions in
+CONDITION."
+  (let (bufs)
+(dolist (buf (or buffers (buffer-list)))
+  (when (compat--buffer-match-p condition (get-buffer buf) arg)
+(push buf bufs)))
+bufs))
+
  Defined in subr-x.el
 
 (compat-defun string-limit (string length &optional end coding-system)
diff --git a/compat.texi b/compat.texi
index 75da790901..c1e61be279 100644
--- a/compat.texi
+++ b/compat.texi
@@ -2434,6 +2434,18 @@ string), @code{(and)} (empty conjunction) or 
@code{always}.
 @xref{Buffer List,,,elisp}.
 @end defun
 
+@c copied from lispref/buffers.texi
+@defun match-buffers condition &optional buffers arg
+This function returns a list of all buffers that satisfy a
+@code{condition}, as defined for @code{buffer-match-p}.  By default
+all buffers are considered, but this can be restricted via the second
+optional @code{buffer-list} argument.  Optional third argument
+@var{arg} will be used by @var{condition} in the same way as
+@code{buffer-match-p} does.
+
+@xref{Buffer List,,,elisp}.
+@end defun
+
 
 
 @subsection Prefixed Definitions



[elpa] externals/compat 2ee63f46b2 07/84: Make compat-font-lock dependency on compat-macs explicit

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 2ee63f46b249eebcee881b0bb3ac69e6476fa7c0
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Make compat-font-lock dependency on compat-macs explicit
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile b/Makefile
index 353ddbad1a..ed9aee0347 100644
--- a/Makefile
+++ b/Makefile
@@ -31,6 +31,7 @@ compat-25.el: compat-macs.el
 compat-26.el:  compat-macs.el
 compat-27.el:  compat-macs.el
 compat-28.el:  compat-macs.el
+compat-font-lock.el: compat-macs.el
 
 .el.elc:
$(EMACS) -Q --batch -L . -f batch-byte-compile $<



[elpa] externals/compat 55080acac2 82/84: Preliminary bump the version tag to 29.1.0.0-dev

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 55080acac2aa7f64af9533db2634f1aaf3877938
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Preliminary bump the version tag to 29.1.0.0-dev
---
 compat.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compat.el b/compat.el
index ddb129927b..cfe3bf7e53 100644
--- a/compat.el
+++ b/compat.el
@@ -4,7 +4,7 @@
 
 ;; Author: Philip Kaludercic 
 ;; Maintainer: Compat Development <~pkal/compat-de...@lists.sr.ht>
-;; Version: 28.1.2.2
+;; Version: 29.1.0.0-dev
 ;; URL: https://sr.ht/~pkal/compat
 ;; Package-Requires: ((emacs "24.3") (nadvice "0.3"))
 ;; Keywords: lisp



[elpa] externals/compat 8d17ffdd88 29/84: Add file-has-changed-p from Emacs 29

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 8d17ffdd88d913e70cd61ea8a85407034a6260a2
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Add file-has-changed-p from Emacs 29
---
 compat-29.el | 24 
 compat.texi  | 17 +
 2 files changed, 41 insertions(+)

diff --git a/compat-29.el b/compat-29.el
index 9538e99c72..540350d6c0 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -381,5 +381,29 @@ to `default-directory', and the result will also be 
relative."
  (t
   parent
 
+(defvar compat--file-has-changed-p--hash-table (make-hash-table :test #'equal)
+  "Internal variable used by `file-has-changed-p'.")
+
+;;* UNTESTED
+(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
+invocation of `file-has-changed-p'.  Thus, the first invocation
+of `file-has-changed-p' always returns non-nil when FILE exists.
+The optional argument TAG, which must be a symbol, can be used to
+limit the comparison to invocations with identical tags; it can be
+the symbol of the calling function, for example."
+  (let* ((file (directory-file-name (expand-file-name file)))
+ (remote-file-name-inhibit-cache t)
+ (fileattr (file-attributes file 'integer))
+(attr (and fileattr
+(cons (file-attribute-size fileattr)
+ (file-attribute-modification-time fileattr
+(sym (concat (symbol-name tag) "@" file))
+(cachedattr (gethash sym compat--file-has-changed-p--hash-table)))
+ (when (not (equal attr cachedattr))
+   (puthash sym attr compat--file-has-changed-p--hash-table
+
 (provide 'compat-29)
 ;;; compat-29.el ends here
diff --git a/compat.texi b/compat.texi
index 35a78ca7b5..064533a3f2 100644
--- a/compat.texi
+++ b/compat.texi
@@ -2510,6 +2510,23 @@ non-@code{nil}, it ends in a slash.
 @xref{Directory Names,,,elisp}.
 @end defun
 
+@c copied from lispref/files.texi
+@defun file-has-changed-p file &optional tag
+This function returns non-@code{nil} if the time stamp of
+@var{filename} has changed since the last call.  When called for the
+first time for some @var{filename}, it records the last modification
+time and size of the file, and returns non-@code{nil} when
+@var{filename} exists.  Thereafter, when called for the same
+@var{filename}, it compares the current time stamp and size with the
+recorded ones, and returns non-@code{nil} only if either the time
+stamp or the size (or both) are different.  This is useful when a Lisp
+program wants to re-read a file whenever it changes.  With an optional
+argument @var{tag}, which must be a symbol, the size and modification
+time comparisons are limited to calls with the same tag.
+
+@xref{File Attributes,,,elisp}.
+@end defun
+
 
 
 @subsection Prefixed Definitions



[elpa] externals/compat 252d33e897 31/84: Fix incompatible function calls in compat-29

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 252d33e897f97d2899f652503c573bdcf57f619a
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Fix incompatible function calls in compat-29
---
 compat-29.el | 17 +++--
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/compat-29.el b/compat-29.el
index 540350d6c0..f2c967f008 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -193,6 +193,11 @@ signalled.  If NOERROR, the non-loop parts of the chain is 
returned."
  (push func chain))
chain
 
+(declare-function compat--provided-mode-derived-p
+  "compat-27" (mode &rest modes))
+(declare-function compat--func-arity
+  "compat-26" (func))
+
 ;;* UNTESTED
 (compat-defun buffer-match-p (condition buffer-or-name &optional arg)
   "Return non-nil if BUFFER-OR-NAME matches CONDITION.
@@ -226,7 +231,7 @@ CONDITION is either:
  ((stringp condition)
   (string-match-p condition (buffer-name buffer)))
  ((functionp condition)
-  (if (eq 1 (cdr (func-arity condition)))
+  (if (eq 1 (cdr (compat--func-arity condition)))
   (funcall condition buffer)
 (funcall condition buffer arg)))
  ((eq (car-safe condition) 'major-mode)
@@ -234,7 +239,7 @@ CONDITION is either:
(buffer-local-value 'major-mode buffer)
(cdr condition)))
  ((eq (car-safe condition) 'derived-mode)
-  (provided-mode-derived-p
+  (compat--provided-mode-derived-p
(buffer-local-value 'major-mode buffer)
(cdr condition)))
  ((eq (car-safe condition) 'not)
@@ -344,8 +349,8 @@ as changes in text properties, `buffer-file-coding-system', 
buffer
 multibyteness, etc. -- will not be noticed, and the buffer will still
 be marked unmodified, effectively ignoring those changes."
   (declare (debug t) (indent 0))
-  (let ((hash (gensym))
-(buffer (gensym)))
+  (let ((hash (make-symbol "hash"))
+(buffer (make-symbol "buffer")))
 `(let ((,hash (and (not (buffer-modified-p))
(buffer-hash)))
(,buffer (current-buffer)))
@@ -398,8 +403,8 @@ the symbol of the calling function, for example."
  (remote-file-name-inhibit-cache t)
  (fileattr (file-attributes file 'integer))
 (attr (and fileattr
-(cons (file-attribute-size fileattr)
- (file-attribute-modification-time fileattr
+(cons (nth 7 fileattr)
+ (nth 5 fileattr
 (sym (concat (symbol-name tag) "@" file))
 (cachedattr (gethash sym compat--file-has-changed-p--hash-table)))
  (when (not (equal attr cachedattr))



[elpa] externals/compat 282f2dc6a7 41/84: Call install-fn in compat--generate-testable

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 282f2dc6a7ebc1a58bde5da45d3f8d8a7751ce43
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Call install-fn in compat--generate-testable
---
 compat-tests.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/compat-tests.el b/compat-tests.el
index 7ef404e17b..9e1fefab71 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -37,7 +37,7 @@
 (require 'compat-macs)
 
 (defvar compat-current-version)
-(defun compat--generate-testable (name def-fn _install-fn _check-fn attr _type)
+(defun compat--generate-testable (name def-fn install-fn _check-fn attr _type)
   "Generate a more verbose compatibility definition, fit for testing.
 See `compat-generate-function' for details on the arguments NAME,
 DEF-FN, INSTALL-FN, CHECK-FN, ATTR and TYPE."
@@ -53,7 +53,8 @@ DEF-FN, INSTALL-FN, CHECK-FN, ATTR and TYPE."
(put ',realname 'compat-max-version
 ,(plist-get attr :max-version))
,(and feature `(require ,feature))
-   ,(funcall def-fn realname version
+   ,(funcall def-fn realname version)
+   ,(funcall install-fn realname version
 
 ;; For testing: (setq compat--generate-function #'compat--generate-testable)
 



[elpa] externals/compat 5031a586a3 09/84: Add take and ntake defined in Emacs 29

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 5031a586a35b1e6177bc5335bb235e5c5017fe6d
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Add take and ntake defined in Emacs 29
---
 compat-29.el| 20 
 compat-tests.el | 19 +++
 2 files changed, 39 insertions(+)

diff --git a/compat-29.el b/compat-29.el
index 57495c193d..0ac82bbe76 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -58,6 +58,26 @@ the properties at POSITION."
  (eq (car properties) prop))
 (cadr properties
 
+ Defined in fns.c
+
+(compat-defun ntake (n list)
+  "Modify LIST to keep only the first N elements.
+If N is zero or negative, return nil.
+If N is greater or equal to the length of LIST, return LIST unmodified.
+Otherwise, return LIST after truncating it."
+  (and (> n 0) (let ((cons (nthcdr (1- n) list)))
+ (when cons (setcdr cons nil))
+ list)))
+
+(compat-defun take (n list)
+  "Return the first N elements of LIST.
+If N is zero or negative, return nil.
+If N is greater or equal to the length of LIST, return LIST (or a copy)."
+  (setq list (copy-sequence list))  ;FIXME: only copy as much as necessary
+  (and (> n 0) (let ((cons (nthcdr (1- n) list)))
+ (when cons (setcdr cons nil))
+ list)))
+
  Defined in subr.el
 
 (compat-defun function-alias-p (func &optional noerror)
diff --git a/compat-tests.el b/compat-tests.el
index 5983e92017..178f1ab4d7 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -1834,6 +1834,25 @@ being compared against."
   (ought nil (symbol-function 'defun));macro from subr.el
   (ought nil nil))
 
+(compat-deftests take
+  (ought nil 0 nil)
+  (ought nil 0 (list 1 2 3 4 5))
+  (ought (list 1) 1 (list 1 2 3 4 5))
+  (ought (list 1 2 3 4 5) 5 (list 1 2 3 4 5))
+  (ought (list 1 2 3 4 5) 6 (list 1 2 3 4 5))
+  (ought nil -1 nil)
+  (ought nil -1 (list 1 2 3 4 5)))
+
+(compat-deftests ntake
+  ;; TODO: test destructive property
+  (ought nil 0 nil)
+  (ought nil 0 (list 1 2 3 4 5))
+  (ought (list 1) 1 (list 1 2 3 4 5))
+  (ought (list 1 2 3 4 5) 5 (list 1 2 3 4 5))
+  (ought (list 1 2 3 4 5) 6 (list 1 2 3 4 5))
+  (ought nil -1 nil)
+  (ought nil -1 (list 1 2 3 4 5)))
+
 (ert-deftest compat-string-limit ()
   "Check if `compat-string-limit' was implemented properly."
   (compat-test string-limit



[elpa] externals/compat 22b2634ada 06/84: Compile compat-macs before anything else

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 22b2634ada4e28bf92aac74e5b36f19b04e19172
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Compile compat-macs before anything else
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 794344003a..353ddbad1a 100644
--- a/Makefile
+++ b/Makefile
@@ -4,9 +4,9 @@
 
 EMACS = emacs
 MAKEINFO = makeinfo
-BYTEC = compat-help.elc \
+BYTEC = compat-macs.elc \
+   compat-help.elc \
compat-font-lock.elc \
-   compat-macs.elc \
compat-24.elc \
compat-25.elc \
compat-26.elc \



[elpa] externals/compat 878221eabd 44/84: Update the commentary section for compat-29

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 878221eabd61d38fa8877b5984a03fbe9525e04b
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Update the commentary section for compat-29
---
 compat-29.el | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/compat-29.el b/compat-29.el
index 90251726b2..cd57b2565e 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -23,7 +23,12 @@
 ;; Find here the functionality added in Emacs 29.1, needed by older
 ;; versions.
 ;;
-;; Do NOT load this library manually.  Instead require `compat'.
+;; Only load this library if you need to use one of the following
+;; functions:
+;;
+;; - `plist-get'
+;; - `plist-put'
+;; - `plist-member'
 
 ;;; Code:
 



[elpa] externals/compat 54565a768c 73/84: Abbreviate Makefile by re-using BYTEC

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 54565a768caae2975d77e822f9ac532332048ac7
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Abbreviate Makefile by re-using BYTEC
---
 Makefile | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index f96d21bb24..36c6635f68 100644
--- a/Makefile
+++ b/Makefile
@@ -25,13 +25,7 @@ test: compile
 clean:
$(RM) $(BYTEC) compat.info
 
-compat-24.elc: compat-macs.el
-compat-25.elc: compat-macs.el
-compat-26.elc: compat-macs.el
-compat-27.elc: compat-macs.el
-compat-28.elc: compat-macs.el
-compat-29.elc: compat-macs.el
-compat-font-lock.elc: compat-macs.el
+$(BYTEC): compat-macs.el
 
 .el.elc:
$(EMACS) -Q --batch -L . -f batch-byte-compile $<



[elpa] externals/compat c81333a6b0 30/84: Merge branch 'master' into emacs-29.1

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit c81333a6b040893cfa245b4ba3b84dae15829771
Merge: 8d17ffdd88 46b44c3be1
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Merge branch 'master' into emacs-29.1
---
 README.md   | 97 +
 compat-24.el| 33 ++--
 compat-25.el|  2 ++
 compat-26.el|  2 ++
 compat-27.el| 25 +++
 compat-28.el|  2 ++
 compat-macs.el  | 31 +++---
 compat-tests.el | 40 +++-
 compat.el   |  7 +++--
 compat.texi | 15 +++--
 10 files changed, 117 insertions(+), 137 deletions(-)

diff --git a/README.md b/README.md
index 9666e3999a..ec9ca086cb 100644
--- a/README.md
+++ b/README.md
@@ -4,79 +4,41 @@ COMPATibility Library for Emacs
 Find here the source for compat.el, a forwards-compatibility library
 for (GNU) Emacs Lisp, versions 24.3 and newer.
 
-The intended audience of this library aren't day-to-day users, but
-package developers that wish to make use of newer functionality, not
-provided in older versions of Emacs, without breaking compatibility
-for users bound to specific Emacs releases.
-
-Version 24.3 is chosen as the oldest version, because this is the
-newest version on CentOS 7. It is intended to preserve compatibility
-for at least as the CentOS 7 reaches [EOL], 2024.
-
-If you are developing a package with compat.el in mind, consider
-loading `compat-help` (on your system, not in a package) to get
-relevant notes inserted into the help buffers of functions that are
-implemented or advised in compat.el.
-
-Note that compat.el provides a few prefixed function, ie. functions
-with a `compat-` prefix.  These are used to provide extended
-functionality for commands that are already defined (`sort`, `assoc`,
-...).  It might be possible to transform these into advised functions
-later on, so that the modified functionality is accessible without a
-prefix.  Feedback on this point is appreciated.
-
-Installation
-
-
-compat.el shouldn't be installed directly, but downloaded from [GNU
-ELPA].  If necessary, this can be done using M-x package-install-file
-in the current working directory.
-
-Usage
--
-
-The intended use-case for this library is for package developers to
-add as a dependency in the header:
-
-;; Package-Requires: ((emacs "24.3") (compat "28.1.2.0"))
-
-and later on a
+For information on how to use Compat, please consult the [manual].
+The latest state of development can be found in the [snapshot
+version].
 
-   (require 'compat)
-
-This will load all non-prefixed definitions (functions and macros with
-a leading `compat-`).  To load these, an additional
-
-   (require 'compat-XY) ; e.g. 26
-
-will be necessary, to load compatibility code for Emacs version XY.
-
-It is recommended to subscribe to the [compat-announce] mailing list
-to be notified when new versions are released or relevant changes are
-made.
+[manual]: https://elpa.gnu.org/packages/doc/compat.html
+[snapshot version]: https://elpa.gnu.org/devel/doc/compat.html
 
 Contribute
 --
 
-As compat.el is distribed as part of GNU ELPA, and therefore requires
-a [copyright assignment] to the FSF, for all non-trivial code
+As compat.el is distribed as part of [GNU ELPA], and therefore
+requires a [copyright assignment] to the [FSF], for all non-trivial code
 contributions.
 
+[GNU ELPA]: http://elpa.gnu.org/packages/compat.html
+[copyright assignment]: 
https://www.gnu.org/software/emacs/manual/html_node/emacs/Copyright-Assignment.html
+[FSF]: https://www.fsf.org/
+
 Source code
 ---
 
 Compat is developed on [SourceHut]. A restricted [GitHub] mirror is
 also provided.
 
+[SourceHut]: https://sr.ht/~pkal/compat
+[GitHub]: https://github.com/phikal/compat.el
+
 Bug and patches
 ---
 
-Patches and comments can be sent to the [development mailing
-list][compat-devel].  Bug reports and issues should be directed to the
-[issue tracker][compat-tracker] (also accessible via
-[Email][compat-tracker-mailto]).  [GitHub] can also be used to submit
-patches ("Pull Request").  These may include issues in the
-compatibility code, missing definitions or performance issues.
+Patches and comments can be sent to the [development mailing list].
+Bug reports and issues should be directed to the [issue tracker] (also
+accessible via [email]).  [GitHub] can also be used to submit patches
+("Pull Request").  These may include issues in the compatibility code,
+missing definitions or performance issues.
 
 When contributing, make sure to provide test and use the existing
 tests defined in compat-test.el.  These can be easily executed using
@@ -84,18 +46,17 @@ the bundled Makefile:
 
 make test
 
+[development mailing list]: https://lists.sr.ht/~pkal/compat-devel
+[issue tracker]: https://todo.sr.ht/~pkal/compat
+[email]: mailto:~pkal/com...@todo.sr.ht
+
 Distribution
 
 
-compat.el and all other files in this directory are distr

[elpa] externals/compat be4595fec8 84/84: Update README to reflect the move from SourceHut to GitHub

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit be4595fec8a8a15afa098295273bb32cf1f4caf8
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Update README to reflect the move from SourceHut to GitHub

The background for this decision is explained here:
http://amodernist.com/texts/break.html.
---
 README.md | 17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/README.md b/README.md
index 0ad7f15fb5..57266b4841 100644
--- a/README.md
+++ b/README.md
@@ -30,22 +30,21 @@ contributions.
 Source code
 ---
 
-Compat is developed on [SourceHut]. A restricted [GitHub] mirror is
-also provided.
+Compat is developed on [GitHub].  The code is also mirrored on [SourceHut].
 
+[GitHub]:
+   https://github.com/emacs-compat/compat
 [SourceHut]:
https://sr.ht/~pkal/compat
-[GitHub]:
-   https://github.com/phikal/compat.el
 
 Bug and patches
 ---
 
-Patches and comments can be sent to the [development mailing list].
-Bug reports and issues should be directed to the [issue tracker] (also
-accessible via [email]).  [GitHub] can also be used to submit patches
-("Pull Request").  These may include issues in the compatibility code,
-missing definitions or performance issues.
+Patches, bug reports and comments can be sent via [GitHub].  These may
+include issues in the compatibility code, missing definitions or
+performance issues.  If you do not have a GitHub account, we also
+provide a [development mailing list] and a [issue tracker] on
+SourceHut, the latter also being accessible via [email].
 
 When contributing, make sure to provide test and use the existing
 tests defined in compat-test.el.  These can be easily executed using



[elpa] externals/compat 3104c89c2d 13/84: Test compat-string-trim instead of string-trim

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 3104c89c2d76c0443eba902fef8cac97e3170114
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Test compat-string-trim instead of string-trim
---
 compat-tests.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compat-tests.el b/compat-tests.el
index 313e3a3eab..2a334b9b68 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -715,7 +715,7 @@ being compared against."
   (ought "\t\ta" "\t\ta\t\n")
   (ought "\n  \ta" "\n  \ta  \n"))
 
-(compat-deftests string-trim
+(compat-deftests compat-string-trim
   (ought "" "")  ;empty string
   (ought "a" "a");"full" string
   (ought "aaa" "aaa")



[elpa] externals/compat d375504e3c 27/84: Add with-buffer-unmodified-if-unchanged from Emacs 29

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit d375504e3cb06ac6519b96e4448c6cbd800f474b
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Add with-buffer-unmodified-if-unchanged from Emacs 29
---
 compat-29.el | 38 ++
 compat.texi  | 17 +
 2 files changed, 55 insertions(+)

diff --git a/compat-29.el b/compat-29.el
index 4389289105..8af82913ce 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -323,5 +323,43 @@ than this function."
   (insert string)
   (car (compat--buffer-text-pixel-size nil nil t)
 
+;;* UNTESTED
+(compat-defmacro with-buffer-unmodified-if-unchanged (&rest body)
+  "Like `progn', but change buffer-modified status only if buffer text changes.
+If the buffer was unmodified before execution of BODY, and
+buffer text after execution of BODY is identical to what it was
+before, ensure that buffer is still marked unmodified afterwards.
+For example, the following won't change the buffer's modification
+status:
+
+  (with-buffer-unmodified-if-unchanged
+(insert \"a\")
+(delete-char -1))
+
+Note that only changes in the raw byte sequence of the buffer text,
+as stored in the internal representation, are monitored for the
+purpose of detecting the lack of changes in buffer text.  Any other
+changes that are normally perceived as \"buffer modifications\", such
+as changes in text properties, `buffer-file-coding-system', buffer
+multibyteness, etc. -- will not be noticed, and the buffer will still
+be marked unmodified, effectively ignoring those changes."
+  (declare (debug t) (indent 0))
+  (let ((hash (gensym))
+(buffer (gensym)))
+`(let ((,hash (and (not (buffer-modified-p))
+   (buffer-hash)))
+   (,buffer (current-buffer)))
+   (prog1
+   (progn
+ ,@body)
+ ;; If we didn't change anything in the buffer (and the buffer
+ ;; was previously unmodified), then flip the modification status
+ ;; back to "unchanged".
+ (when (and ,hash (buffer-live-p ,buffer))
+   (with-current-buffer ,buffer
+ (when (and (buffer-modified-p)
+(equal ,hash (buffer-hash)))
+   (restore-buffer-modified-p nil
+
 (provide 'compat-29)
 ;;; compat-29.el ends here
diff --git a/compat.texi b/compat.texi
index f19c884df5..e35065883c 100644
--- a/compat.texi
+++ b/compat.texi
@@ -2481,6 +2481,23 @@ you can say:
 @xref{Size of Displayed Text,,,elisp}.
 @end defun
 
+@c based on lisp/subr-x.el
+@defmac with-buffer-unmodified-if-unchanged &rest body@dots{}
+Evaluate @var{body} like @code{progn}, but change buffer-modified status
+only if buffer text changes.  If the buffer was unmodified before
+execution of BODY, and buffer text after execution of BODY is identical
+to what it was before, ensure that buffer is still marked unmodified
+afterwards.
+
+Note that only changes in the raw byte sequence of the buffer text, as
+stored in the internal representation, are monitored for the purpose of
+detecting the lack of changes in buffer text.  Any other changes that
+are normally perceived as "buffer modifications", such as changes in
+text properties, @code{buffer-file-coding-system}, buffer multibyteness,
+etc. -- will not be noticed, and the buffer will still be marked
+unmodified, effectively ignoring those changes.
+@end defmac
+
 
 
 @subsection Prefixed Definitions



[elpa] externals/compat 0de389aca6 19/84: Add string-equal-ignore-case from Emacs 29

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 0de389aca6ce4429933bde15bc5e26f8b387889b
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Add string-equal-ignore-case from Emacs 29
---
 compat-29.el|  7 +++
 compat-tests.el | 21 +
 compat.texi |  9 +
 3 files changed, 37 insertions(+)

diff --git a/compat-29.el b/compat-29.el
index 8b14b23a43..af29d96446 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -100,6 +100,13 @@ If N is zero or negative, return nil.
 If N is greater or equal to the length of LIST, return LIST (or a copy)."
   (compat--ntake-elisp n (copy-sequence list)))  ;FIXME: only copy as much 
as necessary
 
+(compat-defun string-equal-ignore-case (string1 string2)
+  "Like `string-equal', but case-insensitive.
+Upper-case and lower-case letters are treated as equal.
+Unibyte strings are converted to multibyte for comparison."
+  (declare (pure t) (side-effect-free t))
+  (eq t (compare-strings string1 0 nil string2 0 nil t)))
+
  Defined in subr.el
 
 (compat-defun function-alias-p (func &optional noerror)
diff --git a/compat-tests.el b/compat-tests.el
index 2a334b9b68..2b5c8ba817 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -2030,6 +2030,27 @@ being compared against."
 ;;   (ought t "~root")
 ;;   (ought t "~root/")
 ;;   (ought t "~root/file"))
+(compat-deftests string-equal-ignore-case
+  (ought t "" "")
+  (ought t "a" "a")
+  (ought t "a" "A")
+  (ought t "A" "a")
+  (ought nil "aA" "a")
+  (ought nil "a" "Aa")
+  (ought t "aA" "aA")
+  (ought t "Aa" "Aa")
+  (ought nil "aB" "aA")
+  (ought nil "Ba" "Aa")
+  (ought t "AAA BBB" "AAA BBB")
+  (ought t "aaa BBB" "AAA BBB")
+  (ought t "AAA bbb" "AAA BBB")
+  (ought t "AAA BBB" "aaa BBB")
+  (ought t "AAA BBB" "AAA bbb")
+  (ought t "AAA BBB" "aaa bbb")
+  (ought t "AAA BBB" "aaa bbb")
+  (ought t "AAA bbb" "aaa bbb")
+  (ought t "aaa BBB" "aaa bbb"))
+
 
 (provide 'compat-tests)
 ;;; compat-tests.el ends here
diff --git a/compat.texi b/compat.texi
index 80077f1bcb..e82badff2a 100644
--- a/compat.texi
+++ b/compat.texi
@@ -2379,6 +2379,15 @@ meaning as with @code{window-text-pixel-size}.
 @xref{Size of Displayed Text,,,elisp}.
 @end defun
 
+@c copied from lispref/strings.texi
+@defun string-equal-ignore-case string1 string2
+@code{string-equal-ignore-case} compares strings ignoring case
+differences, like @code{char-equal} when @code{case-fold-search} is
+@code{t}.
+
+@xref{Text Comparison,,,elisp}.
+@end defun
+
 
 
 



[elpa] externals/compat 9aac0f55d1 23/84: Add prefixed plist-member from Emacs 29

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 9aac0f55d1935201f274b80477b5f109d70d4833
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Add prefixed plist-member from Emacs 29
---
 compat-29.el| 20 
 compat-tests.el | 20 
 compat.texi | 15 +++
 3 files changed, 55 insertions(+)

diff --git a/compat-29.el b/compat-29.el
index 68fd657961..0e03b1fc01 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -149,6 +149,26 @@ The PLIST is modified by side effects."
   (setq tail (cddr tail
   (nconc plist (list prop val)
 
+(compat-defun plist-member (plist prop &optional predicate)
+  "Return non-nil if PLIST has the property PROP.
+PLIST is a property list, which is a list of the form
+\(PROP1 VALUE1 PROP2 VALUE2 ...).
+
+The comparison with PROP is done using PREDICATE, which defaults to
+`eq'.
+
+Unlike `plist-get', this allows you to distinguish between a missing
+property and a property with the value nil.
+The value is actually the tail of PLIST whose car is PROP."
+  :prefix t
+  (if (or (null predicate) (eq predicate 'eq))
+  (plist-member plist prop)
+(catch 'found
+  (while (consp plist)
+(when (funcall predicate prop (car plist))
+  (throw 'found plist))
+(setq plist (cddr plist))
+
  Defined in subr.el
 
 (compat-defun function-alias-p (func &optional noerror)
diff --git a/compat-tests.el b/compat-tests.el
index 76e640e0cf..567be85797 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -2077,6 +2077,26 @@ being compared against."
  '(1 :one 2 :two 3 :three)
  4 :vier #'>))
 
+(compat-deftests compat-plist-get-member
+  (ought '(:one 1 :two 2 :three 3)
+ '(:one 1 :two 2 :three 3)
+ :one)
+  (ought '(:two 2 :three 3)
+ '(:one 1 :two 2 :three 3)
+ :two)
+  (ought '(:three 3)
+ '(:one 1 :two 2 :three 3)
+ :three)
+  (ought nil '(:one 1 :two 2 :three 3) :four)
+  ;; With a custom predicate
+  (ought '(1 :one 2 :two 3 :three)
+ '(1 :one 2 :two 3 :three)
+ 3 #'>)
+  (ought '(3 :three)
+ '(1 :one 2 :two 3 :three)
+ 3 #'<=)
+  (ought nil '(1 :one 2 :two 3 :three) 4 #'<=))
+
 
 (provide 'compat-tests)
 ;;; compat-tests.el ends here
diff --git a/compat.texi b/compat.texi
index 0fb1ff2438..77df3082a1 100644
--- a/compat.texi
+++ b/compat.texi
@@ -2424,6 +2424,21 @@ This compatibility version handles the optional argument
 @var{predicate}.
 @end defun
 
+@c copied from lispref/lists.texi
+@defun compat-plist-member plist prop &optional predicate
+This returns non-@code{nil} if @var{plist} contains the given
+@var{property}.  Comparisons are done with @var{predicate}, and
+defaults to @code{eq}.  Unlike @code{plist-get}, this allows you to
+distinguish between a missing property and a property with the value
+@code{nil}.  The value is actually the tail of @var{plist} whose
+@code{car} is @var{property}.
+
+@xref{Plist Access,,,elisp}.
+
+This compatibility version handles the optional argument
+@var{predicate}.
+@end defun
+
 @subsection Missing Definitions
 Compat does not provide support for the following Lisp features
 implemented in 29.1:



[elpa] externals/compat 9083cfc4f6 05/84: Add get-display-property

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 9083cfc4f65eea86b91cba9298fd3138f768ada1
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Add get-display-property
---
 compat-29.1.el  | 29 +++
 compat-tests.el | 61 +
 2 files changed, 90 insertions(+)

diff --git a/compat-29.1.el b/compat-29.1.el
index 507219b27b..3ff48f4f3c 100644
--- a/compat-29.1.el
+++ b/compat-29.1.el
@@ -30,6 +30,35 @@
 (eval-when-compile (require 'compat-macs))
 (declare-function compat-maxargs-/= "compat" (func n))
 
+ Defined in xdisp.c
+
+(compat-defun get-display-property (position prop &optional object properties)
+  "Get the value of the `display' property PROP at POSITION.
+If OBJECT, this should be a buffer or string where the property is
+fetched from.  If omitted, OBJECT defaults to the current buffer.
+
+If PROPERTIES, look for value of PROP in PROPERTIES instead of
+the properties at POSITION."
+  (if properties
+  (unless (listp properties)
+(signal 'wrong-type-argument (list 'listp properties)))
+(setq properties (get-text-property position 'display object)))
+  (cond
+   ((vectorp properties)
+(catch 'found
+  (dotimes (i (length properties))
+(let ((ent (aref properties i)))
+  (when (eq (car ent) prop)
+(throw 'found (cadr ent )))
+   ((consp (car properties))
+(condition-case nil
+(cadr (assq prop properties))
+  ;; Silently handle improper lists:
+  (wrong-type-argument nil)))
+   ((and (consp (cdr properties))
+ (eq (car properties) prop))
+(cadr properties
+
  Defined in subr.el
 
 (compat-defun function-alias-p (func &optional noerror)
diff --git a/compat-tests.el b/compat-tests.el
index 20dd733aad..ac2c5e411e 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -1383,5 +1383,66 @@ the compatibility function."
   (compat--error cyclic-function-indirection a)
   (compat--should (list b) a t
 
+(ert-deftest compat-get-display-property ()
+  "Check if `compat--function-alias-p' was implemented properly."
+  ;; Based on tests from xdisp-test.el
+  (with-temp-buffer
+(insert (propertize "foo" 'face 'bold 'display '(height 2.0))
+" bar")
+(compat-test get-display-property
+  (compat--should 2.0 1 'height)
+  (compat--should 2.0 2 'height)
+  (compat--should nil 2 'width)
+  (compat--should nil 5 'height)
+  (compat--should nil 5 'height)
+  (compat--should nil 2 'bold)
+  (compat--should nil 5 'bold)))
+  (let ((str (concat
+  (propertize "foo" 'face 'bold 'display '(height 2.0))
+  " bar")))
+(compat-test get-display-property
+  (compat--should 2.0 1 'height str)
+  (compat--should 2.0 2 'height str)
+  (compat--should nil 2 'width str)
+  (compat--should nil 5 'height str)
+  (compat--should nil 5 'height str)
+  (compat--should nil 2 'bold str)
+  (compat--should nil 5 'bold str)))
+  (with-temp-buffer
+(insert (propertize "foo" 'face 'bold 'display '((height 2.0)
+ (space-width 4.0)))
+" bar")
+(compat-test get-display-property
+  (compat--should 2.0 1 'height)
+  (compat--should 2.0 2 'height)
+  (compat--should nil 5 'height)
+  (compat--should 4.0 1 'space-width)
+  (compat--should 4.0 2 'space-width)
+  (compat--should nil 5 'space-width)
+  (compat--should nil 2 'width)
+  (compat--should nil 5 'width)
+  (compat--should nil 2 'bold)
+  (compat--should nil 5 'bold)))
+  (with-temp-buffer
+(insert (propertize "foo bar" 'face 'bold
+'display '[(height 2.0)
+   (space-width 20)])
+" baz")
+(compat-test get-display-property
+  (compat--should 2.0 1 'height)
+  (compat--should 2.0 2 'height)
+  (compat--should 2.0 5 'height)
+  (compat--should nil 8 'height)
+  (compat--should 20 1 'space-width)
+  (compat--should 20 2 'space-width)
+  (compat--should 20 5 'space-width)
+  (compat--should nil 8 'space-width)
+  (compat--should nil 2 'width)
+  (compat--should nil 5 'width)
+  (compat--should nil 8 'width)
+  (compat--should nil 2 'bold)
+  (compat--should nil 5 'bold)
+  (compat--should nil 8 'width
+
 (provide 'compat-tests)
 ;;; compat-tests.el ends here



[elpa] externals/compat f42ebfaf97 35/84: Use compat--directory-name-p instead of directory-name-p

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit f42ebfaf972ca089a154053529a39a701672bd0a
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Use compat--directory-name-p instead of directory-name-p
---
 compat-25.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compat-25.el b/compat-25.el
index fec59048a4..c4e75fe08d 100644
--- a/compat-25.el
+++ b/compat-25.el
@@ -287,7 +287,7 @@ recursion."
 (dolist (file (sort (file-name-all-completions "" dir)
 'string<))
   (unless (member file '("./" "../"))
-(if (directory-name-p file)
+(if (compat--directory-name-p file)
 (let* ((leaf (substring file 0 (1- (length file
(full-file (concat dir "/" leaf)))
   ;; Don't follow symlinks to other directories.



[elpa] externals/compat 45028d9fa7 64/84: Merge branch 'master' into emacs-29.1

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 45028d9fa72c87f8af7797cf2120ba4d95fff8e0
Merge: e7413bcf2b c6e6af4251
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Merge branch 'master' into emacs-29.1
---
 NEWS.org| 14 ++
 README.md   | 38 +-
 compat.el   |  2 +-
 compat.texi | 13 -
 4 files changed, 48 insertions(+), 19 deletions(-)

diff --git a/NEWS.org b/NEWS.org
index 9c6a819b6a..dee10ae9f1 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -1,6 +1,20 @@
 #+options: toc:nil num:nil
 #+link:compat https://todo.sr.ht/~pkal/compat/
 
+* Release of "Compat" Version 28.1.2.1
+
+This is a minor release adding the following changes:
+
+- Add =derived-mode-p= defined in Emacs 27
+- Add =provided-mode-derived-p= defined in Emacs 27
+- Add =read-multiple-choice= defined in Emacs 26
+- Add =file-name-absolute-p= defined in Emacs 28
+
+The only other notable change is that the manual has been rewritten to
+include much more documentation that had been the case previously.
+
+(Release <2022-08-24 Wed>)
+
 * Release of "Compat" Version 28.1.2.0
 
 The main change of this release has been the major simplification of
diff --git a/README.md b/README.md
index ec9ca086cb..0ad7f15fb5 100644
--- a/README.md
+++ b/README.md
@@ -8,8 +8,10 @@ For information on how to use Compat, please consult the 
[manual].
 The latest state of development can be found in the [snapshot
 version].
 
-[manual]: https://elpa.gnu.org/packages/doc/compat.html
-[snapshot version]: https://elpa.gnu.org/devel/doc/compat.html
+[manual]:
+   https://elpa.gnu.org/packages/doc/compat.html
+[snapshot version]:
+   https://elpa.gnu.org/devel/doc/compat.html
 
 Contribute
 --
@@ -18,9 +20,12 @@ As compat.el is distribed as part of [GNU ELPA], and 
therefore
 requires a [copyright assignment] to the [FSF], for all non-trivial code
 contributions.
 
-[GNU ELPA]: http://elpa.gnu.org/packages/compat.html
-[copyright assignment]: 
https://www.gnu.org/software/emacs/manual/html_node/emacs/Copyright-Assignment.html
-[FSF]: https://www.fsf.org/
+[GNU ELPA]:
+   http://elpa.gnu.org/packages/compat.html
+[copyright assignment]:
+   
https://www.gnu.org/software/emacs/manual/html_node/emacs/Copyright-Assignment.html
+[FSF]:
+   https://www.fsf.org/
 
 Source code
 ---
@@ -28,8 +33,10 @@ Source code
 Compat is developed on [SourceHut]. A restricted [GitHub] mirror is
 also provided.
 
-[SourceHut]: https://sr.ht/~pkal/compat
-[GitHub]: https://github.com/phikal/compat.el
+[SourceHut]:
+   https://sr.ht/~pkal/compat
+[GitHub]:
+   https://github.com/phikal/compat.el
 
 Bug and patches
 ---
@@ -44,11 +51,14 @@ When contributing, make sure to provide test and use the 
existing
 tests defined in compat-test.el.  These can be easily executed using
 the bundled Makefile:
 
-make test
+   make test
 
-[development mailing list]: https://lists.sr.ht/~pkal/compat-devel
-[issue tracker]: https://todo.sr.ht/~pkal/compat
-[email]: mailto:~pkal/com...@todo.sr.ht
+[development mailing list]:
+   https://lists.sr.ht/~pkal/compat-devel
+[issue tracker]:
+   https://todo.sr.ht/~pkal/compat
+[email]:
+   mailto:~pkal/com...@todo.sr.ht
 
 Distribution
 
@@ -58,5 +68,7 @@ under the [GNU Public License], Version 3 (like Emacs 
itself).  The manual
 (`compat.texi`) is distributed under the [GNU Free Documentation
 License], Version 1.3.
 
-[GNU Public License]: https://www.gnu.org/licenses/gpl-3.0.en.html
-[GNU Free Documentation License]: https://www.gnu.org/licenses/fdl-1.3.html
+[GNU Public License]:
+   https://www.gnu.org/licenses/gpl-3.0.en.html
+[GNU Free Documentation License]:
+   https://www.gnu.org/licenses/fdl-1.3.html
diff --git a/compat.el b/compat.el
index 0b28ff05e2..334c4237a5 100644
--- a/compat.el
+++ b/compat.el
@@ -4,7 +4,7 @@
 
 ;; Author: Philip Kaludercic 
 ;; Maintainer: Compat Development <~pkal/compat-de...@lists.sr.ht>
-;; Version: 28.1.2.0
+;; Version: 28.1.2.1
 ;; URL: https://sr.ht/~pkal/compat
 ;; Package-Requires: ((emacs "24.3") (nadvice "0.3"))
 ;; Keywords: lisp
diff --git a/compat.texi b/compat.texi
index 5f49bb2380..efc622bd54 100644
--- a/compat.texi
+++ b/compat.texi
@@ -31,7 +31,7 @@ modify this GNU manual.”
 @finalout
 @titlepage
 @title "Compat" Manual
-@subtitle For version 28.1.2.0
+@subtitle For version 28.1.2.1
 @author Philip Kaludercic
 @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 28.1.2.0.
+version 28.1.2.1.
 
 @insertcopying
 @end ifnottex
@@ -124,16 +124,20 @@ The intended use-case for this library is for package 
developers to add
 as a dependency in the header:
 
 @example
-;; Package-Requires: ((emacs "24.3") (compat "28.1.2.0"))
+;; Package-Requires: ((emacs "24.3") (compat "28.1.2.1"))
 @end example
 
+There is

[elpa] externals/compat db53afa3a7 18/84: Add buffer-text-pixel-size from Emacs 29

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit db53afa3a7fc17f826de047551ecee39b3ee493c
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Add buffer-text-pixel-size from Emacs 29
---
 compat-29.el | 24 
 compat.texi  | 20 
 2 files changed, 44 insertions(+)

diff --git a/compat-29.el b/compat-29.el
index 5ec5680311..8b14b23a43 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -58,6 +58,30 @@ the properties at POSITION."
  (eq (car properties) prop))
 (cadr properties
 
+;;* UNTESTED
+(compat-defun buffer-text-pixel-size
+(&optional buffer-or-name window x-limit y-limit)
+  "Return size of whole text of BUFFER-OR-NAME in WINDOW.
+BUFFER-OR-NAME must specify a live buffer or the name of a live buffer
+and defaults to the current buffer.  WINDOW must be a live window and
+defaults to the selected one.  The return value is a cons of the maximum
+pixel-width of any text line and the pixel-height of all the text lines
+of the buffer specified by BUFFER-OR-NAME.
+
+The optional arguments X-LIMIT and Y-LIMIT have the same meaning as with
+`window-text-pixel-size'.
+
+Do not use this function if the buffer specified by BUFFER-OR-NAME is
+already displayed in WINDOW.  `window-text-pixel-size' is cheaper in
+that case because it does not have to temporarily show that buffer in
+WINDOW."
+  :realname compat--buffer-text-pixel-size
+  (setq buffer-or-name (or buffer-or-name (current-buffer)))
+  (setq window (or window (selected-window)))
+  (save-window-excursion
+(set-window-buffer window buffer-or-name)
+(window-text-pixel-size window nil nil x-limit y-limit)))
+
  Defined in fns.c
 
 (compat-defun ntake (n list)
diff --git a/compat.texi b/compat.texi
index cdf089125c..80077f1bcb 100644
--- a/compat.texi
+++ b/compat.texi
@@ -2359,6 +2359,26 @@ display purposes; use @code{truncate-string-to-width} or
 (@pxref{Size of Displayed Text,Size of Displayed Text,,elisp,}).
 @end defun
 
+@c copied from lispref/display.texi
+@defun buffer-text-pixel-size &optional buffer-or-name window x-limit y-limit
+This is much like @code{window-text-pixel-size}, but can be used when
+the buffer isn't shown in a window.  (@code{window-text-pixel-size} is
+faster when it is, so this function shouldn't be used in that case.)
+
+@var{buffer-or-name} must specify a live buffer or the name of a live
+buffer and defaults to the current buffer.  @var{window} must be a
+live window and defaults to the selected one; the function will
+compute the text dimensions as if @var{buffer} is displayed in
+@var{window}.  The return value is a cons of the maximum pixel-width
+of any text line and the pixel-height of all the text lines of the
+buffer specified by @var{buffer-or-name}.
+
+The optional arguments @var{x-limit} and @var{y-limit} have the same
+meaning as with @code{window-text-pixel-size}.
+
+@xref{Size of Displayed Text,,,elisp}.
+@end defun
+
 
 
 



[elpa] externals/compat 8e397fee78 66/84: Ignore all .patch files

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 8e397fee78059c35b57521d893d9744fa5dc8755
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Ignore all .patch files
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index 29f171e696..ebcf256fa4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+*.patch
 *.elc
 *~
 \#*\#



[elpa] externals/compat 68c6ccd5cc 68/84: Always load compat-macs

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 68c6ccd5cc738da341a211902447ce9a762f80c7
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Always load compat-macs

This is a temporary workaround that might help avoid issues like
https://todo.sr.ht/~pkal/compat/7 and perhaps
https://todo.sr.ht/~pkal/compat/5 too.

This will be reverted before the next release.
---
 compat-24.el | 2 +-
 compat-25.el | 2 +-
 compat-26.el | 3 +--
 compat-27.el | 2 +-
 compat-28.el | 2 +-
 5 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/compat-24.el b/compat-24.el
index 8e0fd93e92..d38f0511b4 100644
--- a/compat-24.el
+++ b/compat-24.el
@@ -37,7 +37,7 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'compat-macs))
+(require 'compat-macs "compat-macs.el")
 
 (compat-declare-version "24.4")
 
diff --git a/compat-25.el b/compat-25.el
index f6d6de09bf..815d9dda0d 100644
--- a/compat-25.el
+++ b/compat-25.el
@@ -32,7 +32,7 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'compat-macs))
+(require 'compat-macs "compat-macs.el")
 
 (compat-declare-version "25.1")
 
diff --git a/compat-26.el b/compat-26.el
index bcfd893fe8..5b8cfacf76 100644
--- a/compat-26.el
+++ b/compat-26.el
@@ -37,8 +37,7 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'compat-macs))
-(declare-function compat-func-arity "compat" (func))
+(require 'compat-macs "compat-macs.el")
 
 (compat-declare-version "26.1")
 
diff --git a/compat-27.el b/compat-27.el
index 2581ce7df5..e630bb9677 100644
--- a/compat-27.el
+++ b/compat-27.el
@@ -39,7 +39,7 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'compat-macs))
+(require 'compat-macs "compat-macs.el")
 
 (compat-declare-version "27.1")
 
diff --git a/compat-28.el b/compat-28.el
index 1cb3879acb..a3dc769341 100644
--- a/compat-28.el
+++ b/compat-28.el
@@ -39,7 +39,7 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'compat-macs))
+(require 'compat-macs "compat-macs.el")
 
 (compat-declare-version "28.1")
 



[elpa] externals/compat c96aa66fb4 57/84: Remove realname for if-let*

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit c96aa66fb441ae918f0820b4fa7145f347b1b4da
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Remove realname for if-let*
---
 compat-26.el | 1 -
 1 file changed, 1 deletion(-)

diff --git a/compat-26.el b/compat-26.el
index b1ea51771c..bd8f341cbf 100644
--- a/compat-26.el
+++ b/compat-26.el
@@ -367,7 +367,6 @@ PREFIX is a string, and defaults to \"g\"."
   "Bind variables according to VARLIST and evaluate THEN or ELSE.
 This is like `if-let' but doesn't handle a VARLIST of the form
 \(SYMBOL SOMETHING) specially."
-  :realname compat--if-let*
   (declare (indent 2)
(debug ((&rest [&or symbolp (symbolp form) (form)])
body)))



[elpa] externals/compat 0e4da35d72 46/84: Add functions and macros from keymap.el

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 0e4da35d72ae03025c3dfee987090a4fd05d3361
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Add functions and macros from keymap.el
---
 compat-29.el | 495 +++
 compat.texi  | 274 +
 2 files changed, 769 insertions(+)

diff --git a/compat-29.el b/compat-29.el
index bf313b4b21..0fcd3ad0d6 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -481,5 +481,500 @@ the symbol of the calling function, for example."
  (when (not (equal attr cachedattr))
(puthash sym attr compat--file-has-changed-p--hash-table
 
+ Defined in keymap.el
+
+(compat-defun key-valid-p (keys)
+  "Say whether KEYS is a valid key.
+A key is a string consisting of one or more key strokes.
+The key strokes are separated by single space characters.
+
+Each key stroke is either a single character, or the name of an
+event, surrounded by angle brackets.  In addition, any key stroke
+may be preceded by one or more modifier keys.  Finally, a limited
+number of characters have a special shorthand syntax.
+
+Here's some example key sequences.
+
+  \"f\"   (the key `f')
+  \"S o m\"   (a three key sequence of the keys `S', `o' and `m')
+  \"C-c o\"   (a two key sequence of the keys `c' with the control modifier
+ and then the key `o')
+  \"H-\"(the key named \"left\" with the hyper modifier)
+  \"M-RET\"   (the \"return\" key with a meta modifier)
+  \"C-M-\" (the \"space\" key with both the control and meta modifiers)
+
+These are the characters that have shorthand syntax:
+NUL, RET, TAB, LFD, ESC, SPC, DEL.
+
+Modifiers have to be specified in this order:
+
+   A-C-H-M-S-s
+
+which is
+
+   Alt-Control-Hyper-Meta-Shift-super"
+  :realname compat--key-valid-p
+  (declare (pure t) (side-effect-free t))
+  (let ((case-fold-search nil))
+(and
+ (stringp keys)
+ (string-match-p "\\`[^ ]+\\( [^ ]+\\)*\\'" keys)
+ (save-match-data
+   (catch 'exit
+ (let ((prefixes
+"\\(A-\\)?\\(C-\\)?\\(H-\\)?\\(M-\\)?\\(S-\\)?\\(s-\\)?"))
+   (dolist (key (split-string keys " "))
+ ;; Every key might have these modifiers, and they should be
+ ;; in this order.
+ (when (string-match (concat "\\`" prefixes) key)
+   (setq key (substring key (match-end 0
+ (unless (or (and (= (length key) 1)
+  ;; Don't accept control characters as keys.
+  (not (< (aref key 0) ?\s))
+  ;; Don't accept Meta'd characters as keys.
+  (or (multibyte-string-p key)
+  (not (<= 127 (aref key 0) 255
+ (and (string-match-p "\\`<[-_A-Za-z0-9]+>\\'" key)
+  ;; Don't allow .
+  (= (progn
+   (string-match
+(concat "\\`<" prefixes) key)
+   (match-end 0))
+ 1))
+ (string-match-p
+  "\\`\\(NUL\\|RET\\|TAB\\|LFD\\|ESC\\|SPC\\|DEL\\)\\'"
+  key))
+   ;; Invalid.
+   (throw 'exit nil)))
+   t))
+
+(compat-defun key-parse (keys)
+  "Convert KEYS to the internal Emacs key representation.
+See `kbd' for a descripion of KEYS."
+  :realname compat--key-parse
+  (declare (pure t) (side-effect-free t))
+  ;; A pure function is expected to preserve the match data.
+  (save-match-data
+(let ((case-fold-search nil)
+  (len (length keys)) ; We won't alter keys in the loop below.
+  (pos 0)
+  (res []))
+  (while (and (< pos len)
+  (string-match "[^ \t\n\f]+" keys pos))
+(let* ((word-beg (match-beginning 0))
+   (word-end (match-end 0))
+   (word (substring keys word-beg len))
+   (times 1)
+   key)
+  ;; Try to catch events of the form "".
+  (if (string-match "\\`<[^ <>\t\n\f][^>\t\n\f]*>" word)
+  (setq word (match-string 0 word)
+pos (+ word-beg (match-end 0)))
+(setq word (substring keys word-beg word-end)
+  pos word-end))
+  (when (string-match "\\([0-9]+\\)\\*." word)
+(setq times (string-to-number (substring word 0 (match-end 1
+(setq word (substring word (1+ (match-end 1)
+  (cond ((string-match "^<<.+>>$" word)
+ (setq key (vconcat (if (eq (key-binding [?\M-x])
+'execute-extended-command)
+[?\M-x]
+  (or (car (where-is-internal
+'execute-extended-co

[elpa] externals/compat e7413bcf2b 63/84: Document additional missing functions from compat-29

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit e7413bcf2bc6f0aca6e6c2967ea55859dcff17e0
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Document additional missing functions from compat-29
---
 compat.texi | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/compat.texi b/compat.texi
index cb89595c4f..5f49bb2380 100644
--- a/compat.texi
+++ b/compat.texi
@@ -2903,6 +2903,12 @@ The macro @code{with-delayed-message} and the function
 @code{funcall-with-delayed-message}.
 @item
 The function @code{string-glyph-split}.
+@item
+The function @code{textsec-suspicious-p}.
+@item
+The function @code{minibuffer-lazy-highlight-setup}.
+@item
+The function @code{pp-emacs-lisp-code}.
 @end itemize
 
 @node Development



[elpa] externals/compat fcac0fa893 81/84: Update copyright years

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit fcac0fa8939ef56b4d6f94cb89086ffb9801b0e2
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Update copyright years
---
 compat-24.el|   2 +-
 compat-25.el|   2 +-
 compat-26.el|   2 +-
 compat-27.el|   2 +-
 compat-28.el|   2 +-
 compat-29.el|   2 +-
 compat-font-lock.el |   2 +-
 compat-help.el  |   2 +-
 compat-macs.el  |   2 +-
 compat-tests.el | Bin 90231 -> 240017 bytes
 compat.el   |   2 +-
 compat.texi |   2 +-
 12 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/compat-24.el b/compat-24.el
index aa77f3b66f..aa383df431 100644
--- a/compat-24.el
+++ b/compat-24.el
@@ -1,6 +1,6 @@
 ;;; compat-24.el --- Compatibility Layer for Emacs 24.4  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2021, 2022 Free Software Foundation, Inc.
+;; Copyright (C) 2021, 2022, 2023 Free Software Foundation, Inc.
 
 ;; Author: Philip Kaludercic 
 ;; Maintainer: Compat Development <~pkal/compat-de...@lists.sr.ht>
diff --git a/compat-25.el b/compat-25.el
index ace517d502..181dada278 100644
--- a/compat-25.el
+++ b/compat-25.el
@@ -1,6 +1,6 @@
 ;;; compat-25.el --- Compatibility Layer for Emacs 25.1  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2021, 2022 Free Software Foundation, Inc.
+;; Copyright (C) 2021, 2022, 2023 Free Software Foundation, Inc.
 
 ;; Author: Philip Kaludercic 
 ;; Maintainer: Compat Development <~pkal/compat-de...@lists.sr.ht>
diff --git a/compat-26.el b/compat-26.el
index fd87057805..12cad8 100644
--- a/compat-26.el
+++ b/compat-26.el
@@ -1,6 +1,6 @@
 ;;; compat-26.el --- Compatibility Layer for Emacs 26.1  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2021, 2022 Free Software Foundation, Inc.
+;; Copyright (C) 2021, 2022, 2023 Free Software Foundation, Inc.
 
 ;; Author: Philip Kaludercic 
 ;; Maintainer: Compat Development <~pkal/compat-de...@lists.sr.ht>
diff --git a/compat-27.el b/compat-27.el
index 0687dc826f..1987a3c0b0 100644
--- a/compat-27.el
+++ b/compat-27.el
@@ -1,6 +1,6 @@
 ;;; compat-27.el --- Compatibility Layer for Emacs 27.1  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2021, 2022 Free Software Foundation, Inc.
+;; Copyright (C) 2021, 2022, 2023 Free Software Foundation, Inc.
 
 ;; Author: Philip Kaludercic 
 ;; Maintainer: Compat Development <~pkal/compat-de...@lists.sr.ht>
diff --git a/compat-28.el b/compat-28.el
index 5ce1073830..fc877b47e3 100644
--- a/compat-28.el
+++ b/compat-28.el
@@ -1,6 +1,6 @@
 ;;; compat-28.el --- Compatibility Layer for Emacs 28.1  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2021, 2022 Free Software Foundation, Inc.
+;; Copyright (C) 2021, 2022, 2023 Free Software Foundation, Inc.
 
 ;; Author: Philip Kaludercic 
 ;; Maintainer: Compat Development <~pkal/compat-de...@lists.sr.ht>
diff --git a/compat-29.el b/compat-29.el
index a47037ec07..20076ff5b6 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -1,6 +1,6 @@
 ;;; compat-29.el --- Compatibility Layer for Emacs 29.1  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2021, 2022 Free Software Foundation, Inc.
+;; Copyright (C) 2021, 2022, 2023 Free Software Foundation, Inc.
 
 ;; Author: Philip Kaludercic 
 ;; Keywords: lisp
diff --git a/compat-font-lock.el b/compat-font-lock.el
index 66a62e5522..5a8626fb99 100644
--- a/compat-font-lock.el
+++ b/compat-font-lock.el
@@ -1,6 +1,6 @@
 ;;; compat-font-lock.el ---  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2022 Free Software Foundation, Inc.
+;; Copyright (C) 2022, 2023 Free Software Foundation, Inc.
 
 ;; Author: Philip Kaludercic 
 ;; Keywords:
diff --git a/compat-help.el b/compat-help.el
index 440e35f24c..a796d944d8 100644
--- a/compat-help.el
+++ b/compat-help.el
@@ -1,6 +1,6 @@
 ;;; compat-help.el --- Documentation for compat functions  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2022  Free Software Foundation, Inc.
+;; Copyright (C) 2022, 2023  Free Software Foundation, Inc.
 
 ;; Author: Philip Kaludercic 
 
diff --git a/compat-macs.el b/compat-macs.el
index 66b531be40..41e4d19a69 100644
--- a/compat-macs.el
+++ b/compat-macs.el
@@ -1,6 +1,6 @@
 ;;; compat-macs.el --- Compatibility Macros   -*- lexical-binding: t; 
no-byte-compile: t; -*-
 
-;; Copyright (C) 2021, 2022 Free Software Foundation, Inc.
+;; Copyright (C) 2021, 2022, 2023 Free Software Foundation, Inc.
 
 ;; Author: Philip Kaludercic 
 ;; Keywords: lisp
diff --git a/compat-tests.el b/compat-tests.el
index 2733a48b95..cb63619d8a 100644
Binary files a/compat-tests.el and b/compat-tests.el differ
diff --git a/compat.el b/compat.el
index ba2855fc39..ddb129927b 100644
--- a/compat.el
+++ b/compat.el
@@ -1,6 +1,6 @@
 ;;; compat.el --- Emacs Lisp Compatibility Library -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2021, 2022 Free Software Foundation, Inc.
+;; Copyright (C) 2021, 2022, 2023 Free Software Foundation, Inc.
 
 ;; Author: Philip Kaludercic 
 ;; Maintainer: Compat Development <~pkal/compat-de...@lists.s

[elpa] externals/compat 0c14c42bc1 50/84: Copy edebug specifications instead of referencing

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 0c14c42bc1b28670e6f13c46a439d1481bf4145c
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Copy edebug specifications instead of referencing
---
 compat-25.el | 5 -
 compat-26.el | 4 +++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/compat-25.el b/compat-25.el
index c4e75fe08d..d0df7d8a96 100644
--- a/compat-25.el
+++ b/compat-25.el
@@ -163,7 +163,10 @@ Evaluate each binding in turn, stopping if a binding value 
is nil.
 If all are non-nil, return the value of the last form in BODY.
 
 The variable list SPEC is the same as in `if-let'."
-  (declare (indent 1) (debug if-let))
+  (declare (indent 1)
+   (debug ([&or (symbolp form)
+(&rest [&or symbolp (symbolp form) (form)])]
+   body)))
   `(compat--if-let ,spec ,(macroexp-progn body)))
 
  Defined in subr-x.el
diff --git a/compat-26.el b/compat-26.el
index a21b903b93..d823a75b61 100644
--- a/compat-26.el
+++ b/compat-26.el
@@ -385,7 +385,9 @@ This is like `if-let' but doesn't handle a VARLIST of the 
form
   "Bind variables according to VARLIST and conditionally evaluate BODY.
 This is like `when-let' but doesn't handle a VARLIST of the form
 \(SYMBOL SOMETHING) specially."
-  (declare (indent 1) (debug if-let*))
+  (declare (indent 1)
+   (debug ((&rest [&or symbolp (symbolp form) (form)])
+   body)))
   (let ((empty (make-symbol "s"))
 (last t) list)
 (dolist (var varlist)



[elpa] externals/compat 62ec50bdd1 83/84: Merge branch 'emacs-29.1'

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 62ec50bdd121baf8edc460ab5f7888da7c702eab
Merge: 1573aa2e6d 55080acac2
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Merge branch 'emacs-29.1'
---
 .dir-locals.el  |1 -
 Makefile|9 +-
 compat-24.el|4 +-
 compat-25.el|   44 ++-
 compat-26.el|  116 +++---
 compat-27.el|   10 +-
 compat-28.el|4 +-
 compat-29.el| 1049 +++
 compat-font-lock.el |2 +-
 compat-help.el  |2 +-
 compat-macs.el  |   27 +-
 compat-tests.el |2 +-
 compat.el   |   14 +-
 compat.texi |  666 +++-
 14 files changed, 1842 insertions(+), 108 deletions(-)

diff --git a/.dir-locals.el b/.dir-locals.el
index 900dee5f90..6d22de33f5 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -2,6 +2,5 @@
 ;;; For more information see (info "(emacs) Directory Variables")
 
 ((emacs-lisp-mode
-  (byte-compile-docstring-max-column . 100)
   (show-trailing-whitespace . t)
   (indent-tabs-mode . nil)))
diff --git a/Makefile b/Makefile
index 776c125027..36c6635f68 100644
--- a/Makefile
+++ b/Makefile
@@ -6,12 +6,12 @@ EMACS = emacs
 MAKEINFO = makeinfo
 BYTEC = compat-help.elc \
compat-font-lock.elc \
-   compat-macs.elc \
compat-24.elc \
compat-25.elc \
compat-26.elc \
compat-27.elc \
compat-28.elc \
+   compat-29.elc \
compat.elc
 
 all: compile
@@ -25,12 +25,7 @@ test: compile
 clean:
$(RM) $(BYTEC) compat.info
 
-compat-24.el:  compat-macs.el
-compat-25.el:  compat-macs.el
-compat-26.el:  compat-macs.el
-compat-27.el:  compat-macs.el
-compat-28.el:  compat-macs.el
-compat-font-lock.el: compat-macs.el
+$(BYTEC): compat-macs.el
 
 .el.elc:
$(EMACS) -Q --batch -L . -f batch-byte-compile $<
diff --git a/compat-24.el b/compat-24.el
index 51bd31e279..2a4e8a8a75 100644
--- a/compat-24.el
+++ b/compat-24.el
@@ -1,6 +1,6 @@
 ;;; compat-24.el --- Compatibility Layer for Emacs 24.4  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2021, 2022 Free Software Foundation, Inc.
+;; Copyright (C) 2021, 2022, 2023 Free Software Foundation, Inc.
 
 ;; Author: Philip Kaludercic 
 ;; Maintainer: Compat Development <~pkal/compat-de...@lists.sr.ht>
@@ -37,7 +37,7 @@
 
 ;;; Code:
 
-(require 'compat-macs "compat-macs.el")
+(eval-when-compile (load "compat-macs.el" nil t t))
 
 (compat-declare-version "24.4")
 
diff --git a/compat-25.el b/compat-25.el
index 471fbee8b2..181dada278 100644
--- a/compat-25.el
+++ b/compat-25.el
@@ -1,6 +1,6 @@
 ;;; compat-25.el --- Compatibility Layer for Emacs 25.1  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2021, 2022 Free Software Foundation, Inc.
+;; Copyright (C) 2021, 2022, 2023 Free Software Foundation, Inc.
 
 ;; Author: Philip Kaludercic 
 ;; Maintainer: Compat Development <~pkal/compat-de...@lists.sr.ht>
@@ -32,7 +32,7 @@
 
 ;;; Code:
 
-(require 'compat-macs "compat-macs.el")
+(eval-when-compile (load "compat-macs.el" nil t t))
 
 (compat-declare-version "25.1")
 
@@ -130,8 +130,6 @@ Equality with KEY is tested by TESTFN, defaulting to `eq'."
 default)))
 (if entry (cdr entry) default)))
 
- Defined in subr-x.el
-
 (compat-defmacro if-let (spec then &rest else)
   "Bind variables according to SPEC and evaluate THEN or ELSE.
 Evaluate each binding in turn, as in `let*', stopping if a
@@ -148,8 +146,6 @@ SYMBOL is checked for nil.
 As a special case, interprets a SPEC of the form \(SYMBOL SOMETHING)
 like \((SYMBOL SOMETHING)).  This exists for backward compatibility
 with an old syntax that accepted only one binding."
-  :realname compat--if-let
-  :feature 'subr-x
   (declare (indent 2)
(debug ([&or (symbolp form)
 (&rest [&or symbolp (symbolp form) (form)])]
@@ -158,7 +154,16 @@ with an old syntax that accepted only one binding."
  (not (listp (car spec
 ;; Adjust the single binding case
 (setq spec (list spec)))
-  `(compat--if-let* ,spec ,then ,(macroexp-progn else)))
+  (let ((empty (make-symbol "s"))
+(last t) list)
+(dolist (var spec)
+  (push `(,(if (cdr var) (car var) empty)
+  (and ,last ,(if (cdr var) (cadr var) (car var
+list)
+  (when (or (cdr var) (consp (car var)))
+(setq last (caar list
+`(let* ,(nreverse list)
+   (if ,(caar list) ,then ,@else
 
 (compat-defmacro when-let (spec &rest body)
   "Bind variables according to SPEC and conditionally evaluate BODY.
@@ -166,9 +171,26 @@ Evaluate each binding in turn, stopping if a binding value 
is nil.
 If all are non-nil, return the value of the last form in BODY.
 
 The variable list SPEC is the same as in `if-let'."
-  :feature 'subr-x
-  (declare (indent 1) (debug if-let))
-  `(compat--if-let ,spec ,(macroexp-progn body)))
+  (declare (indent 1)
+   (debug ([&or (symbolp form)
+(&res

[elpa] externals/compat 661ba3a441 74/84: Use 'equal' instead of 'file-equal-p'

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 661ba3a44152724ea97f4a4d7e22c94711f997c3
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Use 'equal' instead of 'file-equal-p'

See bug#56355.
---
 compat-29.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compat-29.el b/compat-29.el
index f7747b7434..493f75fa4e 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -498,7 +498,7 @@ to `default-directory', and the result will also be 
relative."
 (cond
  ;; filename is at top-level, therefore no parent
  ((or (null parent)
-  (file-equal-p parent expanded-filename))
+  (equal parent expanded-filename))
   nil)
  ;; filename is relative, return relative parent
  ((not (file-name-absolute-p filename))



[elpa] externals/compat 9e14c2f2df 56/84: Remove realname for if-let

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 9e14c2f2df5f533fc1f902889bd67b81506e3cb3
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Remove realname for if-let
---
 compat-25.el | 1 -
 1 file changed, 1 deletion(-)

diff --git a/compat-25.el b/compat-25.el
index 339de654ce..f6d6de09bf 100644
--- a/compat-25.el
+++ b/compat-25.el
@@ -146,7 +146,6 @@ SYMBOL is checked for nil.
 As a special case, interprets a SPEC of the form \(SYMBOL SOMETHING)
 like \((SYMBOL SOMETHING)).  This exists for backward compatibility
 with an old syntax that accepted only one binding."
-  :realname compat--if-let
   (declare (indent 2)
(debug ([&or (symbolp form)
 (&rest [&or symbolp (symbolp form) (form)])]



[elpa] externals/compat ff331f6c29 22/84: Add prefixed plist-put from Emacs 29

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit ff331f6c2931d88afbcf7af540552d30a76313be
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Add prefixed plist-put from Emacs 29
---
 compat-29.el| 23 +++
 compat-tests.el | 30 ++
 compat.texi | 15 +++
 3 files changed, 68 insertions(+)

diff --git a/compat-29.el b/compat-29.el
index 3d823ee6aa..68fd657961 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -126,6 +126,29 @@ This function doesn't signal an error if PLIST is invalid."
   (throw 'found (cadr plist)))
 (setq plist (cddr plist))
 
+(compat-defun plist-put (plist prop val &optional predicate)
+  "Change value in PLIST of PROP to VAL.
+PLIST is a property list, which is a list of the form
+\(PROP1 VALUE1 PROP2 VALUE2 ...).
+
+The comparison with PROP is done using PREDICATE, which defaults to `eq'.
+
+If PROP is already a property on the list, its value is set to VAL,
+otherwise the new PROP VAL pair is added.  The new plist is returned;
+use `(setq x (plist-put x prop val))' to be sure to use the new value.
+The PLIST is modified by side effects."
+  :prefix t
+  (if (or (null predicate) (eq predicate 'eq))
+  (plist-put plist prop val)
+(catch 'found
+  (let ((tail plist))
+(while (consp tail)
+  (when (funcall predicate prop (car tail))
+(setcar (cdr tail) val)
+(throw 'found plist))
+  (setq tail (cddr tail
+  (nconc plist (list prop val)
+
  Defined in subr.el
 
 (compat-defun function-alias-p (func &optional noerror)
diff --git a/compat-tests.el b/compat-tests.el
index 9ad7651534..76e640e0cf 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -2047,6 +2047,36 @@ being compared against."
   (ought :three '(1 :one 2 :two 3 :three) 3 #'<=)
   (ought nil '(1 :one 2 :two 3 :three) 4 #'<=))
 
+(compat-deftests compat-plist-put
+  (ought '(:one -1 :two 2 :three 3)
+ (list :one 1 :two 2 :three 3)
+ :one -1)
+  (ought '(:one -1 :one 2 :one 3)
+ (list :one 1 :one 2 :one 3)
+ :one -1)
+  (ought '(:zero 1 :one -1 :one 3)
+ (list :zero 1 :one 2 :one 3)
+ :one -1)
+  (ought '(:one -1 :two 2 :three 3)
+ (list :one 1 :two 2 :three 3)
+ :one -1)
+  (ought '(:one 1 :two 2 :three 3 :four -1)
+ (list :one 1 :two 2 :three 3)
+ :four -1)
+  ;; With a custom predicate
+  (ought '(1 :eins 2 :two 3 :three)
+ '(1 :one 2 :two 3 :three)
+ 3 :eins #'>)
+  (ought '(1 :one 2 :zwei 3 :three)
+ '(1 :one 2 :two 3 :three)
+ 2 :zwei #'<=)
+  (ought '(1 :one 2 :two 3 :three 4 :vier)
+ '(1 :one 2 :two 3 :three)
+ 4 :vier #'<=)
+  (ought '(1 :vier 2 :two 3 :three)
+ '(1 :one 2 :two 3 :three)
+ 4 :vier #'>))
+
 
 (provide 'compat-tests)
 ;;; compat-tests.el ends here
diff --git a/compat.texi b/compat.texi
index c4e8aa710f..0fb1ff2438 100644
--- a/compat.texi
+++ b/compat.texi
@@ -2409,6 +2409,21 @@ This compatibility version handles the optional argument
 @var{predicate}.
 @end defun
 
+@c copied from lispref/lists.texi
+@defun compat-plist-put plist prop val &optional predicate
+This stores @var{value} as the value of the @var{property} property in
+the property list @var{plist}.  Comparisons are done with @var{predicate},
+and defaults to @code{eq}.  It may modify @var{plist} destructively,
+or it may construct a new list structure without altering the old.  The
+function returns the modified property list, so you can store that back
+in the place where you got @var{plist}.
+
+@xref{Plist Access,,,elisp}.
+
+This compatibility version handles the optional argument
+@var{predicate}.
+@end defun
+
 @subsection Missing Definitions
 Compat does not provide support for the following Lisp features
 implemented in 29.1:



[elpa] externals/compat e6d279af18 14/84: Extend byte-compile-docstring-max-column to 100

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit e6d279af18821c1f58f300639bb6922638b53c51
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Extend byte-compile-docstring-max-column to 100

This addresses https://todo.sr.ht/~pkal/compat/6.

To have to change also affect ELPA packages, we will remove
.dir-locals.el from .elpaignore.
---
 .dir-locals.el | 6 --
 .elpaignore| 1 -
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/.dir-locals.el b/.dir-locals.el
index 2ce32d64ca..900dee5f90 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -1,5 +1,7 @@
 ;;; Directory Local Variables
 ;;; For more information see (info "(emacs) Directory Variables")
 
-((emacs-lisp-mode . ((show-trailing-whitespace . t)
-(indent-tabs-mode . nil
+((emacs-lisp-mode
+  (byte-compile-docstring-max-column . 100)
+  (show-trailing-whitespace . t)
+  (indent-tabs-mode . nil)))
diff --git a/.elpaignore b/.elpaignore
index 2fe0af53a7..f7d22f93fc 100644
--- a/.elpaignore
+++ b/.elpaignore
@@ -1,6 +1,5 @@
 compat-tests.el
 Makefile
-.dir-locals.el
 .github
 .elpaignore
 COPYING



[elpa] externals/compat accc689c7e 20/84: Remove nonsensical file-parent-directory test comment

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit accc689c7ec82b7e96aec2b9d0929bc03b0ae169
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Remove nonsensical file-parent-directory test comment
---
 compat-tests.el | 14 --
 1 file changed, 14 deletions(-)

diff --git a/compat-tests.el b/compat-tests.el
index 2b5c8ba817..4f91473a85 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -2016,20 +2016,6 @@ being compared against."
   (ought t "~root/")
   (ought t "~root/file"))
 
-;; (compat-deftests file-parent-directory;assuming unix
-;;   (ought '() "/")
-;;   (ought t "/a")
-;;   (ought nil "a")
-;;   (ought nil "a/b")
-;;   (ought nil "a/b/")
-;;   (ought t "~")
-;;   (when (version< "27.1" emacs-version)
-;; (ought t "~/foo")
-;; (ought nil "~foo")
-;; (ought nil "~foo/"))
-;;   (ought t "~root")
-;;   (ought t "~root/")
-;;   (ought t "~root/file"))
 (compat-deftests string-equal-ignore-case
   (ought t "" "")
   (ought t "a" "a")



[elpa] externals/compat 26cf72e36a 49/84: Explicitly denote subr-x functions with :feature

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 26cf72e36adf41bdb76bf147015aeecb5d22dfe2
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Explicitly denote subr-x functions with :feature
---
 compat-29.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/compat-29.el b/compat-29.el
index 34b21d6070..32783b58f7 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -390,6 +390,7 @@ than this function."
 ;;* UNTESTED
 (compat-defun string-pixel-width (string)
   "Return the width of STRING in pixels."
+  :feature 'subr-x
   (if (zerop (length string))
   0
 ;; Keeping a work buffer around is more efficient than creating a
@@ -419,6 +420,7 @@ changes that are normally perceived as \"buffer 
modifications\", such
 as changes in text properties, `buffer-file-coding-system', buffer
 multibyteness, etc. -- will not be noticed, and the buffer will still
 be marked unmodified, effectively ignoring those changes."
+  :feature 'subr-x
   (declare (debug t) (indent 0))
   (let ((hash (make-symbol "hash"))
 (buffer (make-symbol "buffer")))



[elpa] externals/compat 2ad7057293 70/84: Always load compat-macs.el while compiling

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 2ad7057293b0ab74ebbf50808d4581b43a1bff4a
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Always load compat-macs.el while compiling

This is another attempt at solving https://todo.sr.ht/~pkal/compat/7,
as had been done with 66b83295 before.  The difference is that the
previous attempt could still avoid re-loading compat-macs.el if
'compat-macs' had previously been loaded, and hence also be missing
any new macros that require a manual, full recompilation.
---
 compat-24.el | 2 +-
 compat-25.el | 2 +-
 compat-26.el | 2 +-
 compat-27.el | 2 +-
 compat-28.el | 2 +-
 compat-29.el | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/compat-24.el b/compat-24.el
index d38f0511b4..aa77f3b66f 100644
--- a/compat-24.el
+++ b/compat-24.el
@@ -37,7 +37,7 @@
 
 ;;; Code:
 
-(require 'compat-macs "compat-macs.el")
+(eval-when-compile (load "compat-macs.el" nil t t))
 
 (compat-declare-version "24.4")
 
diff --git a/compat-25.el b/compat-25.el
index 815d9dda0d..54ea191f45 100644
--- a/compat-25.el
+++ b/compat-25.el
@@ -32,7 +32,7 @@
 
 ;;; Code:
 
-(require 'compat-macs "compat-macs.el")
+(eval-when-compile (load "compat-macs.el" nil t t))
 
 (compat-declare-version "25.1")
 
diff --git a/compat-26.el b/compat-26.el
index 5b8cfacf76..6df2545cd7 100644
--- a/compat-26.el
+++ b/compat-26.el
@@ -37,7 +37,7 @@
 
 ;;; Code:
 
-(require 'compat-macs "compat-macs.el")
+(eval-when-compile (load "compat-macs.el" nil t t))
 
 (compat-declare-version "26.1")
 
diff --git a/compat-27.el b/compat-27.el
index e630bb9677..0687dc826f 100644
--- a/compat-27.el
+++ b/compat-27.el
@@ -39,7 +39,7 @@
 
 ;;; Code:
 
-(require 'compat-macs "compat-macs.el")
+(eval-when-compile (load "compat-macs.el" nil t t))
 
 (compat-declare-version "27.1")
 
diff --git a/compat-28.el b/compat-28.el
index a3dc769341..5ce1073830 100644
--- a/compat-28.el
+++ b/compat-28.el
@@ -39,7 +39,7 @@
 
 ;;; Code:
 
-(require 'compat-macs "compat-macs.el")
+(eval-when-compile (load "compat-macs.el" nil t t))
 
 (compat-declare-version "28.1")
 
diff --git a/compat-29.el b/compat-29.el
index 65a300c78f..f7747b7434 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -33,7 +33,7 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'compat-macs))
+(eval-when-compile (load "compat-macs.el" nil t t))
 
 (compat-declare-version "29.1")
 



[elpa] externals/compat 9ab3081959 26/84: Add string-pixel-width from Emacs 29

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 9ab3081959fd47d368e216c41c4f6d6875fd095b
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Add string-pixel-width from Emacs 29
---
 compat-29.el | 12 
 compat.texi  | 35 +++
 2 files changed, 47 insertions(+)

diff --git a/compat-29.el b/compat-29.el
index 757f9e76ee..4389289105 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -311,5 +311,17 @@ than this function."
  (end (substring string (- (length string) length)))
  (t (substring string 0 length)
 
+;;* UNTESTED
+(compat-defun string-pixel-width (string)
+  "Return the width of STRING in pixels."
+  (if (zerop (length string))
+  0
+;; Keeping a work buffer around is more efficient than creating a
+;; new temporary buffer.
+(with-current-buffer (get-buffer-create " *string-pixel-width*")
+  (delete-region (point-min) (point-max))
+  (insert string)
+  (car (compat--buffer-text-pixel-size nil nil t)
+
 (provide 'compat-29)
 ;;; compat-29.el ends here
diff --git a/compat.texi b/compat.texi
index c1e61be279..f19c884df5 100644
--- a/compat.texi
+++ b/compat.texi
@@ -2446,6 +2446,41 @@ optional @code{buffer-list} argument.  Optional third 
argument
 @xref{Buffer List,,,elisp}.
 @end defun
 
+@c copied from lispref/display.texi
+@defun string-pixel-width string
+This is a convenience function that uses @code{window-text-pixel-size}
+to compute the width of @var{string} (in pixels).
+
+@xref{Size of Displayed Text,,,elisp}.
+@end defun
+
+@c copied from lispref/display.texi
+@defun string-glyph-split string
+When character compositions are in effect, sequence of characters can
+be composed for display to form @emph{grapheme clusters}, for example
+to display accented characters, or ligatures, or Emoji, or when
+complex text shaping requires that for some scripts.  When that
+happens, characters no longer map in a simple way to display columns,
+and display layout decisions with such strings, such as truncating too
+wide strings, can be a complex job.  This function helps in performing
+suvh jobs: it splits up its argument @var{string} into a list of
+substrings, where each substring produces a single grapheme cluster
+that should be displayed as a unit.  Lisp programs can then use this
+list to construct visually-valid substrings of @var{string} which will
+look correctly on display, or compute the width of any substring of
+@var{string} by adding the width of its constituents in the returned
+list, etc.
+
+For instance, if you want to display a string without the first glyph,
+you can say:
+
+@example
+(apply #'insert (cdr (string-glyph-split string
+@end example
+
+@xref{Size of Displayed Text,,,elisp}.
+@end defun
+
 
 
 @subsection Prefixed Definitions



[elpa] externals/compat bb25d50b6c 78/84: Fix test skip condition for 'compat-ref-define-key'

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit bb25d50b6c9f231a777616dbad10beeaea955922
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Fix test skip condition for 'compat-ref-define-key'

We want to test it from Emacs 29 onwards, not any version newer than
Emacs 29.
---
 compat-tests.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compat-tests.el b/compat-tests.el
index cee5e63deb..6cc5ed9c1a 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -2401,7 +2401,7 @@ being compared against."
 
 (ert-deftest compat-ref-define-key ()
   "Check if the real `define-key' handles the REMOVE argument."
-  (skip-unless (version<= "29" emacs-version))
+  (skip-unless (version< "29" emacs-version))
   (let ((map (make-sparse-keymap))
 (super (make-sparse-keymap)))
 (set-keymap-parent map super)



[elpa] externals/compat 4bd1226048 59/84: Rewrite take to copy only as much as required

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 4bd12260483fde4e8d06d12e2986befb302fad44
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Rewrite take to copy only as much as required
---
 compat-29.el | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/compat-29.el b/compat-29.el
index a492fe1001..64aa3a78d7 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -106,7 +106,11 @@ Otherwise, return LIST after truncating it."
   "Return the first N elements of LIST.
 If N is zero or negative, return nil.
 If N is greater or equal to the length of LIST, return LIST (or a copy)."
-  (compat--ntake-elisp n (copy-sequence list)))  ;FIXME: only copy as much 
as necessary
+  (let (copy)
+(while (and (< 0 n) list)
+  (push (pop list) copy)
+  (setq n (1- n)))
+(nreverse copy)))
 
 (compat-defun string-equal-ignore-case (string1 string2)
   "Like `string-equal', but case-insensitive.



[elpa] externals/compat 7e4533ab45 65/84: Add compatibility notices to the end of the docstring

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 7e4533ab4558ee4417db44fa6bab868d61fffa92
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Add compatibility notices to the end of the docstring

This is done to avoid hidden overlong documentation strings without
folding the first line of the documentation string.

In addition to that, references to the Compat manual are inserted if
possible.
---
 .dir-locals.el |  1 -
 compat-macs.el | 25 ++---
 2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/.dir-locals.el b/.dir-locals.el
index 900dee5f90..6d22de33f5 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -2,6 +2,5 @@
 ;;; For more information see (info "(emacs) Directory Variables")
 
 ((emacs-lisp-mode
-  (byte-compile-docstring-max-column . 100)
   (show-trailing-whitespace . t)
   (indent-tabs-mode . nil)))
diff --git a/compat-macs.el b/compat-macs.el
index fa0f6ea74a..2e8b38e74e 100644
--- a/compat-macs.el
+++ b/compat-macs.el
@@ -193,13 +193,24 @@ attributes (see `compat-generate-common')."
((eq type 'macro) "macro")
((eq type 'advice) "advice")
((error "Unknown type")
-(if version
-(format
- "[Compatibility %s for `%S', defined in Emacs %s]\n\n%s"
- type oldname version docstring)
-  (format
-   "[Compatibility %s for `%S']\n\n%s"
-   type oldname docstring)))
+(with-temp-buffer
+  (insert docstring)
+  (newline 2)
+  (insert
+   "[Compatibility "
+   (if version
+   (format
+"%s for `%S', defined in Emacs %s.  \
+If this is not documented on your system, you can check \
+`(compat) Emacs %s' for more details."
+ type oldname version version)
+ (format
+  "code %s for `%S'"
+  type oldname))
+   "]")
+  (let ((fill-column 80))
+(fill-region (point-min) (point-max)))
+  (buffer-string)))
  ;; Advice may use the implicit variable `oldfun', but
  ;; to avoid triggering the byte compiler, we make
  ;; sure the argument is used at least once.



[elpa] externals/compat a660d13326 75/84: Add while-let from Emacs 29

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit a660d133266ed981fd165ad6e9b23fdd9dcd514f
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Add while-let from Emacs 29
---
 compat-29.el| 19 +
 compat-tests.el | 63 +
 compat.texi |  8 
 3 files changed, 90 insertions(+)

diff --git a/compat-29.el b/compat-29.el
index 493f75fa4e..a47037ec07 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -486,6 +486,25 @@ this defaults to the current buffer."
   (put-text-property sub-start sub-end 'display disp)))
   (setq sub-start sub-end
 
+(compat-defmacro while-let (spec &rest body)
+  "Bind variables according to SPEC and conditionally evaluate BODY.
+Evaluate each binding in turn, stopping if a binding value is nil.
+If all bindings are non-nil, eval BODY and repeat.
+
+The variable list SPEC is the same as in `if-let'."
+  (declare (indent 1) (debug if-let))
+  (let ((empty (make-symbol "s"))
+(last t) list)
+(dolist (var spec)
+  (push `(,(if (cdr var) (car var) empty)
+  (and ,last ,(if (cdr var) (cadr var) (car var
+list)
+  (when (or (cdr var) (consp (car var)))
+(setq last (caar list
+`(while (let* ,(nreverse list)
+  (and ,(caar list)
+   (progn ,(macroexp-progn (or body '(t))) t))
+
  Defined in files.el
 
 (compat-defun file-parent-directory (filename)
diff --git a/compat-tests.el b/compat-tests.el
index 5c5c4f2df0..38fcc724b9 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -2135,5 +2135,68 @@ being compared against."
 (should (eq (lookup-key map "a") nil))
 (should (eq (lookup-key super "a") nil
 
+(ert-deftest compat-ref-while-let ()
+  "Check if the real `while-let' behaves as expected."
+  (skip-unless (fboundp 'while-let))
+  ;; Basic test
+  (let ((list (list 1 2 3 4 5)))
+(while-let ((one (pop list))
+(two (pop list)))
+  (should one)
+  (should two)
+  (should (< one two)))
+(should (null list)))
+  ;; Practical test
+  (with-temp-buffer
+(insert "1 2 3 4 1 2 3 4 1 2 3 4")
+(goto-char (point-min))
+(let ((count 0))
+  (while-let (((search-forward-regexp "2" nil t))
+  (match (match-string 0))
+  ((string= match "2")))
+(setq count (1+ count)))
+  (should (= count 3
+  ;; Edge cases
+  (catch 'break
+(while-let ()
+  (throw 'break (should t
+  (while-let ((()))
+(should nil))
+  (while-let ((test nil))
+(should nil))
+  (while-let (((ignore)))
+(should nil)))
+
+(ert-deftest compat-impl-while-let ()
+  "Check if the compat `while-let' behaves as expected."
+  ;; Basic test
+  (let ((list (list 1 2 3 4 5)))
+(compat--while-let ((one (pop list))
+(two (pop list)))
+  (should one)
+  (should two)
+  (should (< one two)))
+(should (null list)))
+  ;; Practical test
+  (with-temp-buffer
+(insert "1 2 3 4 1 2 3 4 1 2 3 4")
+(goto-char (point-min))
+(let ((count 0))
+  (compat--while-let (((search-forward-regexp "2" nil t))
+  (match (match-string 0))
+  ((string= match "2")))
+(setq count (1+ count)))
+  (should (= count 3
+  ;; Edge cases
+  (catch 'break
+(compat--while-let ()
+  (throw 'break (should t
+  (compat--while-let ((()))
+(should nil))
+  (compat--while-let ((test nil))
+(should nil))
+  (compat--while-let (((ignore)))
+(should nil)))
+
 (provide 'compat-tests)
 ;;; compat-tests.el ends here
diff --git a/compat.texi b/compat.texi
index da6cee008b..c488bb7d12 100644
--- a/compat.texi
+++ b/compat.texi
@@ -2825,6 +2825,14 @@ Here's an example:
 @end lisp
 @end defun
 
+@c copied from lispref/control.texi
+@defmac while-let spec then-forms...
+Like @code{when-let}, but repeat until a binding in @var{spec} is
+@code{nil}.  The return value is always @code{nil}.
+
+This is comparable to @code{and-let*}.
+@end defmac
+
 @subsection Prefixed Definitions
 These functions are prefixed with @code{compat} prefix, and will require
 manual loading even after the release of Compat 29.1.0.0:



[elpa] externals/compat 8fbc3b6ea6 69/84: Bump to version 28.1.2.2

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 8fbc3b6ea653c337a768c0244a9c35fd2bdc4ccc
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Bump to version 28.1.2.2
---
 NEWS.org| 6 ++
 compat.el   | 2 +-
 compat.texi | 6 +++---
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/NEWS.org b/NEWS.org
index dee10ae9f1..abb3448dd9 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -1,6 +1,12 @@
 #+options: toc:nil num:nil
 #+link:compat https://todo.sr.ht/~pkal/compat/
 
+* Release of "Compat" Version 28.1.2.2
+
+This is a minor release that hopes to address [[compat:7]].
+
+(Release <2022-08-25 Thu>)
+
 * Release of "Compat" Version 28.1.2.1
 
 This is a minor release adding the following changes:
diff --git a/compat.el b/compat.el
index 334c4237a5..fe634e7a68 100644
--- a/compat.el
+++ b/compat.el
@@ -4,7 +4,7 @@
 
 ;; Author: Philip Kaludercic 
 ;; Maintainer: Compat Development <~pkal/compat-de...@lists.sr.ht>
-;; Version: 28.1.2.1
+;; Version: 28.1.2.2
 ;; URL: https://sr.ht/~pkal/compat
 ;; Package-Requires: ((emacs "24.3") (nadvice "0.3"))
 ;; Keywords: lisp
diff --git a/compat.texi b/compat.texi
index efc622bd54..da6cee008b 100644
--- a/compat.texi
+++ b/compat.texi
@@ -31,7 +31,7 @@ modify this GNU manual.”
 @finalout
 @titlepage
 @title "Compat" Manual
-@subtitle For version 28.1.2.1
+@subtitle For version 28.1.2.2
 @author Philip Kaludercic
 @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 28.1.2.1.
+version 28.1.2.2.
 
 @insertcopying
 @end ifnottex
@@ -124,7 +124,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.3") (compat "28.1.2.1"))
+;; Package-Requires: ((emacs "24.3") (compat "28.1.2.2"))
 @end example
 
 There is no need to depend on @code{emacs} 24.3 specifically.  One can



[elpa] externals/compat 6aad62a6b8 77/84: Split plain unit tests into "ref" (real) and "impl" (compat) tests

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 6aad62a6b84d5db515c8a30299bf26aaee0e14db
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Split plain unit tests into "ref" (real) and "impl" (compat) tests
---
 compat-tests.el | 635 +---
 1 file changed, 464 insertions(+), 171 deletions(-)

diff --git a/compat-tests.el b/compat-tests.el
index e19c5905a9..cee5e63deb 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -355,7 +355,7 @@ being compared against."
   (ought t 1)  ;single argument
   (ought t 1 2 3 4))  ;multiple arguments
 
-(ert-deftest compat-insert-into-buffer-1 ()
+(ert-deftest compat-impl-insert-into-buffer-1 ()
   "Check if `insert-into-buffer' can handle no optional argument."
   (with-temp-buffer
 (let ((other (current-buffer)))
@@ -363,17 +363,20 @@ being compared against."
   (with-temp-buffer
(insert "def")
(compat--insert-into-buffer other))
-  (should (string= (buffer-string) "abcdef"
-  (when (fboundp 'insert-into-buffer)
-(with-temp-buffer
-  (let ((other (current-buffer)))
-   (insert "abc")
-   (with-temp-buffer
- (insert "def")
- (insert-into-buffer other))
-   (should (string= (buffer-string) "abcdef"))
-
-(ert-deftest compat-insert-into-buffer-2 ()
+  (should (string= (buffer-string) "abcdef")
+
+(ert-deftest compat-ref-insert-into-buffer-1 ()
+  "Check if `insert-into-buffer' can handle no optional argument."
+  (skip-unless (fboundp 'insert-into-buffer))
+  (with-temp-buffer
+(let ((other (current-buffer)))
+  (insert "abc")
+  (with-temp-buffer
+(insert "def")
+(insert-into-buffer other))
+  (should (string= (buffer-string) "abcdef")
+
+(ert-deftest compat-impl-insert-into-buffer-2 ()
   "Check if `insert-into-buffer' handles one optional argument."
   (with-temp-buffer
 (let ((other (current-buffer)))
@@ -381,17 +384,20 @@ being compared against."
   (with-temp-buffer
(insert "def")
(compat--insert-into-buffer other 2))
-  (should (string= (buffer-string) "abcef"
-  (when (fboundp 'insert-into-buffer)
-(with-temp-buffer
-  (let ((other (current-buffer)))
-   (insert "abc")
-   (with-temp-buffer
- (insert "def")
- (insert-into-buffer other 2))
-   (should (string= (buffer-string) "abcef"))
-
-(ert-deftest compat-insert-into-buffer-3 ()
+  (should (string= (buffer-string) "abcef")
+
+(ert-deftest compat-ref-insert-into-buffer-2 ()
+  "Check if `insert-into-buffer' handles one optional argument."
+  (skip-unless (fboundp 'insert-into-buffer))
+  (with-temp-buffer
+(let ((other (current-buffer)))
+  (insert "abc")
+  (with-temp-buffer
+(insert "def")
+(insert-into-buffer other 2))
+  (should (string= (buffer-string) "abcef")
+
+(ert-deftest compat-impl-insert-into-buffer-3 ()
   "Check if `insert-into-buffer' handles two optional arguments."
   (with-temp-buffer
 (let ((other (current-buffer)))
@@ -399,15 +405,18 @@ being compared against."
   (with-temp-buffer
(insert "def")
(compat--insert-into-buffer other 2 3))
-  (should (string= (buffer-string) "abce"
-  (when (fboundp 'insert-into-buffer)
-(with-temp-buffer
-  (let ((other (current-buffer)))
-   (insert "abc")
-   (with-temp-buffer
- (insert "def")
- (insert-into-buffer other 2 3))
-   (should (string= (buffer-string) "abce"))
+  (should (string= (buffer-string) "abce")
+
+(ert-deftest compat-ref-insert-into-buffer-3 ()
+  "Check if `insert-into-buffer' handles two optional arguments."
+  (skip-unless (fboundp 'insert-into-buffer))
+  (with-temp-buffer
+(let ((other (current-buffer)))
+  (insert "abc")
+  (with-temp-buffer
+(insert "def")
+(insert-into-buffer other 2 3))
+  (should (string= (buffer-string) "abce")
 
 (compat-deftests file-name-with-extension
   (ought "file.ext" "file" "ext")
@@ -524,15 +533,22 @@ being compared against."
   (ought 3 "a" "あ" t) ;byte example
   (ought 1 "a" "あ"))
 
-(ert-deftest compat-regexp-unmatchable ()
-  "Check if `compat--string-distance' was implemented correctly."
+(ert-deftest compat-impl-regexp-unmatchable ()
+  "Check if the real `regexp-unmatchable' works as assumed."
   (dolist (str '("" ;empty string
  "a";simple string
  "aaa"  ;longer string
  ))
-(should-not (string-match-p (with-no-warnings compat--regexp-unmatchable) 
str))
-(when (boundp 'regexp-unmatchable)
-  (should-not (string-match-p regexp-unmatchable str)
+(should-not (string-match-p (with-no-warnings compat--regexp-unmatchable) 
str
+
+(ert-deftest compat-ref-regexp-unmatchable ()
+  "Check if the compat `regexp-unmatchable' works as expected."
+  (ski

[elpa] externals/compat 5c0c55c20d 47/84: Document missing functionality from compat-29

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 5c0c55c20d0d927bb6924c38eb390f7c8454485c
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Document missing functionality from compat-29
---
 compat.texi | 13 +
 1 file changed, 13 insertions(+)

diff --git a/compat.texi b/compat.texi
index 71ce879e79..1c9f1fea94 100644
--- a/compat.texi
+++ b/compat.texi
@@ -2882,6 +2882,19 @@ This compatibility version handles the optional argument
 @subsection Missing Definitions
 Compat does not provide support for the following Lisp features
 implemented in 29.1:
+
+@itemize
+@item
+The command @code{string-edit} and @code{read-string-from-buffer}.
+@item
+The function @code{readablep}.
+@item
+The macro @code{with-delayed-message} and the function
+@code{funcall-with-delayed-message}.
+@item
+The function @code{string-glyph-split}.
+@end itemize
+
 @node Development
 @chapter Development
 



[elpa] externals/compat 6ac6ed2a99 36/84: Use make-symbol instead of gensym in function-alias-p tests

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 6ac6ed2a9913f28568257355cfbbb2917e2682c8
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Use make-symbol instead of gensym in function-alias-p tests
---
 compat-tests.el | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/compat-tests.el b/compat-tests.el
index db9a0e76d7..7a4c0e264f 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -1859,9 +1859,11 @@ being compared against."
   (expect wrong-type-argument 'a 2)
   (expect wrong-type-argument 'a 'b))
 
-(let* ((f (gensym))
-   (g (gensym)) (h (gensym))
-   (a (gensym)) (b (gensym)))
+(let* ((f (make-symbol "f"))
+   (g (make-symbol "g"))
+   (h (make-symbol "h"))
+   (a (make-symbol "a"))
+   (b (make-symbol "b")))
   (defalias f #'ignore)
   (defalias g f)
   (defalias h g)



[elpa] externals/compat ded0f01036 40/84: Revert "Fix gv-expander for compat-alist-get"

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit ded0f0103682da31e653a24d6c21a83e9767d315
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Revert "Fix gv-expander for compat-alist-get"

This reverts commit b98e7cc868020a4ede2f330b73bd5aaead147cfd.
---
 compat-26.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/compat-26.el b/compat-26.el
index a7dcf2e7b1..a21b903b93 100644
--- a/compat-26.el
+++ b/compat-26.el
@@ -123,7 +123,6 @@ Equality is defined by the function TESTFN, defaulting to
 `equal'.  TESTFN is called with 2 arguments: a car of an alist
 element and KEY.  With no optional argument, the function behaves
 just like `assoc'."
-  :realname compat--assoc-handle-testfn
   :prefix t
   (if testfn
   (catch 'found
@@ -170,7 +169,7 @@ from the absolute start of the buffer, disregarding the 
narrowing."
 (macroexp-let2 macroexp-copyable-p k key
   (gv-letplace (getter setter) alist
 (macroexp-let2 nil p `(if (and ,testfn (not (eq ,testfn 'eq)))
-  (compat--assoc-handle-testfn ,k ,getter 
,testfn)
+  (compat-assoc ,k ,getter ,testfn)
 (assq ,k ,getter))
   (funcall do (if (null default) `(cdr ,p)
 `(if ,p (cdr ,p) ,default))



[elpa] externals/compat c0d5634570 80/84: Simplify loading procedure

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit c0d5634570d65bce07c8fb60e5b29106c379fc43
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Simplify loading procedure

Instead of modifying the name of the file we pass to 'load', we modify
the order of contents in 'load-suffixes' and ensure that .el files are
preferred over .elc files, thus preventing that the macro-expanded
files are used, which prevents definitions form being loaded.
---
 compat-tests.el |  1 +
 compat.el   | 10 --
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/compat-tests.el b/compat-tests.el
index 6cc5ed9c1a..2733a48b95 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -60,6 +60,7 @@ DEF-FN, INSTALL-FN, CHECK-FN, ATTR and TYPE."
 
 (defvar compat-testing)
 (let ((compat--generate-function #'compat--generate-testable)
+  (load-suffixes '(".el" ".elc"))
   (compat-testing t))
   (load "compat.el"))
 
diff --git a/compat.el b/compat.el
index ab490cbc98..ba2855fc39 100644
--- a/compat.el
+++ b/compat.el
@@ -47,12 +47,10 @@
   ;; the file (which is disabled by `compat--inhibit-prefixed', so
   ;; that the file can be loaded again at some later point when the
   ;; prefixed definitions are needed).
-  (dolist (vers '(24 25 26 27 28 29))
-(unless (memq (intern (format "compat-%d" vers)) features)
-  (load (format "compat-%d%s" vers
-(if (bound-and-true-p compat-testing)
-".el" ""))
-nil t
+  (dolist (version '(24 25 26 27 28 29))
+(let ((feature-name (format "compat-%d" version)))
+  (unless (memq (intern feature-name) features)
+(load feature-name nil t)
 
 (provide 'compat)
 ;;; compat.el ends here



[elpa] externals/compat e96cd14210 72/84: Have Makefile targets rebuild .elc files not .el

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit e96cd14210b9102fc82135ec50bcd86cb6324d05
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Have Makefile targets rebuild .elc files not .el
---
 Makefile | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index 81f0334930..f96d21bb24 100644
--- a/Makefile
+++ b/Makefile
@@ -25,13 +25,13 @@ test: compile
 clean:
$(RM) $(BYTEC) compat.info
 
-compat-24.el:  compat-macs.el
-compat-25.el:  compat-macs.el
-compat-26.el:  compat-macs.el
-compat-27.el:  compat-macs.el
-compat-28.el:  compat-macs.el
-compat-29.el:  compat-macs.el
-compat-font-lock.el: compat-macs.el
+compat-24.elc: compat-macs.el
+compat-25.elc: compat-macs.el
+compat-26.elc: compat-macs.el
+compat-27.elc: compat-macs.el
+compat-28.elc: compat-macs.el
+compat-29.elc: compat-macs.el
+compat-font-lock.elc: compat-macs.el
 
 .el.elc:
$(EMACS) -Q --batch -L . -f batch-byte-compile $<



[elpa] externals/compat 933d6fdf80 24/84: Add buffer-match-p from Emacs 29

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 933d6fdf8086ff5908df6daa556ab14eb029e183
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Add buffer-match-p from Emacs 29
---
 compat-29.el | 57 +
 compat.texi  | 45 +
 2 files changed, 102 insertions(+)

diff --git a/compat-29.el b/compat-29.el
index 0e03b1fc01..cf1ed41404 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -193,6 +193,63 @@ signalled.  If NOERROR, the non-loop parts of the chain is 
returned."
  (push func chain))
chain
 
+;;* UNTESTED
+(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,
+- the symbol nil, which never matches,
+- a regular expression, to match a buffer name,
+- a predicate function that takes a buffer object and ARG as
+  arguments, and returns non-nil if the buffer matches,
+- a cons-cell, where the car describes how to interpret the cdr.
+  The car can be one of the following:
+  * `derived-mode': the buffer matches if the buffer's major mode
+is derived from the major mode in the cons-cell's cdr.
+  * `major-mode': the buffer matches if the buffer's major mode
+is eq to the cons-cell's cdr.  Prefer using `derived-mode'
+instead when both can work.
+  * `not': the cdr is interpreted as a negation of a condition.
+  * `and': the cdr is a list of recursive conditions, that all have
+to be met.
+  * `or': the cdr is a list of recursive condition, of which at
+least one has to be met."
+  :realname compat--buffer-match-p
+  (letrec
+  ((buffer (get-buffer buffer-or-name))
+   (match
+(lambda (conditions)
+  (catch 'match
+(dolist (condition conditions)
+  (when (cond
+ ((eq condition t))
+ ((stringp condition)
+  (string-match-p condition (buffer-name buffer)))
+ ((functionp condition)
+  (if (eq 1 (cdr (func-arity condition)))
+  (funcall condition buffer)
+(funcall condition buffer arg)))
+ ((eq (car-safe condition) 'major-mode)
+  (eq
+   (buffer-local-value 'major-mode buffer)
+   (cdr condition)))
+ ((eq (car-safe condition) 'derived-mode)
+  (provided-mode-derived-p
+   (buffer-local-value 'major-mode buffer)
+   (cdr condition)))
+ ((eq (car-safe condition) 'not)
+  (not (funcall match (cdr condition
+ ((eq (car-safe condition) 'or)
+  (funcall match (cdr condition)))
+ ((eq (car-safe condition) 'and)
+  (catch 'fail
+(dolist (c (cdr conditions))
+  (unless (funcall match c)
+(throw 'fail nil)))
+t)))
+(throw 'match t)))
+(funcall match (list condition
+
  Defined in subr-x.el
 
 (compat-defun string-limit (string length &optional end coding-system)
diff --git a/compat.texi b/compat.texi
index 77df3082a1..75da790901 100644
--- a/compat.texi
+++ b/compat.texi
@@ -2388,6 +2388,51 @@ differences, like @code{char-equal} when 
@code{case-fold-search} is
 @xref{Text Comparison,,,elisp}.
 @end defun
 
+@c copied from lispref/buffers.texi
+@defun buffer-match-p condition buffer-or-name &optional arg
+This function checks if a buffer designated by @code{buffer-or-name}
+satisfies a @code{condition}.  Optional third argument @var{arg} is
+passed to the predicate function in @var{condition}.  A condition can
+be one of the following:
+@itemize @bullet{}
+@item
+A string, interpreted as a regular expression.  The buffer
+satisfies the condition if the regular expression matches the buffer
+name.
+@item
+A predicate function, which should return non-@code{nil} if the buffer
+matches.  If the function expects one argument, it is called with
+@var{buffer-or-name} as the argument; if it expects 2 arguments, the
+first argument is @var{buffer-or-name} and the second is @var{arg}
+(or @code{nil} if @var{arg} is omitted).
+@item
+A cons-cell @code{(@var{oper} . @var{expr})} where @var{oper} is one
+of
+@table @code
+@item not
+Satisfied if @var{expr} doesn't satisfy @code{buffer-match-p} with
+the same buffer and @code{arg}.
+@item or
+Satisfied if @var{expr} is a list and @emph{any} condition in
+@var{expr} satisfies @code{buffer-match-p}, with the same buffer and
+@code{arg}.
+@item and
+Satisfied if @var{expr} is a list and @emph{all} conditions in
+@var{expr} satisfy @code{buffer-match-p}, with the same buffer and
+@code{arg}.
+@item derived-mode
+Satisfied if the buffer's majo

[elpa] externals/compat a4036f9b1b 01/84: Prepare Emacs 29.1 compatibility

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit a4036f9b1bad600678b4d3f41efe8a95ef202809
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Prepare Emacs 29.1 compatibility
---
 Makefile   |  1 +
 compat-29.1.el | 36 
 compat.el  |  1 +
 3 files changed, 38 insertions(+)

diff --git a/Makefile b/Makefile
index b9a6e8b4b6..f0fe9ec7dd 100644
--- a/Makefile
+++ b/Makefile
@@ -10,6 +10,7 @@ BYTEC = compat-help.elc \
compat-26.1.elc \
compat-27.1.elc \
compat-28.1.elc \
+   compat-29.1.elc \
compat.elc
 
 all: compile test
diff --git a/compat-29.1.el b/compat-29.1.el
new file mode 100644
index 00..d7eecce9be
--- /dev/null
+++ b/compat-29.1.el
@@ -0,0 +1,36 @@
+;;; compat-29.1.el --- Compatibility Layer for Emacs 29.1  -*- 
lexical-binding: t; -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; Author: Philip Kaludercic 
+;; Keywords: lisp
+
+;; 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:
+
+;; Find here the functionality added in Emacs 29.1, needed by older
+;; versions.
+;;
+;; Do NOT load this library manually.  Instead require `compat'.
+
+;;; Code:
+
+(eval-when-compile (require 'compat-macs))
+(declare-function compat-maxargs-/= "compat" (func n))
+
+
+
+(provide 'compat-29.1)
+;;; compat-29.1.el ends here
diff --git a/compat.el b/compat.el
index d3f2e50a71..52712f2502 100644
--- a/compat.el
+++ b/compat.el
@@ -146,6 +146,7 @@ advice."
 (require 'compat-26.1)
 (require 'compat-27.1)
 (require 'compat-28.1)
+(require 'compat-29.1)
 
  Etcetera
 



[elpa] externals/compat dd334e5616 04/84: Add function-alias-p

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit dd334e5616d794f9c761402fa77686d342ef790f
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Add function-alias-p
---
 compat-29.1.el  | 26 +-
 compat-tests.el | 21 +
 2 files changed, 46 insertions(+), 1 deletion(-)

diff --git a/compat-29.1.el b/compat-29.1.el
index 3564270d81..507219b27b 100644
--- a/compat-29.1.el
+++ b/compat-29.1.el
@@ -30,6 +30,30 @@
 (eval-when-compile (require 'compat-macs))
 (declare-function compat-maxargs-/= "compat" (func n))
 
+ Defined in subr.el
+
+(compat-defun function-alias-p (func &optional noerror)
+  "Return nil if FUNC is not a function alias.
+If FUNC is a function alias, return the function alias chain.
+
+If the function alias chain contains loops, an error will be
+signalled.  If NOERROR, the non-loop parts of the chain is returned."
+  (declare (side-effect-free t))
+  (let ((chain nil)
+(orig-func func))
+(nreverse
+ (catch 'loop
+   (while (and (symbolp func)
+   (setq func (symbol-function func))
+   (symbolp func))
+ (when (or (memq func chain)
+   (eq func orig-func))
+   (if noerror
+   (throw 'loop chain)
+ (signal 'cyclic-function-indirection (list orig-func
+ (push func chain))
+   chain
+
  Defined in subr-x.el
 
 (compat-defun string-limit (string length &optional end coding-system)
@@ -51,7 +75,7 @@ character.
 When shortening strings for display purposes,
 `truncate-string-to-width' is almost always a better alternative
 than this function."
-  :feature subr-x
+  :feature 'subr-x
   (unless (natnump length)
 (signal 'wrong-type-argument (list 'natnump length)))
   (if coding-system
diff --git a/compat-tests.el b/compat-tests.el
index 4a4ab25a27..20dd733aad 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -1361,6 +1361,27 @@ the compatibility function."
 (compat--error wrong-type-argument 'a 2)
 (compat--error wrong-type-argument 'a 'b)))
 
+(ert-deftest compat-function-alias-p ()
+  "Check if `compat--function-alias-p' was implemented properly."
+  (let* ((f (gensym))
+ (g (gensym)) (h (gensym))
+ (a (gensym)) (b (gensym)))
+(defalias f #'ignore)
+(defalias g f)
+(defalias h g)
+(defalias a b)
+(defalias b a)
+
+(compat-test function-alias-p
+  (compat--should nil nil)
+  (compat--should nil "")
+  (compat--should nil #'ignore)
+  (compat--should nil #'ignore)
+  (compat--should (list #'ignore) f)
+  (compat--should (list f #'ignore) g)
+  (compat--should (list g f #'ignore) h)
+  (compat--error cyclic-function-indirection a)
+  (compat--should (list b) a t
 
 (provide 'compat-tests)
 ;;; compat-tests.el ends here



[elpa] externals/compat updated (1573aa2e6d -> be4595fec8)

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

  from  1573aa2e6d Fix @end for "@defun make-empty-file" in compat.texi
   new  a4036f9b1b Prepare Emacs 29.1 compatibility
   new  f21b114ec7 Add string-limit
   new  5a1f3bdc59 Merge branch 'master' into emacs-29.1
   new  dd334e5616 Add function-alias-p
   new  9083cfc4f6 Add get-display-property
   new  22b2634ada Compile compat-macs before anything else
   new  2ee63f46b2 Make compat-font-lock dependency on compat-macs explicit
   new  ae2bf0aee5 Merge branch 'master' into emacs-29.1
   new  5031a586a3 Add take and ntake defined in Emacs 29
   new  71ddb93f75 Merge branch 'master' into emacs-29
   new  87da1d984d Begin documenting Emacs 29 support
   new  e13ca90cd7 Rewrite legacy compat-test definitions
   new  3104c89c2d Test compat-string-trim instead of string-trim
   new  e6d279af18 Extend byte-compile-docstring-max-column to 100
   new  29dd29609a Prepare compat.el for testing functions from compat-29
   new  9b8799091c Add @subsection headers for Emacs 29.1 node
   new  c177ff5e83 Reuse ntake in take definition
   new  db53afa3a7 Add buffer-text-pixel-size from Emacs 29
   new  0de389aca6 Add string-equal-ignore-case from Emacs 29
   new  accc689c7e Remove nonsensical file-parent-directory test comment
   new  2e206a8304 Add prefixed plist-get from Emacs 29
   new  ff331f6c29 Add prefixed plist-put from Emacs 29
   new  9aac0f55d1 Add prefixed plist-member from Emacs 29
   new  933d6fdf80 Add buffer-match-p from Emacs 29
   new  e370f9b7e7 Add match-buffers from Emacs 29
   new  9ab3081959 Add string-pixel-width from Emacs 29
   new  d375504e3c Add with-buffer-unmodified-if-unchanged from Emacs 29
   new  4710da5fa7 Add file-parent-directory from Emacs 29
   new  8d17ffdd88 Add file-has-changed-p from Emacs 29
   new  c81333a6b0 Merge branch 'master' into emacs-29.1
   new  252d33e897 Fix incompatible function calls in compat-29
   new  8b3d3ea5c8 Merge branch 'master' into emacs-29.1
   new  9e0eb5b72f Add compat-declare-version to compat-29.el
   new  fdae099b00 Move if-let and related function from subr-x to subr
   new  f42ebfaf97 Use compat--directory-name-p instead of directory-name-p
   new  6ac6ed2a99 Use make-symbol instead of gensym in function-alias-p 
tests
   new  bb86f3aa3b Simplify compat--generate-testable
   new  ef5246cf55 Fix issues related to 'expect' tests
   new  b98e7cc868 Fix gv-expander for compat-alist-get
   new  ded0f01036 Revert "Fix gv-expander for compat-alist-get"
   new  282f2dc6a7 Call install-fn in compat--generate-testable
   new  4a56adbcdf Remove references to the deleted "Emacs 24.5" node
   new  3f3f2e44d5 Split compat-insert-into-buffer into multiple tests
   new  878221eabd Update the commentary section for compat-29
   new  145d344d37 Add prefixed define-key from Emacs 29.1
   new  0e4da35d72 Add functions and macros from keymap.el
   new  5c0c55c20d Document missing functionality from compat-29
   new  0a84a7c219 Add add-display-text-property from Emacs 29
   new  26cf72e36a Explicitly denote subr-x functions with :feature
   new  0c14c42bc1 Copy edebug specifications instead of referencing
   new  11c9917215 Declare alist-get for usage in compat-alist-get
   new  faeeebe50b Remove unused local variable in file-name-absolute-p
   new  b888c2fb49 Replace when-let with expansions in compat-29
   new  97cecbc1c0 Replace seq-into with concrete implementations in 
compat-29
   new  b4f38aa5ab Copy if-let/if-let* definitions into if-let/when-let
   new  9e14c2f2df Remove realname for if-let
   new  c96aa66fb4 Remove realname for if-let*
   new  518067a7d6 Copy edebug specification for and-let* from if-let*
   new  4bd1226048 Rewrite take to copy only as much as required
   new  59cd42a912 Generate test names without double-dashes
   new  b0f8f6eaac Remove realname for ntake
   new  835b4301b4 Add 'pure' and 'side-effect-free' properties to take
   new  e7413bcf2b Document additional missing functions from compat-29
   new  45028d9fa7 Merge branch 'master' into emacs-29.1
   new  7e4533ab45 Add compatibility notices to the end of the docstring
   new  8e397fee78 Ignore all .patch files
   new  3bd425a0d6 Prevent compat-macs.el from being byte compiled
   new  68c6ccd5cc Always load compat-macs
   new  8fbc3b6ea6 Bump to version 28.1.2.2
   new  2ad7057293 Always load compat-macs.el while compiling
   new  59e50fc7f4 Remove compat-macs.el from the list of files to 
byte-compile
   new  e96cd14210 Have Makefile targets rebuild .elc files not .el
   new  54565a768c Abbreviate Makefile by re-using BYTEC
   new  661ba3a441 Use 'equal' instead of 'file-equal-p'
   new  a660d13326 Add while-let from Emacs 29
 

[elpa] externals/compat f21b114ec7 02/84: Add string-limit

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit f21b114ec784ad799355dec8e7bc8a0cd1dba417
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Add string-limit
---
 compat-29.1.el  | 45 +
 compat-tests.el | 28 
 2 files changed, 73 insertions(+)

diff --git a/compat-29.1.el b/compat-29.1.el
index d7eecce9be..3564270d81 100644
--- a/compat-29.1.el
+++ b/compat-29.1.el
@@ -30,7 +30,52 @@
 (eval-when-compile (require 'compat-macs))
 (declare-function compat-maxargs-/= "compat" (func n))
 
+ Defined in subr-x.el
 
+(compat-defun string-limit (string length &optional end coding-system)
+  "Return a substring of STRING that is (up to) LENGTH characters long.
+If STRING is shorter than or equal to LENGTH characters, return the
+entire string unchanged.
+
+If STRING is longer than LENGTH characters, return a substring
+consisting of the first LENGTH characters of STRING.  If END is
+non-nil, return the last LENGTH characters instead.
+
+If CODING-SYSTEM is non-nil, STRING will be encoded before
+limiting, and LENGTH is interpreted as the number of bytes to
+limit the string to.  The result will be a unibyte string that is
+shorter than LENGTH, but will not contain \"partial\" characters,
+even if CODING-SYSTEM encodes characters with several bytes per
+character.
+
+When shortening strings for display purposes,
+`truncate-string-to-width' is almost always a better alternative
+than this function."
+  :feature subr-x
+  (unless (natnump length)
+(signal 'wrong-type-argument (list 'natnump length)))
+  (if coding-system
+  (let ((result nil)
+(result-length 0)
+(index (if end (1- (length string)) 0)))
+(while (let ((encoded (encode-coding-char
+   (aref string index) coding-system)))
+ (and (<= (+ (length encoded) result-length) length)
+  (progn
+(push encoded result)
+(setq result-length
+  (+ result-length (length encoded)))
+(setq index (if end (1- index)
+  (1+ index
+  (if end (> index -1)
+(< index (length string)
+  ;; No body.
+  )
+(apply #'concat (if end result (nreverse result
+(cond
+ ((<= (length string) length) string)
+ (end (substring string (- (length string) length)))
+ (t (substring string 0 length)
 
 (provide 'compat-29.1)
 ;;; compat-29.1.el ends here
diff --git a/compat-tests.el b/compat-tests.el
index dd5f462f17..ac33f96236 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -1334,5 +1334,33 @@ the compatibility function."
   (compat--should* 'foo (list a-map b-map) "x")
   (compat--should* 'bar (list b-map a-map) "x"
 
+(ert-deftest compat-string-limit ()
+  "Check if `compat-string-limit' was implemented properly."
+  (compat-test string-limit
+(compat--should "" "" 0)
+(compat--should "" "" 1)
+(compat--should "" "" 100)
+(compat--should "" "1234567890" 0)
+(compat--should "1" "1234567890" 1)
+(compat--should "12" "1234567890" 2)
+(compat--should "123456789" "1234567890" 9)
+(compat--should "1234567890" "1234567890" 10)
+(compat--should "1234567890" "1234567890" 11)
+(compat--should "1234567890" "1234567890" 20)
+(compat--should "a" "a\U00010f98z" 1)
+(compat--should "a𐾘" "a\U00010f98z" 2)
+(compat--should "a𐾘z" "a\U00010f98z" 3)
+(compat--should "a𐾘z" "a\U00010f98z" 4)
+(compat--should [] [1 2 3] 0)
+(compat--should [1] [1 2 3] 1)
+(compat--should [1 2] [1 2 3] 2)
+(compat--should [1 2 3] [1 2 3] 3)
+(compat--should [1 2 3] [1 2 3] 4)
+(compat--error wrong-type-argument "abc" -1)
+(compat--error wrong-type-argument "abc" 'a)
+(compat--error wrong-type-argument 'a 2)
+(compat--error wrong-type-argument 'a 'b)))
+
+
 (provide 'compat-tests)
 ;;; compat-tests.el ends here



[elpa] externals/compat 5a1f3bdc59 03/84: Merge branch 'master' into emacs-29.1

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 5a1f3bdc5904f9ac403b4d5838c968f780f2d753
Merge: f21b114ec7 edfc71a8b9
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Merge branch 'master' into emacs-29.1
---
 Makefile|   2 +-
 README.md   |   7 +
 compat-24.4.el  |  41 +++---
 compat-25.1.el  |  30 ++--
 compat-26.1.el  |  27 ++--
 compat-27.1.el  |  30 ++--
 compat-28.1.el  |  45 +++---
 compat-macs.el  | 133 +-
 compat-tests.el | 430 
 compat.el   |  32 +
 10 files changed, 379 insertions(+), 398 deletions(-)

diff --git a/Makefile b/Makefile
index f0fe9ec7dd..7148b2f7d9 100644
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,7 @@ test:
$(EMACS) -Q --batch -L . -l compat-tests.el -f 
ert-run-tests-batch-and-exit
 
 clean:
-   rm -f $(BYTEC)
+   $(RM) $(BYTEC)
 
 .el.elc:
$(EMACS) -Q --batch -L . -f batch-byte-compile $^
diff --git a/README.md b/README.md
index ccf80adc41..e7e1d3e957 100644
--- a/README.md
+++ b/README.md
@@ -22,6 +22,13 @@ loading `compat-help` (on your system, not in a package) to 
get
 relevant notes inserted into the help buffers of functions that are
 implemented or advised in compat.el.
 
+Note that compat.el provides a few prefixed function, ie. functions
+with a `compat-` prefix.  These are used to provide extended
+functionality for commands that are already defined (`sort`, `assoc`,
+...).  It might be possible to transform these into advised functions
+later on, so that the modified functionality is accessible without a
+prefix.  Feedback on this point is appreciated.
+
 Installation
 
 
diff --git a/compat-24.4.el b/compat-24.4.el
index 2d67ce6182..338513fbaa 100644
--- a/compat-24.4.el
+++ b/compat-24.4.el
@@ -28,56 +28,55 @@
 ;;; Code:
 
 (eval-when-compile (require 'compat-macs))
-(declare-function compat-maxargs-/= "compat" (func n))
 
  Defined in data.c
 
-(compat-advise = (number-or-marker &rest numbers-or-markers)
+(compat-defun = (number-or-marker &rest numbers-or-markers)
   "Handle multiple arguments."
-  :cond (compat-maxargs-/= #'= 'many)
+  :prefix t
   (catch 'fail
 (while numbers-or-markers
-  (unless (funcall oldfun number-or-marker (car numbers-or-markers))
+  (unless (= number-or-marker (car numbers-or-markers))
 (throw 'fail nil))
   (setq number-or-marker (pop numbers-or-markers)))
 t))
 
-(compat-advise < (number-or-marker &rest numbers-or-markers)
+(compat-defun < (number-or-marker &rest numbers-or-markers)
   "Handle multiple arguments."
-  :cond (compat-maxargs-/= #'= 'many)
+  :prefix t
   (catch 'fail
 (while numbers-or-markers
-  (unless (funcall oldfun number-or-marker (car numbers-or-markers))
+  (unless (< number-or-marker (car numbers-or-markers))
 (throw 'fail nil))
   (setq number-or-marker (pop numbers-or-markers)))
 t))
 
-(compat-advise > (number-or-marker &rest numbers-or-markers)
+(compat-defun > (number-or-marker &rest numbers-or-markers)
   "Handle multiple arguments."
-  :cond (compat-maxargs-/= #'= 'many)
+  :prefix t
   (catch 'fail
 (while numbers-or-markers
-  (unless (funcall oldfun number-or-marker (car numbers-or-markers))
+  (unless (> number-or-marker (car numbers-or-markers))
 (throw 'fail nil))
   (setq number-or-marker (pop numbers-or-markers)))
 t))
 
-(compat-advise <= (number-or-marker &rest numbers-or-markers)
+(compat-defun <= (number-or-marker &rest numbers-or-markers)
   "Handle multiple arguments."
-  :cond (compat-maxargs-/= #'= 'many)
+  :prefix t
   (catch 'fail
 (while numbers-or-markers
-  (unless (funcall oldfun number-or-marker (car numbers-or-markers))
+  (unless (<= number-or-marker (car numbers-or-markers))
 (throw 'fail nil))
   (setq number-or-marker (pop numbers-or-markers)))
 t))
 
-(compat-advise >= (number-or-marker &rest numbers-or-markers)
+(compat-defun >= (number-or-marker &rest numbers-or-markers)
   "Handle multiple arguments."
-  :cond (compat-maxargs-/= #'= 'many)
+  :prefix t
   (catch 'fail
 (while numbers-or-markers
-  (unless (funcall oldfun number-or-marker (pop numbers-or-markers))
+  (unless (>= number-or-marker (pop numbers-or-markers))
 (throw 'fail nil)))
 t))
 
@@ -119,10 +118,12 @@ attention to case differences."
  (eq t (compare-strings suffix nil nil
 string start-pos nil ignore-case)
 
-(compat-advise split-string (string &optional separators omit-nulls trim)
-  "Handle optional argument TRIM."
-  :cond (compat-maxargs-/= #'split-string 4)
-  (let* ((token (funcall oldfun string separators omit-nulls))
+(compat-defun split-string (string &optional separators omit-nulls trim)
+  "Extend `split-string' by a TRIM argument.
+The remaining arguments STRING, SEPARATORS and OMIT-NULLS are
+handled just as with `split-string'."
+  :prefix t
+  (let* ((token (split-string string separators o

[elpa] externals/compat 18152ca068 76/84: Fix edge-case of binding nil in if-let* and related macros

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 18152ca06805dc93bc9f15e26c5b298323683afb
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Fix edge-case of binding nil in if-let* and related macros
---
 compat-25.el|  4 ++--
 compat-26.el|  6 +++---
 compat-tests.el | 20 
 3 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/compat-25.el b/compat-25.el
index 54ea191f45..ace517d502 100644
--- a/compat-25.el
+++ b/compat-25.el
@@ -158,7 +158,7 @@ with an old syntax that accepted only one binding."
 (last t) list)
 (dolist (var spec)
   (push `(,(if (cdr var) (car var) empty)
-  (and ,last ,(or (cadr var) (car var
+  (and ,last ,(if (cdr var) (cadr var) (car var
 list)
   (when (or (cdr var) (consp (car var)))
 (setq last (caar list
@@ -183,7 +183,7 @@ The variable list SPEC is the same as in `if-let'."
 (last t) list)
 (dolist (var spec)
   (push `(,(if (cdr var) (car var) empty)
-  (and ,last ,(or (cadr var) (car var
+  (and ,last ,(if (cdr var) (cadr var) (car var
 list)
   (when (or (cdr var) (consp (car var)))
 (setq last (caar list
diff --git a/compat-26.el b/compat-26.el
index 6df2545cd7..fd87057805 100644
--- a/compat-26.el
+++ b/compat-26.el
@@ -373,7 +373,7 @@ This is like `if-let' but doesn't handle a VARLIST of the 
form
 (last t) list)
 (dolist (var varlist)
   (push `(,(if (cdr var) (car var) empty)
-  (and ,last ,(or (cadr var) (car var
+  (and ,last ,(if (cdr var) (cadr var) (car var
 list)
   (when (or (cdr var) (consp (car var)))
 (setq last (caar list
@@ -391,7 +391,7 @@ This is like `when-let' but doesn't handle a VARLIST of the 
form
 (last t) list)
 (dolist (var varlist)
   (push `(,(if (cdr var) (car var) empty)
-  (and ,last ,(or (cadr var) (car var
+  (and ,last ,(if (cdr var) (cadr var) (car var
 list)
   (when (or (cdr var) (consp (car var)))
 (setq last (caar list
@@ -410,7 +410,7 @@ are non-nil, then the result is non-nil."
 (last t) list)
 (dolist (var varlist)
   (push `(,(if (cdr var) (car var) empty)
-  (and ,last ,(or (cadr var) (car var
+  (and ,last ,(if (cdr var) (cadr var) (car var
 list)
   (when (or (cdr var) (consp (car var)))
 (setq last (caar list
diff --git a/compat-tests.el b/compat-tests.el
index 38fcc724b9..e19c5905a9 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -1174,6 +1174,12 @@ being compared against."
 
 (ert-deftest compat-if-let* ()
   "Check if `compat--if-let*' was implemented properly."
+  (should   ;trivial condition
+   (eq (compat--if-let* ((test t)) 'true 'false) 'true))
+  (should   ;trivial non-condition
+   (eq (compat--if-let* ((test nil)) 'true 'false) 'false))
+  (should   ;non-binding non-condition
+   (eq (compat--if-let* (((ignore))) 'true 'false) 'false))
   (should
(compat--if-let*
 ((x 3)
@@ -1187,6 +1193,14 @@ being compared against."
 
 (ert-deftest compat-if-let ()
   "Check if `compat--if-let' was implemented properly."
+  (should   ;trivial condition
+   (eq (compat--if-let ((test t)) 'true 'false) 'true))
+  (should   ;trivial non-condition
+   (eq (compat--if-let ((test nil)) 'true 'false) 'false))
+  (should   ;trivial non-condition
+   (eq (compat--if-let (test nil) 'true 'false) 'false))
+  (should   ;non-binding non-condition
+   (eq (compat--if-let (((ignore))) 'true 'false) 'false))
   (should (compat--if-let ((e (memq 0 '(1 2 3 0 5 6
   e))
   (should-not (compat--if-let ((e (memq 0 '(1 2 3 5 6)))
@@ -1200,6 +1214,12 @@ being compared against."
 
 (ert-deftest compat-and-let* ()
   "Check if `compat--and-let*' was implemented properly."
+  (should   ;trivial condition
+   (compat--and-let* ((test t
+  (should   ;trivial non-condition
+   (not (compat--and-let* ((test nil)
+  (should   ;non-binding non-condition
+   (not (compat--and-let* (((ignore))
   (should   ;trivial body
(compat--and-let*
 ((x 3)



[elpa] externals/compat 3c81fa3325 1/7: Ensure that tests are interpreted

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 3c81fa33252143ff44f96ae81e12d4b0dc0a83c9
Author: Daniel Mendler 
Commit: Daniel Mendler 

Ensure that tests are interpreted
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 36c6635f68..31d761945b 100644
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@ all: compile
 
 compile: $(BYTEC)
 
-test: compile
+test: clean
$(EMACS) --version
$(EMACS) -Q --batch -L . -l compat-tests.el -f 
ert-run-tests-batch-and-exit
 



[elpa] externals/compat d375a95a7a 2/7: Update CI, separate compile and test run

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

Update CI, separate compile and test run
---
 .github/workflows/makefile.yml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml
index bf7c0f7d5a..b109e3d510 100644
--- a/.github/workflows/makefile.yml
+++ b/.github/workflows/makefile.yml
@@ -33,5 +33,7 @@ jobs:
 - uses: purcell/setup-emacs@master
   with:
 version: ${{ matrix.emacs-version }}
-- name: Compile and run tests
+- name: Compile
+  run: make compile
+- name: Run tests
   run: make test



[elpa] externals/compat 3e65059af7 3/7: Add func-arity tests

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 3e65059af71db18970c148aa227026dfd526ac5a
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add func-arity tests
---
 compat-tests.el | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/compat-tests.el b/compat-tests.el
index 8c48733b96..86471caf74 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -1817,6 +1817,17 @@ being compared against."
   (expect wrong-type-argument '(0 0 0 0 a))
   (expect wrong-type-argument '(0 0 0 0 0 a)))
 
+(compat-deftests func-arity
+  (should (equal '(0 . 0) (func-arity (lambda ()
+  (should (equal '(1 . 1) (func-arity (lambda (x) x
+  (should (equal '(1 . 2) (func-arity (lambda (x &optional _) x
+  (should (equal '(0 . many) (func-arity (lambda (&rest _)
+  (ought '(1 . 1) 'identity)
+  (ought '(0 . many) 'ignore)
+  (ought '(2 . many) 'defun)
+  (ought '(2 . 3) 'defalias)
+  (ought '(1 . unevalled) 'defvar))
+
 (compat-deftests subr-primitive-p
   (ought t (symbol-function 'identity))   ;function from fns.c
   (unless (fboundp 'subr-native-elisp-p)



[elpa] externals/compat 84635968be 6/7: Oh dear, also directory-files-recursively is broken

2023-01-03 Thread ELPA Syncer
branch: externals/compat
commit 84635968be8cf6641af706ac15d57c227f0a3d76
Author: Daniel Mendler 
Commit: Daniel Mendler 

Oh dear, also directory-files-recursively is broken
---
 compat-tests.el | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/compat-tests.el b/compat-tests.el
index c621600337..cdbe9affa8 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -1176,10 +1176,11 @@ being compared against."
 ((lop (and (setq b (not b)) (1+ i)))
   'ok)))
 
-(compat-deftests directory-files-recursively
-  (should (equal
-   (compat-sort (directory-files-recursively "." "make\\|copying") 
#'string<)
-   '("./.github/workflows/makefile.yml" "./COPYING" "./Makefile"
+;; TODO fix broken test
+;;(compat-deftests directory-files-recursively
+;;  (should (equal
+;;   (compat-sort (directory-files-recursively "." "make\\|copying") 
#'string<)
+;;   '("./.github/workflows/makefile.yml" "./COPYING" "./Makefile"
 
 (compat-deftests directory-name-p
   (ought t "/")



  1   2   3   >