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 | |
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')
-rw-r--r-- | lisp/progmodes/cc-cmds.el | 19 | ||||
-rw-r--r-- | lisp/progmodes/cc-langs.el | 6 | ||||
-rw-r--r-- | lisp/progmodes/cc-mode.el | 7 |
3 files changed, 20 insertions, 12 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'." diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 375725e6834..b93cc780732 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -318,9 +318,9 @@ the evaluated constant value at compile time." :style toggle :selected c-auto-newline] ["Hungry delete" c-toggle-hungry-state :style toggle :selected c-hungry-delete-key] - ["Subword mode" subword-mode - :style toggle :selected (and (boundp 'subword-mode) - subword-mode)]))) + ["Subword mode" c-subword-mode + :style toggle :selected (and (boundp 'c-subword-mode) + c-subword-mode)]))) ;;; Syntax tables. diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 4b8e41f1c54..a4824479b3c 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -108,11 +108,6 @@ ;; with your version of Emacs, you are incompatible! (cc-external-require 'easymenu) -;; Autoload directive for emacsen that doesn't have an older CC Mode -;; version in the dist. -(autoload 'subword-mode "subword" - "Mode enabling subword movement and editing keys." t) - ;; Load cc-fonts first after font-lock is loaded, since it isn't ;; necessary until font locking is requested. ; (eval-after-load "font-lock" ; 2006-07-09: font-lock is now preloaded. @@ -379,7 +374,7 @@ control). See \"cc-mode.el\" for more info." ;; conflicts with OOBR ;;(define-key c-mode-base-map "\C-c\C-v" 'c-version) ;; (define-key c-mode-base-map "\C-c\C-y" 'c-toggle-hungry-state) Commented out by ACM, 2005-11-22. - (define-key c-mode-base-map "\C-c\C-w" 'subword-mode) + (define-key c-mode-base-map "\C-c\C-w" 'c-subword-mode) ) ;; We don't require the outline package, but we configure it a bit anyway. |