Mercurial > emacs
comparison lisp/info.el @ 24580:2d0999df43c7
(Info-find-node): Check for an anchor at the
proper place, before reading an indirect file.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 06 Apr 1999 23:23:23 +0000 |
parents | 2db3b19a94bb |
children | a6ad37f4f6cb |
comparison
equal
deleted
inserted
replaced
24579:82cf6c4c1e03 | 24580:2d0999df43c7 |
---|---|
473 | 473 |
474 ;; First, search a tag table, if any | 474 ;; First, search a tag table, if any |
475 (if (marker-position Info-tag-table-marker) | 475 (if (marker-position Info-tag-table-marker) |
476 | 476 |
477 (let (found-in-tag-table | 477 (let (found-in-tag-table |
478 found-anchor | |
478 found-mode | 479 found-mode |
479 (m Info-tag-table-marker)) | 480 (m Info-tag-table-marker)) |
480 (save-excursion | 481 (save-excursion |
481 (set-buffer (marker-buffer m)) | 482 (set-buffer (marker-buffer m)) |
482 (goto-char m) | 483 (goto-char m) |
483 (beginning-of-line) ; so re-search will work. | 484 (beginning-of-line) ; so re-search will work. |
484 | 485 |
485 ;; Search tag table | 486 ;; Search tag table |
486 (setq found-in-tag-table | 487 (setq found-in-tag-table |
487 (re-search-forward regexp nil t)) | 488 (re-search-forward regexp nil t) |
489 found-anchor | |
490 (string-equal "Ref:" (match-string 1))) | |
488 (if found-in-tag-table | 491 (if found-in-tag-table |
489 (setq guesspos (1+ (read (current-buffer))))) | 492 (setq guesspos (1+ (read (current-buffer))))) |
490 (setq found-mode major-mode)) | 493 (setq found-mode major-mode)) |
491 | 494 |
492 ;; Indirect file among split files | 495 ;; Indirect file among split files |
501 ;; Info-read-subfile. Thus the hackery | 504 ;; Info-read-subfile. Thus the hackery |
502 ;; above. | 505 ;; above. |
503 (setq guesspos (Info-read-subfile guesspos))))) | 506 (setq guesspos (Info-read-subfile guesspos))))) |
504 | 507 |
505 ;; Handle anchor | 508 ;; Handle anchor |
506 (if (and found-in-tag-table | 509 (if found-anchor (goto-char guesspos) |
507 (string-equal "Ref:" (match-string 1))) | |
508 (goto-char guesspos) | |
509 | 510 |
510 ;; Else we may have a node, which we search for: | 511 ;; Else we may have a node, which we search for: |
511 (goto-char (max (point-min) | 512 (goto-char (max (point-min) |
512 (- (byte-to-position guesspos) 1000))) | 513 (- (byte-to-position guesspos) 1000))) |
513 ;; Now search from our advised position | 514 ;; Now search from our advised position |