]> code.delx.au - gnu-emacs/commitdiff
progmodes/cc-menus.el (cc-imenu-c++-generic-expression): Make it handle
authorAlan Mackenzie <acm@muc.de>
Sat, 27 Aug 2011 08:41:23 +0000 (08:41 +0000)
committerAlan Mackenzie <acm@muc.de>
Sat, 27 Aug 2011 08:41:23 +0000 (08:41 +0000)
function pointer parameters properly.

lisp/ChangeLog
lisp/progmodes/cc-menus.el
lisp/textmodes/paragraphs.el

index 93f7bd1a20052d9b1fd5af00d114d32c603bfa3f..8a57fe754052cda20d4afd0a9f3921ec5a61a769 100644 (file)
@@ -1,3 +1,8 @@
+2011-08-27  Alan Mackenzie  <acm@muc.de>
+
+       * progmodes/cc-menus.el (cc-imenu-c++-generic-expression): Make it
+       handle function pointer parameters properly.
+
 2011-08-27  Martin Rudalics  <rudalics@gmx.at>
 
        * window.el (display-buffer-reuse-window): Fix case where
index f53a7da5186f885c4cde1745d8a05b1c4de7254f..4e9350de425ffe86bde806dac54762feaa26d9ed 100644 (file)
@@ -108,8 +108,11 @@ A sample value might look like: `\\(_P\\|_PROTO\\)'.")
        "[^" c-alnum "_:<>~]"                  ; match any non-identifier char
        "\\([" c-alpha "_][" c-alnum "_:<>~]*\\)" ; match function name
        "\\([ \t\n]\\|\\\\\n\\)*("            ; see above, BUT the arg list
-       "\\([ \t\n]\\|\\\\\n\\)*\\([^ \t\n(*][^)]*\\)?)" ; must not start
-       "\\([ \t\n]\\|\\\\\n\\)*[^ \t\n;(]"    ; with an asterisk or parentheses
+       "\\([ \t\n]\\|\\\\\n\\)*"             ; must not start
+       "\\([^ \t\n(*]"                       ; with an asterisk or parentheses
+       "[^()]*\\(([^()]*)[^()]*\\)*"         ; Maybe function pointer arguments
+       "\\)?)"
+       "\\([ \t\n]\\|\\\\\n\\)*[^ \t\n;(]"
        ) 1)
     ;; Special case for definitions using phony prototype macros like:
     ;; `int main _PROTO( (int argc,char *argv[]) )'.
index a0892b5ebbae991b375eed1169f0aece54c2cf18..59454043c4ed45a3ac2967e6baa55978cd783955 100644 (file)
@@ -456,21 +456,25 @@ sentences.  Also, every paragraph boundary terminates sentences as well."
         (sentence-end (sentence-end)))
     (while (< arg 0)
       (let ((pos (point))
-           ;; We used to use (start-of-paragraph-text), but this can
-           ;; prevent sentence-end from matching if it is anchored at
-           ;; BOL and the paragraph starts indented.
-           (par-beg (save-excursion (backward-paragraph) (point))))
-       (if (and (re-search-backward sentence-end par-beg t)
-               (or (< (match-end 0) pos)
-                   (re-search-backward sentence-end par-beg t)))
-          (goto-char (match-end 0))
-        (goto-char par-beg)))
+           (par-beg
+            (save-excursion
+              (start-of-paragraph-text)
+              ;; Move PAR-BEG back over indentation
+              ;; to allow s1entence-end to match if it is anchored at
+              ;; BOL and the paragraph starts indented.
+              (beginning-of-line)
+              (point))))
+       (if (and (re-search-backward sentence-end par-beg t)
+                (or (< (match-end 0) pos)
+                    (re-search-backward sentence-end par-beg t)))
+           (goto-char (match-end 0))
+         (goto-char par-beg)))
       (setq arg (1+ arg)))
     (while (> arg 0)
       (let ((par-end (save-excursion (end-of-paragraph-text) (point))))
-       (if (re-search-forward sentence-end par-end t)
-          (skip-chars-backward " \t\n")
-        (goto-char par-end)))
+       (if (re-search-forward sentence-end par-end t)
+           (skip-chars-backward " \t\n")
+         (goto-char par-end)))
       (setq arg (1- arg)))
     (constrain-to-field nil opoint t)))