Emacs Evil <E> mode and org-mode - emacs

I have recent started using emacs, Evil and org-mode together. When taking notes in org-mode sometimes the program will go into an < E > mode which I can see on the status bar at the bottom of the frame. When starting emacs I usually see a < N > on the status bar.
I am assuming that
< N > - is for normal mode
< I > - is for insert mode
What is < E > mode?
How do I return to normal mode without having to restart emacs?

It means you somehow got into "Emacs" state, which uses the standard Emacs keymap. You can get back to "Normal state" with M-x evil-normal-state. (Just in case you're brand new: M-x means "Meta-x", which in practice means "Alt-x").

Related

How to prevent `magit-visit-thing` to open an `evil-mode` buffer

evil-mode has evil-emacs-state-modes var, which defines modes to open in emacs mode.
I have magit-diff-mode listed in that var (in fact, it is a default).
Running magit-diff opens correctly in emacs mode.
However, if I a run magit-status (opens in emacs mode), place the point on Head (first line in the buffer) and hit Ret, magit-visit-thing is called and and the commit info is shown in a new buffer. This buffer is in magit-diff-mode, however, evil-mode is active for this buffer.
How do I prevent this behaviour?
As we figured out in the comments - the buffer opens in magit-revision-mode, not in magit-diff-mode.
To find out the major mode of the buffer, describe variable major-mode - C-h v major-mode <RET>.
For you information, when you do describe-mode instead (C-h m) what you see as mode name is the string that appears in the status line. It may be difficult to guess from it what the actual mode name is - like Magit Rev is actually a string for magit-revision-mode - no way of knowing unless you look in magit-diff.el:
define-derived-mode magit-revision-mode magit-diff-mode "Magit Rev"

emacs kill process from list

When using M-x list-processes I get a list of processes.
Is there a way to kill them interactively ? For instance by selecting one in the list, then pressing q or something similar ?
In case it matters, I am using emacs 24.5.1 on osx with emacs prelude.
Note : it is different from this question I want to do it interactively, not from the mini-buffer (as understood by #legoscia already).
In Emacs 25, you can do what you'd expect: in the process list, hit d to "delete" the process under point.
For earlier Emacs versions, I've been using this little function that works using the minibuffer, not the process list:
(defun delete-process-i(p)
(interactive `(,(completing-read"Kill proc: "(mapcar 'process-name(process-list))()t)))
(delete-process p))
After defining it, you can type M-x delete-process-i, and type the name of the process you want to kill, with tab completion.
(I originally wrote it to fit in 140 characters; thus the non-standard layout.)

emacs with nrepl.el for Clojure - how to hide a popup buffer?

I'm using emacs 23 (acquamacs) and have installed nrepl.el.
I've evaluated some Clojure code with
C-c C-p
(this key combo is to Evaluate the form preceding point and display the result in a popup buffer.)
Running it has produced a nice popup buffer for me to see the results.
How do I hide this popup buffer? (I don't want to kill it - just get my fullscreen back).
FYI Re this command - I've run this with
C-h k C-c C-p
and got
^C ^P runs the command nrepl-pprint-eval-last-expression, which is an interactive compiled Lisp function in `nrepl.el'.
It is bound to ^C ^P, <menu-bar> <nREPL> <Eval last expression in popup buffer>.
(nrepl-pprint-eval-last-expression)
Evaluate the expression preceding point and pprint its value in a popup buffer.
You haven't provided enough information for anyone to test (that's not a standard global binding), and you haven't even indicated whether the new window is selected; but there's a generic solution which will work regardless.
Add (winner-mode 1) to your init file, and then you can always use C-c<left> to undo the most recent window configuration change (or changes plural, if you repeat the command).
Either that or just press q. I just tried it out with the help buffer and it dismisses the window but not the buffer. However, popup buffers in the style of ac-nrepl does for its autocompletion are meant to simply be dismissed
Always, when asking Emacs questions, say what the key sequence does. C-c C-p does nothing here. TO find out what it does press C-h k C-c C-p and report back. In this case we're invoking 'describe-key and then telling it to describe what C-c C-p does.

Use emacs to copy kill-ring to window/buffer based on position

This may be too involved.
Considering:
In emacs in r-mode or lisp mode (etc) information can be sent directly (copied, pasted, evaluated) from one buffer to the the R or Lisp interpreter.
I typically configure an emacs session to have 3 windows - a large horizontal window on top and two windows beneath it. (How) could I configure, which keys/ commands might I use to send the kill-ring to the last cursor position of the top window / buffer?
The buffer / window will not always necessarily have the same contents/file. (How) could I name it upon initialization?
Similar to C-X, C-B or C-X, B how might I specify which of the three window positions to go to (based on position)?
See window-at. For example,
(defun yank-into-top-window (&optional arg)
(interactive "*P")
(with-selected-window (window-at 0 0)
(yank arg)))
I think you're going to have to write lisp code to do this effectively. Basically, you'd want a minor mode that sets up the two subwindows -- which isn't hard, it happens in compile mode from M-x compile -- and then make special keybindings for the keys you want to use.

Emacs nxhtml applying wrong mode when using Emacs-desktop

I have I standard Emacs/nxhtml install. My nxhtml-autoload.el has the following line (I use .djhtml for my django template files)
(add-to-list 'auto-mode-alist '("\\.djhtml\\'" . django-nxhtml-mumamo-mode))
I also use Emacs Desktop to re-open buffers ("save desktop state") when starting Emacs. When Emacs Desktop opens buffers, it fails to apply proper nxhtml mode however (django-nxhtml). I can apply the correct mode manually just fine and correct mode is used if I open new buffers.
Emacs desktop is placed at the very bottom of my init.el, so I don't understand why nxhtml is not applied when desktop recreates the old buffers?
Were the buffers in question opened prior to adding & evaluating that auto-mode-alist entry?
The desktop library saves the major mode and minor modes currently associated with each buffer, and re-applies only those modes when restoring them (in order to put you back in the exact same state); so saving and restoring the desktop will not have the desired effect if the buffers were not already in the correct mode.
If you have a lot of files open, you could use ibuffer to revert (reload) them, so that the auto-mode kicks in: M-x ibuffer RET % f \.djhtml RET V