From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: Different fonts per region Date: Thu, 03 Mar 2016 01:37:32 +0100 Message-ID: <87wppk2y7n.fsf@debian.uxu> References: <871t7t40e3.fsf@posteo.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1456965491 1120 80.91.229.3 (3 Mar 2016 00:38:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 3 Mar 2016 00:38:11 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 03 01:38:02 2016 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 1abHHB-00074b-K0 for geh-help-gnu-emacs@m.gmane.org; Thu, 03 Mar 2016 01:37:57 +0100 Original-Received: from localhost ([::1]:59835 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abHHA-0000tc-OL for geh-help-gnu-emacs@m.gmane.org; Wed, 02 Mar 2016 19:37:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59100) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abHGz-0000tK-Qc for help-gnu-emacs@gnu.org; Wed, 02 Mar 2016 19:37:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1abHGv-0002eg-PM for help-gnu-emacs@gnu.org; Wed, 02 Mar 2016 19:37:45 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:41068) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abHGv-0002eB-IZ for help-gnu-emacs@gnu.org; Wed, 02 Mar 2016 19:37:41 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1abHGs-0006qt-Cu for help-gnu-emacs@gnu.org; Thu, 03 Mar 2016 01:37:38 +0100 Original-Received: from nl106-137-54.student.uu.se ([130.243.137.54]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 Mar 2016 01:37:38 +0100 Original-Received: from embe8573 by nl106-137-54.student.uu.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 Mar 2016 01:37:38 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 45 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: nl106-137-54.student.uu.se Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:UOIroiJcv4tH0D4A1gEo2dYO90I= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:109405 Archived-At: henry atting writes: > Okay, I can change the font per buffer, frame, mode > or set another default font. Is it also possible to > set the font per region, say have three different > regions in a buffer with three different fonts? > Just to know if it's possible; outside emacs it > would be of little avail anyway. It is possible: Just look! (It is red.) And this is yellow: I'm rubber, you're glue. Have a look: http://user.it.uu.se/~embe8573/pics/region-colors.png Note tho I had to do `text-mode' first as the colorizing stuff isn't supported for `message-mode' just yet. Something you could add, perhaps? Anyway what you look for is the `facemenu-' stuff, e.g., `facemenu-set-foreground' which I used for the examples above. By the way, anyone who is interested in colorizing the message buffer, check out this little pearl from the bottomless pit of the technicolor ocean: (font-lock-add-keywords 'message-mode '( ("`\\(.*?\\)'" (1 font-lock-reference-face)) ) t) And the next step is a function that colorizes it red if there isn't such a function or variable defined! Dig (dive) deep :) -- underground experts united http://user.it.uu.se/~embe8573