From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#14325: 24.3; cc-mode does not initialize correctly w/ -batch Date: Tue, 30 Apr 2013 23:37:16 -0400 Message-ID: References: <878v3z29r2.fsf@Rainer.invalid> <6m38u7plnh.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1367379467 17089 80.91.229.3 (1 May 2013 03:37:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 1 May 2013 03:37:47 +0000 (UTC) Cc: 14325@debbugs.gnu.org To: Achim Gratz Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 01 05:37:43 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UXNrT-0000ZR-75 for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 May 2013 05:37:43 +0200 Original-Received: from localhost ([::1]:57513 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXNrS-0001wQ-QH for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Apr 2013 23:37:42 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXNrP-0001w8-AO for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2013 23:37:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UXNrO-00057V-AU for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2013 23:37:39 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48992) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXNrM-000571-HU; Tue, 30 Apr 2013 23:37:36 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UXNrm-00060M-NF; Tue, 30 Apr 2013 23:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Glenn Morris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Wed, 01 May 2013 03:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14325 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 14325-submit@debbugs.gnu.org id=B14325.136737946823034 (code B ref 14325); Wed, 01 May 2013 03:38:02 +0000 Original-Received: (at 14325) by debbugs.gnu.org; 1 May 2013 03:37:48 +0000 Original-Received: from localhost ([127.0.0.1]:53101 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UXNrX-0005zM-5N for submit@debbugs.gnu.org; Tue, 30 Apr 2013 23:37:47 -0400 Original-Received: from fencepost.gnu.org ([208.118.235.10]:50556) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UXNrU-0005z6-CI for 14325@debbugs.gnu.org; Tue, 30 Apr 2013 23:37:45 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1UXNr3-0003Gt-0m; Tue, 30 Apr 2013 23:37:17 -0400 X-Spook: bce TWA Echelon Security Council high security encryption X-Ran: S]ZP.[&ppgfUPlM(]aZ*IooO!+V}Qen~ScrvSjG&Q0n/x@c5!Df0#^5qrn0$sqbm!WN#bz X-Hue: red X-Attribution: GM In-Reply-To: <6m38u7plnh.fsf@fencepost.gnu.org> (Glenn Morris's message of "Tue, 30 Apr 2013 20:51:46 -0400") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:73863 Archived-At: 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.