all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Changing background color of an emacs window
@ 2008-05-22 15:25 Corey Foote
  0 siblings, 0 replies; 4+ messages in thread
From: Corey Foote @ 2008-05-22 15:25 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 468 bytes --]




Quick
question: When an Emacs frame is split into several windows, is there a way to
change the background color (and perhaps other visual properties) of one window
without changing the others? 

Thanks
a bunch!

Sincerely,

Corey
Foote
_________________________________________________________________
E-mail for the greater good. Join the i’m Initiative from Microsoft.
http://im.live.com/Messenger/IM/Join/Default.aspx?source=EML_WL_ GreaterGood

[-- Attachment #2: Type: text/html, Size: 797 bytes --]

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

* Re: Changing background color of an emacs window
       [not found] <mailman.12015.1211469916.18990.help-gnu-emacs@gnu.org>
@ 2008-05-22 16:12 ` Xah
  2008-05-22 21:36   ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 4+ messages in thread
From: Xah @ 2008-05-22 16:12 UTC (permalink / raw)
  To: help-gnu-emacs

On May 22, 8:25 am, Corey Foote <coreyfo...@hotmail.com> wrote:
«When an Emacs frame is split into several windows, is there a way to
change the background color (and perhaps other visual properties) of
one window without changing the others?»

I'm not aware a mode or default way to do it. But what you can do is
write a function that changes current window bg color, to the post-
command-hook.

(defun change-bg-color-on-split ()
  (let ((cmd this-command))
    (when (string-equal cmd "split-window-vertically")
      (set-background-color "#ffe4c4"))))

(add-hook 'post-command-hook 'change-bg-color-on-split)

Code untested, but something like that... you'll need to mod the code
so that it changes to diff colors on each split, and perhaps also code
to change back whenever there's unsplit...

  Xah
  xah@xahlee.org
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Changing background color of an emacs window
  2008-05-22 16:12 ` Changing background color of an emacs window Xah
@ 2008-05-22 21:36   ` Lennart Borgman (gmail)
  2008-05-23  0:59     ` Corey Foote
  0 siblings, 1 reply; 4+ messages in thread
From: Lennart Borgman (gmail) @ 2008-05-22 21:36 UTC (permalink / raw)
  To: Xah; +Cc: help-gnu-emacs

Xah wrote:
> On May 22, 8:25 am, Corey Foote <coreyfo...@hotmail.com> wrote:
> «When an Emacs frame is split into several windows, is there a way to
> change the background color (and perhaps other visual properties) of
> one window without changing the others?»
> 
> I'm not aware a mode or default way to do it. But what you can do is
> write a function that changes current window bg color, to the post-
> command-hook.
> 
> (defun change-bg-color-on-split ()
>   (let ((cmd this-command))
>     (when (string-equal cmd "split-window-vertically")
>       (set-background-color "#ffe4c4"))))
> 
> (add-hook 'post-command-hook 'change-bg-color-on-split)


Unfortunately that does not change the bg color of the whole Emacs 
frame, not just the current Emacs window.

There has been a little bit talk about implementing background colors 
etc per buffer on Emacs devel, but so far no one has done anything to 
implement it as far as I know.

There is one workaround, I just added this to EmacsWiki

  http://www.emacswiki.org/cgi-bin/wiki/BufferBackgroundColor




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

* RE: Changing background color of an emacs window
  2008-05-22 21:36   ` Lennart Borgman (gmail)
@ 2008-05-23  0:59     ` Corey Foote
  0 siblings, 0 replies; 4+ messages in thread
From: Corey Foote @ 2008-05-23  0:59 UTC (permalink / raw)
  To: Lennart Borgman (gmail), Xah; +Cc: help-gnu-emacs


Hello Lennart,Thank you! I really appreciate this code that you have contributed.However, I do have a few questions. I'm a newbie when it comes to Emacs Lisp, but is your code missing the read-color function? When I invoke buffer-bg-set-color interactively I get a message in the mini-buffer saying, "Symbol's function definition is void: read-color." I'm running GNU Emacs 22.1.50.1.Also when I call the function by saying, for example, (buffer-bg-set-color "blue" "test-buffer") in the scratch buffer in invoke it with C-x C-e, it applies the color to the scratch buffer itself and not to the test-buffer buffer like I had wanted.- Corey> Date: Thu, 22 May 2008 23:36:42 +0200> From: lennart.borgman@gmail.com> To: xahlee@gmail.com> CC: help-gnu-emacs@gnu.org> Subject: Re: Changing background color of an emacs window> > Xah wrote:> > On May 22, 8:25 am, Corey Foote <coreyfo...@hotmail.com> wrote:> > «When an Emacs frame is split into several windows, is there a way to> > change the background color (and perhaps other visual properties) of> > one window without changing the others?»> > > > I'm not aware a mode or default way to do it. But what you can do is> > write a function that changes current window bg color, to the post-> > command-hook.> > > > (defun change-bg-color-on-split ()> >   (let ((cmd this-command))> >     (when (string-equal cmd "split-window-vertically")> >       (set-background-color "#ffe4c4"))))> > > > (add-hook 'post-command-hook 'change-bg-color-on-split)> > > Unfortunately that does not change the bg color of the whole Emacs > frame, not just the current Emacs window.> > There has been a little bit talk about implementing background colors > etc per buffer on Emacs devel, but so far no one has done anything to > implement it as far as I know.> > There is one workaround, I just added this to EmacsWiki> >   http://www.emacswiki.org/cgi-bin/wiki/BufferBackgroundColor> > 
_________________________________________________________________
Keep your kids safer online with Windows Live Family Safety.
http://www.windowslive.com/family_safety/overview.html?ocid=TXT_TAGLM_WL_Refresh_family_safety_052008



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

end of thread, other threads:[~2008-05-23  0:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.12015.1211469916.18990.help-gnu-emacs@gnu.org>
2008-05-22 16:12 ` Changing background color of an emacs window Xah
2008-05-22 21:36   ` Lennart Borgman (gmail)
2008-05-23  0:59     ` Corey Foote
2008-05-22 15:25 Corey Foote

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.