Skip to content

Commit 5d4c55d

Browse files
authored
Merge pull request #492 from emacs-php/feature/disable-c-mode-hooks
Add php-mode-disable-parent-mode-hooks variable
2 parents 0cf02a1 + 17e4c31 commit 5d4c55d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

php-mode.el

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,11 @@ This function may interfere with other hooks and other behaviors.
418418
In that case set to `NIL'."
419419
:type 'boolean)
420420

421+
(defcustom php-mode-disable-parent-mode-hooks t
422+
"When set to `T', do not run hooks of parent modes (`java-mode', `c-mode')."
423+
:type 'boolean
424+
:group 'php-mode)
425+
421426
(defun php-mode-version ()
422427
"Display string describing the version of PHP Mode."
423428
(interactive)
@@ -1258,7 +1263,9 @@ After setting the stylevars run hooks according to STYLENAME
12581263
"Major mode for editing PHP code.
12591264
12601265
\\{php-mode-map}"
1261-
1266+
(when php-mode-disable-parent-mode-hooks
1267+
(setq-local c-mode-hook nil)
1268+
(setq-local java-mode-hook nil))
12621269
(c-initialize-cc-mode t)
12631270
(c-init-language-vars php-mode)
12641271
(c-common-init 'php-mode)
@@ -1334,7 +1341,6 @@ After setting the stylevars run hooks according to STYLENAME
13341341
(save-excursion
13351342
(php-syntax-propertize-function (point-min) (point-max))))))
13361343

1337-
13381344
(declare-function semantic-create-imenu-index "semantic/imenu" (&optional stream))
13391345

13401346
(defvar-mode-local php-mode imenu-create-index-function

0 commit comments

Comments
 (0)