From: Alan Mackenzie Date: Thu, 2 May 2013 11:18:18 +0000 (+0000) Subject: Eliminate variable c-standard-font-lock-fontify-region-function. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~2026^2~323 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=30cac1e0e41260293b7900f67422f8833aaba63f;p=emacs.git Eliminate variable c-standard-font-lock-fontify-region-function. * progmodes/cc-mode.el (c-standard-font-lock-fontify-region-function): Remove. (c-font-lock-fontify-region, c-after-font-lock-init): Adapt. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index be8329a856c..fd42c57c5c9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2013-05-02 Alan Mackenzie + + Eliminate variable c-standard-font-lock-fontify-region-function. + * progmodes/cc-mode.el + (c-standard-font-lock-fontify-region-function): Remove. + (c-font-lock-fontify-region, c-after-font-lock-init): Adapt. + 2013-05-01 Leo Liu * progmodes/octave.el: Compatible with older emacs-24 releases. diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 17e80b8b25b..d7416ae86cf 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -1160,9 +1160,6 @@ Note that the style variables are always made local to the buffer." ;; `c-set-fl-decl-start' for the detailed functionality. (cons (c-set-fl-decl-start beg) end)) -(defvar c-standard-font-lock-fontify-region-function nil - "Standard value of `font-lock-fontify-region-function'") - (defun c-font-lock-fontify-region (beg end &optional verbose) ;; Effectively advice around `font-lock-fontify-region' which extends the ;; region (BEG END), for example, to avoid context fontification chopping @@ -1187,17 +1184,14 @@ Note that the style variables are always made local to the buffer." (setq new-region (funcall fn new-beg new-end)) (setq new-beg (car new-region) new-end (cdr new-region))) c-before-context-fontification-functions)))) - (funcall c-standard-font-lock-fontify-region-function + (funcall (default-value 'font-lock-fontify-region-function) new-beg new-end verbose))) (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. Amongst other - ;; things. + ;; 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) - (setq c-standard-font-lock-fontify-region-function - (default-value 'font-lock-fontify-region-function))) + (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.