Discussion:
Customising
(too old to reply)
Dieter Britz
2015-06-23 12:18:50 UTC
Permalink
I have a new emacs installed and it gives me a light
grey background and white highlighting. I know that I
can, in principle, set these things in the options page
but there are so many items there, mostly cryptic for me,
but what is the simplest way to set just these two things:

I want to have a white background and yellow highlighting.

How do I change that most easily please, so that it sticks?
Thank you in advance.
--
Dieter Britz
Ray Hughes
2015-06-23 14:21:03 UTC
Permalink
Post by Dieter Britz
I have a new emacs installed and it gives me a light
grey background and white highlighting. I know that I
can, in principle, set these things in the options page
but there are so many items there, mostly cryptic for me,
I want to have a white background and yellow highlighting.
How do I change that most easily please, so that it sticks?
Thank you in advance.
Well you can add something like this to your .emacs file.

(add-to-list 'default-frame-alist '(foreground-color . "darkblue"))
(add-to-list 'default-frame-alist '(background-color . "wheat"))

of course using your own colours.

The built in manuals are terrific.

M-x display-colors <Ret> will show what's available.

Good luck

Ray(the-other-ray)
Dan Espen
2015-06-23 15:21:26 UTC
Permalink
Ray Hughes
Post by Ray Hughes
Post by Dieter Britz
I have a new emacs installed and it gives me a light
grey background and white highlighting. I know that I
can, in principle, set these things in the options page
but there are so many items there, mostly cryptic for me,
I want to have a white background and yellow highlighting.
How do I change that most easily please, so that it sticks?
Thank you in advance.
Well you can add something like this to your .emacs file.
(add-to-list 'default-frame-alist '(foreground-color . "darkblue"))
(add-to-list 'default-frame-alist '(background-color . "wheat"))
of course using your own colours.
Just have to comment on the OPs own colors.

Yellow on white? Seriously? I did:

xterm -fg yellow -bg white

(Why ruin a good emacs session.)

Completely invisible text.
Substituting "tan" for "yellow" gets slightly closer to usable.
Post by Ray Hughes
The built in manuals are terrific.
M-x display-colors <Ret> will show what's available.
And, just because a color is available doesn't mean you should use it.
Remember, black and white provide the most contrast.
--
Dan Espen
Dieter Britz
2015-06-24 19:28:21 UTC
Permalink
Post by Dan Espen
xterm -fg yellow -bg white
(Why ruin a good emacs session.)
I wrote yellow highlighting, not yellow text.
--
Dieter Britz
Dieter Britz
2015-06-24 19:39:37 UTC
Permalink
Post by Ray Hughes
Post by Dieter Britz
I have a new emacs installed and it gives me a light
grey background and white highlighting. I know that I can, in
principle, set these things in the options page but there are so many
items there, mostly cryptic for me, but what is the simplest way to set
I want to have a white background and yellow highlighting.
How do I change that most easily please, so that it sticks?
Thank you in advance.
Well you can add something like this to your .emacs file.
(add-to-list 'default-frame-alist '(foreground-color . "darkblue"))
(add-to-list 'default-frame-alist '(background-color . "wheat"))
of course using your own colours.
The built in manuals are terrific.
M-x display-colors <Ret> will show what's available.
OK, thanks. And highlighting colour? I suppose that's
(add-to-list 'default-frame-alist '(highlight-color . "yellow")) ?
--
Dieter Britz
Dieter Britz
2015-06-25 19:21:24 UTC
Permalink
[...]
Post by Ray Hughes
Well you can add something like this to your .emacs file.
(add-to-list 'default-frame-alist '(foreground-color . "darkblue"))
(add-to-list 'default-frame-alist '(background-color . "wheat"))
of course using your own colours.
[...]
OK, thanks. And highlighting colour? I suppose that's (add-to-list
'default-frame-alist '(highlight-color . "yellow")) ?
Tried that, didn't work. What do I have to insert there?
The second one worked, now my background is smoky white, nice.
But highlights now stand out a bit less than before, and yellow
would be better.
--
Dieter Britz
Ray
2015-06-25 22:34:57 UTC
Permalink
Post by Dieter Britz
[...]
Post by Ray Hughes
Well you can add something like this to your .emacs file.
(add-to-list 'default-frame-alist '(foreground-color . "darkblue"))
(add-to-list 'default-frame-alist '(background-color . "wheat"))
of course using your own colours.
[...]
OK, thanks. And highlighting colour? I suppose that's (add-to-list
'default-frame-alist '(highlight-color . "yellow")) ?
Tried that, didn't work. What do I have to insert there?
The second one worked, now my background is smoky white, nice.
But highlights now stand out a bit less than before, and yellow
would be better.
I can point you in the right direction. Hope it helps.

<http://stackoverflow.com/questions/17701576/changing-highlight-line-color-in-emacs>

I remind you that the built in manuals in emacs really are worth a read.

Ray(the-other-one)
Alain Ketterlin
2015-06-23 16:05:04 UTC
Permalink
Post by Dieter Britz
I have a new emacs installed and it gives me a light
grey background and white highlighting. I know that I
can, in principle, set these things in the options page
but there are so many items there, mostly cryptic for me,
I want to have a white background and yellow highlighting.
How do I change that most easily please, so that it sticks?
Thank you in advance.
The face is called 'region', iiuc. You can customize it.

-- Alain.
Ray
2015-06-23 17:50:19 UTC
Permalink
Post by Dieter Britz
I have a new emacs installed and it gives me a light
grey background and white highlighting. I know that I
can, in principle, set these things in the options page
but there are so many items there, mostly cryptic for me,
I want to have a white background and yellow highlighting.
How do I change that most easily please, so that it sticks?
Thank you in advance.
Sorry Dieter in response to my own last reply to you...

I should have said to see all colors use Mx list-colors NOT Mx
display-colors.

I my own defence I have the 2nd one as my own shortcut. :)

Ray(the other ray)
Michael Heerdegen
2015-06-23 19:07:53 UTC
Permalink
Post by Dieter Britz
I have a new emacs installed and it gives me a light
grey background and white highlighting.
Dunno what Emacs version you installed; the normal distribution has a
white background.
Post by Dieter Britz
I know that I can, in principle, set these things in the options page
but there are so many items there, mostly cryptic for me, but what is
I want to have a white background and yellow highlighting.
How do I change that most easily please, so that it sticks?
Thank you in advance.
Assuming you don't want to use Lisp:

Type M-x customize-group faces RET. Select the "Basic faces" subgroup.
Change the settings for the "default" and the "region" face to your
likes - it should be self-describing; click on the left arrows to expand
a face's settings - and save. It's just a simple GUI.

Alternatively there are pre-defined color schemes called "custom themes"
you can apply. Type M-x customize-themes RET and you get a nice
menu for all installed themes.

Much more themes are available as packages.


HTH,

Michael.
N. Jackson
2015-06-26 00:58:54 UTC
Permalink
Post by Dieter Britz
I have a new emacs installed and it gives me a light
grey background and white highlighting. I know that I
can, in principle, set these things in the options page
but there are so many items there, mostly cryptic for me,
I want to have a white background and yellow highlighting.
How do I change that most easily please, so that it sticks?
Thank you in advance.
IIUC what you want, for the highlighting, perhaps:

M-x customize-face RET highlight RET

and/or

M-x customize-face RET region RET

You'll want to set the background colour to your yellow (and perhaps
also change the foreground colour to make it legible).

Click `Apply' to test out the change; click `Apply and Save' to make the
change "permanent".
Dieter Britz
2015-06-27 14:11:10 UTC
Permalink
On Thu, 25 Jun 2015 21:58:54 -0300, N. Jackson wrote:
[...]
Post by N. Jackson
M-x customize-face RET highlight RET
and/or
M-x customize-face RET region RET
You'll want to set the background colour to your yellow (and perhaps
also change the foreground colour to make it legible).
Click `Apply' to test out the change; click `Apply and Save' to make the
change "permanent".
I did the first one, and it seemed to work, giving me
a sample of the colour that I had chosen. So I clicked on
Apply and Save, and exited. But at the next emacs session,
it was not there any more. ??

On how to exit: when I enter the customising screen and
do my thing, how do I gracefully get back to the editing
session? This is sometimes also a problem if I do something
wrong and get a screen with help or an error message. The only
way I know is to exit with CTRL X C, which means I have to start
a new session. I know there must be better way out.
--
Dieter Britz
N. Jackson
2015-06-27 15:37:13 UTC
Permalink
Post by Dieter Britz
[...]
Post by N. Jackson
M-x customize-face RET highlight RET
and/or
M-x customize-face RET region RET
You'll want to set the background colour to your yellow (and perhaps
also change the foreground colour to make it legible).
Click `Apply' to test out the change; click `Apply and Save' to make the
change "permanent".
I did the first one, and it seemed to work, giving me
a sample of the colour that I had chosen. So I clicked on
Apply and Save, and exited. But at the next emacs session,
it was not there any more. ??
By default, Customize saves its settings near the top of your .emacs
file (`custom-set-faces' are below `custom-set-variables'); have a look
there to see if they were added when you clicked the 'Apply and Save'
button. If the new setting _is_ in your .emacs, then I'd guess that you
have another setting later in the file that unsets it.

If the new setting is not being written to your .emacs file, then there
might be something wrong with your installation. I'd suggest you ask on
the help-gnu-emacs mailing list
(https://savannah.gnu.org/mail/?group_id=40), where you'll find lots of
real experts; I'm just an every-day user. (If you don't want to
subscribe to the list, you can read and post to it as news on
gmane.org.)
Post by Dieter Britz
On how to exit: when I enter the customising screen and
do my thing, how do I gracefully get back to the editing
session? This is sometimes also a problem if I do something
wrong and get a screen with help or an error message. The only
way I know is to exit with CTRL X C, which means I have to start
a new session. I know there must be better way out.
You can exit a Customize or a Help buffer by typing q. That buries the
buffer rather than closing it though. You can close a buffer with C-x k
RET (which runs the command kill-buffer).

Also C-x <left> (which runs the command previous-buffer) and C-x <right>
(which runs the command next-buffer) can be used to cycle through
buffers. Alternatively C-x C-b runs the command list-buffers which you
can use for buffer navigation.

I recommend you run through the Emacs Tutorial (from the Help menu).
It's a bit primitive in a way, but it contains a lot of valuable
information.
Dieter Britz
2015-06-27 18:56:30 UTC
Permalink
Post by N. Jackson
If the new setting is not being written to your .emacs file, then there
might be something wrong with your installation. I'd suggest you ask on
Any idea what there ought to be in the .emacs file? If I knew that
I could edit it in directly. But thanks for the name of the expert
ng, might try that.
--
Dieter Britz
Dieter Britz
2015-06-27 19:06:48 UTC
Permalink
Post by N. Jackson
If the new setting is not being written to your .emacs file, then there
might be something wrong with your installation. I'd suggest you ask on
Any idea what there ought to be in the .emacs file? If I knew that I
could edit it in directly. But thanks for the name of the expert ng,
might try that.
Ah, I just had a look at what is in there. It is:

(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(inhibit-startup-screen t))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(highlight ((t (:background "LightGoldenrod1")))))
(add-to-list 'default-frame-alist '(background-color . "white smoke"))
(add-to-list 'default-frame-alist '(highlight-color . "yellow"))

The goldenrod thing is what I tried, and I see it's there, but
it still doesn't give me that colour highlight background. I also
see "yellow" after that in another statement, from an earlier
attempt. None of these work, so I must be putting in wrong
statements.
--
Dieter Britz
N. Jackson
2015-06-28 03:37:30 UTC
Permalink
Post by Dieter Britz
Any idea what there ought to be in the .emacs file? If I knew that I
could edit it in directly. But thanks for the name of the expert ng,
might try that.
(custom-set-faces
'(highlight ((t (:background "LightGoldenrod1")))))
Great. So Customize is working fine.

If your highlighting looked the way you want after you modified the
`highlight' face in Customize, but no longer was what you wanted after
restarting Emacs, then it looks like one of those two lines you added to
your .emacs by hand is interfering. Try deleting them or commenting them
out.

On the other hand, if you never saw the highlighting you want after you
modified the `highlight' face in Customize, try also modifying the
`region' face in Customize. That should give you what you want.
Dieter Britz
2015-07-25 13:34:17 UTC
Permalink
Post by N. Jackson
Post by Dieter Britz
Any idea what there ought to be in the .emacs file? If I knew that I
could edit it in directly. But thanks for the name of the expert ng,
might try that.
(custom-set-faces
'(highlight ((t (:background "LightGoldenrod1")))))
Great. So Customize is working fine.
If your highlighting looked the way you want after you modified the
`highlight' face in Customize, but no longer was what you wanted after
restarting Emacs, then it looks like one of those two lines you added to
your .emacs by hand is interfering. Try deleting them or commenting them
out.
On the other hand, if you never saw the highlighting you want after you
modified the `highlight' face in Customize, try also modifying the
`region' face in Customize. That should give you what you want.
I still have not worked out how to get light yellow highlighting,
i.e. how to implement this region thing. Exactly what do I have to
add to the file .emacs to do that? Or, if I have to set an option
manually, exactly how do I proceed?

I know I'm a bit slow here but I really would like to get this working.
--
Dieter Britz
Dieter Britz
2015-07-28 07:17:57 UTC
Permalink
Post by Dieter Britz
Post by N. Jackson
Post by Dieter Britz
Any idea what there ought to be in the .emacs file? If I knew that I
could edit it in directly. But thanks for the name of the expert ng,
might try that.
(custom-set-faces
'(highlight ((t (:background "LightGoldenrod1")))))
Great. So Customize is working fine.
If your highlighting looked the way you want after you modified the
`highlight' face in Customize, but no longer was what you wanted after
restarting Emacs, then it looks like one of those two lines you added
to your .emacs by hand is interfering. Try deleting them or commenting
them out.
On the other hand, if you never saw the highlighting you want after you
modified the `highlight' face in Customize, try also modifying the
`region' face in Customize. That should give you what you want.
I still have not worked out how to get light yellow highlighting,
i.e. how to implement this region thing. Exactly what do I have to add
to the file .emacs to do that? Or, if I have to set an option manually,
exactly how do I proceed?
I know I'm a bit slow here but I really would like to get this working.
STOP! I worked it out. Thanks for the advice.
--
Dieter Britz
Loading...