Do Emacs caps block minor mode?

Is there a command in Emacs to enable what can be described as "closing a minor lock mode"? I want to do something like M-x toggle-caps-mode, then each letter that I entered into the buffer is an uppercase letter until I do it M-x toggle-caps-modeagain.

Note. I am NOT looking for instructions on how to change caps and manage them. This is actually because I already did it. I'm generally quite happy with this, but sometimes I edit the code where there are a bunch of constants that are in all the caps, and this becomes a warp holding the shift key. I know various conversion functions upcase; I would rather not enter a word, select it, and then run it upcase-region.

If that matters, I use Aquamacs 2.2 w / Emacs 23.3.1.

+5
source share
2 answers

You do not need to enter a word and select it. If you want to insert the last word, press M-b M-uor ESC b u. Ok, you need to click bseveral times if it is a word_with_underscores.

If you really need a small cap lock mode, try John Paul Wallingtonlockcaps.el .

+4
source

You can try something like this:

(define-minor-mode caps-lock-mode
  "caps-lock mode"
  ;;   The initial value.   
  nil   
  ;; The indicator for the mode line.   
  " CAPS-LOCK"   
  ;; The minor mode bindings.   
  '(("a" . (lambda () (interactive) (insert-char ?A 1)))
    ("b" . (lambda () (interactive) (insert-char ?B 1)))
    ;;etc 
    ("A" . (lambda () (interactive) (insert-char ?a 1)))    
    ("B" . (lambda () (interactive) (insert-char ?b 1)))    
    ;;etc
    ))
+2
source

All Articles