summaryrefslogtreecommitdiff
path: root/.emacs.d
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.d')
-rw-r--r--.emacs.d/init-spw.el49
1 files changed, 0 insertions, 49 deletions
diff --git a/.emacs.d/init-spw.el b/.emacs.d/init-spw.el
index 06592293..7ed49498 100644
--- a/.emacs.d/init-spw.el
+++ b/.emacs.d/init-spw.el
@@ -962,55 +962,6 @@ window first."
(setq comp-async-report-warnings-errors t)
-(defun spw/transient-caps-self-insert (&optional n)
- (interactive "p")
- (insert-char (upcase last-command-event) n))
-
-;; I have caps lock on left-ctrl on standard keyboard layouts and on the
-;; sequence keypd-capslock-keypd on the Kinesis Advantage. These are about
-;; equally inconvenient, but I rarely want caps lock outside of Emacs, so
-;; that's okay, and avoids taking up a convenient-to-press key with something
-;; rarely wanted, since outside of Emacs, making something into caps lock
-;; effectively means that whole key can't be used for anything else. Then,
-;; inside Emacs, rather than having another caps-locking key which is more
-;; convenient to press, have the following which should be more useful.
-;;
-;; Could bind this to Delete because I don't use that at all in Emacs as have
-;; C-d, but Delete is relatively hard to hit on conventional keyboards, and
-;; might not work in some text terminals
-(defun spw/activate-transient-caps ()
- "Activate caps lock while typing the current whitespace-delimited word(s).
-This is useful for typing Lisp symbols and C enums which consist
-of several all-uppercase words separated by hyphens and
-underscores, such that M-- M-u after typing will not upcase the
-whole thing."
- (interactive)
- (let* ((map (make-sparse-keymap))
- (deletion-commands '(delete-backward-char
- paredit-backward-delete
- backward-kill-word
- paredit-backward-kill-word
- spw/unix-word-rubout
- spw/paredit-unix-word-rubout))
- (typing-commands (cons 'spw/transient-caps-self-insert
- deletion-commands)))
- (substitute-key-definition 'self-insert-command
- #'spw/transient-caps-self-insert
- map
- (current-global-map))
- (set-transient-map
- map
- (lambda ()
- ;; try to determine whether we are probably still about to try to type
- ;; something in all-uppercase
- (and (member this-command typing-commands)
- (not (and (eq this-command 'spw/transient-caps-self-insert)
- (= (char-syntax last-command-event) ?\ )))
- (not (and (or (bolp) (= (char-syntax (char-before)) ?\ ))
- (member this-command deletion-commands))))))))
-
-(global-set-key "\M-C" #'spw/activate-transient-caps)
-
(setq inferior-lisp-program "sbcl")
(unless (boundp 'warning-suppress-types)