GNU bug report logs - #14325
24.3; cc-mode does not initialize correctly w/ -batch

Previous Next

Packages: cc-mode, emacs;

Reported by: Achim Gratz <Stromeko <at> nexgo.de>

Date: Tue, 30 Apr 2013 17:46:02 UTC

Severity: normal

Found in version 24.3

Fixed in version 24.4

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 14325 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Achim Gratz <Stromeko <at> nexgo.de>
Cc: 14325 <at> debbugs.gnu.org
Subject: Re: bug#14325: 24.3; cc-mode does not initialize correctly w/ -batch
Date: Tue, 30 Apr 2013 23:37:16 -0400
Glenn Morris wrote:

> To me, c-standard-font-lock-fontify-region-function seems pointless in
> Emacs, where font-lock is preloaded since 22.1.

Even it is wasn't preloaded, I still don't see anything wrong with the
following. cc-mode only changes the buffer-local value.

*** lisp/progmodes/cc-mode.el	2013-04-15 16:10:24 +0000
--- lisp/progmodes/cc-mode.el	2013-05-01 03:34:59 +0000
***************
*** 1160,1168 ****
    ;; `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
--- 1160,1165 ----
***************
*** 1187,1193 ****
  		  (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
  	     new-beg new-end verbose)))
  
  (defun c-after-font-lock-init ()
--- 1184,1190 ----
  		  (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 (default-value 'font-lock-fontify-region-function)
  	     new-beg new-end verbose)))
  
  (defun c-after-font-lock-init ()
***************
*** 1195,1203 ****
    ;; function will get executed before the font-lock one.  Amongst other
    ;; things.
    (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)))
  
  (defun c-font-lock-init ()
    "Set up the font-lock variables for using the font-lock support in CC Mode.
--- 1192,1198 ----
    ;; function will get executed before the font-lock one.  Amongst other
    ;; things.
    (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.





This bug report was last modified 12 years and 13 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.