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/viand you want the file be opened with/usr/bin/vi? (I chosevihere to demonstrate what I mean with something other thanemacs.) – Tobias Apr 28 '17 at 12:36fileopened byemacsclientafter the file is loaded:emacsclient -s my_server --eval '(progn (find-file "file") (...)(select-frame-set-input-focus (selected-frame)))'– Håkon Hægland May 24 '17 at 07:48fileI'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. – Hi-Angel Jul 27 '19 at 11:22{}as a mark in config to show where the filename should be put, so I simply did…(find-file "{}")…, and it worked. – Hi-Angel Jul 27 '19 at 11:28