* e23 inverse video on mode line and nowhere else
@ 2010-01-13 1:42 Karl Berry
2010-01-13 8:31 ` Leo
2010-01-16 22:35 ` Juri Linkov
0 siblings, 2 replies; 9+ messages in thread
From: Karl Berry @ 2010-01-13 1:42 UTC (permalink / raw
To: help-gnu-emacs
I habitually run Emacs in an xterm window. For that purpose, I'd like
to have the mode lines be inverse video, and not to have inverse video,
or any other face manipulations (underline, etc.), in buffer contents,
such as *compilation* and *grep*.
Is there any way to do this globally in Emacs 23?
If not ...
A couple years ago Juri Linkov kindly sent me the Elisp below to
disable faces by default, leaving only faces matching ^mode-line
untouched. This seems to generally give what I want. (Thanks again, Juri.)
But what I'm finding now is that the compilation status string, such as
":run", ": exit[0]", and so on, is shown as normal text (not inverse
video) in the mode line.
I can get the compilation string in inverse video in the mode line with
this (or by excluding ^compilation in my-faces-fix below):
(set-face-attribute 'compilation-info nil :inverse-video t)
(set-face-attribute 'compilation-warning nil :inverse-video t)
(set-face-attribute 'compilation-error nil :inverse-video t)
But then filenames and various other strings show up in inverse video in
the buffer contents.
Short of reverting back to old versions of M-x compile, etc., which I
don't want to do, is there any way to control this?
Perhaps by doing something in the mode line display to force all faces
to inverse video? (It seems like the same compilation-* faces should
not be used both within the buffer contents and in the mode line, but
anyway.)
Thanks,
Karl
;; Kill all faces except mode lines. (Juri, 14aug07)
(defun my-faces-fix (&optional frame)
"Fix defined faces."
(interactive)
;; Check if this function is called by `custom-define-hook' from
;; `custom-declare-face' where the variable `face' is bound locally.
(when (boundp 'face)
(dolist (face (face-list))
(unless (string-match "^mode-line" (symbol-name face))
;; Reset all face attributes
(modify-face face)))))
;;
;; 1. Fix existing faces
(let ((face t)) (my-faces-fix))
;;
;; 2. Call `my-faces-fix' every time some new face gets defined
(add-to-list 'custom-define-hook 'my-faces-fix)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: e23 inverse video on mode line and nowhere else
2010-01-13 1:42 Karl Berry
@ 2010-01-13 8:31 ` Leo
2010-01-16 22:35 ` Juri Linkov
1 sibling, 0 replies; 9+ messages in thread
From: Leo @ 2010-01-13 8:31 UTC (permalink / raw
To: help-gnu-emacs
On 2010-01-13 01:42 +0000, Karl Berry wrote:
> I habitually run Emacs in an xterm window. For that purpose, I'd like
> to have the mode lines be inverse video, and not to have inverse
> video, or any other face manipulations (underline, etc.), in buffer
> contents, such as *compilation* and *grep*.
When I run emacs in terminals, the mode line is always inverse video but
the rest is normal. M-x describe RET mode-line RET:
Face: mode-line (sample) (customize this face)
Documentation: Basic mode line face for selected window.
Defined in `faces.el'.
Family: unspecified
Foundry: unspecified
Width: unspecified
Height: unspecified
Weight: unspecified
Slant: unspecified
Foreground: unspecified
Background: unspecified
Underline: unspecified
Overline: unspecified
Strike-through: unspecified
Box: unspecified
Inverse: t
Stipple: unspecified
Font: unspecified
Fontset: unspecified
Inherit: unspecified
Leo
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: e23 inverse video on mode line and nowhere else
@ 2010-01-14 23:04 ` Karl Berry
2010-01-15 4:13 ` Steve Revilak
2010-01-15 20:23 ` Leo
0 siblings, 2 replies; 9+ messages in thread
From: Karl Berry @ 2010-01-14 23:04 UTC (permalink / raw
To: help-gnu-emacs
When I run emacs in terminals, the mode line is always inverse video
but the rest is normal.
Thanks for replying, but this is not even remotely true for me in e23
(it used to be that way, for sure, for many many years). Now, I start
emacs with emacs-23.1 --no-site --no-init in an xterm, and immediately
observe the *scratch* buffer name is in bold. (Haven't tried
tty-suppress-bold-inverse-default-colors yet, but anyway, that's not so
critical.)
More importantly, then I run M-x grep and do something like
"grep -nH e /etc/issue", and observe that "/etc/issue:1:" is underlined,
"matches found" is in bold, etc.
All of these things are what my brain needs to have eliminated :).
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: e23 inverse video on mode line and nowhere else
[not found] <mailman.1436.1263510311.18930.help-gnu-emacs@gnu.org>
@ 2010-01-15 0:32 ` Tim X
2010-01-15 8:21 ` Eli Zaretskii
0 siblings, 1 reply; 9+ messages in thread
From: Tim X @ 2010-01-15 0:32 UTC (permalink / raw
To: help-gnu-emacs
karl@freefriends.org (Karl Berry) writes:
> When I run emacs in terminals, the mode line is always inverse video
> but the rest is normal.
>
> Thanks for replying, but this is not even remotely true for me in e23
> (it used to be that way, for sure, for many many years). Now, I start
> emacs with emacs-23.1 --no-site --no-init in an xterm, and immediately
> observe the *scratch* buffer name is in bold. (Haven't tried
> tty-suppress-bold-inverse-default-colors yet, but anyway, that's not so
> critical.)
>
> More importantly, then I run M-x grep and do something like
> "grep -nH e /etc/issue", and observe that "/etc/issue:1:" is underlined,
> "matches found" is in bold, etc.
>
> All of these things are what my brain needs to have eliminated :).
Three possible solutions.
1. M-x customize-face will allow you to set the attributes of various
faces. If you have the cursor on one of the faces you want to change
when you run customize-face, it will, by default, allow you to customize
that face. Otherwise, you can ask to customize all faces and they will
be listed in a customize buffer (showing samples for each of the faces).
One of the options is to set a face to inherit its attributes from
another face and then modify it further. This allows you to have a
hierarchy of attributes. So, if you wanted to have a specific face have
no special attributes, you could define it to inherit from the 'default'
face and not set any specific attributes. Doing this will mean that if,
at some later time, you want to modify the default face, all the ones
that inherit from it will also inherit those mods.
2. M-x list-faces-display will bring up a buffer showing all the
currently defined faces. You can then use the mouse or cursor keys to
select a definition for customization.
Using either of the two above techniques, you can change all the
attributes of a face i.e. bold, underline, fg/bg colour, size, font,
etc.
3. Turn off global font lock mode. This will result in most faces just
having the 'default' attributes.
HTH
Tim
--
tcross (at) rapttech dot com dot au
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: e23 inverse video on mode line and nowhere else
2010-01-14 23:04 ` Karl Berry
@ 2010-01-15 4:13 ` Steve Revilak
2010-01-15 20:23 ` Leo
1 sibling, 0 replies; 9+ messages in thread
From: Steve Revilak @ 2010-01-15 4:13 UTC (permalink / raw
To: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 1646 bytes --]
>> When I run emacs in terminals, the mode line is always inverse video
>> but the rest is normal.
karl> Thanks for replying, but this is not even remotely true for me
karl> in e23 (it used to be that way, for sure, for many many years).
karl> Now, I start emacs with emacs-23.1 --no-site --no-init in an
karl> xterm, and immediately observe the *scratch* buffer name is in
karl> bold. (Haven't tried tty-suppress-bold-inverse-default-colors
karl> yet, but anyway, that's not so critical.)
I had a bit of a surprise when I first tried Emacs-23. It's only
slightly related to Karl's issue, but I'll mention it anyway.
The first time I tried Emacs-23, I lost reverse video in the mode
line. Talk about disorienting :)
After some trial and error, I discovered the cause. I'd used M-x
customize-face to customize the default face. The customized default
face worked well for a windowed emacs, but not so well for "emacs
-nw". Unfortunately, I don't remember the precise customization, and
the bufferfly has long flipped those bits on my hard drive.
Karl was using --no-init-file --no-site-file, so face customizations
probably have nothing to do with it.
timx> Three possible solutions.
timx>
timx> 1. M-x customize-face will allow you to set the attributes of
timx> various faces.
timx> 3. Turn off global font lock mode. This will result in most
timx> faces just having the 'default' attributes.
Turning off font-lock removes much of the decoration, but seems to
have little effect on compile mode. M-x customize-face might be the
most effective way to de-ornament compile mode.
Steve
[-- Attachment #2: Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: e23 inverse video on mode line and nowhere else
2010-01-15 0:32 ` e23 inverse video on mode line and nowhere else Tim X
@ 2010-01-15 8:21 ` Eli Zaretskii
0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2010-01-15 8:21 UTC (permalink / raw
To: help-gnu-emacs
> From: Tim X <timx@nospam.dev.null>
> Date: Fri, 15 Jan 2010 11:32:20 +1100
>
> Three possible solutions.
>
> 1. M-x customize-face will allow you to set the attributes of various
> faces. If you have the cursor on one of the faces you want to change
> when you run customize-face, it will, by default, allow you to customize
> that face. Otherwise, you can ask to customize all faces and they will
> be listed in a customize buffer (showing samples for each of the faces).
> One of the options is to set a face to inherit its attributes from
> another face and then modify it further. This allows you to have a
> hierarchy of attributes. So, if you wanted to have a specific face have
> no special attributes, you could define it to inherit from the 'default'
> face and not set any specific attributes. Doing this will mean that if,
> at some later time, you want to modify the default face, all the ones
> that inherit from it will also inherit those mods.
>
> 2. M-x list-faces-display will bring up a buffer showing all the
> currently defined faces. You can then use the mouse or cursor keys to
> select a definition for customization.
>
> Using either of the two above techniques, you can change all the
> attributes of a face i.e. bold, underline, fg/bg colour, size, font,
> etc.
>
> 3. Turn off global font lock mode. This will result in most faces just
> having the 'default' attributes.
In practice, solution #3 alone won't cut it, because some Emacs
features use faces regardless of Font Lock mode.
So what Karl would need to do is:
. Turn off Global Font Lock mode. This will turn off many faces.
. Use "M-x list-faces-display" to list and customize the rest of
faces.
. Whenever a new face pops up, list it with list-faces-display and
customize it.
The last item is needed because many faces are not defined until they
are first used by some feature. Until it is defined,
list-faces-display will not show it.
I believe that with this procedure, the number of faces that evade
customization will fade out with time.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: e23 inverse video on mode line and nowhere else
2010-01-14 23:04 ` Karl Berry
2010-01-15 4:13 ` Steve Revilak
@ 2010-01-15 20:23 ` Leo
1 sibling, 0 replies; 9+ messages in thread
From: Leo @ 2010-01-15 20:23 UTC (permalink / raw
To: help-gnu-emacs
On 2010-01-14 23:04 +0000, Karl Berry wrote:
> When I run emacs in terminals, the mode line is always inverse video
> but the rest is normal.
>
> Thanks for replying, but this is not even remotely true for me in e23
> (it used to be that way, for sure, for many many years). Now, I start
> emacs with emacs-23.1 --no-site --no-init in an xterm, and immediately
> observe the *scratch* buffer name is in bold. (Haven't tried
> tty-suppress-bold-inverse-default-colors yet, but anyway, that's not so
> critical.)
>
> More importantly, then I run M-x grep and do something like
> "grep -nH e /etc/issue", and observe that "/etc/issue:1:" is underlined,
> "matches found" is in bold, etc.
>
> All of these things are what my brain needs to have eliminated :).
My test was with Emacs 2010-01-01 version 23.1.91. Maybe that's a bug in
23.1.
Best wishes,
Leo
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: e23 inverse video on mode line and nowhere else
2010-01-13 1:42 Karl Berry
2010-01-13 8:31 ` Leo
@ 2010-01-16 22:35 ` Juri Linkov
1 sibling, 0 replies; 9+ messages in thread
From: Juri Linkov @ 2010-01-16 22:35 UTC (permalink / raw
To: help-gnu-emacs
> A couple years ago Juri Linkov kindly sent me the Elisp below to
> disable faces by default, leaving only faces matching ^mode-line
> untouched. This seems to generally give what I want. (Thanks again, Juri.)
>
> But what I'm finding now is that the compilation status string, such as
> ":run", ": exit[0]", and so on, is shown as normal text (not inverse
> video) in the mode line.
>
> I can get the compilation string in inverse video in the mode line with
> this (or by excluding ^compilation in my-faces-fix below):
>
> (set-face-attribute 'compilation-info nil :inverse-video t)
> (set-face-attribute 'compilation-warning nil :inverse-video t)
> (set-face-attribute 'compilation-error nil :inverse-video t)
>
> But then filenames and various other strings show up in inverse video in
> the buffer contents.
>
> Short of reverting back to old versions of M-x compile, etc., which I
> don't want to do, is there any way to control this?
>
> Perhaps by doing something in the mode line display to force all faces
> to inverse video? (It seems like the same compilation-* faces should
> not be used both within the buffer contents and in the mode line, but
> anyway.)
Currently I see no way to display the compilation status string
differently in the mode line and in the compilation buffer because
compile.el reuses non-mode-line faces for the mode line.
A good solution would be to add new faces to compile.el like
mode-line-compilation-info
mode-line-compilation-warning
mode-line-compilation-error
--
Juri Linkov
http://www.jurta.org/emacs/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: e23 inverse video on mode line and nowhere else
@ 2010-02-01 2:04 Karl Berry
0 siblings, 0 replies; 9+ messages in thread
From: Karl Berry @ 2010-02-01 2:04 UTC (permalink / raw
To: help-gnu-emacs
Thanks to everyone for replying, although unfortunately these
suggestions do not work for me.(*)
I've filed a bug about compile.el using non-mode-line-faces on the
mode line. Meanwhile, I'll guess I'll try to defadvise
mode line creation, or something.
Karl
(*) list-faces and customize-face are useless for me. They do not allow
for completely turning off "facification", last time I tried anyway.
Beyond that, they are far too ui-intensive, mess around with my startup
files, and most importantly there are far too many faces to deal with
that way. And new faces crop up at the drop of a hat.
The Elisp that Juri sent me years ago, which I included in my original
post, already takes care of the issue in general, as well as possible.
(http://lists.gnu.org/archive/html/help-gnu-emacs/2010-01/msg00196.html)
What I posted about this month is a new problem, where, as Juri and I
said, non-mode-line faces are used to propertize text for the mode line.
It's no different in the 23.1.92 pretest, either.
Anyway.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2010-02-01 2:04 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.1436.1263510311.18930.help-gnu-emacs@gnu.org>
2010-01-15 0:32 ` e23 inverse video on mode line and nowhere else Tim X
2010-01-15 8:21 ` Eli Zaretskii
2010-02-01 2:04 Karl Berry
[not found] <20100115004221.598A8AF600@mxperim7.sea5.speakeasy.net>
2010-01-14 23:04 ` Karl Berry
2010-01-15 4:13 ` Steve Revilak
2010-01-15 20:23 ` Leo
-- strict thread matches above, loose matches on Subject: below --
2010-01-13 1:42 Karl Berry
2010-01-13 8:31 ` Leo
2010-01-16 22:35 ` Juri Linkov
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.