How can I configure console emacs so it can be suspended/backgrounded with C-z when it's being run from the console?
I believe it should work by default. Have you bound C-z to a function? That might be overriding it.
As a test, try running Emacs in a terminal, with no init file loaded:
emacs -q -nw
C-z properly suspends for me.
With elscreen, use C-x C-z, which is just an alternative to C-z. Read elscreen help !
Related
I just installed Emacs 26.3 on Ubuntu 20.04. I opened a buffer in the terminal, and I cannot close it. C-x C-c does nothing. f10 to activate the menu does not activate the menu.
I'm using a .emacs file that maps cut/copy/paste commands to the normal C-x/C-c/C-v. I don't think that this can affect the issue, however, because I have the exact same setup (including the same .emacs file) on by Emacs 24.5/Ubuntu 16.04 laptop, and it has no problem exiting with C-x C-c. Also, I had the exact same problem before I installed the .emacs file on the new system.
How do I kill Emacs?
This question exists, but it has no useful answers.
ESC x save-buffers-kill-terminal
OFC binding C-x will affect C-x C-c. You don't need to know anything about Emacs to realize the problem. Just think twice.
I have successfully installed hy-mode from https://github.com/hylang/hy-mode. I now can open a .hy file in emacs and have syntax highlighting, and editing with paredit is a joy.
I however, don't know how to start a REPL. At the bottom of the github readme, it says:
When in hy-mode, you can launch a Hy REPL by launching a Lisp inferior
process
M-x lisp-inferior-process
That function, however, is not defined for me. What else do I need to install or check to be able to use the repl for Hy?
I am currently using:
GNU Emacs 24.3.1.
Have you tried to set inferior-lisp-program to "hy" and then doing M-x run-lisp?
This is the standard way (or maybe just the "way I know about") of having an inferior lisp process.
As of version 1.0.4 of hy-mode, you can start a hy repl buffer in Emacs using M-x run-hy or use the default key binding of C-c C-z.
In any Emacs mode, including hy-mode, you can use M-x describe-mode or the default key binding of C-h m to show key bindings for the current mode.
How can I access the command history when running irb in the emacs eshell?
When I run irb at the command line outside of emacs, I can use the up arrow to get the last command or ctrl-r to search the command history. In irb inside eshell, the up arrow does nothing (i.e. it runs eshell-previous-matching-input-from-input which does nothing in irb) and ctrl-r uses the emacs reverse search of the buffer instead of searching the command history. I guess irb never receives the up-arrow keystroke because it's bound to eshell-previous-matching-input-from-input, but I'm not sure how to fix it. Running (global-unset-key (kbd "<up>")) doesn't unbind the up-arrow in eshell and I'm not sure that's desirable anyway.
I know about inf-ruby, but I prefer using irb in eshell and besides up-arrow and ctrl-r don't work with that either.
It could be a problem with readline in irb, but I don't think so. conf.use_readline is nil on the commandline where irb command history works fine. Running irb --readline in eshell switches conf.use_readline to true but doesn't fix the up arrow or ctrl-r.
Emacs term mode (M-x term) in combination with C-c C-j / C-c C-k to temporarily allow yanking seems to be a good option. See another answer here.
Is it expected that C-M-% and ESC C-% do not run the command query-replace-regexp when running emacs in a terminal window (for example, emacs -nw)?
According to describe-function the binding exists, but emacs runs query-replace instead (which has the binding M-%). This has happened on several machines I've tried it on, and does not happen when I run emacs in a window.
The problem is that C-% simply can't be typed in a terminal. The only control sequences available are those that corresponds to ascii-code 0-31, mainly C-letter.
I have created a new shortcut in my .emacs file.
(global-set-key "\M-q" 'query-replace-regexp)
Control-Alt-Shift-% all together works on Windows and Fedora Linux. Does your keyboard have all those keys?
What are some REPLs for Emacs Lisp?
Is there only one that is within Emacs?
Are there some that run inside terminal outside Emacs?
Based on this question: REPL on console emacs, you can use M-x ielm (inferior emacs lisp mode).
There is a (work in progress) REPL for Emacs for use from the command line. It currently supports basic command line editing and history.
The code is hosted on Github.
There is this project on Gitlab. The REPL can run on a termninal or on Emacs' minibuffer. Even if you run it in "no-window-system" mode (with -nw).