|
From: | Kim F. Storm |
Subject: | Re: Emacs's Command Frequency and default keyboard shortcuts |
Date: | Thu, 19 Oct 2006 11:11:11 +0200 |
User-agent: | Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Miles Bader <address@hidden> writes: > Stefan Monnier <address@hidden> writes: >> You mean >> >> (defvar caps-lock-mode-map >> (define-minor-mode caps-lock-mode > > Ah yes indeed! > > So now the complete goodness: Brilliant! > > (defvar caps-lock-mode-map > (let ((map (make-sparse-keymap))) > (define-key map [remap self-insert-command] 'self-insert-upcased) > map)) > > (define-minor-mode caps-lock-mode > "When enabled, convert all self-inserting characters to uppercase." > :lighter " CapsLock") I think "CAPS" is better (and shorter :-) > > (defun self-insert-upcased (arg) > (interactive "p") > (setq last-command-char (upcase last-command-char)) > (self-insert-command arg)) -- Kim F. Storm <address@hidden> http://www.cua.dk
[Prev in Thread] | Current Thread | [Next in Thread] |