[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GNU Emacs 21.2.1 - problem with .emacs file and facement-set-face ke
From: |
Eli Zaretskii |
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 |
> 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").