@@ -1080,13 +1080,7 @@ Borrow the `interactive-form' from `c-set-style' and use the original
1080
1080
`c-set-style' function to set all declared stylevars.
1081
1081
For compatibility with `c-set-style' pass DONT-OVERRIDE to it.
1082
1082
1083
- After setting the stylevars run hooks according to STYLENAME
1084
-
1085
- \" pear\" `php-mode-pear-hook'
1086
- \" drupal\" `php-mode-drupal-hook'
1087
- \" wordpress\" `php-mode-wordpress-hook'
1088
- \" symfony2\" `php-mode-symfony2-hook'
1089
- \" psr2\" `php-mode-psr2-hook' "
1083
+ After setting the stylevars run hook `php-mode-STYLENAME-hook' ."
1090
1084
(interactive
1091
1085
(list (let ((completion-ignore-case t )
1092
1086
(prompt (format " Which %s indentation style? "
@@ -1110,15 +1104,10 @@ After setting the stylevars run hooks according to STYLENAME
1110
1104
; ; Restore variables
1111
1105
(cl-loop for (name . value) in backup-vars
1112
1106
do (set (make-local-variable name) value)))
1113
-
1114
- (if (eq (symbol-value 'php-style-delete-trailing-whitespace ) t )
1115
- (add-hook 'before-save-hook 'delete-trailing-whitespace nil t )
1116
- (remove-hook 'before-save-hook 'delete-trailing-whitespace t ))
1117
- (cond ((equal stylename " pear" ) (run-hooks 'php-mode-pear-hook ))
1118
- ((equal stylename " drupal" ) (run-hooks 'php-mode-drupal-hook ))
1119
- ((equal stylename " wordpress" ) (run-hooks 'php-mode-wordpress-hook ))
1120
- ((equal stylename " symfony2" ) (run-hooks 'php-mode-symfony2-hook ))
1121
- ((equal stylename " psr2" ) (run-hooks 'php-mode-psr2-hook ))))
1107
+ (if (eq php-style-delete-trailing-whitespace t )
1108
+ (add-hook 'before-save-hook #'delete-trailing-whitespace nil t )
1109
+ (remove-hook 'before-save-hook #'delete-trailing-whitespace t ))
1110
+ (run-hooks (intern (format " php-mode-%s -hook " stylename))))
1122
1111
1123
1112
(defun php-mode--disable-delay-set-style (&rest _args )
1124
1113
" Disable `php-mode-set-style-delay' on after hook. ARGS be ignore."
0 commit comments