diff options
Diffstat (limited to 'lisp/progmodes')
| -rw-r--r-- | lisp/progmodes/octave.el | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index 899bf151a2c..1803ea62c13 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el | |||
| @@ -1724,20 +1724,32 @@ sentence." | |||
| 1724 | (if all "'-all', " "") | 1724 | (if all "'-all', " "") |
| 1725 | str))) | 1725 | str))) |
| 1726 | (let ((lines inferior-octave-output-list)) | 1726 | (let ((lines inferior-octave-output-list)) |
| 1727 | (when (string-match "error: \\(.*\\)$" (car lines)) | 1727 | (when (and (stringp (car lines)) |
| 1728 | (string-match "error: \\(.*\\)$" (car lines))) | ||
| 1728 | (error "%s" (match-string 1 (car lines)))) | 1729 | (error "%s" (match-string 1 (car lines)))) |
| 1729 | (with-help-window octave-help-buffer | 1730 | (with-help-window octave-help-buffer |
| 1730 | (princ (mapconcat 'identity lines "\n")) | ||
| 1731 | (with-current-buffer octave-help-buffer | 1731 | (with-current-buffer octave-help-buffer |
| 1732 | (if lines | ||
| 1733 | (insert (mapconcat 'identity lines "\n")) | ||
| 1734 | (insert (format "Nothing found for \"%s\".\n" str))) | ||
| 1732 | ;; Bound to t so that `help-buffer' returns current buffer for | 1735 | ;; Bound to t so that `help-buffer' returns current buffer for |
| 1733 | ;; `help-setup-xref'. | 1736 | ;; `help-setup-xref'. |
| 1734 | (let ((help-xref-following t)) | 1737 | (let ((help-xref-following t)) |
| 1735 | (help-setup-xref (list 'octave-lookfor str all) | 1738 | (help-setup-xref (list 'octave-lookfor str all) |
| 1736 | (called-interactively-p 'interactive))) | 1739 | (called-interactively-p 'interactive))) |
| 1737 | (goto-char (point-min)) | 1740 | (goto-char (point-min)) |
| 1738 | (while (re-search-forward "^\\([^[:blank:]]+\\) " nil 'noerror) | 1741 | (when lines |
| 1739 | (make-text-button (match-beginning 1) (match-end 1) | 1742 | (while (re-search-forward "^\\([^[:blank:]]+\\) " nil 'noerror) |
| 1740 | :type 'octave-help-function)) | 1743 | (make-text-button (match-beginning 1) (match-end 1) |
| 1744 | :type 'octave-help-function))) | ||
| 1745 | (unless all | ||
| 1746 | (goto-char (point-max)) | ||
| 1747 | (insert "\nRetry with ") | ||
| 1748 | (insert-text-button "'-all'" | ||
| 1749 | 'follow-link t | ||
| 1750 | 'action #'(lambda (b) | ||
| 1751 | (octave-lookfor str '-all))) | ||
| 1752 | (insert ".\n")) | ||
| 1741 | (octave-help-mode))))) | 1753 | (octave-help-mode))))) |
| 1742 | 1754 | ||
| 1743 | (defcustom octave-source-directories nil | 1755 | (defcustom octave-source-directories nil |