Is it possible to specify an argument for emacsclient to run a command in the opened file? I would like to set the editor of a program to emacsclient -r '(search-forward-regexp "^<<<")'
.
Addition 1
While I can run
emacs file --eval '(search-forward "test")'
the same with emacsclient
fails with *ERROR*: Symbol's value as variable is void: file
. Very helpful would be an --eval-next
so I could define and use a shell alias like
% alias edit-as-shell='emacsclient --eval-next "(shell-mode t)"'
% edit-as-shell ~/bin/script
% alias edit-at-end='emacsclient --eval-next "(end-of-buffer)"'
% edit-at-end file
"^<<<"
? E.g., the file contains the line<<</usr/bin/vi
and you want the file be opened with/usr/bin/vi
? (I chosevi
here to demonstrate what I mean with something other thanemacs
.)file
opened byemacsclient
after the file is loaded:emacsclient -s my_server --eval '(progn (find-file "file") (...)(select-frame-set-input-focus (selected-frame)))'
file
I'm opening, right? But what if I don't? E.g. I use emacsclient from Qutebrowser when I want to edit some lengthy texts, and the filename Qutebrowser generates is random.{}
as a mark in config to show where the filename should be put, so I simply did…(find-file "{}")…
, and it worked.