Any suggestions will be much appreciated!
Thanks,
Eric
[If you want to reply by email, please remove the obvious spam-proofing
from my email address.]
> I'm sick of seeing light colored text on a light grey background, which
> I cannot read. I don't really want to customize the colors, I just want
> them gone. And I'm sick of manually turning off font lock mode all the
> time. I've tried in vain to figure out what I can put in my .emacs that
> will prevent font lock mode from ever being used.
(global-font-lock-mode -1)
Note however that it is off by default, so you probably should remove
the code that turns it on. (Which will probably be the above snippet
with a "1" as an arg)
> Eric Smith <eric-no-s...@brouhaha.com> writes:
>
>> I'm sick of seeing light colored text on a light grey background, which
>> I cannot read. I don't really want to customize the colors, I just want
>> them gone. And I'm sick of manually turning off font lock mode all the
>> time. I've tried in vain to figure out what I can put in my .emacs that
>> will prevent font lock mode from ever being used.
>
> (global-font-lock-mode -1)
If you still see too many colors you don't like (there are several
places that use colors even when font-lock-mode is off) you could do
(I won't do that however...)
(mapatoms (lambda (fce) (if (facep fce) (copy-face 'default fce))))
which will set *all* loaded faces to the default face.
Michael
This should never happen and is a bug. Please report it.
The only known cases where it can happen is if you're running under a text
terminal in which case there's no way for Emacs to figure out whether your
background is dark or light, so it might guess wrong, in which case you
should customize frame-background-mode manually.
Stefan
Stefan Monnier <mon...@iro.umontreal.ca> writes:
> The only known cases where it can happen is if you're running under a text
> terminal
Exactly.
> in which case there's no way for Emacs to figure out whether your
> background is dark or light, so it might guess wrong, in which case you
> should customize frame-background-mode manually.
s/it might guess wrong/it does guess wrong/
Why does it guess? When it guesses wrong, it renders the text
unreadable, so the default assumption on a text terminal should be that
the user does NOT want color. (Or maybe that is the default, but my
Linux distribution (Red Hat 9) has changed it?)
If I set frame-background-mode to light, won't that screw up my X frames
which have a dark background? Is there an easy way to set
frame-background-mode to light only if Emacs can't figure out whether
the background is dark or light, as in the text terminal case? Or, better
yet, to simply not use color on text terminals?
Thanks!
Eric Smith
Henrik Enberg <henrik...@telia.com> writes:
> (global-font-lock-mode -1)
I'm not sure what was turning font-lock-mode on, but this has taken care
of it. I had previously tried (global-font-lock-mode nil), which did
not have the desired effect. It never occurred to me to use -1.
Thanks!
Eric
> If I set frame-background-mode to light, won't that screw up my X frames
> which have a dark background?
(unless window-system
(setq frame-background-mode 'light))
Won't do so.
--
Matthieu
In your case, perhaps. In general, it does guess correctly in quite a
few cases. If you still think Emacs _always_ guesses wrong, please
describe your reasons; one specific case---yours---is not enough to
justify a general claim.
> Why does it guess?
Because there's no method known to Emacs developers to query the
terminal about its default background color.
> the default assumption on a text terminal should be that the user
> does NOT want color.
That would be a bad default, since most Emacs users do want color on
the text terminal.
Did it occur to you to read the function's doc string with `C-h f'?
--
Kevin Rodgers
No, most Emacs users want text they can read. If guessing colors
can commonly render unreadable text (and it can), the default should be
no color. There is very little downside to not having color, and it
can be manually enabled. But having unreadable colors is relatively
difficult to disable, because one can't read the help information in order
to find out how to disable it.
I didn't say that it *always* guesses wrong. I just said that it *does*
guess wrong. The nature of a guess is that it is sometimes wrong. In
this case, I think it is frequently wrong, since in my experience most
of the modern virtual terminal software (both under Linux/Posix systems
and on Windows) defaults to a light background.
Guessing wrong is *much* worse than having only B&W text.
> I'm sick of seeing light colored text on a light grey background, which
> I cannot read. I don't really want to customize the colors, I just want
> them gone. And I'm sick of manually turning off font lock mode all the
> time. I've tried in vain to figure out what I can put in my .emacs that
> will prevent font lock mode from ever being used.
You don't need to put something in your .emacs, you need to take
something out. font-lock-mode is disabled by default.
OTOH, you might want to look at using a different terminal emulator
if your current one is not working correctly. You mention Windows in
another post - PuTTY works fine with either light or dark background,
and is a better terminal emulator in general than most of the
alternatives on Windows.
> Guessing wrong is *much* worse than having only B&W text.
disabling the guessing is much worse than improving it.
to improve it, the people who implement the guessing need to
learn the precise environment in which triggers the mis-guess.
the easier this environment is communicated, the easier the
people who implement the guessing can improve it.
thi
Obviously, having the text readable is higher priority than having
colors. Nevertheless, having colors is also a high priority, as
anyone who read this forum back when Emacs didn't support that would
tell you.
> If guessing colors can commonly render unreadable text (and it can),
> the default should be no color.
I don't think it guesses wrong ``commonly'', but in any case I agree
with what someone else said here: improving the guesswork is better
than disabling it, when the feature is wanted by many users.
> There is very little downside to not having color
See, this is where many (most?) Emacs users disagree with you.
> and it can be manually enabled
Well, it's off by default, so what you ask is already there.
On a virtual terminal (i.e. a terminal emulator), Emacs should have
defaulted to a bright background. The code to do that is part of the
guesswork that is the subject of discussions in this thread. If in
your case that didn't work, it might be a bug worth reporting.
Xdefaults like so:
Emacs*Background: black
Emacs*Foreground: white
Emacs*Font: -misc-fixed-medium-r-*-*-13-*-*-*-*-*-*-*
Emacs*MenuBar: off
Emacs*ToolBar: 0
Emacs*ScrollBars: off
Emacs*internalBorder: 2
Custom faces like so:
(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.
'(bold ((nil (:foreground "light blue"))))
'(book-result ((t (:background "darkviolet" :foreground "white" :slant normal :weight bold :height 150 :width normal :family "misc-fixed"))) t)
'(cursor ((nil (:background "DeepPink1"))) t)
'(diary-face ((((class color) (background dark)) (:foreground "green"))))
'(diff-file-header-face ((((class color) (background dark)) (:background "forestgreen" :weight bold))))
'(diff-header-face ((((class color) (background dark)) (:background "maroon"))))
'(font-lock-builtin-face ((nil (:foreground "orange"))))
'(font-lock-comment-face ((nil (:foreground "red"))))
'(font-lock-function-name-face ((((type tty) (class color)) (:foreground "yellow" :weight bold))))
'(font-lock-string-face ((((class color) (background dark)) (:foreground "goldenrod1"))))
'(font-lock-variable-name-face ((nil (:foreground "tan"))))
'(gnus-group-mail-3-empty-face ((((class color) (background dark)) (:foreground "chartreuse3"))))
'(gnus-group-mail-3-face ((t (:foreground "chartreuse1" :weight bold))))
'(holiday-face ((((class color) (background dark)) (:background "grey15"))))
'(italic ((nil (:foreground "green"))))
'(km-nonanon-face ((t (:foreground "purple"))))
'(minibuffer-prompt ((t (:foreground "yellow"))))
'(mode-line ((t (:background "pink" :foreground "black" :weight bold))))
'(mode-line-inactive ((t (:background "grey30" :foreground "peachpuff"))))
'(region ((((class color) (background dark)) (:background "blue4"))))
'(w3-style-face-00005 ((t (:foreground "red" :underline nil :weight normal :family "fixed"))) t)
'(w3-style-face-00009 ((t (:foreground "cadetblue" :underline nil :weight normal :family "fixed"))) t)
'(w3-style-face-00010 ((t (:foreground "grey77" :underline t :weight normal :family "fixed"))) t)
'(w3-style-face-00011 ((t (:foreground "navajowhite" :underline nil :weight normal :family "fixed"))) t)
'(w3-style-face-00012 ((t (:foreground "cadetblue" :underline t :weight normal :family "fixed"))) t)
'(w3-style-face-00013 ((t (:foreground "cadetblue" :underline nil :weight normal :family "fixed"))) t)
'(w3-style-face-00014 ((t (:foreground "plum" :underline t :weight normal :family "fixed"))) t)
'(w3-style-face-00015 ((t (:foreground "goldenrod" :underline nil :weight bold :family "fixed"))) t)
'(w3-style-face-00017 ((t (:foreground "darkgreen" :underline nil :weight normal :height 100 :family "fixed"))) t)
'(w3-style-face-00018 ((t (:foreground "plum" :underline nil :weight normal :height 100 :family "fixed"))) t)
'(w3-style-face-00019 ((t (:foreground "alicewhite" :underline nil :weight normal :family "fixed"))) t)
'(w3-style-face-00021 ((t (:foreground "darkgreen" :underline nil :weight normal :height 100 :family "fixed"))) t)
'(w3-style-face-00030 ((t (:background "darkred" :underline nil :weight normal :family "fixed"))) t))
Having to find all the things in emacs that use distinct faces and
come up with new settings for all of them is exactly what I did not
want to do.
I'm still not sure why font-lock seemed to be on by default on my
system, but now that my .emacs is disabling it thanks to the help
people have provided here, I'm much happier.
But thanks for posting you configuration, and I may try it in the
future.
Kevin Rodgers <ihs_...@yahoo.com> writes:
> Did it occur to you to read the function's doc string with `C-h f'?
I thought I had done that, but apparently not. I must have found mention
of the function elsewhere.
So either nil is positive (which seems somewhat unlikely), or the
documentation for the function is incorrect.
OK, I stand corrected. That is exactly what I wanted (off by default).
There must be something on my system that was turning it on, but I have
not found it yet. Anyhow, turning it off in my .emacs using
(global-font-lock-mode -1) has solved the problem.
Thanks,
Eric
Eli> Obviously, having the text readable is higher priority than
Eli> having colors. Nevertheless, having colors is also a high
Eli> priority, as anyone who read this forum back when Emacs
Eli> didn't support that would tell you.
Why not add a menu entry (if there isn't one yet) and add a sentence
on the welcome screen to tell the clueless people how to activate that
menu item?
--
Lee Sau Dan 李守敦 ~{@nJX6X~}
E-mail: dan...@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee
I think Joe's point was that a few X resource definitions can cover all
the cases so that you don't have to enumerate them all. Note in
particular his use of class (vs. instance) names and an asterisk (vs. A
dot) to separate the program from its resource.
Besides those he listed, you might need these to override all the faces'
colors:
Emacs*attributeForeground: white
Emacs*attributeBackground: black
--
Kevin Rodgers
Trust, but verify.
> So either nil is positive (which seems somewhat unlikely), or the
> documentation for the function is incorrect.
Here is the actual doc string:
| global-font-lock-mode is an interactive compiled Lisp function in `font-lock'.
| (global-font-lock-mode &optional ARG DUMMY)
|
| Toggle Font-Lock mode in every buffer.
| With prefix ARG, turn Global-Font-Lock mode on if and only if ARG is positive.
| Font-Lock mode is actually not turned on in every buffer but only in those
| in which `turn-on-font-lock-if-enabled' turns it on.
Note that the argument is optional; when it is not specified, the mode
is toggled; and a nil value for an optional arg is the same thing as
leaving it unspecified.
--
Kevin Rodgers
> Emacs*attributeForeground: white
> Emacs*attributeBackground: black
AFAIK, X resources aren't used on a text-terminal.
Stefan
Hm, well I nevertheless have good results both under X and on a
terminal, and moreover, in the case of a terminal, the background
can be either dark or light background, and Emacs adjusts the
*default* face accordingly. The font lock setup I use is optimized
for a dark background, including plenty of yellow etc., so I don't
really advise using it on a terminal with a light background unless
you have to.
I should probably have posted this little .emacs snippet too, which
is useful in combination with the .Xdefaults config. This is only
relevant under X; its purpose is to keep flickering at startup time
down to a minimum.
(Cf. http://mail.gnu.org/archive/html/help-gnu-emacs/2004-02/msg00757.html)
(cond (window-system
(setq default-frame-alist
'((internal-border-width . 2)
(border-width . 2)
(left-fringe . 0)
(right-fringe . 0)
(menu-bar-lines . 0)
(tool-bar-lines . 0)
(tool-bar-lines . 0)
(modeline . t)
(width . 85)
(height . 32)
(background-mode . dark)
(display-type . color)
(cursor-color . "DeepPink1")
(background-color . "black")
(foreground-color . "white")
(border-width . 2)
(font
. "-misc-fixed-medium-r-*-*-13-*-*-*-*-*-*-*")))
(set-scroll-bar-mode nil)
(blink-cursor-mode -1)
(tooltip-mode -1)))
The menu item is already there.
What global-font-lock-mode looks at is the _numerical_value_ of the
prefix arg (see the doc string of prefix-numeric-value). You can try
that function with nil and see that
(prefix-numeric-value nil)
=> 1
> What global-font-lock-mode looks at is the _numerical_value_ of the
> prefix arg (see the doc string of prefix-numeric-value). You can try
> that function with nil and see that
> (prefix-numeric-value nil)
> => 1
I wish that was the reason. Sadly, nil is treated specially as a toggle.
Stefan