This is a hard question to "answer", but a few thoughts:
Try working with the default key bindings for a while, because Emacs will definitely feel strange at first. I would not suggest making major configuration changes until you have a better sense of what works and doesn't work for you.
You'll find Emacs users on both sides of the caps-lock vs. ctrl ...
Addressing the last question in your post: you can get an auto-updating log of commands & key strokes by using https://github.com/lewang/command-log-mode which is also available on MELPA - by default it only shows non-trivial commands (so no self-insert or cursor movement commands). It looks like this:
You are looking to adjust the value of the
You can read its docstring by entering C-h v echo-keystrokes (or
M-x describe-variable echo-keystrokes):
Nonzero means echo unfinished commands after this many seconds of pause.
The value may be integer or floating point.
If the value is zero, don't echo at all.
(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 determines the delay, in seconds, before echoing unfinished commands. If the value is 0, then do not echo at all (which is why you need to choose a very short ...
I've got myself for Christmas a Kinesis keyboard. I will not post links so that not to make this an advertisement. Keyboards with similar qualities will do too.
Before that I had a Steelseries keyboard with additional Ctrl mapped to Caps Lock. The important things I needed to learn (with my old keyboard) were these:
Press M-x with both hands. I can reach ...
Yes. There's a package called mwe-log-commands, which is available in MELPA.
Just run M-x mwe:log-keyboard-commands to start recording, then M-x mwe:open-command-log-buffer will open a buffer which shows the typed commands in real time.
command-log-mode is a newer and more actively-maintained fork of mwe-log-commands, so it might be preferable these days.
You can use a
to update the lossage buffer. The following snippet does that for you
(on a buffer local basis), but it assumes you've renamed the lossage
buffer to "Lossage" (so this way you can still open other help
(defun update-lossage-buffer ()
"Update the \"Lossage\" buffer.
For this to work, visit the lossage buffer, and ...
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 of a key, use C-h k.
So C-h k, then hit the Pause key. Emacs probably tells you this:
<pause> is undefined
So you now know that Emacs describes that key ...
Applications written with/for GUI frameworks such as X11 can generally receive individual key-up/key-down events, so it would be possible if only Emacs exposed that functionality to the land of Elisp, but it doesn't.
For a surprise though, in e.g. an X11 frame, hit C-h k, then click down with your mouse, drag it around, and release it somewhere. The up/down ...
Emacs records the last 300 input events (mainly keystrokes, but also mouse clicks and such). In Elisp, you can access them by calling recent-keys. As a user, you can view the list of keystrokes by invoking the command view-lossage by pressing C-h l or f1 l.
Glancing through the uses of the recent-keys function, the only thing I can find in Emacs itself that ...
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-function is as follows:
unwind-protect is a special form in `eval.c'.
(unwind-protect BODYFORM UNWINDFORMS...)
Do BODYFORM, protecting with UNWINDFORMS.
If BODYFORM ...
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 movie. You can play (back/forth) the color-coded
movie-history of your document, or manually go back and forth, and
revert your document to the frame you ...
You could take advantage of the recent-keys function. It returns a vector of the last 300 events.
(defun get-last-key ()
(let ((vect (recent-keys)))
(aref vect (1- (length vect)))))
And then doing C-x C-e on
You will get
5 (#o5, #x5, ?\C-e)
You will "just" have to compare this to the keystroke you want.
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-decode-map. But there's no way for Emacs to know for sure whether you hit up or you hit ESC O A. So if you type ESC ESC up, Emacs will see ESC ESC ESC O A and ...
Checking the Ubuntu system-settings :System-settings->keyboard->shortcuts->navigation, shows that
Ctrl+Alt+Left was bound to "Switch to workspace left" and
Ctrl+Alt+Right was bound to "Switch to workspace right". Disabling these two shortcuts solved the problem.
step 1, install evil-mode (http://www.emacswiki.org/emacs/Evil). It uses vim key bindings and provides advanced vim features like text objects, so you type much less Ctrl, Alt
step 2, use evil-leader (https://github.com/cofi/evil-leader), you press leader key (I map it into ",") first then type combination of any keys to trigger a command. Please take full ...
I think you want event-basic-type. E.g. (event-basic-type ?\C-;) returns ?;.
If you want to only stop the control modifier but keep the other modifiers (e.g. the shift modifier), then you can try something like:
(defun my-strip-control (event)
(append (cl-set-difference (event-modifiers event)
There are other methods than the one mentioned in this answer, but I personally prefer the best of both worlds -- i.e., I use the left alt/option key as meta, and I use the right alt/option key for stock Apple stuff -- e.g., special characters like the ones mentioned by the original poster:
(setq ns-alternate-modifier 'meta)
Okay, so my first answer has a number of shortcomings as detailed in its comments.
execute-kbd-macro is a built-in function in C source code.
(execute-kbd-macro MACRO &optional COUNT LOOPFUNC)
Execute MACRO as string of editor command characters.
MACRO can also be a vector of keyboard events. If MACRO is a symbol,
its function definition ...
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 keystrokes don't even reach Emacs.
Using ESC is a fallback for when you can't type Alt-something directly in Emacs.
I found a solution—the following works for me:
Control Panel >
Advanced Settings >
Change language bar hot keys >
Ensure Between input languages is highlighted >
Change Key Sequence... >
Change Switch Keyboard Layout from Ctrl + Shift to Not Assigned.
A similar process is outlined here.
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 bits of the 7-bit character set, allowing for 32 control codes. A Q is character number 0x51, and q is 0x71. The bottom five bits of these are both the same (...
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)
(member (quail-name) '("TeX" "latin-1-prefix")))
(quail-defrule "uu" "ū")
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 invoke the log window as shown in the video
Open a Python file (in my example) and start manipulating the code to see your ...
(defun foo (keys)
(interactive "kUse a key sequence: ")
(let ((ks (this-single-command-keys)))
(setq ks (aref ks (1- (length ks))))
(if (eq 'home ks) (message "yes") (message "no"))))
Get rid of the argument and the interactive spec, if you intend to use this in a context where a key sequence has already been read and you want to test it.
The lossage help buffer is not associated with a file on disk. Hence auto revert mode does not work. A pseudo realtime alternative can be using
(open-dribble-file "FILE") which writes all keystrokes to FILE. Using auto-revert-tail-mode on FILE buffer can reflect the keystrokes.
Another way would be to advice self-insert-command(and some prefix keys) to ...
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 keyboard macro [kp-add] in order that the alternative key sequence does whatever <kp-add> would have done:
(global-set-key (kbd "C-c p") (kbd "<kp-add>...
@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 temporary bookmark (unless you want to get back to the position in a later Emacs session).
You can easily create (and delete) temporary bookmarks using Bookmark+. ...