emacs-devel
[Top][All Lists]
Advanced

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

Re: superword-mode


From: Andreas Schwab
Subject: Re: superword-mode
Date: Wed, 27 Mar 2013 10:31:04 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Masatake YAMATO <address@hidden> writes:

>>> +(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)?
>
> How about using copy-keymap to handle the case an user wants to 
> modify the keymaps separately?

Maybe inherit one from the other.

Andreas.

-- 
Andreas Schwab, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



reply via email to

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