diff options
| author | Richard M. Stallman | 1997-07-18 02:09:34 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-07-18 02:09:34 +0000 |
| commit | a6739a05e399008b8a0861376eacda5e3650ee06 (patch) | |
| tree | 5ccd07d534762b1dedaab6f8dd6265869ec07b10 | |
| parent | 7543028ea0375c194aea1dadadcb286b571be4ab (diff) | |
| download | emacs-a6739a05e399008b8a0861376eacda5e3650ee06.tar.gz emacs-a6739a05e399008b8a0861376eacda5e3650ee06.zip | |
Require 'cc-defs for the definition of c-emacs-features.
(c-symbol-key): First character must be a letter or underscore.
(c-make-inherited-keymap): Change to a defun.
(c-mode-menu): Added uncomment region and slight rearrangement of items.
| -rw-r--r-- | lisp/progmodes/cc-langs.el | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index abfab2f2bf4..c92118e76b7 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | ;; 1985 Richard M. Stallman | 7 | ;; 1985 Richard M. Stallman |
| 8 | ;; Maintainer: cc-mode-help@python.org | 8 | ;; Maintainer: cc-mode-help@python.org |
| 9 | ;; Created: 22-Apr-1997 (split from cc-mode.el) | 9 | ;; Created: 22-Apr-1997 (split from cc-mode.el) |
| 10 | ;; Version: 5.12 | 10 | ;; Version: 5.13 |
| 11 | ;; Keywords: c languages oop | 11 | ;; Keywords: c languages oop |
| 12 | 12 | ||
| 13 | ;; This file is part of GNU Emacs. | 13 | ;; This file is part of GNU Emacs. |
| @@ -27,6 +27,8 @@ | |||
| 27 | ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 27 | ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 28 | ;; Boston, MA 02111-1307, USA. | 28 | ;; Boston, MA 02111-1307, USA. |
| 29 | 29 | ||
| 30 | (require 'cc-defs) | ||
| 31 | |||
| 30 | 32 | ||
| 31 | (require 'cc-defs) | 33 | (require 'cc-defs) |
| 32 | 34 | ||
| @@ -36,11 +38,18 @@ | |||
| 36 | ;; Keywords defining protection levels | 38 | ;; Keywords defining protection levels |
| 37 | (defconst c-protection-key "\\<\\(public\\|protected\\|private\\)\\>") | 39 | (defconst c-protection-key "\\<\\(public\\|protected\\|private\\)\\>") |
| 38 | 40 | ||
| 39 | ;; Regex describing a `symbol' in all languages We cannot use just | 41 | ;; Regex describing a `symbol' in all languages. We cannot use just |
| 40 | ;; `word' syntax class since `_' cannot be in word class. Putting | 42 | ;; `word' syntax class since `_' cannot be in word class. Putting |
| 41 | ;; underscore in word class breaks forward word movement behavior that | 43 | ;; underscore in word class breaks forward word movement behavior that |
| 42 | ;; users are familiar with. | 44 | ;; users are familiar with. Besides, this runs counter to Emacs |
| 43 | (defconst c-symbol-key "\\(\\w\\|\\s_\\)+") | 45 | ;; convention. |
| 46 | ;; | ||
| 47 | ;; I suspect this definition isn't correct in light of Java's | ||
| 48 | ;; definition of a symbol as being Unicode. I know so little about | ||
| 49 | ;; I18N (except how to sound cool and say I18N :-) that I'm willing to | ||
| 50 | ;; punt on this for now. | ||
| 51 | |||
| 52 | (defconst c-symbol-key "[_a-zA-Z]\\(\\w\\|\\s_\\)*") | ||
| 44 | 53 | ||
| 45 | 54 | ||
| 46 | ;; keywords introducing class definitions. language specific | 55 | ;; keywords introducing class definitions. language specific |
| @@ -273,7 +282,7 @@ it finds in `c-file-offsets'." | |||
| 273 | 282 | ||
| 274 | 283 | ||
| 275 | ;; Common routines | 284 | ;; Common routines |
| 276 | (defsubst c-make-inherited-keymap () | 285 | (defun c-make-inherited-keymap () |
| 277 | (let ((map (make-sparse-keymap))) | 286 | (let ((map (make-sparse-keymap))) |
| 278 | (cond | 287 | (cond |
| 279 | ;; XEmacs 19 & 20 | 288 | ;; XEmacs 19 & 20 |
| @@ -397,17 +406,22 @@ it finds in `c-file-offsets'." | |||
| 397 | (defun c-mode-menu (modestr) | 406 | (defun c-mode-menu (modestr) |
| 398 | (let ((m | 407 | (let ((m |
| 399 | '(["Comment Out Region" comment-region (mark)] | 408 | '(["Comment Out Region" comment-region (mark)] |
| 400 | ["Macro Expand Region" c-macro-expand (mark)] | 409 | ["Uncomment Region" |
| 401 | ["Backslashify" c-backslash-region (mark)] | 410 | (comment-region (region-beginning) (region-end) '(4)) |
| 411 | (mark)] | ||
| 412 | ["Fill Comment Paragraph" c-fill-paragraph t] | ||
| 413 | "---" | ||
| 402 | ["Indent Expression" c-indent-exp | 414 | ["Indent Expression" c-indent-exp |
| 403 | (memq (char-after) '(?\( ?\[ ?\{))] | 415 | (memq (char-after) '(?\( ?\[ ?\{))] |
| 404 | ["Indent Line" c-indent-command t] | 416 | ["Indent Line" c-indent-command t] |
| 405 | ["Fill Comment Paragraph" c-fill-paragraph t] | ||
| 406 | ["Up Conditional" c-up-conditional t] | 417 | ["Up Conditional" c-up-conditional t] |
| 407 | ["Backward Conditional" c-backward-conditional t] | 418 | ["Backward Conditional" c-backward-conditional t] |
| 408 | ["Forward Conditional" c-forward-conditional t] | 419 | ["Forward Conditional" c-forward-conditional t] |
| 409 | ["Backward Statement" c-beginning-of-statement t] | 420 | ["Backward Statement" c-beginning-of-statement t] |
| 410 | ["Forward Statement" c-end-of-statement t] | 421 | ["Forward Statement" c-end-of-statement t] |
| 422 | "---" | ||
| 423 | ["Macro Expand Region" c-macro-expand (mark)] | ||
| 424 | ["Backslashify" c-backslash-region (mark)] | ||
| 411 | ))) | 425 | ))) |
| 412 | (cons modestr m))) | 426 | (cons modestr m))) |
| 413 | 427 | ||