Commit cb694ab7 authored by Alan Mackenzie's avatar Alan Mackenzie

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.
parent 0d566910
2006-02-24 Alan Mackenzie <bug-cc-mode@gnu.org>
* CC Mode Update to 5.31.3.
2006-02-24 Alan Mackenzie <bug-cc-mode@gnu.org>
* progmodes/cc-mode.el (c-postprocess-file-styles): bind
inhibit-read-only to t, around the call to
c-remove-any-local-eval-or-mode-variables, so that it works on a
RO file.
2006-02-24 Alan Mackenzie <bug-cc-mode@gnu.org>
* progmodes/cc-awk.el: Correct a typo.
2006-02-24 Alan Mackenzie <bug-cc-mode@gnu.org>
* progmodes/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.
2006-02-24 Alan Mackenzie <bug-cc-mode@gnu.org>
* progmodes/cc-mode.el: Correct a typo.
2006-02-24 Alan Mackenzie <bug-cc-mode@gnu.org>
* progmodes/cc-defs.el: Update the version number to 5.31.3.
2006-02-24 Alan Mackenzie <bug-cc-mode@gnu.org>
* progmodes/cc-cmds.el (c-electric-brace): Fix clean-up
brace-else-brace (error due to mbeg, mend being undefined).
2006-02-24 Alan Mackenzie <bug-cc-mode@gnu.org>
* progmodes/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.
2006-02-24 Alan Mackenzie <bug-cc-mode@gnu.org>
* progmodes/cc-mode.el:
[Supersedes patch to cc-engine.el 2005-12-16T20:07:49Z!monnier@iro.umontreal.ca]
(c-after-change): Protect the match data with save-match-data. It
was getting corrupted by c-after-change-check-<>-operators.
* 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.
* progmodes/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.
2006-02-24 Alan Mackenzie <bug-cc-mode@gnu.org>
* progmodes/cc-langs.el (c-mode-menu): Add menu items for Electric
Mode and Subword Mode.
* progmodes/cc-engine.el (c-beginning-of-statment-1): Distinguish
real labels ("case 1:" or "foo:") from non-labels ("public:").
(c-forward-objc-directive): Replace c-forward-token-2 with crude
coding; c-f-t-2 doesn't move over a token at EOB.
* progmodes/cc-defs.el (c-version): Update version number to
5.31.2
* progmodes/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.
* progmodes/cc-cmds.el (c-electric-brace, c-electric-semi&comma,
c-electric-colon): Correct doc-strings: "/ln" -> "/la".
2006-02-24 Martin Stjernholm <bug-cc-mode@gnu.org>
* progmodes/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-filter-ops): Made it available at runtime too to work when
`c-make-init-lang-vars-fun' needs to evaluate from source.
2006-02-24 Juanma Barranquero <lekktu@gmail.com>
* help.el (help): Revert last part of 2006-02-23 change (deletion
......
;;; cc-align.el --- custom indentation functions 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
......
;;; cc-awk.el --- AWK specific code within cc-mode.
;; Copyright (C) 1988,94,96,2000, 2001, 2002, 2003, 2004, 2005, 2006
;; Free Software Foundation, Inc.
;; Copyright (C) 1988,94,96,2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
;; Software Foundation, Inc.
;; Author: Alan Mackenzie <acm@muc.de> (originally based on awk-mode.el)
;; Maintainer: FSF
......@@ -804,7 +804,7 @@
(defun c-awk-end-of-change-region (beg end old-len)
;; Find the end of the region which needs to be font-locked after a change.
;; This is the end of the logical line on which the change happened, either
;; as it was before the change, or as it is now, which ever is later.
;; as it was before the change, or as it is now, whichever is later.
;; N.B. point is left undefined.
;;
;; This function might do hidden buffer changes.
......@@ -822,11 +822,12 @@
(unless (and (boundp 'font-lock-mode) font-lock-mode)
(save-restriction
(save-excursion
(setq end (c-awk-end-of-change-region beg end old-len))
(c-awk-beginning-of-logical-line beg)
(c-save-buffer-state nil ; So that read-only status isn't affected.
(save-match-data
(setq end (c-awk-end-of-change-region beg end old-len))
(c-awk-beginning-of-logical-line beg)
(c-save-buffer-state nil ; So that read-only status isn't affected.
; (e.g. when first loading the buffer)
(c-awk-set-syntax-table-properties end))))))
(c-awk-set-syntax-table-properties end)))))))
;; ACM 2002/5/25. When font-locking is invoked by a buffer change, the region
;; specified by the font-lock after-change function must be expanded to
......
;;; cc-bytecomp.el --- compile time setup for proper compilation
;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006
;; Free Software Foundation, Inc.
;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
;; Foundation, Inc.
;; Author: Martin Stjernholm
;; Maintainer: bug-cc-mode@gnu.org
......
;;; 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'.
......
;;; cc-compat.el --- cc-mode compatibility with c-mode.el confusion
;; 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
;; 1994-1999 Barry A. Warsaw
......
;;; cc-defs.el --- compile time definitions 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
......@@ -71,10 +71,10 @@
(eval-after-load "font-lock"
'(if (and (not (featurep 'cc-fix)) ; only load the file once.
(featurep 'xemacs) ; There is now (2005/12) code in GNU Emacs CVS
; to make the call to f-l-c-k throw an error.
(let (font-lock-keywords)
(condition-case nil
(font-lock-compile-keywords '("\\<\\>"))
(error nil))
(font-lock-compile-keywords '("\\<\\>"))
font-lock-keywords)) ; did the previous call foul this up?
(load "cc-fix")))
......@@ -82,19 +82,18 @@
;; to ensure correct byte compilation.
(eval-when-compile
(if (and (not (featurep 'cc-fix))
(featurep 'xemacs)
(progn
(require 'font-lock)
(let (font-lock-keywords)
(condition-case nil
(font-lock-compile-keywords '("\\<\\>"))
(error nil))
(font-lock-compile-keywords '("\\<\\>"))
font-lock-keywords)))
(cc-load "cc-fix")))
;;; Variables also used at compile time.
(defconst c-version "5.31"
(defconst c-version "5.31.3"
"CC Mode version number.")
(defconst c-version-sym (intern c-version))
......@@ -2041,5 +2040,5 @@ quoted."
(cc-provide 'cc-defs)
;; arch-tag: 3bb2629d-dd84-4ff0-ad39-584be0fe3cda
;;; arch-tag: 3bb2629d-dd84-4ff0-ad39-584be0fe3cda
;;; cc-defs.el ends here
;;; cc-engine.el --- core syntax guessing engine 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
......@@ -179,8 +179,8 @@
(make-variable-buffer-local 'c-auto-newline)
;; Included in the mode line to indicate the active submodes.
(defvar c-submode-indicators nil)
(make-variable-buffer-local 'c-submode-indicators)
;; (defvar c-submode-indicators nil)
;; (make-variable-buffer-local 'c-submode-indicators)
(defun c-calculate-state (arg prevstate)
;; Calculate the new state of PREVSTATE, t or nil, based on arg. If
......@@ -525,14 +525,15 @@ also stop at a continuation clause.
Labels are treated as part of the following statements if
IGNORE-LABELS is non-nil. (FIXME: Doesn't work if we stop at a known
statement start keyword.)
statement start keyword.) Otherwise, each label is treated as a
separate statement.
Macros are ignored unless point is within one, in which case the
content of the macro is treated as normal code. Aside from any normal
statement starts found in it, stop at the first token of the content
in the macro, i.e. the expression of an \"#if\" or the start of the
definition in a \"#define\". Also stop at start of macros before
leaving them.
Macros are ignored \(i.e. skipped over) unless point is within one, in
which case the content of the macro is treated as normal code. Aside
from any normal statement starts found in it, stop at the first token
of the content in the macro, i.e. the expression of an \"#if\" or the
start of the definition in a \"#define\". Also stop at start of
macros before leaving them.
Return 'label if stopped at a label, 'same if stopped at the beginning
of the current statement, 'up if stepped to a containing statement,
......@@ -547,8 +548,9 @@ position if that is less ('same is returned in this case).
NOERROR turns off error logging to `c-parsing-error'.
Normally only ';' is considered to delimit statements, but if
COMMA-DELIM is non-nil then ',' is treated likewise.
Normally only ';' and virtual semicolons are considered to delimit
statements, but if COMMA-DELIM is non-nil then ',' is treated
as a delimiter too.
Note that this function might do hidden buffer changes. See the
comment at the start of cc-engine.el for more info."
......@@ -883,6 +885,7 @@ comment at the start of cc-engine.el for more info."
;; barriers in this round.
(sexp-loop-end-pos pos))
;; The following while goes back one sexp per iteration.
(while
(progn
(unless (c-safe (c-backward-sexp) t)
......@@ -954,7 +957,7 @@ comment at the start of cc-engine.el for more info."
;; Like a C "continue". Analyze the next sexp.
(throw 'loop t)))
sexp-loop-continue-pos)
sexp-loop-continue-pos) ; End of "go back a sexp" loop.
(goto-char sexp-loop-continue-pos)
(setq sexp-loop-end-pos sexp-loop-continue-pos
sexp-loop-continue-pos nil))))
......@@ -969,17 +972,26 @@ comment at the start of cc-engine.el for more info."
;; Handle labels.
(unless (eq ignore-labels t)
(when (numberp c-maybe-labelp)
;; `c-crosses-statement-barrier-p' has found a
;; colon, so we might be in a label now.
(if after-labels-pos
(if (not last-label-pos)
(setq last-label-pos (or tok start)))
(setq after-labels-pos (or tok start)))
(setq c-maybe-labelp t
label-good-pos nil))
(when (and (not label-good-pos)
(looking-at c-nonlabel-token-key))
;; `c-crosses-statement-barrier-p' has found a colon, so we
;; might be in a label now. Have we got a real label
;; (including a case label) or something like C++'s "public:"?
(if (or (not (looking-at c-nonlabel-token-key)) ; proper label
(save-excursion ; e.g. "case 'a':" ?
(and (c-safe (c-backward-sexp) t)
(looking-at "\\<case\\>")))) ; FIXME!!! this is
; wrong for AWK. 2006/1/14.
(progn
(if after-labels-pos ; Have we already encountered a label?
(if (not last-label-pos)
(setq last-label-pos (or tok start)))
(setq after-labels-pos (or tok start)))
(setq c-maybe-labelp t
label-good-pos nil))
(setq c-maybe-labelp nil))) ; bogus "label"
(when (and (not label-good-pos) ; i.e. no invalid "label"'s yet
; been found.
(looking-at c-nonlabel-token-key)) ; e.g. "while :"
;; We're in a potential label and it's the first
;; time we've found something that isn't allowed in
;; one.
......@@ -3993,36 +4005,35 @@ comment at the start of cc-engine.el for more info."
;;
;; This function might do hidden buffer changes.
(save-match-data
(save-excursion
(save-excursion
(goto-char beg)
(when (or (looking-at "[<>]")
(< (skip-chars-backward "<>") 0))
(goto-char beg)
(c-beginning-of-current-token)
(when (and (< (point) beg)
(looking-at c-<>-multichar-token-regexp)
(< beg (setq beg (match-end 0))))
(while (progn (skip-chars-forward "^<>" beg)
(< (point) beg))
(c-clear-char-property (point) 'syntax-table)
(forward-char))))
(when (< beg end)
(goto-char end)
(when (or (looking-at "[<>]")
(< (skip-chars-backward "<>") 0))
(goto-char beg)
(goto-char end)
(c-beginning-of-current-token)
(when (and (< (point) beg)
(when (and (< (point) end)
(looking-at c-<>-multichar-token-regexp)
(< beg (setq beg (match-end 0))))
(while (progn (skip-chars-forward "^<>" beg)
(< (point) beg))
(< end (setq end (match-end 0))))
(while (progn (skip-chars-forward "^<>" end)
(< (point) end))
(c-clear-char-property (point) 'syntax-table)
(forward-char))))
(when (< beg end)
(goto-char end)
(when (or (looking-at "[<>]")
(< (skip-chars-backward "<>") 0))
(goto-char end)
(c-beginning-of-current-token)
(when (and (< (point) end)
(looking-at c-<>-multichar-token-regexp)
(< end (setq end (match-end 0))))
(while (progn (skip-chars-forward "^<>" end)
(< (point) end))
(c-clear-char-property (point) 'syntax-table)
(forward-char))))))))
(forward-char)))))))
;; Dynamically bound variable that instructs `c-forward-type' to also
;; treat possible types (i.e. those that it normally returns 'maybe or
......@@ -5991,7 +6002,10 @@ y ;; True if there's a suffix match outside the outermost
;; Handle the name of the class itself.
(progn
(c-forward-token-2)
; (c-forward-token-2) ; 2006/1/13 This doesn't move if the token's
; at EOB.
(goto-char (match-end 0))
(c-skip-ws-forward)
(c-forward-type))
(catch 'break
......
;;; cc-langs.el --- language specific settings 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
......@@ -177,7 +177,7 @@ the evaluated constant value at compile time."
'(def-edebug-spec c-lang-defvar
(&define name def-form &optional stringp)))
(eval-when-compile
(eval-and-compile
;; Some helper functions used when building the language constants.
(defun c-filter-ops (ops opgroup-filter op-filter &optional xlate)
......@@ -260,10 +260,14 @@ the evaluated constant value at compile time."
("Toggle..."
["Syntactic indentation" c-toggle-syntactic-indentation
:style toggle :selected c-syntactic-indentation]
["Auto newline" c-toggle-auto-newline
["Electric mode" c-toggle-electric-state
:style toggle :selected c-electric-flag]
["Auto newline" c-toggle-auto-newline
:style toggle :selected c-auto-newline]
["Hungry delete" c-toggle-hungry-state
:style toggle :selected c-hungry-delete-key])))
["Hungry delete" c-toggle-hungry-state
:style toggle :selected c-hungry-delete-key]
["Subword mode" c-subword-mode
:style toggle :selected c-subword-mode])))
;;; Syntax tables.
......@@ -2826,7 +2830,7 @@ accomplish that conveniently."
;; This let sets up the context for `c-mode-var' and similar
;; that could be in the result from `cl-macroexpand-all'.
(let ((c-buffer-is-cc-mode ',mode)
current-var)
current-var source-eval)
(condition-case err
(if (eq c-version-sym ',c-version-sym)
......@@ -2852,6 +2856,7 @@ accomplish that conveniently."
;; (put ',mode 'c-has-warned-lang-consts t))
(require 'cc-langs)
(setq source-eval t)
(let ((init (cdr c-lang-variable-inits)))
(while init
(setq current-var (caar init))
......@@ -2860,8 +2865,14 @@ accomplish that conveniently."
(error
(if current-var
(message "Eval error in the `c-lang-defvar' for `%s': %S"
current-var err)
(message "Eval error in the `c-lang-defvar' for `%s'%s: %S"
current-var
(if source-eval
(format "\
(fallback source eval - %s compiled with CC Mode %s but loaded with %s)"
',mode ,c-version c-version)
"")
err)
(signal (car err) (cdr err)))))))
;; Being evaluated from source. Always use the dynamic method to
......@@ -2881,8 +2892,9 @@ accomplish that conveniently."
(error
(if current-var
(message "Eval error in the `c-lang-defvar' for `%s': %S"
current-var err)
(message
"Eval error in the `c-lang-defvar' for `%s' (source eval): %S"
current-var err)
(signal (car err) (cdr err)))))))
))
......
;;; cc-menus.el --- imenu support 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
......
;;; cc-mode.el --- major mode for editing C and similar languages
;; 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: 2003- Alan Mackenzie
;; 1998- Martin Stjernholm
......@@ -242,9 +242,9 @@ control). See \"cc-mode.el\" for more info."
(define-key c-mode-base-map (kbd "C-c C-<delete>")
'c-hungry-delete-forward)
(define-key c-mode-base-map (kbd "C-c C-<backspace>")
'c-hungry-backspace))
'c-hungry-delete-backwards))
(define-key c-mode-base-map (kbd "C-c C-<delete>")
'c-hungry-backspace)
'c-hungry-delete-backwards)
(define-key c-mode-base-map (kbd "C-c C-<backspace>")
'c-hungry-delete-forward)))
......@@ -304,10 +304,11 @@ control). See \"cc-mode.el\" for more info."
;; `c-electric-backspace'. The hungry variants are bound to the
;; same keys but prefixed with C-c. This implies that C-c C-d is
;; `c-hungry-delete-forward'. For consistency, we bind not only C-c
;; <backspace> to `c-hungry-backspace' but also C-c C-<backspace>,
;; so that the Ctrl key can be held down during the whole sequence
;; regardless of the direction. This in turn implies that we bind
;; C-c C-<delete> to `c-hungry-delete-forward', for the same reason.
;; <backspace> to `c-hungry-delete-backwards' but also
;; C-c C-<backspace>, so that the Ctrl key can be held down during
;; the whole sequence regardless of the direction. This in turn
;; implies that we bind C-c C-<delete> to `c-hungry-delete-forward',
;; for the same reason.
;; Bind the electric deletion functions to C-d and DEL. Emacs 21
;; automatically maps the [delete] and [backspace] keys to these two
......@@ -316,8 +317,8 @@ control). See \"cc-mode.el\" for more info."
(define-key c-mode-base-map "\C-d" 'c-electric-delete-forward)
(define-key c-mode-base-map "\177" 'c-electric-backspace)
(define-key c-mode-base-map "\C-c\C-d" 'c-hungry-delete-forward)
(define-key c-mode-base-map [?\C-c ?\d] 'c-hungry-backspace)
(define-key c-mode-base-map [?\C-c ?\C-\d] 'c-hungry-backspace)
(define-key c-mode-base-map [?\C-c ?\d] 'c-hungry-delete-backwards)
(define-key c-mode-base-map [?\C-c ?\C-\d] 'c-hungry-delete-backwards)
(define-key c-mode-base-map [?\C-c deletechar] 'c-hungry-delete-forward) ; C-c <delete> on a tty.
(define-key c-mode-base-map [?\C-c (control deletechar)] ; C-c C-<delete> on a tty.
'c-hungry-delete-forward)
......@@ -339,8 +340,10 @@ control). See \"cc-mode.el\" for more info."
(define-key c-mode-base-map [backspace] 'c-electric-backspace)
(define-key c-mode-base-map (kbd "C-c <delete>") 'c-hungry-delete)