Function: next-error-buffer-p

next-error-buffer-p is a byte-compiled function defined in simple.el.gz.

Signature

(next-error-buffer-p BUFFER &optional AVOID-CURRENT EXTRA-TEST-INCLUSIVE EXTRA-TEST-EXCLUSIVE)

Documentation

Return non-nil if BUFFER is a next-error capable buffer.

If AVOID-CURRENT is non-nil, and BUFFER is the current buffer, return nil.

The function EXTRA-TEST-INCLUSIVE, if non-nil, is called if BUFFER would not normally qualify. If it returns non-nil, BUFFER is considered next-error capable, anyway, and the function returns non-nil.

The function EXTRA-TEST-EXCLUSIVE, if non-nil, is called if the buffer would normally qualify. If it returns nil, BUFFER is rejected, and the function returns nil.

Source Code

;; Defined in /usr/src/emacs/lisp/simple.el.gz
(defsubst next-error-buffer-p (buffer
			       &optional avoid-current
			       extra-test-inclusive
			       extra-test-exclusive)
  "Return non-nil if BUFFER is a `next-error' capable buffer.
If AVOID-CURRENT is non-nil, and BUFFER is the current buffer,
return nil.

The function EXTRA-TEST-INCLUSIVE, if non-nil, is called if
BUFFER would not normally qualify.  If it returns non-nil, BUFFER
is considered `next-error' capable, anyway, and the function
returns non-nil.

The function EXTRA-TEST-EXCLUSIVE, if non-nil, is called if the
buffer would normally qualify.  If it returns nil, BUFFER is
rejected, and the function returns nil."
  (and (buffer-name buffer)		;First make sure it's live.
       (not (and avoid-current (eq buffer (current-buffer))))
       (with-current-buffer buffer
	 (if next-error-function   ; This is the normal test.
	     ;; Optionally reject some buffers.
	     (if extra-test-exclusive
		 (funcall extra-test-exclusive)
	       t)
	   ;; Optionally accept some other buffers.
	   (and extra-test-inclusive
		(funcall extra-test-inclusive))))))