the-kenny / weechat.el

Chat via weechat's relay protocol in Emacs
177 stars 41 forks source link

tracking causes buffer changes to be slow/flickring #69

Open jgoerzen opened 6 years ago

jgoerzen commented 6 years ago

Hi,

I have a weird problem. When I run weechat with weechat-tracking enabled, I see a number of odd behavior:

This behavior never occurs when weechat-tracking is omitted from weechat-modules, or when I haven't yet invoked any weechat commands in an emacs session.

I typically have 30 to 50 weechat buffers open.

The relevant configuration includes:

  (setq weechat-tracking-types '(:highlight :message))
  (setq tracking-frame-behavior nil)  ; Only selected frame
  (setq tracking-max-mode-line-entries 3)
  (setq tracking-position 'end)
  (setq weechat-auto-monitor-buffers 't)
  (setq tracking-sort-faces-first 't)

I attempted to set (setq tracking-ignored-buffers '(".*mu4e.*")) and also (setq weechat-sync-buffer-read-status 't) but neither resolved the problem.

jgoerzen commented 6 years ago

FWIW, this workaround dramatically decreases the impact of this:

     (setq jgoerzen-tracking-timer nil)
     (defvar jgoerzen-tracking-fun)
     (defvar jgoerzen-tracking-args)

     (defun jgoerzen-weechat-window-configuration-change-timer ()
       (apply jgoerzen-tracking-fun jgoerzen-tracking-args)
       )
     (defun jgoerzen-weechat-window-configuration-change (orig-fun &rest args)
       (if jgoerzen-tracking-timer
           (cancel-timer jgoerzen-tracking-timer))
       (setq jgoerzen-tracking-fun orig-fun)
       (setq jgoerzen-tracking-args args)
       (setq jgoerzen-tracking-timer (run-at-time 200 nil 'jgoerzen-weechat-window-configuration-change-timer))
       )
     (advice-add 'weechat-window-configuration-change :around #'jgoerzen-weechat-window-configuration-change)