Skip to content

Commit 910391c

Browse files
authored
Merge pull request #796 from emacs-php/fix/when-let
Use `when-let*` instead of `when-let` to support Emacs 30
2 parents 31f702e + a59e92e commit 910391c

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

lisp/php-format.el

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176
files)
177177
return sym))
178178
(setq-local php-format-command cmd))
179-
(when-let (tup (plist-get (cdr-safe (assq cmd php-format-formatter-alist)) :command))
179+
(when-let* (tup (plist-get (cdr-safe (assq cmd php-format-formatter-alist)) :command))
180180
(setq executable (car tup))
181181
(setq args (cdr tup))
182182
(setq vendor (expand-file-name executable (expand-file-name php-format-command-dir default-directory)))

lisp/php-ide.el

+4-4
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
(cond
167167
((stringp php-ide-eglot-executable) (list php-ide-eglot-executable))
168168
((listp php-ide-eglot-executable) php-ide-eglot-executable)
169-
((when-let (command (assq php-ide-eglot-executable php-ide-lsp-command-alist))
169+
((when-let* (command (assq php-ide-eglot-executable php-ide-lsp-command-alist))
170170
(cond
171171
((functionp command) (funcall command))
172172
((listp command) command))))))
@@ -196,9 +196,9 @@ ACTIVATE: T is given when activeting, NIL when deactivating PHP-IDE."
196196
"Minor mode for integrate IDE-like tools."
197197
:lighter php-ide-mode-lighter
198198
(let ((ide-features php-ide-features))
199-
(when-let (unavailable-features (cl-loop for feature in ide-features
200-
unless (assq feature php-ide-feature-alist)
201-
collect feature))
199+
(when-let* (unavailable-features (cl-loop for feature in ide-features
200+
unless (assq feature php-ide-feature-alist)
201+
collect feature))
202202
(user-error "%s includes unavailable PHP-IDE features. (available features are: %s)"
203203
ide-features
204204
(mapconcat (lambda (feature) (concat "'" (symbol-name feature)))

lisp/php-project.el

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ Typically it is `pear', `drupal', `wordpress', `symfony2' and `psr2'.")
267267
268268
This function is compatible with `project-find-functions'."
269269
(let ((default-directory dir))
270-
(when-let (root (php-project-get-root-dir))
270+
(when-let* (root (php-project-get-root-dir))
271271
(if (file-exists-p (expand-file-name ".git" root))
272272
(cons 'vc root)
273273
(cons 'transient root)))))

lisp/php.el

+3-4
Original file line numberDiff line numberDiff line change
@@ -553,15 +553,14 @@ The order is reversed by calling as follows:
553553
(c-backward-token-2 1 nil))
554554
collect
555555
(cond
556-
((when-let (bounds (php--thing-at-point-bounds-of-string-at-point))
556+
((when-let* (bounds (php--thing-at-point-bounds-of-string-at-point))
557557
(prog1 (buffer-substring-no-properties (car bounds) (cdr bounds))
558558
(goto-char (car bounds)))))
559559
((looking-at php-re-token-symbols)
560560
(prog1 (match-string-no-properties 0)
561561
(goto-char (match-beginning 0))))
562-
(t
563-
(buffer-substring-no-properties (point)
564-
(save-excursion (php--c-end-of-token) (point))))))))))
562+
((buffer-substring-no-properties (point)
563+
(save-excursion (php--c-end-of-token) (point))))))))))
565564

566565
(defun php-get-pattern ()
567566
"Find the pattern we want to complete.

0 commit comments

Comments
 (0)