Skip to content

Commit 0e02362

Browse files
Emanuele TomasiEric James Michael Ritz
Emanuele Tomasi
authored and
Eric James Michael Ritz
committed
Silence compiler warnings about two variables
This patch addresses two warnings when compiling php-mode.el, related to two variables: 1. c-vsemi-status-unknown-p 2. font-lock-syntactic-keywords The previous commit 78cb2fc attempted to fix these warnings but incorrectly used the syntax-propertize-function variable in place of font-lock-syntactic-keywords. As a result syntax highlighting would no longer work and we reverted that commit with 875d33a. This commit properly addresses the issues raised by warnings without breaking syntax highlighting. The fix is to use the variable syntax-propertize-via-font-lock instead of the original attempt to use syntax-propertize-function. The section ‘Syntax Parsing Changes’ in the NEWS file for Emacs 24.2 explains how this is the proper variable to use. Github-issue: 19 Github-issue: 24
1 parent 875d33a commit 0e02362

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

php-mode.el

+4-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@
7171
(require 'custom)
7272
(require 'etags)
7373
(eval-when-compile
74-
(require 'regexp-opt))
74+
(require 'regexp-opt)
75+
(defvar c-vsemi-status-unknown-p)
76+
(defvar syntax-propertize-via-font-lock))
7577
(require 'flymake)
7678

7779
;; Local variables
@@ -474,7 +476,7 @@ This is was done due to the problem reported here:
474476
(modify-syntax-entry ?` "\"" php-mode-syntax-table)
475477
(modify-syntax-entry ?\" "\"" php-mode-syntax-table)
476478

477-
(set (make-local-variable 'font-lock-syntactic-keywords)
479+
(set (make-local-variable 'syntax-propertize-via-font-lock)
478480
'(("\\(\"\\)\\(\\\\.\\|[^\"\n\\]\\)*\\(\"\\)" (1 "\"") (3 "\""))
479481
("\\(\'\\)\\(\\\\.\\|[^\'\n\\]\\)*\\(\'\\)" (1 "\"") (3 "\""))))
480482

0 commit comments

Comments
 (0)