From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: font-lock-global-modes = nil doesn't work Date: Mon, 08 Oct 2007 14:03:27 -0400 Message-ID: References: Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1191866800 27047 80.91.229.12 (8 Oct 2007 18:06:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 8 Oct 2007 18:06:40 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Juanma Barranquero" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 08 20:06:38 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Iewya-000231-RP for ged-emacs-devel@m.gmane.org; Mon, 08 Oct 2007 20:05:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IewyV-0001cg-9W for ged-emacs-devel@m.gmane.org; Mon, 08 Oct 2007 14:05:03 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Iewxv-0001K1-9O for emacs-devel@gnu.org; Mon, 08 Oct 2007 14:04:27 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Iewxu-0001Id-B6 for emacs-devel@gnu.org; Mon, 08 Oct 2007 14:04:26 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iewxt-0001IK-BB for emacs-devel@gnu.org; Mon, 08 Oct 2007 14:04:25 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Iewxt-0002JD-0F for emacs-devel@gnu.org; Mon, 08 Oct 2007 14:04:25 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1Iewwx-0004NP-03; Mon, 08 Oct 2007 14:03:27 -0400 In-reply-to: (lekktu@gmail.com) X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:80415 Archived-At: Does this fix the bug? (It might be equivalent to reverting the previous change, but it's cleaner.) *** font-core.el 26 Jul 2007 12:57:21 -0400 1.46 --- font-core.el 07 Oct 2007 19:21:42 -0400 *************** *** 234,240 **** ;; hook is run, the major mode is in the process of being changed and we do not ;; know what the final major mode will be. So, `font-lock-change-major-mode' ;; only (a) notes the name of the current buffer, and (b) adds our function ! ;; `turn-on-font-lock-if-enabled' to the hook variables ;; `after-change-major-mode-hook' and `post-command-hook' (for modes ;; that do not yet run `after-change-major-mode-hook'). By the time ;; the functions on the first of these hooks to be run are run, the new major --- 234,240 ---- ;; hook is run, the major mode is in the process of being changed and we do not ;; know what the final major mode will be. So, `font-lock-change-major-mode' ;; only (a) notes the name of the current buffer, and (b) adds our function ! ;; `turn-on-font-lock-if-desired' to the hook variables ;; `after-change-major-mode-hook' and `post-command-hook' (for modes ;; that do not yet run `after-change-major-mode-hook'). By the time ;; the functions on the first of these hooks to be run are run, the new major *************** *** 281,294 **** (repeat :inline t (symbol :tag "mode")))) :group 'font-lock) ! (defun turn-on-font-lock-if-enabled () ! (unless (and (eq (car-safe font-lock-global-modes) 'not) ! (memq major-mode (cdr font-lock-global-modes))) (let (inhibit-quit) (turn-on-font-lock)))) (define-globalized-minor-mode global-font-lock-mode ! font-lock-mode turn-on-font-lock-if-enabled :extra-args (dummy) :initialize 'custom-initialize-safe-default :init-value (not (or noninteractive emacs-basic-display)) --- 281,297 ---- (repeat :inline t (symbol :tag "mode")))) :group 'font-lock) ! (defun turn-on-font-lock-if-desired () ! (when (cond ((eq font-lock-global-modes t) ! t) ! ((eq (car-safe font-lock-global-modes) 'not) ! (not (memq major-mode (cdr font-lock-global-modes)))) ! (t (memq major-mode (cdr font-lock-global-modes)))) (let (inhibit-quit) (turn-on-font-lock)))) (define-globalized-minor-mode global-font-lock-mode ! font-lock-mode turn-on-font-lock-if-desired :extra-args (dummy) :initialize 'custom-initialize-safe-default :init-value (not (or noninteractive emacs-basic-display))