* Highlight Active Window
@ 2008-05-08 15:41 Lex Fridman
2008-05-08 22:10 ` Lennart Borgman (gmail)
2008-05-08 22:11 ` Peter Dyballa
0 siblings, 2 replies; 12+ messages in thread
From: Lex Fridman @ 2008-05-08 15:41 UTC (permalink / raw)
To: Help-gnu-emacs
Hi,
Say I split an emacs frame into two windows (horizontally). I switch from
one to the other using the C-x o (other-window) command. Is it possible to
"highlight" the active window by, say, changing its background color, border
color, etc.
I suppose this code would have to executed every time a C-x o command is
fired.
Thanks,
Lex
--
View this message in context: http://www.nabble.com/Highlight-Active-Window-tp17127502p17127502.html
Sent from the Emacs - Help mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Highlight Active Window
2008-05-08 15:41 Highlight Active Window Lex Fridman
@ 2008-05-08 22:10 ` Lennart Borgman (gmail)
2008-05-08 22:11 ` Peter Dyballa
1 sibling, 0 replies; 12+ messages in thread
From: Lennart Borgman (gmail) @ 2008-05-08 22:10 UTC (permalink / raw)
To: Lex Fridman; +Cc: Help-gnu-emacs
Lex Fridman wrote:
> Hi,
>
> Say I split an emacs frame into two windows (horizontally). I switch from
> one to the other using the C-x o (other-window) command. Is it possible to
> "highlight" the active window by, say, changing its background color, border
> color, etc.
>
> I suppose this code would have to executed every time a C-x o command is
> fired.
The color of the mode line should tell which window is active. You can
customize the two faces mode-line and mode-line-inactive:
M-x customize-face RET mode-line
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Highlight Active Window
2008-05-08 15:41 Highlight Active Window Lex Fridman
2008-05-08 22:10 ` Lennart Borgman (gmail)
@ 2008-05-08 22:11 ` Peter Dyballa
2008-05-08 23:44 ` Lex Fridman
1 sibling, 1 reply; 12+ messages in thread
From: Peter Dyballa @ 2008-05-08 22:11 UTC (permalink / raw)
To: Lex Fridman; +Cc: Help-gnu-emacs
Am 08.05.2008 um 17:41 schrieb Lex Fridman:
> Is it possible to "highlight" the active window by, say, changing
> its background color, border color, etc.
It works with mode-line:
'(mode-line ((t (:background "DeepSkyBlue1" :foreground
"black" :height 1.25 :family "courier"))))
'(mode-line-inactive ((t (:inherit mode-line :background
"PaleTurquoise1" :foreground "grey20" :box (:line-width -1 :color
"grey75") :weight light :family "profontwindows"))))
--
Greetings
Pete
The best way to accelerate a PC is 9.8 m/s2
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Highlight Active Window
2008-05-08 22:11 ` Peter Dyballa
@ 2008-05-08 23:44 ` Lex Fridman
2008-05-09 6:07 ` Lennart Borgman (gmail)
2008-05-09 8:25 ` Highlight Active Window Peter Dyballa
0 siblings, 2 replies; 12+ messages in thread
From: Lex Fridman @ 2008-05-08 23:44 UTC (permalink / raw)
To: Help-gnu-emacs
Peter Dyballa wrote:
>
> It works with mode-line:
>
> '(mode-line ((t (:background "DeepSkyBlue1" :foreground
> "black" :height 1.25 :family "courier"))))
> '(mode-line-inactive ((t (:inherit mode-line :background
> "PaleTurquoise1" :foreground "grey20" :box (:line-width -1 :color
> "grey75") :weight light :family "profontwindows"))))
>
Dumb question... do I put these mode-line definition in a (custom-set-faces
...) like as follows. Because this actually doesn't work for me. I still see
the old mode-line settings.
(custom-set-faces
'(mode-line ((t (:background "Yellow" :foreground "#000000" :box
(:line-width -1 :style released-button)))))
'(mode-line-inactive ((default (:inherit mode-line)) (((class color)
(min-colors 88) (background dark)) (:background "grey0" :foreground "grey30"
:box (:line-width -1 :color "grey20") :weight light)))))
--
View this message in context: http://www.nabble.com/Highlight-Active-Window-tp17127502p17138848.html
Sent from the Emacs - Help mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Highlight Active Window
2008-05-08 23:44 ` Lex Fridman
@ 2008-05-09 6:07 ` Lennart Borgman (gmail)
2008-05-10 17:21 ` custom-set-faces [was: Highlight Active Window] Peter Jones
2008-05-09 8:25 ` Highlight Active Window Peter Dyballa
1 sibling, 1 reply; 12+ messages in thread
From: Lennart Borgman (gmail) @ 2008-05-09 6:07 UTC (permalink / raw)
To: Lex Fridman; +Cc: Help-gnu-emacs
Lex Fridman wrote:
>
> Peter Dyballa wrote:
>> It works with mode-line:
>>
>> '(mode-line ((t (:background "DeepSkyBlue1" :foreground
>> "black" :height 1.25 :family "courier"))))
>> '(mode-line-inactive ((t (:inherit mode-line :background
>> "PaleTurquoise1" :foreground "grey20" :box (:line-width -1 :color
>> "grey75") :weight light :family "profontwindows"))))
>>
>
> Dumb question... do I put these mode-line definition in a (custom-set-faces
> ...) like as follows. Because this actually doesn't work for me. I still see
> the old mode-line settings.
>
> (custom-set-faces
> '(mode-line ((t (:background "Yellow" :foreground "#000000" :box
> (:line-width -1 :style released-button)))))
> '(mode-line-inactive ((default (:inherit mode-line)) (((class color)
> (min-colors 88) (background dark)) (:background "grey0" :foreground "grey30"
> :box (:line-width -1 :color "grey20") :weight light)))))
You should not write custom-set-faces by hand.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Highlight Active Window
2008-05-08 23:44 ` Lex Fridman
2008-05-09 6:07 ` Lennart Borgman (gmail)
@ 2008-05-09 8:25 ` Peter Dyballa
1 sibling, 0 replies; 12+ messages in thread
From: Peter Dyballa @ 2008-05-09 8:25 UTC (permalink / raw)
To: Lex Fridman; +Cc: Help-gnu-emacs
Am 09.05.2008 um 01:44 schrieb Lex Fridman:
> Dumb question...
Just customise the mode-line face settings! (Options menu ->
Customize Emacs -> Specific Group)
--
Greetings
Pete
If it should exist, it doesn't.
– Arnold's First Law of Documentation
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: custom-set-faces [was: Highlight Active Window]
2008-05-09 6:07 ` Lennart Borgman (gmail)
@ 2008-05-10 17:21 ` Peter Jones
2008-05-10 17:26 ` Lennart Borgman (gmail)
2008-05-10 17:44 ` Drew Adams
0 siblings, 2 replies; 12+ messages in thread
From: Peter Jones @ 2008-05-10 17:21 UTC (permalink / raw)
To: Help-gnu-emacs
"Lennart Borgman (gmail)" <lennart.borgman@gmail.com> writes:
> You should not write custom-set-faces by hand.
I've read this statement before, but I've never seen any explication
as to why. Is it just because customize will blow it away?
I use custom-set-faces in a separate elisp files, but not in my
custom-file. I also never use customize, so maybe that's why I've not
seen any issues.
Any other reason to not use custom-set-faces?
--
Peter Jones, pmade inc.
http://pmade.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: custom-set-faces [was: Highlight Active Window]
2008-05-10 17:21 ` custom-set-faces [was: Highlight Active Window] Peter Jones
@ 2008-05-10 17:26 ` Lennart Borgman (gmail)
2008-05-10 17:44 ` Drew Adams
1 sibling, 0 replies; 12+ messages in thread
From: Lennart Borgman (gmail) @ 2008-05-10 17:26 UTC (permalink / raw)
To: Help-gnu-emacs
Peter Jones wrote:
> "Lennart Borgman (gmail)" <lennart.borgman@gmail.com> writes:
>> You should not write custom-set-faces by hand.
>
> I've read this statement before, but I've never seen any explication
> as to why. Is it just because customize will blow it away?
Yes. Or you may blow away the settings defined through custom.
> I use custom-set-faces in a separate elisp files, but not in my
> custom-file. I also never use customize, so maybe that's why I've not
> seen any issues.
>
> Any other reason to not use custom-set-faces?
Maybe it is impolite to those who wrote custom ... ;-)
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: custom-set-faces [was: Highlight Active Window]
2008-05-10 17:21 ` custom-set-faces [was: Highlight Active Window] Peter Jones
2008-05-10 17:26 ` Lennart Borgman (gmail)
@ 2008-05-10 17:44 ` Drew Adams
2008-05-10 17:57 ` custom-set-faces Peter Jones
1 sibling, 1 reply; 12+ messages in thread
From: Drew Adams @ 2008-05-10 17:44 UTC (permalink / raw)
To: 'Peter Jones', Help-gnu-emacs
> > You should not write custom-set-faces by hand.
>
> I've read this statement before, but I've never seen any explication
> as to why. Is it just because customize will blow it away?
>
> I use custom-set-faces in a separate elisp files, but not in my
> custom-file. I also never use customize, so maybe that's why I've not
> seen any issues.
>
> Any other reason to not use custom-set-faces?
Someone more knowledgeable will no doubt correct me, but I think that is the
only reason. The comment in a `custom-file' or .emacs says this:
;; 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.
That explains why and where you shouldn't hand-edit the `custom-set-faces' entry
- or should do so only with care. It might be overwritten automatically by
Customize. That assumes a context of (1) using Customize to change a value and
then save the change and (2) Customize saving the change in the same file that
you edited.
So, no, I don't think there is any problem doing what you are doing, as long as
you never let Customize save to the same file that you edit.
That said, there is also no special reason to use `custom-set-faces' to do what
you want, unless you find it more convenient.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: custom-set-faces
2008-05-10 17:44 ` Drew Adams
@ 2008-05-10 17:57 ` Peter Jones
2008-05-10 18:15 ` custom-set-faces Lennart Borgman (gmail)
2008-05-10 18:22 ` custom-set-faces Drew Adams
0 siblings, 2 replies; 12+ messages in thread
From: Peter Jones @ 2008-05-10 17:57 UTC (permalink / raw)
To: Help-gnu-emacs
"Drew Adams" <drew.adams@oracle.com> writes:
> That said, there is also no special reason to use `custom-set-faces' to do what
> you want, unless you find it more convenient.
I'm only using custom-set-faces because that's what color-theme.el was
doing. I've since ditched color theme, and just do it myself.
What's the more appropriate function to use?
--
Peter Jones, pmade inc.
http://pmade.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: custom-set-faces
2008-05-10 17:57 ` custom-set-faces Peter Jones
@ 2008-05-10 18:15 ` Lennart Borgman (gmail)
2008-05-10 18:22 ` custom-set-faces Drew Adams
1 sibling, 0 replies; 12+ messages in thread
From: Lennart Borgman (gmail) @ 2008-05-10 18:15 UTC (permalink / raw)
To: Help-gnu-emacs
Peter Jones wrote:
> "Drew Adams" <drew.adams@oracle.com> writes:
>> That said, there is also no special reason to use `custom-set-faces' to do what
>> you want, unless you find it more convenient.
>
> I'm only using custom-set-faces because that's what color-theme.el was
> doing. I've since ditched color theme, and just do it myself.
>
> What's the more appropriate function to use?
Probably set-face-attribute.
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: custom-set-faces
2008-05-10 17:57 ` custom-set-faces Peter Jones
2008-05-10 18:15 ` custom-set-faces Lennart Borgman (gmail)
@ 2008-05-10 18:22 ` Drew Adams
1 sibling, 0 replies; 12+ messages in thread
From: Drew Adams @ 2008-05-10 18:22 UTC (permalink / raw)
To: 'Peter Jones', Help-gnu-emacs
> > That said, there is also no special reason to use
> > `custom-set-faces' to do what
> > you want, unless you find it more convenient.
>
> I'm only using custom-set-faces because that's what color-theme.el was
> doing. I've since ditched color theme, and just do it myself.
>
> What's the more appropriate function to use?
Perhaps I misspoke. It depends on what you want/need. If you want to do
everything that `custom-set-faces' does, then that is appropriate.
If you just want to change some attributes of a given face for the current
session, then you can use `set-face-attribute'.
See node Attribute Functions in the Elisp manual.
You might also want to take a look at `face-spec-set' and `face-spec-set-2',
which each accept as argument the kind of face spec that `custom-set-faces'
deals with (which you therefore have already).
Again, I didn't mean to imply that you should not use `custom-set-faces' for
this. But keep in mind that it interacts with Customize - that's what it's
designed for. If you never use Customize, then you don't care about that, but if
you do, then at least be aware of it.
All that said, I would offer this general suggestion: Customize is your friend.
Even if you find it ugly or a little inconvenient to use, it has some powerful
type-checking and other features that can help you. The baby is admittedly
sometimes hard to see in the murky bathwater.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2008-05-10 18:22 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-08 15:41 Highlight Active Window Lex Fridman
2008-05-08 22:10 ` Lennart Borgman (gmail)
2008-05-08 22:11 ` Peter Dyballa
2008-05-08 23:44 ` Lex Fridman
2008-05-09 6:07 ` Lennart Borgman (gmail)
2008-05-10 17:21 ` custom-set-faces [was: Highlight Active Window] Peter Jones
2008-05-10 17:26 ` Lennart Borgman (gmail)
2008-05-10 17:44 ` Drew Adams
2008-05-10 17:57 ` custom-set-faces Peter Jones
2008-05-10 18:15 ` custom-set-faces Lennart Borgman (gmail)
2008-05-10 18:22 ` custom-set-faces Drew Adams
2008-05-09 8:25 ` Highlight Active Window Peter Dyballa
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.