From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.help Subject: Re: how to attach properties to a piece of text? Date: Thu, 19 Mar 2009 09:54:36 +0900 Message-ID: <877i2mgwmr.fsf@catnip.gol.com> References: <3f3f751a-a93a-4de6-a306-bf5f47bc9fea@v5g2000prm.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1237426860 28663 80.91.229.12 (19 Mar 2009 01:41:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Mar 2009 01:41:00 +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 19 02:42:17 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Lk7Gy-0002d6-CF for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Mar 2009 02:42:16 +0100 Original-Received: from localhost ([127.0.0.1]:58120 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lk7Fc-0001Pk-1d for geh-help-gnu-emacs@m.gmane.org; Wed, 18 Mar 2009 21:40:52 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!newshub.sdsu.edu!feeder.erje.net!news.netcologne.de!newsfeed-fusi2.netcologne.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 27 Original-X-Trace: individual.net 5qwWRTcZhz+yJfyGb2X5+AACahvaYA80kjg89wrwdKrb0vxl+g Cancel-Lock: sha1:YX3SRlHgYRIZqXZr9/PVS8CMuoA= sha1:4mONbhoC0Oh2WVimg6rorDxFeno= System-Type: x86_64-unknown-linux-gnu Original-Xref: news.stanford.edu gnu.emacs.help:167773 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:63063 Archived-At: Xah Lee writes: > i haven't studied emacs's face, display property etc systems. But > could anyone give me a rough guide on what function i should use or > lookup? `put-text-property' In particular, you may want the :foreground attribute of the `face' property. E.g. try evaluating the following: (put-text-property (point) (mark) 'face '(:foreground "green")) However, note that if the buffer's mode uses font-lock, font-lock will _override_ any `face' property you set (to be its own); in a font-lock'd buffer, you can use the `font-lock-face' property instead: (put-text-property (point) (mark) 'font-lock-face '(:foreground "green")) -Miles -- Cynic, n. A blackguard whose faulty vision sees things as they are, not as they ought to be. Hence the custom among the Scythians of plucking out a cynic's eyes to improve his vision.