As the question says, I want my default editor in R (e.g. when I do fix(fn_name)) to be the non-windowed mode of emacs as opposed to the windowed mode. Is there any way to do this?
Asked
Active
Viewed 140 times
1 Answers
2
Create a file somewhere (I use a bin
directory under my home), called emacsnw
like this:
#!/bin/sh
emacs -nw "$@"
and make it executable: chmod 755 emacsnw
Then you can do options(editor="/home/me/bin/emacsnw")
and that will then call it.
Note I can never remember if "$@"
or "$*"
is the right way to pass args through a script, but this seems to work for fix()
.

Spacedman
- 92,590
- 12
- 140
- 224
-
Awesome, this works exactly as you listed it! THanks! – Mukund Feb 23 '17 at 22:52
-
I think `"$@"` is generally the right thing. It expands each parameter individually and wraps them each in quotes. So it would be like `emacsnw "file name with spaces" "more spaces"` -> `emacs -nw "file name with spaces" "more spaces"` rather than `emacs -nw file name with spaces more spaces` or `emacs -nw "file name with spaces more spaces"`. – jpkotta Feb 24 '17 at 20:04