How can I get emacs to open a new buffer quickly? - emacs

I used to be able to open a new buffer in Emacs quickly using the command C-x b <non existent buffer name>
Somehow I've broken this in my version of Emacs (23.1). When ever I try to do this now I get the message [No match] in the command buffer.
Does anyone know what I might have done to break this functionality, or is it possible that I imagined being able to do this?

Set confirm-nonexistent-file-or-buffer to nil:
confirm-nonexistent-file-or-buffer is a variable defined in `files.el'.
Its value is after-completion
Documentation:
Whether confirmation is requested before visiting a new file or buffer.
If nil, confirmation is not requested.
If the value is `after-completion', confirmation is only
requested if the user called `minibuffer-complete' right before
`minibuffer-complete-and-exit'.
Any other non-nil value means to request confirmation.
This affects commands like `switch-to-buffer' and `find-file'.
You can customize this variable.
This variable was introduced, or its default value was changed, in
version 23.1 of Emacs.

If you have enabled ido-mode, you can still switch to the behavior you're familiar with. I do this frequently when I know I'll be creating a new named buffer.
C-x b C-b

You press C-j instead of hitting enter twice, which will bypass the confirmation and immediately open the new buffer. This works with or without ido-mode. This will have the same effect has pressing enter with confirm-nonexistent-file-or-buffer set to nil.

You probably enabled ido-mode. You need to press ENTER to confirm the creation of the buffer.

Related

Emacs/auctex not asking for prompting label anymore

I know that the default mode of Auctex is that prompting c-c c-e equation RET is supposed to ask me to prompt a label, unless I modify purposely the reftex-plug-into-AUCTeX value.
I find myself in a situation where, after installing the last version of aquamacs (on a new config), I am not asked anymore to prompt a label, which is assigned by default to some eq:N value.
I'd like to have this very convenient prompting feature back, any idea where I should look for ?

Any way to silence Emacs keyboard shortcut advice?

Emacs sometimes can be rather annoying, it emits too much information in minibuffer. For instance, when I run M-x gnus, it tells me that
You can run `gnus' with <menu-bar><tools><gnus>
It also occurs when there is a keymap for certain command. I don't need them, But I don't know how to remove.
Any ideas?
Thanks.
Customize the variable suggest-key-bindings: a value of nil will disable key binding suggestion.

Emacs New File Confirmation during Find-File Completion

Some Emacs package I use has turned off the find-file confirmation for choosing a new non-existing file that matches parts of existing file-names shown during completion. I want this confirmation back to the default. What customization option regulates this behaviour?
Example:
M-x find-file
Enter letter a
Pressing TAB now gives two candidates: a1 and a2
Just pressing Return should now query me to confirm through an extra Return. Indicated by a [Confirm] at the end of the minibuffer.
check the value of the variable confirm-nonexistent-file-or-buffer

How do I stop Emacs from changing my split buffers?

I have a number of splits open, looking at various buffers. But when I for example check the help on a function it will replace one of the splits with the help buffer. Once I'm done reading the help I have to go back to the correct buffer manually which is a pain. How do I get Emacs to be nicer to my buffers?
Update: Help will let you press q to go back to the previous buffer. But causing the Emacs backtrace to pop up also steals one of my buffer windows and it doesn't have a q.
Update: Backtrace DOES have q to go back. My original question still remains: how do I ask Emacs not to steal one of my splits?
Adding the line(push "*Help*" special-display-buffer-names) to the init file should make subsequent invocations of the help buffer to appear in its own frame(what the desktop usually calls "window"), and leave the original frame with its configuration alone.
See Special Buffer Frames.
You could also use winner-mode. It came up on planet.emacsen.org a while back.
Winner Mode is a global minor mode. When activated, it allows to “undo” (and “redo”) changes in the window configuration with the key commands ‘C-c left’ and ‘C-c right’.
That way you can undo any changes to your splits immediately after they happen.
I hope this will help you :
C-x 0 to remove the current window
C-x 1 to keep only the current window
you can use windmove by adding the following line in your .emacs :
(windmove-default-keybindings)
Then, you can move the point between windows using S-right S-left S-up and S-down
There are lots of ways to store and restore emacs windows, see emacswiki.org on the subject.
What I do is just go to that changed buffer, C-x k it, and the current buffer in that window will be the previous buffer.
It may be possible to define advice for the help that saves the current window and buffer state and restores it with a simple keybind. But this is outside my basic elisp knowledge.

Highlight buffer modifications

It often occurs that a file buffer is modified (duh!). Before exiting, emacs asks whether to save the changes. Now it would be interesting to know what actually changed. Is there a way to find out?
As of Emacs 22.1 (at least), 'save-buffers-kill-emacs (the default binding for C-x C-c) prompts you for each unsaved buffer that has a file. Type a d when prompted to save and see the diff.
From the help documentation:
Save some modified file-visiting buffers. Asks user about each one.
You can answer `y' to save, `n' not to save, `C-r' to look at the
buffer in question with `view-buffer' before deciding or `d' to
view the differences using `diff-buffer-with-file'.
If you look at the prompt, it should say something like:
Save file /path/to/file.txt? (y, n, !, ., q, C-r, d, or C-h)
Typing C-h gives you a little more verbose description (but d is what you are asking for):
Type SPC or `y' to save the current buffer;
DEL or `n' to skip the current buffer;
RET or `q' to give up on the save (skip all remaining buffers);
C-g to quit (cancel the whole command);
! to save all remaining buffers;
C-r to view this buffer;
d to view changes in this buffer;
or . (period) to save the current buffer and exit.
I use diff-buffer-with-file, and select the file that the buffer came from (which is the default anyway for the command... just hit enter).
You can also use highlight-changes-mode, though this won't track changes until you turn it on, so not so useful if you want to see what changed when you're closing a file that has not been in this mode :-)
You can have highlight-changes-mode enabled. It will display all changes in red. However it won't show you whitespace changes and will mark removals only with an red _. See also http://www.emacswiki.org/emacs/TrackChanges.
I found this post about tracking changes by djcb most helpful regarding tracking changes in Emacs. The trick is to add the following to your .emacs:
;; higlight changes in documents
(global-highlight-changes-mode t)
(setq highlight-changes-visibility-initial-state nil); initially hide
and then toggle highlight-changes-visible-mode when you want to see what has changed.
In this case I type undo to see the last change (usually some stray character which got typed in the wrong window, since I save early and often).
It would be nice if there were some other indication of the current changes, e.g. in the border like quick diff in Eclipse text editors.
I use goto-chg for things like that. It's not perfect, but it always is enough to jog my memory about what change I made and promptly forgot about.