From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Eli Zaretskii" Newsgroups: gmane.emacs.help Subject: Re: GNU Emacs 21.2.1 - problem with .emacs file and facement-set-face keybinding command. Date: Sat, 22 May 2004 15:40:25 +0200 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <1659-Sat22May2004154024+0300-eliz@gnu.org> References: <743a4358.0405220156.622f27bd@posting.google.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1085300945 29940 80.91.224.253 (23 May 2004 08:29:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 23 May 2004 08:29:05 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun May 23 10:28:57 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 1BRoLp-0005BN-00 for ; Sun, 23 May 2004 10:28:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BRoLi-0001Tp-Iv for geh-help-gnu-emacs@m.gmane.org; Sun, 23 May 2004 04:28:50 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BRoL7-0001T1-Df for help-gnu-emacs@gnu.org; Sun, 23 May 2004 04:28:13 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BRn0I-0002iE-01 for help-gnu-emacs@gnu.org; Sun, 23 May 2004 03:03:10 -0400 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1BRhp1-0000MP-0y for help-gnu-emacs@gnu.org; Sat, 22 May 2004 21:30:39 -0400 Original-Received: from [192.114.186.23] (helo=aragorn.inter.net.il) by mx20.gnu.org with esmtp (Exim 4.34) id 1BRVui-0006DJ-OF for help-gnu-emacs@gnu.org; Sat, 22 May 2004 08:47:49 -0400 Original-Received: from zaretski (pns03-194-251.inter.net.il [80.230.194.251]) by aragorn.inter.net.il (MOS 3.4.6-GR) with ESMTP id CXS26679; Sat, 22 May 2004 15:42:06 +0300 (IDT) Original-To: help-gnu-emacs@gnu.org X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9 In-reply-to: <743a4358.0405220156.622f27bd@posting.google.com> (yasheshb@yahoo.com) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.4 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:18674 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:18674 > From: yasheshb@yahoo.com (Crazy Coder) > Newsgroups: gnu.emacs.help > Date: 22 May 2004 02:56:17 -0700 > > (global-set-key "\M-gx" (lambda () > (interactive) > (facemenu-set-foreground "LightSalmon"))) > > (global-set-key "\M-gy" (lambda () > (interactive) > (facemenu-set-face "highlight"))) > > (global-set-key "\M-gz" (lambda () > (interactive) > (facemenu-set-face "secondary-selection"))) > --------------------------------------------------------------------------- > > Now I have some questions regarding using the above keybindings - > M-g[xyz] > in my .emacs file. > > --------------------------------------------------------------------------- > The first keybinding \M-gx works fine. It marks the selected region > with > LightSalmon foreground. The other two giving problems. > > when i mark a region and press > > \M-gy > > it gives the following error (i got these from the messages buffer) > facemenu-add-new-face: Wrong type argument: symbolp, "highlight" That's because facemenu-set-face's argument should be a symbol, not a string: (facemenu-set-face 'highlight) > so why is the key sequence \M-gy bound to facemenu-add-new-face It's not; it's just that facemenu-set-face called facemenu-add-new-face, and the latter barfed because its argument was not a symbol. > When i set a face of a region using \M-gx it changes the text color to > LightSalmon. However, if i exit emacs, restart emacs and open the file > the faceproperties of the text is lost. > > Why is this the behaviour ? Because the face information isn't written to the file. > Does facemenu-set-face only make changes in the file during that > session only ? It changes the buffer, not the file. > If I want to make the marking permanent what do i need to do ? Use Enriched Text mode ("M-x enriched-text-mode RET").