Skip to content

Commit 738ce16

Browse files
committed
Add php-project-coding-style variable
This variable is introduced to locally override the customization variable php-mode-coding-style on a project basis. It is set by the .dir-locals.el located in the directory, not the user's own .emacs file.
1 parent 11abbfb commit 738ce16

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

php-project.el

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
;; Return root directory of current buffer file. The root directory is
3434
;; determined by several marker file or directory.
3535
;;
36+
;; ## `.dir-locals.el' support
37+
;;
38+
;; - `php-project-coding-style'
39+
;; - Symbol value of the coding style. (ex. `pear', `psr2')
40+
;;
41+
;;
3642

3743
;;; Code:
3844
(require 'cl-lib)
@@ -64,6 +70,16 @@ SYMBOL
6470
(make-variable-buffer-local 'php-project-root)
6571
(put 'php-project-root 'safe-local-variable
6672
#'(lambda (v) (assq v php-project-available-root-files))))
73+
74+
;;;###autoload
75+
(progn
76+
(defvar php-project-coding-style nil
77+
"Symbol value of the coding style of the project that PHP major mode refers to.
78+
79+
Typically it is `pear', `drupal', `wordpress', `symfony2' and `psr2'.")
80+
(make-variable-buffer-local 'php-project-coding-style)
81+
(put 'php-project-coding-style 'safe-local-variable #'symbolp))
82+
6783

6884
;; Functions
6985

0 commit comments

Comments
 (0)