branch: elpa/php-mode
commit a59e92e2334f10bca8cdae0d9ac0210e1212abfe
Author: USAMI Kenta <[email protected]>
Commit: USAMI Kenta <[email protected]>
Use when-let* instead of when-let to support Emacs 30
---
lisp/php-format.el | 2 +-
lisp/php-ide.el | 8 ++++----
lisp/php-project.el | 2 +-
lisp/php.el | 7 +++----
4 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/lisp/php-format.el b/lisp/php-format.el
index cfa71a57e8..a26477f6d6 100644
--- a/lisp/php-format.el
+++ b/lisp/php-format.el
@@ -176,7 +176,7 @@
files)
return sym))
(setq-local php-format-command cmd))
- (when-let (tup (plist-get (cdr-safe (assq cmd
php-format-formatter-alist)) :command))
+ (when-let* (tup (plist-get (cdr-safe (assq cmd
php-format-formatter-alist)) :command))
(setq executable (car tup))
(setq args (cdr tup))
(setq vendor (expand-file-name executable (expand-file-name
php-format-command-dir default-directory)))
diff --git a/lisp/php-ide.el b/lisp/php-ide.el
index a48cf1e09f..5d1201fbc0 100644
--- a/lisp/php-ide.el
+++ b/lisp/php-ide.el
@@ -166,7 +166,7 @@
(cond
((stringp php-ide-eglot-executable) (list php-ide-eglot-executable))
((listp php-ide-eglot-executable) php-ide-eglot-executable)
- ((when-let (command (assq php-ide-eglot-executable
php-ide-lsp-command-alist))
+ ((when-let* (command (assq php-ide-eglot-executable
php-ide-lsp-command-alist))
(cond
((functionp command) (funcall command))
((listp command) command))))))
@@ -196,9 +196,9 @@ ACTIVATE: T is given when activeting, NIL when deactivating
PHP-IDE."
"Minor mode for integrate IDE-like tools."
:lighter php-ide-mode-lighter
(let ((ide-features php-ide-features))
- (when-let (unavailable-features (cl-loop for feature in ide-features
- unless (assq feature
php-ide-feature-alist)
- collect feature))
+ (when-let* (unavailable-features (cl-loop for feature in ide-features
+ unless (assq feature
php-ide-feature-alist)
+ collect feature))
(user-error "%s includes unavailable PHP-IDE features. (available
features are: %s)"
ide-features
(mapconcat (lambda (feature) (concat "'" (symbol-name
feature)))
diff --git a/lisp/php-project.el b/lisp/php-project.el
index 818998032b..caa16eb394 100644
--- a/lisp/php-project.el
+++ b/lisp/php-project.el
@@ -267,7 +267,7 @@ Typically it is `pear', `drupal', `wordpress', `symfony2'
and `psr2'.")
This function is compatible with `project-find-functions'."
(let ((default-directory dir))
- (when-let (root (php-project-get-root-dir))
+ (when-let* (root (php-project-get-root-dir))
(if (file-exists-p (expand-file-name ".git" root))
(cons 'vc root)
(cons 'transient root)))))
diff --git a/lisp/php.el b/lisp/php.el
index 7176cb8c70..437776c624 100644
--- a/lisp/php.el
+++ b/lisp/php.el
@@ -553,15 +553,14 @@ The order is reversed by calling as follows:
(c-backward-token-2 1 nil))
collect
(cond
- ((when-let (bounds (php--thing-at-point-bounds-of-string-at-point))
+ ((when-let* (bounds (php--thing-at-point-bounds-of-string-at-point))
(prog1 (buffer-substring-no-properties (car bounds) (cdr bounds))
(goto-char (car bounds)))))
((looking-at php-re-token-symbols)
(prog1 (match-string-no-properties 0)
(goto-char (match-beginning 0))))
- (t
- (buffer-substring-no-properties (point)
- (save-excursion
(php--c-end-of-token) (point))))))))))
+ ((buffer-substring-no-properties (point)
+ (save-excursion
(php--c-end-of-token) (point))))))))))
(defun php-get-pattern ()
"Find the pattern we want to complete.