mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
progmodes/cc-menus.el (cc-imenu-c++-generic-expression): Make it handle
function pointer parameters properly.
This commit is contained in:
parent
538a061c72
commit
3fc9b21845
3 changed files with 26 additions and 14 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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[]) )'.
|
||||
|
|
|
|||
|
|
@ -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)))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue