From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alexandre LAURENT Newsgroups: gmane.emacs.help Subject: Re: Overriding some face attributes without changing the default(s) one(s) Date: Mon, 9 Jun 2014 20:10:31 +0200 Message-ID: References: <871tv05z88.fsf@web.de> <87ppikgcq7.fsf@gmail.com> <87lht6ha4m.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1402337475 19887 80.91.229.3 (9 Jun 2014 18:11:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 9 Jun 2014 18:11:15 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Alex Kost Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 09 20:11:08 2014 Return-path: Envelope-to: geh-help-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 1Wu42E-0007B1-Nf for geh-help-gnu-emacs@m.gmane.org; Mon, 09 Jun 2014 20:11:06 +0200 Original-Received: from localhost ([::1]:34676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wu42E-00074y-3m for geh-help-gnu-emacs@m.gmane.org; Mon, 09 Jun 2014 14:11:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50169) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wu421-00074t-GX for help-gnu-emacs@gnu.org; Mon, 09 Jun 2014 14:10:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wu420-0007Y6-DJ for help-gnu-emacs@gnu.org; Mon, 09 Jun 2014 14:10:53 -0400 Original-Received: from mail-qa0-x22b.google.com ([2607:f8b0:400d:c00::22b]:35934) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wu420-0007Y0-88 for help-gnu-emacs@gnu.org; Mon, 09 Jun 2014 14:10:52 -0400 Original-Received: by mail-qa0-f43.google.com with SMTP id m5so8141908qaj.16 for ; Mon, 09 Jun 2014 11:10:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=92SlmWWNs7brTbxCgubfr7AVtbXbzwhmUvAPFpbXJv4=; b=e3/5KKX/xwu8HPScyC8XKPGlO0uwfO0+pbzTjGlyrsBarUd1ef4QT2nRPCsUyDw+1U BDtTDMBu/kduAytRrFTXt9zEsuLyxpHH/eyt67cbseG4MZ16ARgg3k/SGVz2qlVt/uOU zWYY/+Mz3jKmaB7XXl2TX4cTWOt07ONrkoG4kfUqefaXlDHE0ewIbcU55MhtKV1fwCWR kHXICj5gpwy2xcP956xW3atHT9zDabZRU3XYAsDewbG2RxNiVz/fqqr40YgAPXHef0Nr K6XXuNAxMxUgd39bmxK3Lask3W2Dwj1FCF9SVVd8e7MMMxOVgMcABBVkGHvzoDG33D0P zZWg== X-Received: by 10.140.102.161 with SMTP id w30mr6141866qge.108.1402337451448; Mon, 09 Jun 2014 11:10:51 -0700 (PDT) Original-Received: by 10.140.107.131 with HTTP; Mon, 9 Jun 2014 11:10:31 -0700 (PDT) In-Reply-To: <87lht6ha4m.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c00::22b X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:98117 Archived-At: On Mon, Jun 9, 2014 at 8:26 AM, Alex Kost wrote: > Oh, now I understand what you want. Actually here you faced with > another problem: when you enable whitespace-mode in emacs 24.3.1, > "whitespace-line" becomes the only active face in a long line, and in > emacs 24.4 it is added to the faces in that line. > > So let's say, you have the following long line in a buffer with > "emacs-lisp-mode" (and "whitespace-mode" is enabled): > > (defun some-function (arg1 arg2 &rest args) "A very useful function." (interactive) (message "Hello")) > > If you move your cursor to the "defun" word and press "C-4 C-x =", in > the bottom of the "*Help*" buffer you will see: > > There are text properties here: > face whitespace-line > fontified t > > I.e. only "whitespace-line" face is active and you can't see > "font-lock-keyword-face" (used for highlighting "defun") no matter how > you customized "whitespace-line". > > As for emacs 24.4, you will see: > > There are text properties here: > face (whitespace-line font-lock-keyword-face) > fontified t > > In this case if some bits of face spec are unspecified in > "whitespace-line" face, the ones from "font-lock-keyword-face" are used. > > So that is not the same problem we were discussing before, but it is > also fixed in emacs 24.4. Ok, I thought both issues were somehow related. The thing is, I was not sure how to highlight these long lines anyway, but I just cannot have a single face to handle this. I sometimes have to read code from people who don't care about these kind of rules (yes, they could even develop their project in a single line (I suppose that they don't plan to read their own code)), so ~70% of the file loses the syntax highlighting in this case. For now, I'll just remove "lines" from "whitespace-style" and define something like this: (add-hook 'prog-mode-hook (lambda () (font-lock-add-keywords nil '(("^[^\n]\\{80\\}\\(.*\\)$" ;;... ))))) It should be enough, and I can catch and highlight the end of the line only. Anyway, thanks it is clear now and I didn't know about "C-4 C-x =". -- Alexandre LAURENT