milkypostman / powerline

emacs powerline

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`defadvice select-window` considered harmful

Alexander-Shukaev opened this issue · comments

Instead of

(defadvice select-window (after powerline-select-window activate)
  "makes powerline aware of window changes"
  (powerline-set-selected-window))

why not add a hook to buffer-list-update-hook (as recommended)?

The problem is that (select-window window 'norecord) is used by Emacs Lisp developers to "programatically" select windows without them producing side effects (such as flickering and/or buffer list updates, see the documentation of select-window for more information). The way select-window is advised now, aggressively invokes powerline updates even during such programmatic window selections. The solution is to either change to around advice and check the value of norecord argument or to use buffer-list-update-hook instead.

Did you have a chance to review the updated PR?