[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: superword-mode

From: Ted Zlatanov
Subject: Re: superword-mode
Date: Wed, 27 Mar 2013 09:06:53 -0400
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux)

On Wed, 27 Mar 2013 12:18:29 +0900 (JST) Masatake YAMATO <address@hidden> 

>>> +(defvar superword-mode-map
>>> +  (let ((map (make-sparse-keymap)))
>>> +    (dolist (cmd '(forward-word backward-word mark-word kill-word
>>> +                           backward-kill-word transpose-words
>>> +                                capitalize-word upcase-word downcase-word
>>> +                                left-word right-word))
>>> +      (let ((othercmd (let ((name (symbol-name cmd)))
>>> +                        (string-match "\\([[:alpha:]-]+\\)-word[s]?" name)
>>> +                        (intern (concat "subword-" (match-string 1 
>>> name))))))
>>> +        (define-key map (vector 'remap cmd) othercmd)))
>>> +    map)
>> Why not (defvar superword-mode-map subword-mode-map)?

MY> How about using copy-keymap to handle the case an user wants to 
MY> modify the keymaps separately?

Currently they are the same function internally so I didn't think it's
likely the user will need to modify just one of the two keymaps.  If you
still disagree, I'll make the change.  I don't know the subtleties of
keymaps well, so your advice is appreciated.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]