diff options
| author | Richard M. Stallman | 1992-07-24 23:48:49 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1992-07-24 23:48:49 +0000 |
| commit | d4fbc2d5fa34f5ead3b9e0d77388f20351728e85 (patch) | |
| tree | cc55061842418be8cbf964e658a132ed97843095 | |
| parent | eb6e9899443ee0ce93d0574cc263c49326e6aaa5 (diff) | |
| download | emacs-d4fbc2d5fa34f5ead3b9e0d77388f20351728e85.tar.gz emacs-d4fbc2d5fa34f5ead3b9e0d77388f20351728e85.zip | |
*** empty log message ***
| -rw-r--r-- | lisp/progmodes/c-mode.el | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/lisp/progmodes/c-mode.el b/lisp/progmodes/c-mode.el index fc784d71518..87046a0a6a3 100644 --- a/lisp/progmodes/c-mode.el +++ b/lisp/progmodes/c-mode.el | |||
| @@ -764,19 +764,27 @@ Otherwise return nil and don't move point." | |||
| 764 | (defun c-beginning-of-statement (count) | 764 | (defun c-beginning-of-statement (count) |
| 765 | "Go to the beginning of the innermost C statement. | 765 | "Go to the beginning of the innermost C statement. |
| 766 | With prefix arg, go back N - 1 statements. If already at the beginning of a | 766 | With prefix arg, go back N - 1 statements. If already at the beginning of a |
| 767 | statement then go to the beginning of the preceeding one." | 767 | statement then go to the beginning of the preceeding one. |
| 768 | If within a string or comment, move by sentences instead of statements." | ||
| 768 | (interactive "p") | 769 | (interactive "p") |
| 769 | (while (> count 0) | 770 | (let ((here (point)) state) |
| 770 | (c-beginning-of-statement-1) | 771 | (save-excursion |
| 771 | (setq count (1- count))) | 772 | (beginning-of-defun) |
| 772 | (while (< count 0) | 773 | (setq state (parse-partial-sexp (point) here nil nil))) |
| 773 | (c-end-of-statement-1) | 774 | (if (or (nth 3 state) (nth 4 state)) |
| 774 | (setq count (1+ count)))) | 775 | (forward-sentence (- count)) |
| 776 | (while (> count 0) | ||
| 777 | (c-beginning-of-statement-1) | ||
| 778 | (setq count (1- count))) | ||
| 779 | (while (< count 0) | ||
| 780 | (c-end-of-statement-1) | ||
| 781 | (setq count (1+ count)))))) | ||
| 775 | 782 | ||
| 776 | (defun c-end-of-statement (count) | 783 | (defun c-end-of-statement (count) |
| 777 | "Go to the end of the innermost C statement. | 784 | "Go to the end of the innermost C statement. |
| 778 | With prefix arg, go forward N - 1 statements. Moves forward to end of the | 785 | With prefix arg, go forward N - 1 statements. |
| 779 | next statement if already at end." | 786 | Move forward to end of the next statement if already at end. |
| 787 | If within a string or comment, move by sentences instead of statements." | ||
| 780 | (interactive "p") | 788 | (interactive "p") |
| 781 | (c-beginning-of-statement (- count))) | 789 | (c-beginning-of-statement (- count))) |
| 782 | 790 | ||