help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `auto-dim-other-windows` -- scrutiny invited


From: Steven Degutis
Subject: Re: `auto-dim-other-windows` -- scrutiny invited
Date: Wed, 3 Apr 2013 13:54:36 -0500

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 disable 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, Óscar 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-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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]