Skip to content

Commit 987e724

Browse files
committed
On Emacs >= 29.1, php-function-call face inherits from font-lock-function-call-face
Resolves emacs-php#782
1 parent c8e4c16 commit 987e724

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lisp/php-face.el

+5-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@
5555
:group 'php-faces
5656
:tag "PHP Function Name")
5757

58-
(defface php-function-call '((t ()))
58+
;; `font-lock-function-call-face' was added in Emacs 29.1
59+
(defface php-function-call (eval-when-compile
60+
(if (get 'font-lock-function-call-face 'face-defface-spec)
61+
'((t (:inherit font-lock-function-call-face)))
62+
'((t ()))))
5963
"PHP Mode face used to highlight function names in calles."
6064
:group 'php-faces
6165
:tag "PHP Function Call")

tests/php-mode-test.el

+6
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,12 @@ Meant for `php-mode-test-issue-503'."
653653
(with-php-mode-test ("indent/issue-702.php" :indent t :magic t))
654654
(with-php-mode-test ("indent/issue-726.php" :indent t :magic t)))
655655

656+
(ert-deftest php-mode-test-issue-782 ()
657+
"Test that function calls are fontified."
658+
(if (version< emacs-version "29.1")
659+
(should (eq (face-attribute 'php-function-call :inherit) nil))
660+
(should (eq (face-attribute 'php-function-call :inherit) 'font-lock-function-call-face))))
661+
656662
(ert-deftest php-mode-test-php74 ()
657663
"Test highlighting language constructs added in PHP 7.4."
658664
(with-php-mode-test ("7.4/arrow-function.php" :faces t))

0 commit comments

Comments
 (0)