Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use when-let* instead of when-let to support Emacs 30 #796

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lisp/php-format.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
8 changes: 4 additions & 4 deletions lisp/php-ide.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))))))
Expand Down Expand Up @@ -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)))
Expand Down
2 changes: 1 addition & 1 deletion lisp/php-project.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)))))
Expand Down
7 changes: 3 additions & 4 deletions lisp/php.el
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading