Function: newsticker--buffer-goto

newsticker--buffer-goto is a byte-compiled function defined in newst-plainview.el.gz.

Signature

(newsticker--buffer-goto TYPES &optional AGE BACKWARDS)

Documentation

Search next occurrence of TYPES in current buffer.

TYPES is a list of symbols. If TYPES is found point is moved, if not point is left unchanged. If optional parameter AGE is not nil, the type AND the age must match. If BACKWARDS is t, search backwards.

Source Code

;; Defined in /usr/src/emacs/lisp/net/newst-plainview.el.gz
(defun newsticker--buffer-goto (types &optional age backwards)
  "Search next occurrence of TYPES in current buffer.
TYPES is a list of symbols.  If TYPES is found point is moved, if
not point is left unchanged.  If optional parameter AGE is not
nil, the type AND the age must match.  If BACKWARDS is t, search
backwards."
  (let ((pos (save-excursion
	       (save-restriction
		 (widen)
		 (catch 'found
		   (let ((tpos (point)))
		     (while (setq tpos
				  (if backwards
				      (if (eq tpos (point-min))
					  nil
					(or (previous-single-property-change
					     tpos 'nt-type)
					    (point-min)))
				    (next-single-property-change
				     tpos 'nt-type)))
		       (and (memq (get-text-property tpos 'nt-type) types)
			    (or (not age)
				(eq (get-text-property tpos 'nt-age) age))
			    (throw 'found tpos)))))))))
    (when pos
      (goto-char pos))
    pos))