Saturday, May 4, 2024
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 5673  / 2 Years ago, wed, december 8, 2021, 5:53:07

I like to use emacs as my configuration editor, so it is the default for programs like git or cron. So I used



sudo update-alternatives --config editor


And chose emacs24 from the list.



Unlike Vim or nano, this launches emacs as a new gui application, rather than taking over the current terminal window.



Is there a way to make emacs open in the terminal as a configuration editor, or maybe when it is invoked from the command line, but still allow for launching emacs as a stand-alone application from the launcher or dash?


More From » configuration

 Answers
7

Most utilities, including git respect an environment variable named EDITOR which you can set to any editor you want, including options. export EDITOR='emacs -nw' will have them run emacs in non windowed mode.



In the case of emacs, it has a handy server mode you can start with M-x server-start and then run emacsclient as an editor to open a file in the already running emacs instance. This is handy since it allows you to retain access to the emacs kill ring and other features. It also accepts the -nw switch so that it will open a new emacs frame in the terminal window rather than in the gui emacs frame, so it will still look and feel like a text mode emacs session, but still share the kill ring and buffers with the other window(s).


[#29207] Thursday, December 9, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ightrushi

Total Points: 129
Total Questions: 125
Total Answers: 127

Location: French Southern and Antarctic Lands
Member since Fri, Jan 6, 2023
1 Year ago
;