diff --git a/php-mode-test.el b/php-mode-test.el index 86826748..2f9a77f6 100644 --- a/php-mode-test.el +++ b/php-mode-test.el @@ -605,6 +605,13 @@ style from Drupal." (search-forward "$that") (should-not (eq 'font-lock-constant-face (get-text-property (- (point) 1) 'face))))) +(ert-deftest php-mode-test-issue-307 () + "Activating php-mode should not mark the buffer as modified." + (with-php-mode-test ("issue-307.php") + (set-buffer-modified-p nil) + (php-mode) + (should-not (buffer-modified-p)))) + ;;; php-mode-test.el ends here ;; Local Variables: diff --git a/php-mode.el b/php-mode.el index 9e33fdc7..9aae782c 100644 --- a/php-mode.el +++ b/php-mode.el @@ -1061,7 +1061,8 @@ PHP heredoc." php-beginning-of-defun-regexp) (when (>= emacs-major-version 25) - (php-syntax-propertize-function (point-min) (point-max)))) + (with-silent-modifications + (php-syntax-propertize-function (point-min) (point-max))))) ;; Define function name completion function diff --git a/tests/issue-307.php b/tests/issue-307.php new file mode 100644 index 00000000..ad844d33 --- /dev/null +++ b/tests/issue-307.php @@ -0,0 +1,3 @@ +