@@ -365,7 +365,7 @@ as a function. Call with AS-NUMBER keyword to compare by `version<'.
365
365
; ; Use the Emacs standard indentation binding. This may upset c-mode
366
366
; ; which does not follow this at the moment, but I see no better
367
367
; ; choice.
368
- (define-key map [tab] 'indent-for-tab-command )
368
+ (define-key map " \t " nil ) ; Hide CC-mode's `TAB' binding.
369
369
map)
370
370
" Keymap for `php-mode' ." )
371
371
@@ -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."
@@ -1143,8 +1132,7 @@ After setting the stylevars run hooks according to STYLENAME
1143
1132
" Reset PHP-irrelevant variables set by Cc Mode initialization."
1144
1133
(setq-local c-mode-hook nil )
1145
1134
(setq-local java-mode-hook nil )
1146
- (when (eval-when-compile (boundp 'flymake-diagnostic-functions ))
1147
- (remove-hook 'flymake-diagnostic-functions 'flymake-cc t ))
1135
+ (remove-hook 'flymake-diagnostic-functions 'flymake-cc t )
1148
1136
t )
1149
1137
1150
1138
(defvar php-mode-syntax-table
0 commit comments