Function: c-defun-name-and-limits

c-defun-name-and-limits is a byte-compiled function defined in cc-cmds.el.gz.

Signature

(c-defun-name-and-limits NEAR)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-cmds.el.gz
(defun c-defun-name-and-limits (near)
  ;; Return a cons of the name and limits (itself a cons) of the current
  ;; top-level declaration or macro, or nil of there is none.
  ;;
  ;; If `c-defun-tactic' is 'go-outward, we return the name and limits of the
  ;; most tightly enclosing declaration or macro.  Otherwise, we return that
  ;; at the file level.
  (save-restriction
    (widen)
    (if (eq c-defun-tactic 'go-outward)
	(c-save-buffer-state ((paren-state (c-parse-state))
			      (orig-point-min (point-min))
			      (orig-point-max (point-max))
			      lim name limits)
	  (setq lim (c-widen-to-enclosing-decl-scope
		     paren-state orig-point-min orig-point-max))
	  (and lim (setq lim (1- lim)))
	  (c-while-widening-to-decl-block (not (setq name (c-defun-name-1))) t)
	  (when name
	    (setq limits (c-declaration-limits-1 near))
	    (cons name limits)))
      (c-save-buffer-state ((name (c-defun-name))
			    (limits (c-declaration-limits near)))
	(and name limits (cons name limits))))))