How to run specific elisp code after starting a new emacsclient frame?

To automatically evaluate specific lisp code every time starting with emacsclient, click here.

My problem is different. I want to write a script that opens a new emacs frame (with its focus) (one way to do this is to run it emacsclient -c), and then run the following elisp code in that frame.

(org-remember)

I tried

emacsclient -c & emacsclient -eval '(org-remember)'

But sometimes it just opens a new frame, unfocused, and then runs the elisp code, and in other cases it opens a new focused frame, but runs the elisp code in the old frame.

Some who know that they can remember org-remember can ask me why not just do this:

emacsclient -eval '(org-remember)'

but this is not focused on the old frame.

+3
2

emacsclient -c, , .

, , make-frame select-frame, :

emacsclient -e '(select-frame (make-frame))' '(org-remember)'

, , , .

+4

, :

emacsclient -c -e '(org-remember)'

Emacs 23.1.

+3

Source: https://habr.com/ru/post/1726901/


All Articles