unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: Emacs's Command Frequency and default keyboard shortcuts
       [not found]             ` <877iyz719o.fsf@thalassa.informatimago.com>
@ 2006-10-18  0:37               ` Miles Bader
  2006-10-18  1:54                 ` Miles Bader
  2006-10-18  2:00                 ` Stefan Monnier
  0 siblings, 2 replies; 7+ messages in thread
From: Miles Bader @ 2006-10-18  0:37 UTC (permalink / raw)
  Cc: emacs-devel

Pascal Bourguignon <pjb@informatimago.com> writes:
>> Rather have Caps Lock be an additional Control key.  When would you
>> _ever_ need Caps Lock?  The only use I can think of is to appear like
>> an idiot on Usenet, and there are other ways for doing that.
>
> Indeed, like M-x caps-mode RET   HOWDY! ;-)

On that note (only works in Emacs 22):


(define-minor-mode caps-lock-mode
  "When enabled, all self-inserting characters will be converted to uppercase."
  :lighter " CapsLock"
  (if caps-lock-mode
      (local-set-key [remap self-insert-command] 'self-insert-upcased)
    (local-unset-key [remap self-insert-command])))

(defun self-insert-upcased ()
  (interactive)
  (insert (upcase last-input-char)))


[THANKS, KIM, FOR THE WONDERFUL "[REMAP ...]"  KEY-BINDING MECHANISM!!!!]


-Miles
-- 
Suburbia: where they tear out the trees and then name streets after them.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Emacs's Command Frequency and default keyboard shortcuts
  2006-10-18  0:37               ` Emacs's Command Frequency and default keyboard shortcuts Miles Bader
@ 2006-10-18  1:54                 ` Miles Bader
  2006-10-18  2:00                 ` Stefan Monnier
  1 sibling, 0 replies; 7+ messages in thread
From: Miles Bader @ 2006-10-18  1:54 UTC (permalink / raw)


I wrote:
> (define-minor-mode caps-lock-mode ...
> (defun self-insert-upcased () ...

Better version of `self-insert-upcased':

(defun self-insert-upcased (arg)
  (interactive "p")
  (setq last-command-char (upcase last-command-char))
  (self-insert-command arg))

-Miles
-- 
Fast, small, soon; pick any 2.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Emacs's Command Frequency and default keyboard shortcuts
  2006-10-18  0:37               ` Emacs's Command Frequency and default keyboard shortcuts Miles Bader
  2006-10-18  1:54                 ` Miles Bader
@ 2006-10-18  2:00                 ` Stefan Monnier
  2006-10-18  2:04                   ` Miles Bader
  1 sibling, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2006-10-18  2:00 UTC (permalink / raw)
  Cc: emacs-devel

> (define-minor-mode caps-lock-mode
>   "When enabled, all self-inserting characters will be converted to uppercase."
>   :lighter " CapsLock"
>   (if caps-lock-mode
>       (local-set-key [remap self-insert-command] 'self-insert-upcased)
>     (local-unset-key [remap self-insert-command])))

You mean

  (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")


-- Stefan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Emacs's Command Frequency and default keyboard shortcuts
  2006-10-18  2:00                 ` Stefan Monnier
@ 2006-10-18  2:04                   ` Miles Bader
  2006-10-19  9:11                     ` Kim F. Storm
  0 siblings, 1 reply; 7+ messages in thread
From: Miles Bader @ 2006-10-18  2:04 UTC (permalink / raw)
  Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:
> You mean
>
>   (defvar caps-lock-mode-map
>   (define-minor-mode caps-lock-mode

Ah yes indeed!

So now the complete goodness:

(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")

(defun self-insert-upcased (arg)
  (interactive "p")
  (setq last-command-char (upcase last-command-char))
  (self-insert-command arg))

-Miles
-- 
.Numeric stability is probably not all that important when you're guessing.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Emacs's Command Frequency and default keyboard shortcuts
  2006-10-18  2:04                   ` Miles Bader
@ 2006-10-19  9:11                     ` Kim F. Storm
  2006-10-19  9:53                       ` David Kastrup
  0 siblings, 1 reply; 7+ messages in thread
From: Kim F. Storm @ 2006-10-19  9:11 UTC (permalink / raw)
  Cc: Stefan Monnier, emacs-devel

Miles Bader <miles.bader@necel.com> writes:

> Stefan Monnier <monnier@iro.umontreal.ca> 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 <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Emacs's Command Frequency and default keyboard shortcuts
  2006-10-19  9:11                     ` Kim F. Storm
@ 2006-10-19  9:53                       ` David Kastrup
  2006-10-19 11:29                         ` Kim F. Storm
  0 siblings, 1 reply; 7+ messages in thread
From: David Kastrup @ 2006-10-19  9:53 UTC (permalink / raw)
  Cc: emacs-devel, Stefan Monnier, Miles Bader

storm@cua.dk (Kim F. Storm) writes:

> Miles Bader <miles.bader@necel.com> writes:
>>
>> (define-minor-mode caps-lock-mode
>>   "When enabled, convert all self-inserting characters to uppercase."
>>   :lighter " CapsLock")
>
> I think "CAPS" is better (and shorter :-)

I think one should rather uppercase the whole mode line.  Then no
separate lighter is necessary.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Emacs's Command Frequency and default keyboard shortcuts
  2006-10-19  9:53                       ` David Kastrup
@ 2006-10-19 11:29                         ` Kim F. Storm
  0 siblings, 0 replies; 7+ messages in thread
From: Kim F. Storm @ 2006-10-19 11:29 UTC (permalink / raw)
  Cc: Miles Bader, Stefan Monnier, emacs-devel

David Kastrup <dak@gnu.org> writes:

>> I think "CAPS" is better (and shorter :-)
>
> I think one should rather uppercase the whole mode line.  Then no
> separate lighter is necessary.

And hide it if the cursor moves into invisible text?  :-)

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-10-19 11:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1159914415.055557.32190@i3g2000cwc.googlegroups.com>
     [not found] ` <1160574910.715784.64440@i42g2000cwa.googlegroups.com>
     [not found]   ` <1160744232.506208.265870@k70g2000cwa.googlegroups.com>
     [not found]     ` <87zmc0tj1r.fsf@post.rwth-aachen.de>
     [not found]       ` <1161009567.067785.208350@i42g2000cwa.googlegroups.com>
     [not found]         ` <874pu3tos2.fsf@localhorst.mine.nu>
     [not found]           ` <851wp7e638.fsf@lola.goethe.zz>
     [not found]             ` <877iyz719o.fsf@thalassa.informatimago.com>
2006-10-18  0:37               ` Emacs's Command Frequency and default keyboard shortcuts Miles Bader
2006-10-18  1:54                 ` Miles Bader
2006-10-18  2:00                 ` Stefan Monnier
2006-10-18  2:04                   ` Miles Bader
2006-10-19  9:11                     ` Kim F. Storm
2006-10-19  9:53                       ` David Kastrup
2006-10-19 11:29                         ` Kim F. Storm

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).