diff options
| author | Juri Linkov | 2004-11-05 19:06:24 +0000 |
|---|---|---|
| committer | Juri Linkov | 2004-11-05 19:06:24 +0000 |
| commit | ca53db337fe95e923eb0b030999d313e16b100a9 (patch) | |
| tree | 575345aee1a6921456bcfc41a809bda9b769ca23 | |
| parent | 3296d21b53c19d620538dae1179a6c9d6dc5de8f (diff) | |
| download | emacs-ca53db337fe95e923eb0b030999d313e16b100a9.tar.gz emacs-ca53db337fe95e923eb0b030999d313e16b100a9.zip | |
(Info-search): Don't search in node header lines and file headers.
| -rw-r--r-- | lisp/info.el | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/lisp/info.el b/lisp/info.el index 2e0ddd0fb02..8aaf7755df2 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -1476,11 +1476,21 @@ If DIRECTION is `backward', search in the reverse direction." | |||
| 1476 | (save-excursion | 1476 | (save-excursion |
| 1477 | (save-restriction | 1477 | (save-restriction |
| 1478 | (widen) | 1478 | (widen) |
| 1479 | (when backward | ||
| 1480 | ;; Hide Info file header for backward search | ||
| 1481 | (narrow-to-region (save-excursion | ||
| 1482 | (goto-char (point-min)) | ||
| 1483 | (search-forward "\n\^_") | ||
| 1484 | (1- (point))) | ||
| 1485 | (point-max))) | ||
| 1479 | (while (and (not give-up) | 1486 | (while (and (not give-up) |
| 1480 | (or (null found) | 1487 | (or (null found) |
| 1481 | (if backward | 1488 | (if backward |
| 1482 | (isearch-range-invisible found beg-found) | 1489 | (isearch-range-invisible found beg-found) |
| 1483 | (isearch-range-invisible beg-found found)))) | 1490 | (isearch-range-invisible beg-found found)) |
| 1491 | ;; Skip node header line | ||
| 1492 | (save-excursion (forward-line -1) | ||
| 1493 | (looking-at "\^_")))) | ||
| 1484 | (if (if backward | 1494 | (if (if backward |
| 1485 | (re-search-backward regexp bound t) | 1495 | (re-search-backward regexp bound t) |
| 1486 | (re-search-forward regexp bound t)) | 1496 | (re-search-forward regexp bound t)) |
| @@ -1531,14 +1541,24 @@ If DIRECTION is `backward', search in the reverse direction." | |||
| 1531 | (while list | 1541 | (while list |
| 1532 | (message "Searching subfile %s..." (cdr (car list))) | 1542 | (message "Searching subfile %s..." (cdr (car list))) |
| 1533 | (Info-read-subfile (car (car list))) | 1543 | (Info-read-subfile (car (car list))) |
| 1534 | (if backward (goto-char (point-max))) | 1544 | (when backward |
| 1545 | ;; Hide Info file header for backward search | ||
| 1546 | (narrow-to-region (save-excursion | ||
| 1547 | (goto-char (point-min)) | ||
| 1548 | (search-forward "\n\^_") | ||
| 1549 | (1- (point))) | ||
| 1550 | (point-max)) | ||
| 1551 | (goto-char (point-max))) | ||
| 1535 | (setq list (cdr list)) | 1552 | (setq list (cdr list)) |
| 1536 | (setq give-up nil found nil) | 1553 | (setq give-up nil found nil) |
| 1537 | (while (and (not give-up) | 1554 | (while (and (not give-up) |
| 1538 | (or (null found) | 1555 | (or (null found) |
| 1539 | (if backward | 1556 | (if backward |
| 1540 | (isearch-range-invisible found beg-found) | 1557 | (isearch-range-invisible found beg-found) |
| 1541 | (isearch-range-invisible beg-found found)))) | 1558 | (isearch-range-invisible beg-found found)) |
| 1559 | ;; Skip node header line | ||
| 1560 | (save-excursion (forward-line -1) | ||
| 1561 | (looking-at "\^_")))) | ||
| 1542 | (if (if backward | 1562 | (if (if backward |
| 1543 | (re-search-backward regexp nil t) | 1563 | (re-search-backward regexp nil t) |
| 1544 | (re-search-forward regexp nil t)) | 1564 | (re-search-forward regexp nil t)) |