Skip to main content
16 votes
Accepted

How to get keystrokes displayed in the echo area immediately?

You are looking to adjust the value of the variable echo-keystrokes. You can read its docstring by entering C-h v echo-keystrokes (or M-x describe-variable echo-keystrokes): Documentation: ...
Dan's user avatar
  • 33.1k
15 votes
Accepted

decrease time until "C-x-" shows in echo area after pressing the keys

(setq echo-keystrokes 0.01) will result in near-instantaneous echoing of the keystrokes. Alternatively, you could customize the variable (M-x customize-variable RET echo-keystrokes). The variable ...
aplaice's user avatar
  • 2,206
9 votes
Accepted

Insert multiple minus ('-') characters using the universal argument (C-u)

For example, C-u C-u C-q -. You can C-h k C-q for more details.
shynur's user avatar
  • 5,473
8 votes
Accepted

Break key as a shortcut -- what am I doing wrong?

You ask several related questions, but this is the main one, I think: How does one find out what name emacs gives to a key such as the one labeled pause/break on my keyboard? For Emacs's description ...
Drew's user avatar
  • 78k
6 votes
Accepted

How to play back an edit session in emacs?

Bob is likely referring to the undo-browse.el package. According to the package's ub-introduction command, In ub terminology, the undo-history is seen as a movie, each step being a frame of the ...
Lorem Ipsum's user avatar
  • 4,527
6 votes
Accepted

Making sure that a pair of functions is executed even if C-g is pressed in the middle

Based upon the comment of the original poster underneath the question, the function unwind-protect achieves the desired behavior. The doc-string and printout of the *Help* buffer for describe-...
lawlist's user avatar
  • 19.2k
5 votes
Accepted

OA and OB inserted by emacs

In text terminals, many keys (like up) work by sending a sequence of bytes, such as ESC O A. Emacs normally recognizes these sequences and turns them into a more meaningful up event, using input-...
Stefan's user avatar
  • 26.5k
5 votes
Accepted

C-) not recognized on Windows 10

I found a solution—the following works for me: Control Panel > Language > Advanced Settings > Change language bar hot keys > Ensure Between input languages is highlighted > Change Key Sequence... ...
achalk's user avatar
  • 589
4 votes

Is there an advantage to learning ESC- instead of ALT- beyond "maybe you'll use a system someday ..."?

Emacs has a lot of keybindings. I have never used a system where some Emacs keybindings did not clash with the underlying system. Every window manager intercepts a different set of keybindings, so the ...
Wilfred Hughes's user avatar
4 votes
Accepted

How to make emacs recognise C + SHIFT combinations in terminal mode?

You can't. There's no way for a terminal to communicate both control and shift modifiers. The very original terminals (teletypes, actually) implemented the control modifier by masking out the top two ...
db48x's user avatar
  • 18.4k
4 votes
Accepted

Abbreviation expansion without spaces

I asked the same question recently on emacs-devel and Kenichi Handa told me I could do: (defvar my-TeX-input-method-tweaked nil) (defun my-quail-activate-hook () (when (and (not (member (quail-name)...
Stefan's user avatar
  • 26.5k
4 votes
Accepted

is there a keybinding to save curor position for returning after viewing other section of same buffer?

@Aaron answered well with the usual way to take care of this in Emacs: set a mark where you are now, then get back to it later using C-u C-SPC. Another way is to use a bookmark, in particular a ...
Drew's user avatar
  • 78k
4 votes

Display keybindings typed in a buffer

Yes! This is command-log-mode which can be installed from Melpa. You have to add the function to whatever modes you want to record, like (add-hook 'python-mode-hook 'command-log-mode) Then, to ...
gregoryg's user avatar
  • 935
4 votes
Accepted

Partly delete a key sequence?

I have just found this from its Github page. https://github.com/justbur/emacs-which-key#paging-options Not one key but, If you press also for C-h u you can go for previous state. which-key-undo can ...
itirazimvar's user avatar
4 votes

Insert multiple minus ('-') characters using the universal argument (C-u)

To type a minus sign with a numeric prefix argument, you can enter the number by typing the digits: C-u 6 4 - or ESC 6 4 - or M-6 M-4 - or C-6 C-4 - (or a few other combinations). This method doesn't ...
Gilles 'SO- stop being evil''s user avatar
3 votes
Accepted

Regex search: Why C-M-s does not seem to work like other keystrokes?

This was apparently due to Ubuntu (with Unity): C-M-s was in my case a default key-binding for minimizing windows. Hence a conflict, I guess. Redefining it to something else solved the problem.
Giuseppe's user avatar
  • 455
3 votes

How to play back an edit session in emacs?

This is within the one buffer , not for the whole session, but it is worth mentioning: With undo-tree , for example: https://www.emacswiki.org/emacs/UndoTree You open undo tree buffer with C-x u ...
manandearth's user avatar
  • 2,128
3 votes

is there a keybinding to save curor position for returning after viewing other section of same buffer?

Whenever I make a large jump in a file, I press C-SPC C-SPC first. That sets the mark to the current value of point*, effectively remembering the current cursor position. Then, once I'm done ...
Aaron Harris's user avatar
  • 2,684
3 votes
Accepted

Convert bitmap vector keys into a human readable string

In Emacs Lisp, key-description does this. For instance: (key-description [134217842]) gives you "M-r". Its docstring says that kbd is an approximate inverse of it. (Method of finding this out: Look ...
aplaice's user avatar
  • 2,206
3 votes
Accepted

Injecting keystrokes on console

For keys which a terminal can't even send unmodified (which I suspect is the case with <kp-add>), you will need to bind some key which can be sent by the terminal. You can bind a key to the ...
phils's user avatar
  • 51.7k
3 votes

How to get immediate visual feedback of keys I type?

Library showkey.el (code) gives you what you request, I think. It defines two global minor modes, which give you two ways to show keys you type: showkey-tooltip-mode – Show only the last key used, in ...
Drew's user avatar
  • 78k
3 votes
Accepted

Let a function do a keystroke

You can use unread-command-events to "push back a character onto the input", so the next time a read-char happens, that character will be returned, rather than having read-char wait for &...
NickD's user avatar
  • 30.9k
3 votes
Accepted

Diacritic marks in emacs for macOS

But on macs keyboard it is no distinction between left and right option key ⌥ as it is in Win (Alt and Alt+Gr). Yes, there is. You have the variables ns-alternate-modifier and ns-right-alternate-...
d125q's user avatar
  • 1,453
2 votes

How to use the Insert key to toggle `overwrite-mode` when using a PC keyboard in OS X?

Placing the following snippet in user-init-file (~/.emacs.d/init.el in my case) worked for me. I also set ctrl-insert and shift-insert to copy/paste. (when (eq system-type 'darwin) ;; when using ...
ValG's user avatar
  • 21
2 votes

Regex search: Why C-M-s does not seem to work like other keystrokes?

C-h f isearch-forward-regexp, then you will find: C-M-s (translated from C-M-S-s) runs the command C-M-S-s works(GNU Emacs 25.1.1) for me.
Big Shield's user avatar
2 votes

"Backspace" key sometimes also deletes forward in python-mode

Short Answer Don't try to create one .emacs file for all your environments and conditions under which you might access them unless you have time on your hands. Longer answer for those who might be ...
Gabe's user avatar
  • 51
2 votes
Accepted

How do I do the key strokes `C-M-c` in spacemacs?

When you're using ESC for Meta, you want to type it separately, as a prefix. So on most keyboards you could use either: ESCCtrl + c Ctrl + Alt + c
phils's user avatar
  • 51.7k
2 votes
Accepted

Function to reprogram muscle memory

Well... (global-set-key (kbd "C-x C-s") (lambda () (interactive) (message "Ctrl x s deprecated. Use instead: SPC f s"))) save-...
muffinmad's user avatar
  • 2,320
2 votes
Accepted

M-P: M-p is undefined

It's a feature. Refer to this duplicate Q&A on the main S.O. site: https://stackoverflow.com/a/54591047/324105 It's still slightly misleading, given that in your case the lower-case sequence ...
phils's user avatar
  • 51.7k

Only top scored, non community-wiki answers of a minimum length are eligible