From 6af84c2b4f558eec14ae74dbe6fb979da24d5b86 Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Sun, 22 Dec 2024 14:59:36 +0900 Subject: [PATCH] Use when-let* instead of let and when --- lisp/php.el | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lisp/php.el b/lisp/php.el index c08227b1..2e05d2a5 100644 --- a/lisp/php.el +++ b/lisp/php.el @@ -664,17 +664,15 @@ Currently there are `php-mode' and `php-ts-mode'." (defun php-current-class () "Insert current class name if cursor in class context." (interactive) - (let ((matched (php-get-current-element php--re-classlike-pattern))) - (when matched - (insert (concat matched php-class-suffix-when-insert))))) + (when-let* ((matched (php-get-current-element php--re-classlike-pattern))) + (insert (concat matched php-class-suffix-when-insert)))) ;;;###autoload (defun php-current-namespace () "Insert current namespace if cursor in namespace context." (interactive) - (let ((matched (php-get-current-element php--re-namespace-pattern))) - (when matched - (insert (concat matched php-namespace-suffix-when-insert))))) + (when-let* ((matched (php-get-current-element php--re-namespace-pattern))) + (insert (concat matched php-namespace-suffix-when-insert)))) ;;;###autoload (defun php-copyit-fqsen ()