From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.help Subject: Re: `auto-dim-other-windows` -- scrutiny invited Date: Wed, 03 Apr 2013 20:10:25 +0200 Message-ID: <87ip43qycu.fsf@wanadoo.es> References: <87ehersl1c.fsf@wanadoo.es> <87r4irr1gp.fsf@wanadoo.es> <87mwtfr0sl.fsf@wanadoo.es> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1365012667 7563 80.91.229.3 (3 Apr 2013 18:11:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Apr 2013 18:11:07 +0000 (UTC) Cc: =?utf-8?Q?=C3=93scar?= Fuentes , "help-gnu-emacs@gnu.org" To: Steven Degutis Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 03 20:11:31 2013 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 1UNS9h-0006oy-HI for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Apr 2013 20:11:29 +0200 Original-Received: from localhost ([::1]:48341 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNS9I-0006cu-NN for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Apr 2013 14:11:04 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNS8v-0006YK-0O for help-gnu-emacs@gnu.org; Wed, 03 Apr 2013 14:10:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNS8k-0005JI-Pg for help-gnu-emacs@gnu.org; Wed, 03 Apr 2013 14:10:40 -0400 Original-Received: from impaqm1.telefonica.net ([213.4.138.17]:65101 helo=telefonica.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNS8k-0005IR-FT for help-gnu-emacs@gnu.org; Wed, 03 Apr 2013 14:10:30 -0400 Original-Received: from IMPmailhost1.adm.correo ([10.20.102.38]) by IMPaqm1.telefonica.net with bizsmtp id KKbn1l03w0piX6q3MWATYV; Wed, 03 Apr 2013 20:10:27 +0200 Original-Received: from qcore ([83.32.114.255]) by IMPmailhost1.adm.correo with BIZ IMP id KWAR1l00G5Wh3kK1hWARUz; Wed, 03 Apr 2013 20:10:26 +0200 X-CMAE-Analysis: v=1.1 cv=BpEojX6iBhkZJV7NjZWN65sh/joJ36HDeYCGZVGXGKI= c=1 sm=1 a=DQlLCnKHR5QA:10 a=GhvpC39hy1IA:10 a=81OwRG/lTlzKMM4beKGMsw==:17 a=pGLkceISAAAA:8 a=6pwBofTczcRYyJttqEYA:9 a=MSl-tDqOz04A:10 a=81OwRG/lTlzKMM4beKGMsw==:117 X-original-sender: 981711563@telefonica.net In-Reply-To: (Steven Degutis's message of "Wed, 3 Apr 2013 12:42:22 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 213.4.138.17 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:89958 Archived-At: Steven Degutis writes: > So it's more conventional to use a minor-mode to do this than just two > functions? > > If so, is it considerably more difficult to implement it as a minor-mode? > And would the code look any cleaner? >From the POV of the user a minor mode is an standard interface for customizing Emacs with active features. For instance, he can query Emacs about which modes are active at any moment (M-x describe-mode). Emacs provides some sugar for making it easy to implement minor modes. A minor mode for this feature would be quite simple and could be implemented with something like (not tested): (define-minor-mode auto-dim-other-windows-mode "Dim the background of non-selected windows blah, blah, blah (more info here)" (if auto-dim-other-windows-mode (auto-dim-other-windows-mode-disable) (auto-dim-other-windows-mode-enable)) where auto-dim-other-windows-mode-enable/disable are the functions your current implementation is using. As you can see, the code overhead is minimal.