@@ -1009,6 +1009,14 @@ this ^ lineup"
1009
1009
(easy-menu-define php-mode-menu php-mode-map " PHP Mode Commands"
1010
1010
(cons " PHP" (c-lang-const c-mode-menu php)))
1011
1011
1012
+ (defun php-mode-get-style-alist ()
1013
+ " Return an alist consisting of `php' style and styles that inherit it."
1014
+ (cl-loop for l in c-style-alist
1015
+ if (or (string= (car l) " php" )
1016
+ (equal (cadr l) " php" ))
1017
+ collect l))
1018
+
1019
+ (defvar php-mode-set-style-history nil )
1012
1020
(defvar-local php-mode--delayed-set-style nil )
1013
1021
(defvar-local php-style-delete-trailing-whitespace nil )
1014
1022
@@ -1027,7 +1035,15 @@ After setting the stylevars run hooks according to STYLENAME
1027
1035
\" wordpress\" `php-mode-wordpress-hook'
1028
1036
\" symfony2\" `php-mode-symfony2-hook'
1029
1037
\" psr2\" `php-mode-psr2-hook' "
1030
- (interactive )
1038
+ (interactive
1039
+ (list (let ((completion-ignore-case t )
1040
+ (prompt (format " Which %s indentation style? "
1041
+ mode-name)))
1042
+ (completing-read prompt
1043
+ (php-mode-get-style-alist)
1044
+ nil t nil
1045
+ 'php-mode-set-style-history
1046
+ c-indentation-style))))
1031
1047
(php-mode--disable-delay-set-style)
1032
1048
1033
1049
; ; Back up manually set variables
@@ -1051,7 +1067,6 @@ After setting the stylevars run hooks according to STYLENAME
1051
1067
((equal stylename " wordpress" ) (run-hooks 'php-mode-wordpress-hook ))
1052
1068
((equal stylename " symfony2" ) (run-hooks 'php-mode-symfony2-hook ))
1053
1069
((equal stylename " psr2" ) (run-hooks 'php-mode-psr2-hook ))))
1054
- (put 'php-set-style 'interactive-form (interactive-form 'c-set-style ))
1055
1070
1056
1071
(defun php-mode--disable-delay-set-style (&rest args )
1057
1072
" Disable php-mode-set-style-delay on after hook. `ARGS' be ignore."
0 commit comments