10

I'm pretty sure there are other solutions, but you can do this using --eval instead of -f (--funcall): emacs --eval '(ediff-files "file1" "file2")' In fact, the Emacs manual on "Command Line Arguments for Emacs Invocation" says that -f function and --funcall function Call Lisp function function. If it is an interactive ...


5

What I recommend you to try is to start Isearch first and then yank your word to the search string, effectively doing the same what you would do manually to add words in isearch-mode: (defun my-search-word () (interactive) (isearch-forward nil 1) (isearch-yank-string "aa")) (my-search-word) If you need to match word boundaries, then try this: (...


5

It's a synonym for -f / --funcall, included for backwards compatibility. The argument-handling code in command-line-1 says: "-f" ; what the manual claims "-funcall" "-e")) ; what the source used to say


3

I use the following script: it checks in advance if there are differences, and in case there are, it opens Emacs with the appropriate function evaluated. With the -d option, it assumes the items provided are directories, and ediff-directories instead of ediff-files is used; otherwise it checks if they are directories or files, and sets the function to use ...


2

DOS does not recognize ' ' as quotes. You will have to use the following: emacs --eval "(set-background-color \"green\")" Powershell works a little closer to what you expect: emacs --eval '(set-background-color \"green\")' But it too requires \ before the " to properly escape them.


2

I use this to diff from bash. --eval is what I think you are looking for. If you are not using emacsclient you can adjust the first portion accordingly. ediff () { if [ -d $1 ]; then emacsclient -c -a emacs -q --eval "(ediff-directories \"$1\" \"$2\" \"\")"; else emacsclient -c -a emacs -q --eval "(ediff-files \"$1\" \"$2\")"; ...


2

The patch which allows you to specify .emacs.d location via `EMACS_USER_DIRECTORY' environment variable is available in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15539 but it's not yet merged.


1

A solution based on suggestions by @phil and @glucas. The idea is to set a dynamic HOME variable: first set it in the shell as the parent of .emacs.d; then reset it in my "pseudo-init" to the desired value (here the document folder). Here is the full working solution. Solution: Emacs.cmd --------- set "HOME=%~dp0\emacs" emacs\bin\runemacs.exe -q --...


1

Sort-of solution: emacsclient -a '' ... Looking at the automatic links appearing at the right of the question, I saw a question not seen before: emacsclient - Opening frames from emacs-daemon - Emacs Stack Exchange. User there uses emacsclient -a '' ... which incidentally solves the issue. I guess it allows emacsclient to assume that callee is a real ...


Only top voted, non community-wiki answers of a minimum length are eligible