all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Trying to make keybindings for color changes
@ 2003-05-14  7:24 Ron House
  2003-05-14 18:36 ` Kevin Rodgers
  0 siblings, 1 reply; 2+ messages in thread
From: Ron House @ 2003-05-14  7:24 UTC (permalink / raw)


I have been trying to get key bindings going to change colours and 
boldness conveniently, but I am not getting exactly what I expect.

In .emacs, I have:

(defun setred (&optional start end)
   (interactive (list))
   (let ((face (intern "fg:red")))
     (or (facemenu-get-face face)
	(error "Unknown color"))
     (facemenu-set-face face start end)))

...and other colours...

And I have key bindings:

(global-set-key [C-f5] 'facemenu-set-default)
(global-set-key [C-f6] 'facemenu-set-bold)
(global-set-key [C-f7] 'setgreen)
(global-set-key [C-f8] 'setblue)
(global-set-key [C-f9] 'setviolet)
(global-set-key [C-f10] 'setmagenta)
(global-set-key [C-f11] 'setred)
(global-set-key [C-f12] 'setblack)

My problem is that the 'bold' key and the colour keys completely cancel 
each other. That is, if I select a colour and then select bold, the 
colour goes back to black, or if I select bold and then select a colour, 
the boldness goes away. I would like to be able to press C-f6 and, say, 
C-f9 (in either order) to get bold violet, for example. I can't remember 
where I got the function for setting the colour in the first place - I 
am not knowledgeable enough to have written it myself and I only barely 
understand it from what documentation I can find about the functions it 
calls.

I tried using facemenu-add-face instead of facemenu-set-face, but that 
turned my colour fns into no-ops.

-- 
Ron House     house@usq.edu.au
               http://www.sci.usq.edu.au/staff/house

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

* Re: Trying to make keybindings for color changes
  2003-05-14  7:24 Trying to make keybindings for color changes Ron House
@ 2003-05-14 18:36 ` Kevin Rodgers
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Rodgers @ 2003-05-14 18:36 UTC (permalink / raw)


Ron House wrote:


> (defun setred (&optional start end)
>   (interactive (list))


This won't solve your problem, but that should be

   (interactive "r")


>   (let ((face (intern "fg:red")))
>     (or (facemenu-get-face face)
>     (error "Unknown color"))
>     (facemenu-set-face face start end)))


-- 
<a href="mailto:&lt;kevin.rodgers&#64;ihs.com&gt;">Kevin Rodgers</a>

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

end of thread, other threads:[~2003-05-14 18:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-14  7:24 Trying to make keybindings for color changes Ron House
2003-05-14 18:36 ` Kevin Rodgers

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.