22

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 ...


19

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:


13

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: 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. ...


12

(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 ...


10

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 ...


9

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.


7

You can use a post-command-hook 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 buffers). (defun update-lossage-buffer () "Update the \"Lossage\" buffer. For this to work, visit the lossage buffer, and ...


6

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 ...


6

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 ...


6

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 ...


6

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 ...


5

Does (execute-kbd-macro (kbd "Hello")) work by any chance?


5

You could take advantage of the recent-keys function. It returns a vector of the last 300 events. Using (defun get-last-key () (interactive) (let ((vect (recent-keys))) (aref vect (1- (length vect))))) And then doing C-x C-e on (get-last-key) You will get 5 (#o5, #x5, ?\C-e) You will "just" have to compare this to the keystroke you want. ...


5

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 ...


4

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.


4

LFD refers to "linefeed". This key is similar to return -- in ways not worth discussing here -- but can be input with C-j.


4

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 ...


4

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: (require 'cl-lib) (defun my-strip-control (event) (event-convert-list (append (cl-set-difference (event-modifiers event) ...


4

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 ...


4

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.


4

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... > Change Switch Keyboard Layout from Ctrl + Shift to Not Assigned. A similar process is outlined here.


4

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 (...


4

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) my-TeX-input-method-tweaked)) (member (quail-name) '("TeX" "latin-1-prefix"))) (quail-defrule "uu" "ū") (push (...


3

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) (setq ns-right-alternate-...


3

(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. Wrt ...


3

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 ...


3

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>...


3

@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+. ...


3

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 then up and down arrow to step through your history while seeing it change in the original buffer. I actually never went fast forward until you asked... but it ...


2

I use the Dvorak layout and I found that it works very well with Emacs default key bindings. C-n is on the home row and C-p can be pressed with the index finger instead of the pinky. C-u (the prefix key) is on the home row as well. I swapped Caps Lock and Ctrl on all keyboards because I find it easier to type certain key combinations. I also bound M-x to ...


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