our after-change-function, rather than re-adding it if it was removed.
(defun c-after-font-lock-init ()
;; Put on `font-lock-mode-hook'. This function ensures our after-change
;; function will get executed before the font-lock one.
- (remove-hook 'after-change-functions 'c-after-change t)
- (add-hook 'after-change-functions 'c-after-change nil t))
+ (when (memq #'c-after-change after-change-functions)
+ (remove-hook 'after-change-functions #'c-after-change t)
+ (add-hook 'after-change-functions #'c-after-change nil t)))
(defun c-font-lock-init ()
"Set up the font-lock variables for using the font-lock support in CC Mode.