From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Steven Degutis Newsgroups: gmane.emacs.help Subject: Re: `auto-dim-other-windows` -- scrutiny invited Date: Wed, 3 Apr 2013 14:19:21 -0500 Message-ID: References: <87ehersl1c.fsf@wanadoo.es> <87r4irr1gp.fsf@wanadoo.es> <87mwtfr0sl.fsf@wanadoo.es> <87ip43qycu.fsf@wanadoo.es> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=bcaec544ece0359eef04d979bb23 X-Trace: ger.gmane.org 1365016782 21089 80.91.229.3 (3 Apr 2013 19:19:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Apr 2013 19:19:42 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org" To: =?ISO-8859-1?Q?=D3scar_Fuentes?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 03 21:20:09 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 1UNTE9-0003Is-G0 for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Apr 2013 21:20:09 +0200 Original-Received: from localhost ([::1]:35144 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNTDk-0008RX-Ga for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Apr 2013 15:19:44 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNTDS-0008Me-3s for help-gnu-emacs@gnu.org; Wed, 03 Apr 2013 15:19:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNTDP-0005GP-2I for help-gnu-emacs@gnu.org; Wed, 03 Apr 2013 15:19:26 -0400 Original-Received: from mail-pa0-f53.google.com ([209.85.220.53]:41483) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNTDO-0005DH-PB for help-gnu-emacs@gnu.org; Wed, 03 Apr 2013 15:19:22 -0400 Original-Received: by mail-pa0-f53.google.com with SMTP id bh4so1067865pad.12 for ; Wed, 03 Apr 2013 12:19:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=oTaUFMlhf36jWmjGJRiFcmkvW86Vi7sXnEc10DzzsuQ=; b=UZq1WLKO7K4yGFaSeVXiQXfGC1qEubAis1siRGO/FKH6hZo523dqk2ljaXm45Sp02W SZa60eWmAtsT6ba/17o/wnbsc6iqi6YXI6VNB+ZMyWIgJzh3dgB5R72qDSaF4lXJ4+Wr QXku122snP2KR4P/n96luxiBfzqSTWD4ATNWAdePxFO/xvz7SsMxFdch3INC4k4zlf/O 57AD6xE8v/YZD0Gpl83WoG4rrrkC/MsEsDyqFIlzft8rz9pk5z80IwJlR/q5Om8JTGVL tPLG89tQ0urqy3s3qSn2yOwDLtlaZbr6X960RwDDuDUdtfPoJdXze36swiSTdsi30zSw AwHA== X-Received: by 10.68.59.8 with SMTP id v8mr1308265pbq.218.1365016761964; Wed, 03 Apr 2013 12:19:21 -0700 (PDT) Original-Received: by 10.70.6.100 with HTTP; Wed, 3 Apr 2013 12:19:21 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.220.53 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:89960 Archived-At: --bcaec544ece0359eef04d979bb23 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Okay, figured it out. Now it's a global minor mode. (But melpa won't catch up for a few hours.) Thanks guys. Later, if I can find some time, I might try to make a new similar project that uses window-overlays via Michael's idea. And I'm going to name it `tunnel-vision`, since the current project's name is way too long. -Steven On Wed, Apr 3, 2013 at 1:54 PM, Steven Degutis wrote: > Seems legit. But then how do users typically install it? It's not like > other minor modes which are part of a hook. Do they just do > "auto-dim-other-buffers-mode" and it's enabled globally until they disabl= e > it the same way or quit emacs? > > Funny, melpa *just* updated it a few minutes ago, and it's already about > to be woefully out of date again. At least the version in melpa right now > is much more efficient than the last one. > > -Steven > > > On Wed, Apr 3, 2013 at 1:10 PM, =D3scar Fuentes wrote: > >> 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. >> > > --bcaec544ece0359eef04d979bb23 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Okay, figured it out.

Now it's a gl= obal minor mode.

(But melpa won't catch up for= a few hours.)

Thanks guys.

Later, if I can find some time, I might try to make a = new similar project that uses window-overlays via Michael's idea. And I= 'm going to name it `tunnel-vision`, since the current project's na= me is way too long.

-Steven


On Wed, Apr 3, 2013 at 1:54 PM,= Steven Degutis <sbdegutis@gmail.com> wrote:
Seems legit. But then how d= o users typically install it? It's not like other minor modes which are= part of a hook. Do they just do "auto-dim-other-buffers-mode" an= d it's enabled globally until they disable it the same way or quit emac= s?

Funny, melpa *just* updated it a few minutes ago, and it'= ;s already about to be woefully out of date again. At least the version in = melpa right now is much more efficient than the last one.

-Steven


On W= ed, Apr 3, 2013 at 1:10 PM, =D3scar Fuentes <ofv@wanadoo.es> = wrote:
Steven Degutis <sbdegutis@gmail.com> 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-mo= de?
> 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
=A0 "Dim the background of non-selected windows

=A0 blah, blah, blah (more info here)"

=A0 (if auto-dim-other-windows-mode
=A0 =A0 =A0 (auto-dim-other-windows-mode-disable)
=A0 =A0 (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.


--bcaec544ece0359eef04d979bb23--