all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* GNU Emacs 21.2.1 - problem with .emacs file and facement-set-face keybinding command.
@ 2004-05-22  9:56 Crazy Coder
  2004-05-22 13:40 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Crazy Coder @ 2004-05-22  9:56 UTC (permalink / raw)


Hi,

   I'm using 

GNU Emacs 21.2.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of
2002-08-29 on astest

  and have ~/.emacs file as follows.

---------------------------------------------------------------------------
(custom-set-variables
  ;; custom-set-variables was added by Custom -- don't edit or
cut/paste it!
  ;; Your init file should contain only one such instance.
 '(case-fold-search t)
 '(current-language-environment "English")
 '(global-font-lock-mode t nil (font-lock))
 '(show-paren-mode t nil (paren))
 '(tab-width 4)
 '(transient-mark-mode t)
 '(uniquify-buffer-name-style (quote forward) nil (uniquify)))
(custom-set-faces
  ;; custom-set-faces was added by Custom -- don't edit or cut/paste
it!
  ;; Your init file should contain only one such instance.
 '(bold ((t (:weight extra-bold)))))

;; my customizations.

(global-set-key "\C-xg" 'goto-line)

(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"

so why is the key sequence \M-gy bound to facemenu-add-new-face
instead of
facemenu-set-face.
---------------------------------------------------------------------------
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 ? Does facemenu-set-face only make changes
in the
file during that session only ? If I want to make the marking
permanent
what do i need to do ?
---------------------------------------------------------------------------

Appreciate any help, feedback.

Thanks.

Yashesh

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: GNU Emacs 21.2.1 - problem with .emacs file and facement-set-face keybinding command.
  2004-05-22  9:56 GNU Emacs 21.2.1 - problem with .emacs file and facement-set-face keybinding command Crazy Coder
@ 2004-05-22 13:40 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2004-05-22 13:40 UTC (permalink / raw)


> 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").

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-05-22 13:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-22  9:56 GNU Emacs 21.2.1 - problem with .emacs file and facement-set-face keybinding command Crazy Coder
2004-05-22 13:40 ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.