Function: octave-lookfor
octave-lookfor is an interactive and byte-compiled function defined in
octave.el.gz.
Signature
(octave-lookfor STR &optional ALL)
Documentation
Search for the string STR in all function help strings.
If ALL is non-nil search the entire help string else only search the first sentence.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/octave.el.gz
(defun octave-lookfor (str &optional all)
"Search for the string STR in all function help strings.
If ALL is non-nil search the entire help string else only search the first
sentence."
(interactive "sSearch for: \nP")
(inferior-octave-send-list-and-digest
(list (format "lookfor (%s'%s');\n"
(if all "'-all', " "")
str)))
(let ((lines inferior-octave-output-list))
(when (and (stringp (car lines))
(string-match "error: \\(.*\\)$" (car lines)))
(error "%s" (match-string 1 (car lines))))
(with-help-window octave-help-buffer
(with-current-buffer octave-help-buffer
(if lines
(insert (mapconcat 'identity lines "\n"))
(insert (format "Nothing found for \"%s\".\n" str)))
;; Bound to t so that `help-buffer' returns current buffer for
;; `help-setup-xref'.
(let ((help-xref-following t))
(help-setup-xref (list 'octave-lookfor str all)
(called-interactively-p 'interactive)))
(goto-char (point-min))
(when lines
(while (re-search-forward "^\\([^[:blank:]]+\\) " nil 'noerror)
(make-text-button (match-beginning 1) (match-end 1)
:type 'octave-help-function)))
(unless all
(goto-char (point-max))
(insert "\nRetry with ")
(insert-text-button "'-all'"
'follow-link t
'action (lambda (_b)
(octave-lookfor str '-all)))
(insert ".\n"))
(octave-help-mode)))))