From 6e4a4655517d7762f9471a4a967c5f8ba22f62ca Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Sat, 18 Jul 2026 01:26:03 +0900 Subject: [PATCH] Use if-let* / when-let* instead of the obsolete plain forms `if-let' and `when-let' are obsolete as of Emacs 31.1, and the byte compiler warns about all three uses here. Each binds a single value, so the starred forms are a direct, behaviour-preserving replacement. Both are available on the supported Emacs (27.1+) through subr-x. --- phpstan-hover.el | 4 ++-- phpstan.el | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/phpstan-hover.el b/phpstan-hover.el index b5ef1d9..71dd6c0 100644 --- a/phpstan-hover.el +++ b/phpstan-hover.el @@ -243,7 +243,7 @@ "Return hover type string at point. If PREFER-PHPDOC is non-nil, return PHPDoc type when available." - (when-let ((datum (phpstan-hover--datum-at-point))) + (when-let* ((datum (phpstan-hover--datum-at-point))) (let ((type (plist-get datum :typeDescr)) (phpdoc-type (plist-get datum :phpDocType))) (if (and prefer-phpdoc @@ -332,7 +332,7 @@ This honors `phpstan-hover-display-backend'." (defun phpstan-hover--show-at-point () "Show hover text for current point if available." - (if-let ((datum (phpstan-hover--datum-at-point))) + (if-let* ((datum (phpstan-hover--datum-at-point))) (phpstan-hover--show (phpstan-hover--format-message datum)) (setq phpstan-hover--last-shown nil) (phpstan-hover--hide))) diff --git a/phpstan.el b/phpstan.el index c4eb970..9b2965b 100644 --- a/phpstan.el +++ b/phpstan.el @@ -480,7 +480,7 @@ it returns the value of `SOURCE' as it is." (defun phpstan-find-baseline-file () "Find PHPStan baseline file of current project." (interactive) - (if-let ((path (locate-dominating-file default-directory phpstan-baseline-file))) + (if-let* ((path (locate-dominating-file default-directory phpstan-baseline-file))) (find-file (expand-file-name phpstan-baseline-file path)) (user-error "Baseline file not found. Try running M-x phpstan-generate-baseline")))