From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Francis Belliveau Newsgroups: gmane.emacs.help Subject: Re: Problem with CC mode hooks and font-locking Date: Sat, 1 Dec 2018 09:33:39 -0500 Message-ID: <19114789-568E-41DD-9A06-C0410F023E53@comcast.net> References: <5B8BFDC9-A07B-48FE-8C97-1BB0B84E5577@gmail.com> <865zxruycx.fsf@zoho.com> <875zxr7zke.fsf@portable.galex-713.eu> <00997cf4-4577-49d4-b48d-79e6a46b0211@googlegroups.com> <28B5D5A6-4E84-455C-BA8E-84AC0C5BD454@comcast.net> <83h8gftwxb.fsf@gnu.org> <5FC1FE19-E1AE-49EB-9D42-4D0B3E22E34E@comcast.net> <837egtd6ll.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1543674732 18807 195.159.176.226 (1 Dec 2018 14:32:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 1 Dec 2018 14:32:12 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Dec 01 15:32:08 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gT6JT-0004nD-OF for geh-help-gnu-emacs@m.gmane.org; Sat, 01 Dec 2018 15:32:08 +0100 Original-Received: from localhost ([::1]:41491 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gT6La-0003Z3-3j for geh-help-gnu-emacs@m.gmane.org; Sat, 01 Dec 2018 09:34:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gT6L8-0003Yn-3Z for help-gnu-emacs@gnu.org; Sat, 01 Dec 2018 09:33:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gT6L2-0000lL-8A for help-gnu-emacs@gnu.org; Sat, 01 Dec 2018 09:33:50 -0500 Original-Received: from resqmta-ch2-12v.sys.comcast.net ([2001:558:fe21:29:69:252:207:44]:44312) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gT6L0-0000kO-Ai for help-gnu-emacs@gnu.org; Sat, 01 Dec 2018 09:33:44 -0500 Original-Received: from resomta-ch2-07v.sys.comcast.net ([69.252.207.103]) by resqmta-ch2-12v.sys.comcast.net with ESMTP id T5oGgUqI3x7x3T6KzgGdPn; Sat, 01 Dec 2018 14:33:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20161114; t=1543674821; bh=NymeKxn74CQicknEVH6yovw8vSY5kIY3fpdewBnytdI=; h=Received:Received:Content-Type:Mime-Version:Subject:From:Date: Message-Id:To; b=ESaZOSjMyrJJunO5iuTdWGsO4iVYOZK7sdOyC93WRGASB7dOiG91ClzvhS3oexeoZ UuU957N9ujXbj1dSRrzUGX6c74zrwFDoIw/cdwFm4tY1gbh/R1G19uKcj4u1dHGWhY GZqUakEP0nqn6TNAmRPpC4UvpmjGtK+0Zvxo8BaYLE47Bb0oPBEX5VRiaty6EE+4Kz US6bRCPmB6fUtHofnGWn2bXureu5JkG1M8XH1n4RhqvQgurDXNbuNbPPQzx9eQLa2D 659WTRlEqbEYLmwGkD5LTC4qGtiOrNmVo+dD0hltFVsxXTyTBSbdCeK3QxROpCL9xc +VidbopDQqwng== Original-Received: from [IPv6:2601:190:580:9c44:d527:4cd5:b880:488a] ([IPv6:2601:190:580:9c44:d527:4cd5:b880:488a]) by resomta-ch2-07v.sys.comcast.net with ESMTPSA id T6Kxgh32FsSYsT6KygG6N6; Sat, 01 Dec 2018 14:33:41 +0000 In-Reply-To: <837egtd6ll.fsf@gnu.org> X-Mailer: Apple Mail (2.3445.9.1) X-CMAE-Envelope: MS4wfLxd/yS4I66tdKFll9XfB7TSEoHUDeQ3tfK5IBP0lgub740tvZEzzNqJA0u8bgUIJXPppJnRNXsYiSZgV/cHCqW+rL5dul9xe2m/cKyEZQocs3V0TtUl pXu9NgsWY9ON7/SO+ZPRzdylyP2DTXg99OLlsd5XKBA9iy/8xEPianmuFCAj3cxTgZMvtV5mc6AEMtOtx3zLePyCUvshhmFlrK3wUUwXLwPI4pqg7zvhVh2d XoZoPWXWSEtKU1iAfvwSgiojcskjbCgV7Fdjz/mzNlPIhXmh0HbCRRNzwcqaXH9U9nyMi7UGJjIWbcnTjETYJg== X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:558:fe21:29:69:252:207:44 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:118814 Archived-At: Thank you Eli, I found found the problem hidden elsewhere that was = toggling things. Understanding is everything. By the way "Starting from the dock" is the same a clicking an icon on = the desktop. It just starts the application without any arguments. I am now at the point of not liking what this is doing because, as Eli = said, all coloring has been disabled. I did like seeing the colors in = buffers like the output of "grep". So I removed the statement from my .emacs file and placed = (font-lock-mode -1) in my 'c-initialization-hook' with the intention of = only disabling colors in my coding modes. That seems to disable it for only the first file loaded, but not the = others. As Eli suggested, this does not have any effect on Lisp mode; = that buffer is always colored. My guess here is that placing it there = does not step on the defaults for all future mode initializations like I = would have expected. So I moved if to my 'c-mode-common-hook' and that did the trick. Thanks to all who read through my details. I hope that it will help = others to understand these things. Fran > On Dec 1, 2018, at 02:55, Eli Zaretskii wrote: >=20 >> From: Francis Belliveau >> Date: Fri, 30 Nov 2018 16:50:23 -0500 >>=20 >> To be clear, what I am trying to do is eliminate the colors being = applied to text in all my files. My understanding from the = documentation is that if I add (global-font-lock-mode -1) to my .emacs = file before I load any modes, the effects should be globally disabled. = Therefore, "failure" in this case is when various portions of my text is = being shown in different colors. >>=20 >> I am not sure that it matters, but for clarity, my .emacs setup opens = up with the window split vertically so that I can see two buffers = simultaneously. >> For the experiments below, I always open the application from my dock = so that no file is loaded. Then I usually open my .emacs file first, in = the left half, then the code files in order on the right. Where I open = another file first, it is done in the left side and the others on the = right. >=20 > Maybe the above does matters, as I'm not on macOS, so maybe there's > something macOS specific involved here; in particular, I have no idea > what does "opening application from my dock" mean. >=20 >> 1. Placing this in my .emacs file does not seem to have any effect. = Lisp, C++ and Java modes all show text in lots of colors. >=20 > Just doing this one thing, i.e. having a .emacs that says only >=20 > (global-font-lock-mode -1) >=20 > disables colors in both Lisp (including *scratch* buffer and any Lisp > file I visit) and C/Java files I visited. >=20 > Do you have anything else in your .emacs in addition to that single > line? If so, perhaps those other things are the culprit. What > happens if you leave just the above single line in your .emacs, and > then restart Emacs? >=20 >> 2. Removed it from main .emacs and placed it in my = 'c-initialization-hook' produces the following curious effects: >=20 > This is definitely not the right thing to do, so let's disregard what > you get when you do this. (c-initialization-hook is only relevant to > C-like languages, which is not what you want. And if you do anything > from that hook, you should only change local values, > i.e. font-lock-mode and not global-font-lock-mode; the latter is a > global mode, so it is inappropriate to turn it on or off from a mode > hook.) >=20 >> I do not understand why there is any "file load order" dependency >=20 > Because you are changing a global setting from a hook that is called > when the first C-like file is visited. >=20