diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-12-18 11:18:21 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-12-18 11:18:21 -0500 |
commit | 39ead8cdfcaa921beb901ecbf27c19314221aa32 (patch) | |
tree | b4e748a55ee6f63e07208237edfab7796b9e0b1c /lisp/progmodes/cc-cmds.el | |
parent | b1978229162b0d4c3b14d8ad8bff383eb3511969 (diff) | |
download | emacs-39ead8cdfcaa921beb901ecbf27c19314221aa32.tar.gz |
* lisp/progmodes/cc-cmds.el (c-subword-mode): Alias to subword-mode.
(c-update-modeline):
* lisp/progmodes/cc-langs.el (c-mode-menu): Use c-subword-mode.
* lisp/progmodes/cc-mode.el (subword-mode): Move autoload to cc-cmds.el.
(c-mode-base-map): Use c-subword-mode.
Diffstat (limited to 'lisp/progmodes/cc-cmds.el')
-rw-r--r-- | lisp/progmodes/cc-cmds.el | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index 55b676b1d9f..0724697f8e8 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el @@ -258,9 +258,11 @@ With universal argument, inserts the analysis as a comment on that line." "a" "") (if c-hungry-delete-key "h" "") (if (and - ;; subword might not be loaded. - (boundp 'subword-mode) - (symbol-value 'subword-mode)) + ;; (cc-)subword might not be loaded. + (boundp 'c-subword-mode) + (symbol-value 'c-subword-mode)) + ;; FIXME: subword-mode already comes with its + ;; own lighter! "w" ""))) ;; FIXME: Derived modes might want to use something else @@ -1304,6 +1306,17 @@ keyword on the line, the keyword is not inserted inside a literal, and (declare-function subword-forward "subword" (&optional arg)) (declare-function subword-backward "subword" (&optional arg)) +(cond + ((and (fboundp 'subword-mode) (not (fboundp 'c-subword-mode))) + ;; Recent Emacsen come with their own subword support. Use that. + (define-obsolete-function-alias 'c-subword-mode 'subword-mode "24.3") + (define-obsolete-variable-alias 'c-subword-mode 'subword-mode "24.3")) + (t + ;; Autoload directive for emacsen that doesn't have an older CC Mode + ;; version in the dist. + (autoload 'c-subword-mode "cc-subword" + "Mode enabling subword movement and editing keys." t))) + ;; "nomenclature" functions + c-scope-operator. (defun c-forward-into-nomenclature (&optional arg) "Compatibility alias for `c-forward-subword'." |