Skip to content

Commit 883568f

Browse files
author
Eric James Michael Ritz
committed
Address the compiler warning regarding `c-syntactic-context'
1 parent d14c610 commit 883568f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

php-mode.el

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,8 +603,16 @@ This is was done due to the problem reported here:
603603
(beginning-of-line)
604604
(if (looking-at-p "\\s-*;\\s-*$") 0 '+)))
605605

606+
;;; We silence all byte-compiler warnings when creating the `syntax'
607+
;;; variable binding in this function. Emacs will normally warn us
608+
;;; that `c-syntactic-context' is unbound. The variable comes from CC
609+
;;; Mode and it is only bound dynamically when calling certain
610+
;;; indentation functions. See the documentation in section "8.1.1
611+
;;; Custom Brace Hanging" of the CC Mode manual for more information,
612+
;;; along with an explanation of why we do not simply bind the
613+
;;; variable to a value in order to appease the compiler warning.
606614
(defun php-unindent-closure ()
607-
(let ((syntax (mapcar 'car c-syntactic-context)))
615+
(let ((syntax (with-no-warnings (mapcar 'car c-syntactic-context))))
608616
(if (and (member 'arglist-cont-nonempty syntax)
609617
(or
610618
(member 'statement-block-intro syntax)

0 commit comments

Comments
 (0)