On Tue, 26 Mar 2013 21:23:18 -0400 Stefan Monnier wrote: >> OK; see attached. Implemented by looking at the `superword-mode' >> variable in the internal `subword-mode' commands. SM> Looks good, see comments below. >> Included and done for both `subword-mode' and `superword-mode'. SM> BTW, this needs an entry in etc/NEWS, of course. OK; done. >> +;; (add-hook 'c-mode-common-hook >> +;; (lambda () (superword-mode 1))) SM> This should be simply SM> +;; (add-hook 'c-mode-common-hook 'superword-mode) OK; done for both cases in the docs. >> + :lighter " ," >> + nil >> + nil >> + subword-mode-map SM> The "three args" are only used if there's no :keyword arg. SM> So the above is the same as >> + :lighter " ," >> + (progn nil >> + nil >> + subword-mode-map) SM> The subword-mode-map should be used by default anyway, so you can just SM> remove those 3 expressions. Oh, OK. Done for both subword and superword. SM> I'm not sure we want to add a :lighter, by the way. Booo. I want my modeline to look like a Christmas tree ;) SM> Why not (defalias 'subword-right 'subword-forward)? SM> Else, please add a docstring. I thought it would be nicer, but I see it's not. Changed for both left and right. >> +(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) SM> Why not (defvar superword-mode-map subword-mode-map)? OK; done. I'd rather not inherit, they are identical right now. I still don't have the mutual exclusivity working; you can't go subword->superword with `M-x superword-mode'. It goes subword->subword disabled->superword and you have to do `M-x superword-mode' twice. See attached. Ted