aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/cc-cmds.el
diff options
context:
space:
mode:
authorAlan Mackenzie <[email protected]>2006-02-24 15:33:02 +0000
committerAlan Mackenzie <[email protected]>2006-02-24 15:33:02 +0000
commitcb694ab73063cc92342daf96d009cdc6d086bc0b (patch)
treef60c5467a7d18135fc252a6702fcbaf38c2f980d /lisp/progmodes/cc-cmds.el
parent0d566910540fa519c48f90455bdecd4565cea948 (diff)
cc-align.el, cc-awk.el, cc-bytecomp.el, cc-cmds.el, cc-compat.el,
cc-defs.el, cc-engine.el, cc-fonts.el, cc-langs.el, cc-menus.el, cc-mode.el, cc-styles.el, cc-subword.el, cc-vars.el: Add 2006 to the copyright statement. cc-awk.el: (c-awk-after-change): Protect the match data with save-match-data. It was being corrupted when Font Lock was not enabled. (ii): Fix a typo. cc-cmds.el, cc-mode.el, cc-engine.el (c-update-modeline): Concatenate the minor mode indicators directly onto mode-name, removing c-submode-indicators. Sometimes, c-s-i got separated from the mode name on the mode line. cc-cmds.el, cc-mode.el: Rename c-hungry-backspace to c-hungry-delete-backwards, at the request of RMS. Leave the old name as an alias. cc-cmds.el (c-electric-brace, c-electric-semi&comma, c-electric-colon): Correct doc-strings: "/ln" -> "/la". cc-cmds.el (c-electric-brace): Fix clean-up brace-else-brace (error due to mbeg, mend being undefined). cc-defs.el (c-version): Update to 5.31.3. cc-defs.el: [Supersedes patch V1.38]: (top level): Check for a buggy font-lock-compile-keywords ONLY in XEmacs. GNU Emacs 22 now has a check which would throw an error here. cc-engine.el (c-beginning-of-statement-1): Clarify doc-string and comments. Distinguish real labels ("case 1:" or "foo:") from non-labels ("public:"). cc-engine.el (c-after-change-check-<>-operators): Remove save-match-data, reversing change for V1.45. save-match-data is now in c-after-change. cc-engine.el (c-forward-objc-directive): Replace c-forward-token-2 with crude coding; c-f-t-2 doesn't move over a token at EOB. Objc Mode was hanging after typing, e.g., "@implementation". cc-langs.el (c-filter-ops): Made it available at runtime too to work when `c-make-init-lang-vars-fun' needs to evaluate from source. cc-langs.el (c-make-init-lang-vars-fun): Improved the error message when there's an evaluation error to show whether it's loaded from source or not. (c-mode-menu): Add menu items for Electric Mode and Subword Mode. cc-mode.el (c-after-change): Protect the match data with save-match-data. It was getting corrupted by c-after-change-check-<>-operators. cc-mode.el: File Local variables: Solve the problem where both `mode' and c-file-offsets are specified: `mode' will overwrite c-f-o's settings: (c-remove-any-local-eval-or-mode-variables): new function. (c-postprocess-file-styles): call the above new function, within c-tentative-buffer-change, to splat `mode' and `eval' before the second hack-local-variables.
Diffstat (limited to 'lisp/progmodes/cc-cmds.el')
-rw-r--r--lisp/progmodes/cc-cmds.el35
1 files changed, 22 insertions, 13 deletions
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 4c8aa1518b..8b2f5e57f8 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -1,7 +1,7 @@
;;; cc-cmds.el --- user level commands for CC Mode
-;; Copyright (C) 1985,1987,1992-2003, 2004, 2005, 2006
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992-2003, 2004, 2005, 2006 Free Software
+;; Foundation, Inc.
;; Authors: 1998- Martin Stjernholm
;; 1992-1999 Barry A. Warsaw
@@ -262,10 +262,17 @@ With universal argument, inserts the analysis as a comment on that line."
(boundp 'c-subword-mode)
(symbol-value 'c-subword-mode))
"w"
- ""))))
- (setq c-submode-indicators
+ "")))
+ (bare-mode-name (if (string-match "\\(^[^/]*\\)/" mode-name)
+ (substring mode-name (match-beginning 1) (match-end 1))
+ mode-name)))
+;; (setq c-submode-indicators
+;; (if (> (length fmt) 1)
+;; fmt))
+ (setq mode-name
(if (> (length fmt) 1)
- fmt))
+ (concat bare-mode-name fmt)
+ bare-mode-name))
(force-mode-line-update)))
(defun c-toggle-syntactic-indentation (&optional arg)
@@ -365,9 +372,9 @@ inside a literal then the function in the variable
arg
(c-in-literal)))
(funcall c-backspace-function (prefix-numeric-value arg))
- (c-hungry-backspace)))
+ (c-hungry-delete-backwards)))
-(defun c-hungry-backspace ()
+(defun c-hungry-delete-backwards ()
"Delete the preceding character or all preceding whitespace
back to the previous non-whitespace character.
See also \\[c-hungry-delete-forward]."
@@ -378,6 +385,8 @@ See also \\[c-hungry-delete-forward]."
(delete-region (point) here)
(funcall c-backspace-function 1))))
+(defalias 'c-hungry-backspace 'c-hungry-delete-backwards)
+
(defun c-electric-delete-forward (arg)
"Delete the following character or whitespace.
If `c-hungry-delete-key' is non-nil (indicated by \"/h\" on the mode
@@ -396,7 +405,7 @@ is called."
(defun c-hungry-delete-forward ()
"Delete the following character or all following whitespace
up to the next non-whitespace character.
-See also \\[c-hungry-backspace]."
+See also \\[c-hungry-delete-backwards]."
(interactive)
(let ((here (point)))
(c-skip-ws-forward)
@@ -436,7 +445,7 @@ function to control that."
(if (and (fboundp 'delete-forward-p)
(delete-forward-p))
(c-hungry-delete-forward)
- (c-hungry-backspace)))
+ (c-hungry-delete-backwards)))
(defun c-electric-pound (arg)
"Insert a \"#\".
@@ -648,7 +657,7 @@ If `c-electric-flag' is non-nil, the brace is not inside a literal and a
numeric ARG hasn't been supplied, the command performs several electric
actions:
-\(a) If the auto-newline feature is turned on (indicated by \"/ln\" on
+\(a) If the auto-newline feature is turned on (indicated by \"/la\" on
the mode line) newlines are inserted before and after the brace as
directed by the settings in `c-hanging-braces-alist'.
@@ -752,7 +761,7 @@ settings of `c-cleanup-list' are done."
"{"
"\\=")
nil t))
- (delete-region mbeg mend)
+ (delete-region (match-beginning 0) (match-end 0))
(insert-and-inherit "} else {"))
((and (memq 'brace-elseif-brace c-cleanup-list)
(progn
@@ -886,7 +895,7 @@ If `c-electric-flag' is non-nil, point isn't inside a literal and a
numeric ARG hasn't been supplied, the command performs several electric
actions:
-\(a) When the auto-newline feature is turned on (indicated by \"/ln\" on
+\(a) When the auto-newline feature is turned on (indicated by \"/la\" on
the mode line) a newline might be inserted. See the variable
`c-hanging-semi&comma-criteria' for how newline insertion is determined.
@@ -958,7 +967,7 @@ If `c-electric-flag' is non-nil, the colon is not inside a literal and a
numeric ARG hasn't been supplied, the command performs several electric
actions:
-\(a) If the auto-newline feature is turned on (indicated by \"/ln\" on
+\(a) If the auto-newline feature is turned on (indicated by \"/la\" on
the mode line) newlines are inserted before and after the colon based on
the settings in `c-hanging-colons-alist'.