Skip to content

Commit f7b0074

Browse files
committed
Merge pull request #308 from jorissteyn/issue-307-modified-state
Retain the modification state on mode activation
2 parents c9fc190 + ebf5b47 commit f7b0074

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

php-mode-test.el

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,13 @@ style from Drupal."
605605
(search-forward "$that")
606606
(should-not (eq 'font-lock-constant-face (get-text-property (- (point) 1) 'face)))))
607607

608+
(ert-deftest php-mode-test-issue-307 ()
609+
"Activating php-mode should not mark the buffer as modified."
610+
(with-php-mode-test ("issue-307.php")
611+
(set-buffer-modified-p nil)
612+
(php-mode)
613+
(should-not (buffer-modified-p))))
614+
608615
;;; php-mode-test.el ends here
609616

610617
;; Local Variables:

php-mode.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,8 @@ PHP heredoc."
10611061
php-beginning-of-defun-regexp)
10621062

10631063
(when (>= emacs-major-version 25)
1064-
(php-syntax-propertize-function (point-min) (point-max))))
1064+
(with-silent-modifications
1065+
(php-syntax-propertize-function (point-min) (point-max)))))
10651066

10661067

10671068
;; Define function name completion function

tests/issue-307.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
// It's the apostrophe.

0 commit comments

Comments
 (0)