From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Jim Ottaway Newsgroups: gmane.emacs.help Subject: font-lock problem with a block of text (font-latex) Date: Wed, 07 Jan 2004 17:45:18 +0000 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87n08zmz4h.fsf@lse.ac.uk> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1073500727 21325 80.91.224.253 (7 Jan 2004 18:38:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 7 Jan 2004 18:38:47 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 07 19:38:43 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AeIZn-00020e-00 for ; Wed, 07 Jan 2004 19:38:43 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AeJTr-0008QH-Gn for geh-help-gnu-emacs@m.gmane.org; Wed, 07 Jan 2004 14:36:39 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AeJTI-0008PM-IJ for help-gnu-emacs@gnu.org; Wed, 07 Jan 2004 14:36:04 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AeIzP-0003du-5a for help-gnu-emacs@gnu.org; Wed, 07 Jan 2004 14:05:42 -0500 Original-Received: from [212.74.114.47] (helo=mk-smarthost-1.mail.uk.tiscali.com) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AeIzO-0003d7-LH for help-gnu-emacs@gnu.org; Wed, 07 Jan 2004 14:05:10 -0500 Original-Received: from ppp-1-4.lond-b-1.access.uk.tiscali.com ([80.40.1.4]:1046 helo=runcible) by mk-smarthost-1.mail.uk.tiscali.com with esmtp (Exim 4.24) id 1AeI0u-0001mj-SA for help-gnu-emacs@gnu.org; Wed, 07 Jan 2004 18:02:41 +0000 Original-Received: from jeho by runcible with local (Exim 3.35 #1 (Debian)) id 1AeHk6-0001AJ-00 for ; Wed, 07 Jan 2004 17:45:18 +0000 Original-To: help-gnu-emacs@gnu.org User-Agent: Gnus/5.090024 (Oort Gnus v0.24) Emacs/21.2 (gnu/linux) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 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 Xref: main.gmane.org gmane.emacs.help:15786 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:15786 I am using font-latex with the AUCTeX LaTeX mode (CVS version), but this is more likely a more general question about font-locking blocks of text. I don't like the way that the highlighting in footnotes overrides any other highlighting of code within the footnote, so in my .emacs I have: (defvar hlfn-fn-face 'hlfn-fn-face) ;;; with a light default background, changing the background looks ;;; better, and with a dark background, changing the foreground looks ;;; better. (defface hlfn-fn-face '((((class color) (background light)) (:background "gray90")) (((class color) (background dark)) (:foreground "seagreen3"))) "Face for footnote text in LaTeX mode.") (defvar hlfn-fn-regexp "\\\\footnote\\>") (defun hlfn-match (limit) (require 'font-latex) (font-latex-match-command-outside-arguments hlfn-fn-regexp limit nil nil)) (defun latex-extra-font-lock () (font-lock-add-keywords nil '((hlfn-match (0 font-lock-keyword-face append t) (2 hlfn-fn-face append t))) t)) (add-hook 'LaTeX-mode-hook 'latex-extra-font-lock) And I have removed footnote from `font-latex-match-reference'. This does what I want; I can see the extent of the footnote because it is highlighted with hlfn-fn-face, and any other commands in the footnote are highlighted too. My problem is with the highlighting of the background (when the default background is light), the grey colour extends to the edge of the window, and I would like to limit it to the end of the line: Felix qui potuit rerum cognoscere causas,########################### Quique metus omnes, et inexorabile fatum,########################### Subjecit pedibus, strepitumque Acherontis avari---################## In the above, the # characters show the highlighting that I would like to avoid, it extends to the edge of the window. I have tried some obvious things, such as adding '("\n" . default) to the keywords, but it doesn't work. Does anyone have any idea how this could be done? Regards, Jim Ottaway