Function: c-just-after-func-arglist-p

c-just-after-func-arglist-p is a byte-compiled function defined in cc-engine.el.gz.

Signature

(c-just-after-func-arglist-p &optional LIM)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-engine.el.gz
(defun c-just-after-func-arglist-p (&optional lim)
  ;; Return non-nil if the point is in the region after the argument
  ;; list of a function and its opening brace (or semicolon in case it
  ;; got no body).  If there are K&R style argument declarations in
  ;; that region, the point has to be inside the first one for this
  ;; function to recognize it.
  ;;
  ;; If successful, the point is moved to the first token after the
  ;; function header (see `c-forward-decl-or-cast-1' for details) and
  ;; the position of the opening paren of the function arglist is
  ;; returned.
  ;;
  ;; The point is clobbered if not successful.
  ;;
  ;; LIM is used as bound for backward buffer searches.
  ;;
  ;; This function might do hidden buffer changes.

  (let ((beg (point)) id-start)
    (and
     (eq (c-beginning-of-statement-1 lim nil nil nil t) 'same)

     (not (and (c-major-mode-is 'objc-mode)
	       (c-forward-objc-directive)))

     ;; Don't confuse #if .... defined(foo) for a function arglist.
     (not (and (looking-at c-cpp-expr-functions-key)
	       (save-excursion
		 (save-restriction
		   (widen)
		   (c-beginning-of-macro lim)))))
     (progn (if (looking-at c-protection-key)
		(c-forward-token-2))
	    t)
     (setq id-start
	   (car-safe (c-forward-decl-or-cast-1 (c-point 'bosws) 'top nil)))
     (numberp id-start)
     (< id-start beg)

     ;; There should not be a '=' or ',' between beg and the
     ;; start of the declaration since that means we were in the
     ;; "expression part" of the declaration.
     (or (> (point) beg)
	 (not (looking-at "[=,]")))

     (save-excursion
       ;; Check that there's an arglist paren in the
       ;; declaration.
       (goto-char id-start)
       (cond ((eq (char-after) ?\()
	      ;; The declarator is a paren expression, so skip past it
	      ;; so that we don't get stuck on that instead of the
	      ;; function arglist.
	      (c-forward-sexp))
	     ((and c-opt-op-identifier-prefix
		   (looking-at c-opt-op-identifier-prefix))
	      ;; Don't trip up on "operator ()".
	      (c-forward-token-2 2 t)))
       (and (< (point) beg)
	    (c-syntactic-re-search-forward "(" beg t t)
	    (1- (point)))))))