]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/cc-cmds.el
Update copyright year to 2015
[gnu-emacs] / lisp / progmodes / cc-cmds.el
index 55b676b1d9f2b535c878f0503ec0541cff15fbe3..68075f356ab8a6c17de8433c5254b21152362ecc 100644 (file)
@@ -1,6 +1,6 @@
 ;;; cc-cmds.el --- user level commands for CC Mode
 
-;; Copyright (C) 1985, 1987, 1992-2014 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992-2015 Free Software Foundation, Inc.
 
 ;; Authors:    2003- Alan Mackenzie
 ;;             1998- Martin Stjernholm
@@ -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'."