diff options
| author | Alan Mackenzie | 2011-08-27 08:41:23 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2011-08-27 08:41:23 +0000 |
| commit | 3fc9b2184582296ffe4a602d87534f35ba4b4919 (patch) | |
| tree | 9b29ff9c7b4bbde7c07ec8f0456c3497d31e41e0 | |
| parent | 538a061c725a191b921055c87cc0c26f0bccd95f (diff) | |
| download | emacs-3fc9b2184582296ffe4a602d87534f35ba4b4919.tar.gz emacs-3fc9b2184582296ffe4a602d87534f35ba4b4919.zip | |
progmodes/cc-menus.el (cc-imenu-c++-generic-expression): Make it handle
function pointer parameters properly.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/progmodes/cc-menus.el | 7 | ||||
| -rw-r--r-- | lisp/textmodes/paragraphs.el | 28 |
3 files changed, 26 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 93f7bd1a200..8a57fe75405 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-08-27 Alan Mackenzie <acm@muc.de> | ||
| 2 | |||
| 3 | * progmodes/cc-menus.el (cc-imenu-c++-generic-expression): Make it | ||
| 4 | handle function pointer parameters properly. | ||
| 5 | |||
| 1 | 2011-08-27 Martin Rudalics <rudalics@gmx.at> | 6 | 2011-08-27 Martin Rudalics <rudalics@gmx.at> |
| 2 | 7 | ||
| 3 | * window.el (display-buffer-reuse-window): Fix case where | 8 | * window.el (display-buffer-reuse-window): Fix case where |
diff --git a/lisp/progmodes/cc-menus.el b/lisp/progmodes/cc-menus.el index f53a7da5186..4e9350de425 100644 --- a/lisp/progmodes/cc-menus.el +++ b/lisp/progmodes/cc-menus.el | |||
| @@ -108,8 +108,11 @@ A sample value might look like: `\\(_P\\|_PROTO\\)'.") | |||
| 108 | "[^" c-alnum "_:<>~]" ; match any non-identifier char | 108 | "[^" c-alnum "_:<>~]" ; match any non-identifier char |
| 109 | "\\([" c-alpha "_][" c-alnum "_:<>~]*\\)" ; match function name | 109 | "\\([" c-alpha "_][" c-alnum "_:<>~]*\\)" ; match function name |
| 110 | "\\([ \t\n]\\|\\\\\n\\)*(" ; see above, BUT the arg list | 110 | "\\([ \t\n]\\|\\\\\n\\)*(" ; see above, BUT the arg list |
| 111 | "\\([ \t\n]\\|\\\\\n\\)*\\([^ \t\n(*][^)]*\\)?)" ; must not start | 111 | "\\([ \t\n]\\|\\\\\n\\)*" ; must not start |
| 112 | "\\([ \t\n]\\|\\\\\n\\)*[^ \t\n;(]" ; with an asterisk or parentheses | 112 | "\\([^ \t\n(*]" ; with an asterisk or parentheses |
| 113 | "[^()]*\\(([^()]*)[^()]*\\)*" ; Maybe function pointer arguments | ||
| 114 | "\\)?)" | ||
| 115 | "\\([ \t\n]\\|\\\\\n\\)*[^ \t\n;(]" | ||
| 113 | ) 1) | 116 | ) 1) |
| 114 | ;; Special case for definitions using phony prototype macros like: | 117 | ;; Special case for definitions using phony prototype macros like: |
| 115 | ;; `int main _PROTO( (int argc,char *argv[]) )'. | 118 | ;; `int main _PROTO( (int argc,char *argv[]) )'. |
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el index a0892b5ebba..59454043c4e 100644 --- a/lisp/textmodes/paragraphs.el +++ b/lisp/textmodes/paragraphs.el | |||
| @@ -456,21 +456,25 @@ sentences. Also, every paragraph boundary terminates sentences as well." | |||
| 456 | (sentence-end (sentence-end))) | 456 | (sentence-end (sentence-end))) |
| 457 | (while (< arg 0) | 457 | (while (< arg 0) |
| 458 | (let ((pos (point)) | 458 | (let ((pos (point)) |
| 459 | ;; We used to use (start-of-paragraph-text), but this can | 459 | (par-beg |
| 460 | ;; prevent sentence-end from matching if it is anchored at | 460 | (save-excursion |
| 461 | ;; BOL and the paragraph starts indented. | 461 | (start-of-paragraph-text) |
| 462 | (par-beg (save-excursion (backward-paragraph) (point)))) | 462 | ;; Move PAR-BEG back over indentation |
| 463 | (if (and (re-search-backward sentence-end par-beg t) | 463 | ;; to allow s1entence-end to match if it is anchored at |
| 464 | (or (< (match-end 0) pos) | 464 | ;; BOL and the paragraph starts indented. |
| 465 | (re-search-backward sentence-end par-beg t))) | 465 | (beginning-of-line) |
| 466 | (goto-char (match-end 0)) | 466 | (point)))) |
| 467 | (goto-char par-beg))) | 467 | (if (and (re-search-backward sentence-end par-beg t) |
| 468 | (or (< (match-end 0) pos) | ||
| 469 | (re-search-backward sentence-end par-beg t))) | ||
| 470 | (goto-char (match-end 0)) | ||
| 471 | (goto-char par-beg))) | ||
| 468 | (setq arg (1+ arg))) | 472 | (setq arg (1+ arg))) |
| 469 | (while (> arg 0) | 473 | (while (> arg 0) |
| 470 | (let ((par-end (save-excursion (end-of-paragraph-text) (point)))) | 474 | (let ((par-end (save-excursion (end-of-paragraph-text) (point)))) |
| 471 | (if (re-search-forward sentence-end par-end t) | 475 | (if (re-search-forward sentence-end par-end t) |
| 472 | (skip-chars-backward " \t\n") | 476 | (skip-chars-backward " \t\n") |
| 473 | (goto-char par-end))) | 477 | (goto-char par-end))) |
| 474 | (setq arg (1- arg))) | 478 | (setq arg (1- arg))) |
| 475 | (constrain-to-field nil opoint t))) | 479 | (constrain-to-field nil opoint t))) |
| 476 | 480 | ||