dotfiles icon indicating copy to clipboard operation
dotfiles copied to clipboard

Flashing frames with emacsclient still occur

Open hisnawi opened this issue 8 years ago • 1 comments

Hi Joe, I have close to your setup, and this is the behavior I see. Starting the first emacsclient loads fine, the second one flashes both frames and the rest have no issues. It is just the second instantiation of a frame that has the flashing issue, no big deal but still annoying. Do you see the same on your end?

Here is my setup:


     (setq myGraphicModeHash (make-hash-table :test 'equal :size 2))
    (puthash "gui" t myGraphicModeHash)
    (puthash "term" t myGraphicModeHash)
    (defun emacsclient-setup-theme-function (frame)
      (let ((gui (gethash "gui" myGraphicModeHash))
            (ter (gethash "term" myGraphicModeHash)))
        (progn
          (select-frame frame)
          (when (or gui ter) 
            (progn
              (load-theme 'material t)
              (if (display-graphic-p)
                  (puthash "gui" nil myGraphicModeHash)
                (puthash "term" nil myGraphicModeHash))))
          (when (not (and gui ter))
            (remove-hook 'after-make-frame-functions 'emacsclient-setup-theme-function)))))
    (if (daemonp)
        (add-hook 'after-make-frame-functions 'emacsclient-setup-theme-function)
      (progn 
        (load-theme 'material t)
        ))

hisnawi avatar Jul 02 '17 07:07 hisnawi

You're right! It happens to me too, and I'm pretty sure I don't remembering this happening before.

But I think that I know why, because seems that the prior problem was fixed upstream, because I'm using Emacs 25.2.1 and if I remove this code entirely, it works fine! You have to excuse me, I was not following the Emacs development for a few months, and they probably fix this a while ago. Either way, when I had a moment I'll take a better look a this to know if I can find what's happening exactly.

If you remove the code, works fine for you as well?

Edit: I wasn't able to find any reference to this specifically both in Emacs News or in the ChangeLog, but seems that in the 25.1 version some changes were made to the handling of windows and frames, and probably that fixed the previous odd behaviour.

joedicastro avatar Jul 02 '17 09:07 joedicastro