From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Francesco Mazzoli Newsgroups: gmane.emacs.help Subject: Re: Highlighting current window Date: Sun, 01 Jul 2012 12:49:13 +0100 Message-ID: <87lij38zwm.wl%f@mazzo.li> References: <87hattxfay.wl%f@mazzo.li> <7EEB8635C8F742348EFD06F2C7514F0D@us.oracle.com> <878vf4sikv.wl%f@mazzo.li> <4FEF5E95.10706@comcast.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: dough.gmane.org 1341143372 447 80.91.229.3 (1 Jul 2012 11:49:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 1 Jul 2012 11:49:32 +0000 (UTC) To: cgrubert02@comcast.net, 'help-gnu-emacs' Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jul 01 13:49:31 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SlIee-000563-UH for geh-help-gnu-emacs@m.gmane.org; Sun, 01 Jul 2012 13:49:29 +0200 Original-Received: from localhost ([::1]:35794 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SlIed-0003Ni-Or for geh-help-gnu-emacs@m.gmane.org; Sun, 01 Jul 2012 07:49:27 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41724) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SlIeY-0003NS-4U for help-gnu-emacs@gnu.org; Sun, 01 Jul 2012 07:49:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SlIeW-00043m-Ar for help-gnu-emacs@gnu.org; Sun, 01 Jul 2012 07:49:21 -0400 Original-Received: from mail-we0-f169.google.com ([74.125.82.169]:46522) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SlIeW-00043i-44 for help-gnu-emacs@gnu.org; Sun, 01 Jul 2012 07:49:20 -0400 Original-Received: by wefh52 with SMTP id h52so3785030wef.0 for ; Sun, 01 Jul 2012 04:49:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:message-id:from:to:subject:in-reply-to:references:user-agent :mime-version:content-type:x-gm-message-state; bh=JN4fpyp+jPivAphr5ZCdKOEvb2p1ss8EZZGN+oHbeIg=; b=SCwvjreLqzBVol+/sSThuM5fR0o0Z5oQITgEyvkLlCmvzHdQOARmWkg+UnPXvUeFRc 7JSM4+D3Wv6lHbv2dxlgDX52JMSUFlcPsHLTUkoaI8G4Etwjfm+AbnECOYLaGa/S9MiI sTQ5Cr4F8ccf/mcQ405eP4+GwDATfmzrMON+FRJwmiN0Qmr4nRi0sW9OPbW3FTPvbRAc rEYLJNMMa85bYgnGoIHBLknhYDOOyHmgrwf0jpId2WqSA9FscbpNQJyAR5R7LbqPlZzA pIXSQIi+no7HDRlqwgV/hlEUW02/XCQlFf/TFnnGUD/Ve5CFSDBXgL+cnPpa3ni9ZxwM LmFA== Original-Received: by 10.216.203.201 with SMTP id f51mr167186weo.52.1341143356959; Sun, 01 Jul 2012 04:49:16 -0700 (PDT) Original-Received: from stringer.mazzo.li (host86-154-102-59.range86-154.btcentralplus.com. [86.154.102.59]) by mx.google.com with ESMTPS id m4sm18173876wie.1.2012.07.01.04.49.14 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 01 Jul 2012 04:49:16 -0700 (PDT) In-Reply-To: <4FEF5E95.10706@comcast.net> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/23.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) X-Gm-Message-State: ALoCoQkATOYFB3LWVCYpFMMxwtVXbaGajZuXJoYeYG57A3d2Q04Cn3VlyluCdk7fg8pm1bfNShEl X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.169 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:85603 Archived-At: Hi Christopher, At Sat, 30 Jun 2012 16:16:21 -0400, Christopher Grubert wrote: > I use a combination of the three faces mode-line, mode-line-inactive, > mode-line-buffer-id and the hl-line+ package which gives current line > highlighting but only in the active window. I've found this combination > to work pretty well for me. I also use a fairly innocuous line > highlighting color (:background "#222") so that it doesn't really > conflict with any other fontification colors, but still draws attention > to where I am. It draws your attention to the exact line you're on as > opposed to just the window you're in, but I've found that useful. > Chris. I looked at hl-line mode and it supports that functionality as well. I looked at the source and the trick is using overlays. Knowing that, I was able to do what I want quite quickly: ----------------8<------------------------------- ;;; Darker background for current buffer (set-face-attribute 'default nil :background "#1e1e1e") (set-cursor-color "#ffffff") (defvar current-buffer-backround-overlay nil) (defun darken-current-buffer-background () (unless (window-minibuffer-p (selected-window)) (unless current-buffer-backround-overlay (setq current-buffer-backround-overlay (make-overlay 1 1)) (overlay-put current-buffer-backround-overlay 'face '(:background "black"))) (overlay-put current-buffer-backround-overlay 'window (selected-window)) (move-overlay current-buffer-backround-overlay (point-min) (point-max)))) (defun undarken-current-buffer-background () (when darken-current-buffer-background (delete-overlay current-buffer-backround-overlay))) (add-hook 'pre-command-hook #'undarken-current-buffer-background) (add-hook 'post-command-hook #'darken-current-buffer-background) ---------------->8------------------------------- However, I think that using hl-line might be an even better solution, I'll try both a bit and see what I prefer. -- Francesco * Often in error, never in doubt