diff options
| author | Stefan Monnier | 2003-02-10 21:52:30 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2003-02-10 21:52:30 +0000 |
| commit | 22f5d492084be45add196d8ecc3a1280b43260cd (patch) | |
| tree | 6aaff106bf3e3d781e7a81dcb0a45570cea541a8 | |
| parent | 389fe8885e51e6e294b7f87e4ebea4a2f74f3a43 (diff) | |
| download | emacs-22f5d492084be45add196d8ecc3a1280b43260cd.tar.gz emacs-22f5d492084be45add196d8ecc3a1280b43260cd.zip | |
(help-xref-on-pp): Only add xref if the text is less than 5K.
| -rw-r--r-- | lisp/help-mode.el | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 904d08f7519..03a711115db 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el | |||
| @@ -443,31 +443,29 @@ See `help-make-xrefs'." | |||
| 443 | ;;;###autoload | 443 | ;;;###autoload |
| 444 | (defun help-xref-on-pp (from to) | 444 | (defun help-xref-on-pp (from to) |
| 445 | "Add xrefs for symbols in `pp's output between FROM and TO." | 445 | "Add xrefs for symbols in `pp's output between FROM and TO." |
| 446 | (let ((ost (syntax-table))) | 446 | (if (> (- to from) 5000) nil |
| 447 | (unwind-protect | 447 | (with-syntax-table emacs-lisp-mode-syntax-table |
| 448 | (save-excursion | 448 | (save-excursion |
| 449 | (save-restriction | 449 | (save-restriction |
| 450 | (set-syntax-table emacs-lisp-mode-syntax-table) | 450 | (narrow-to-region from to) |
| 451 | (narrow-to-region from to) | 451 | (goto-char (point-min)) |
| 452 | (goto-char (point-min)) | 452 | (condition-case nil |
| 453 | (condition-case nil | 453 | (while (not (eobp)) |
| 454 | (while (not (eobp)) | 454 | (cond |
| 455 | (cond | 455 | ((looking-at "\"") (forward-sexp 1)) |
| 456 | ((looking-at "\"") (forward-sexp 1)) | 456 | ((looking-at "#<") (search-forward ">" nil 'move)) |
| 457 | ((looking-at "#<") (search-forward ">" nil 'move)) | 457 | ((looking-at "\\(\\(\\sw\\|\\s_\\)+\\)") |
| 458 | ((looking-at "\\(\\(\\sw\\|\\s_\\)+\\)") | 458 | (let* ((sym (intern-soft (match-string 1))) |
| 459 | (let* ((sym (intern-soft (match-string 1))) | 459 | (type (cond ((fboundp sym) 'help-function) |
| 460 | (type (cond ((fboundp sym) 'help-function) | 460 | ((or (memq sym '(t nil)) |
| 461 | ((or (memq sym '(t nil)) | 461 | (keywordp sym)) |
| 462 | (keywordp sym)) | 462 | nil) |
| 463 | nil) | 463 | ((and sym (boundp sym)) |
| 464 | ((and sym (boundp sym)) | 464 | 'help-variable)))) |
| 465 | 'help-variable)))) | 465 | (when type (help-xref-button 1 type sym))) |
| 466 | (when type (help-xref-button 1 type sym))) | 466 | (goto-char (match-end 1))) |
| 467 | (goto-char (match-end 1))) | 467 | (t (forward-char 1)))) |
| 468 | (t (forward-char 1)))) | 468 | (error nil))))))) |
| 469 | (error nil)))) | ||
| 470 | (set-syntax-table ost)))) | ||
| 471 | 469 | ||
| 472 | 470 | ||
| 473 | ;; Additional functions for (re-)creating types of help buffers. | 471 | ;; Additional functions for (re-)creating types of help buffers. |