[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: superword-mode
From: |
Stefan Monnier |
Subject: |
Re: superword-mode |
Date: |
Tue, 26 Mar 2013 21:23:18 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
> OK; see attached. Implemented by looking at the `superword-mode'
> variable in the internal `subword-mode' commands.
Looks good, see comments below.
> Included and done for both `subword-mode' and `superword-mode'.
BTW, this needs an entry in etc/NEWS, of course.
> +;; (add-hook 'c-mode-common-hook
> +;; (lambda () (superword-mode 1)))
This should be simply
+;; (add-hook 'c-mode-common-hook 'superword-mode)
> + :lighter " ,"
> + nil
> + nil
> + subword-mode-map
The "three args" are only used if there's no :keyword arg.
So the above is the same as
> + :lighter " ,"
> + (progn nil
> + nil
> + subword-mode-map)
The subword-mode-map should be used by default anyway, so you can just
remove those 3 expressions.
I'm not sure we want to add a :lighter, by the way.
> +(defun subword-right (&optional arg)
> + (interactive "p")
> + (subword-forward arg))
Why not (defalias 'subword-right 'subword-forward)?
Else, please add a docstring.
> +(defun subword-left (&optional arg)
> + (interactive "p")
> + (subword-backward arg))
Same here.
> +(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)?
Stefan
- Re: [Emacs-diffs] /srv/bzr/emacs/trunk r112104: * progmodes/cfengine.el (cfengine-common-syntax): Add "_" to word syntax., (continued)
- Re: [Emacs-diffs] /srv/bzr/emacs/trunk r112104: * progmodes/cfengine.el (cfengine-common-syntax): Add "_" to word syntax., Tom Tromey, 2013/03/22
- Re: [Emacs-diffs] /srv/bzr/emacs/trunk r112104: * progmodes/cfengine.el (cfengine-common-syntax): Add "_" to word syntax., Ted Zlatanov, 2013/03/22
- Re: [Emacs-diffs] /srv/bzr/emacs/trunk r112104: * progmodes/cfengine.el (cfengine-common-syntax): Add "_" to word syntax., Stefan Monnier, 2013/03/22
- Re: [Emacs-diffs] /srv/bzr/emacs/trunk r112104: * progmodes/cfengine.el (cfengine-common-syntax): Add "_" to word syntax., Ted Zlatanov, 2013/03/22
- Re: [Emacs-diffs] /srv/bzr/emacs/trunk r112104: * progmodes/cfengine.el (cfengine-common-syntax): Add "_" to word syntax., Stefan Monnier, 2013/03/22
- Re: [Emacs-diffs] /srv/bzr/emacs/trunk r112104: * progmodes/cfengine.el (cfengine-common-syntax): Add "_" to word syntax., Ted Zlatanov, 2013/03/22
- Re: [Emacs-diffs] /srv/bzr/emacs/trunk r112104: * progmodes/cfengine.el (cfengine-common-syntax): Add "_" to word syntax., Stefan Monnier, 2013/03/23
- Re: [Emacs-diffs] /srv/bzr/emacs/trunk r112104: * progmodes/cfengine.el (cfengine-common-syntax): Add "_" to word syntax., Ted Zlatanov, 2013/03/26
- Re: [Emacs-diffs] /srv/bzr/emacs/trunk r112104: * progmodes/cfengine.el (cfengine-common-syntax): Add "_" to word syntax., Stefan Monnier, 2013/03/26
- superword-mode (was: [Emacs-diffs] /srv/bzr/emacs/trunk r112104: * progmodes/cfengine.el (cfengine-common-syntax): Add "_" to word syntax.), Ted Zlatanov, 2013/03/26
- Re: superword-mode,
Stefan Monnier <=
- Re: superword-mode, Masatake YAMATO, 2013/03/26
- Re: superword-mode, Andreas Schwab, 2013/03/27
- Re: superword-mode, Ted Zlatanov, 2013/03/27
- Re: superword-mode, Stefan Monnier, 2013/03/27
- Re: superword-mode, Ted Zlatanov, 2013/03/27
- Re: superword-mode, Stefan Monnier, 2013/03/27
- Re: superword-mode, Ted Zlatanov, 2013/03/27
- Re: superword-mode, Davis Herring, 2013/03/27
- Re: superword-mode, Ted Zlatanov, 2013/03/27
- Re: superword-mode, Ted Zlatanov, 2013/03/27