Skip to content

Commit

Permalink
[Hotfix] Fix lazy evaluation of php-set-style
Browse files Browse the repository at this point in the history
Statements were not bundled by progn.  This bug was caused by #442.
  • Loading branch information
zonuexe committed Mar 23, 2018
1 parent 398d1ea commit 4b1c80f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions php-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -1202,10 +1202,11 @@ After setting the stylevars run hooks according to STYLENAME
;; Since it depends on the timing at which the file local variable is set.
;; File local variables are set after initialization of major mode except `run-hook' is complete.
(if php-mode-enable-project-coding-style
(add-hook 'hack-local-variables-hook #'php-mode-set-style-delay t t)
(setq php-mode--delayed-set-style t)
(when (fboundp 'advice-add)
(advice-add #'c-set-style :after #'php-mode--disable-delay-set-style '(local)))
(progn
(add-hook 'hack-local-variables-hook #'php-mode-set-style-delay t t)
(setq php-mode--delayed-set-style t)
(when (fboundp 'advice-add)
(advice-add #'c-set-style :after #'php-mode--disable-delay-set-style '(local))))
(php-set-style (symbol-name php-mode-coding-style)))

(when (or php-mode-force-pear
Expand Down

0 comments on commit 4b1c80f

Please sign in to comment.