From 9a90bbf1553b7c8eff229906ca30e15e09e183bc Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Thu, 1 Aug 2019 19:51:58 +0900 Subject: [PATCH 1/2] Add defvar-local php-style-delete-trailing-whitespace fixes #553 --- php-mode.el | 1 + 1 file changed, 1 insertion(+) diff --git a/php-mode.el b/php-mode.el index dc4fc920..35633242 100644 --- a/php-mode.el +++ b/php-mode.el @@ -1010,6 +1010,7 @@ this ^ lineup" (cons "PHP" (c-lang-const c-mode-menu php))) (defvar-local php-mode--delayed-set-style nil) +(defvar-local php-style-delete-trailing-whitespace nil) (defun php-set-style (stylename &optional dont-override) "Set the current `php-mode' buffer to use the style STYLENAME. From 58342681c2312b3c22ac0e5ff92e8bee6426d32b Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Thu, 1 Aug 2019 19:58:14 +0900 Subject: [PATCH 2/2] Fix to avoid (php-set-style "nil") being called --- php-mode.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/php-mode.el b/php-mode.el index 35633242..9be3b55c 100644 --- a/php-mode.el +++ b/php-mode.el @@ -1065,7 +1065,8 @@ After setting the stylevars run hooks according to STYLENAME (when php-mode--delayed-set-style (let ((coding-style (or (and (boundp 'php-project-coding-style) php-project-coding-style) php-mode-coding-style))) - (prog1 (php-set-style (symbol-name coding-style)) + (prog1 (when coding-style + (php-set-style (symbol-name coding-style))) (remove-hook 'hack-local-variables-hook #'php-mode-set-style-delay))))) (defvar php-mode-syntax-table