Function: info-lookup-guess-default

info-lookup-guess-default is a byte-compiled function defined in info-look.el.gz.

Signature

(info-lookup-guess-default TOPIC MODE)

Documentation

Return a guess for a symbol to look up, based on text around point.

Try all related modes applicable to TOPIC and MODE. Return nil if there is nothing appropriate in the buffer near point.

Source Code

;; Defined in /usr/src/emacs/lisp/info-look.el.gz
(defun info-lookup-guess-default (topic mode)
  "Return a guess for a symbol to look up, based on text around point.
Try all related modes applicable to TOPIC and MODE.
Return nil if there is nothing appropriate in the buffer near point."
  (let ((modes (info-lookup->all-modes topic mode))
	guess)
    (while (and (not guess) modes)
      (setq guess (info-lookup-guess-default* topic (car modes))
	    modes (cdr modes)))
    ;; Collapse whitespace characters.
    (when guess
      (let ((pos 0))
	(while (string-match "[ \t\n]+" guess pos)
	  (setq pos (1+ (match-beginning 0)))
	  (setq guess (replace-match " " t t guess)))))
    guess))