10

I use emacs24 and I usually start emacs as a daemon at start then use emacsclient frames.

But I've encountered a problem: After I created the first frame, then whenever I created a new frame (after the first frame is closed) there would be a system message "emacs24@myusername" is ready popped out so that the new frame loses focus (the focus is on the message), which is rather annoying. It seems that it is because even if I close all frames some buffers are still open (like Scratch and Messages). I am just wondering if there is a way to prevent the system message from popping out?

Thanks!

EDIT: forgot to mention that I am using Gnome 3.

9

Here is what I do :

(server-start)
(defun px-raise-frame-and-give-focus ()
  (when window-system
    (raise-frame)
    (x-focus-frame (selected-frame))
    (set-mouse-pixel-position (selected-frame) 4 4)
    ))
(add-hook 'server-switch-hook 'px-raise-frame-and-give-focus)
| improve this answer | |
  • 2
    Thanks! This was really bothering me in Ubuntu 16.04 and I solved it with /usr/bin/emacsclient -c -e "(progn (raise-frame) (x-focus-frame (selected-frame)))" – Marduk Nov 30 '16 at 6:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.