aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii1998-12-16 14:01:45 +0000
committerEli Zaretskii1998-12-16 14:01:45 +0000
commitba42ce1405319d612e8a227d3bacb52f2574b5de (patch)
treed3e2bc394e6a0dcfa901e63c4090ff588d527c81
parent1be7f9b0a59e0382a5155371a8d1cb131ed095fc (diff)
downloademacs-ba42ce1405319d612e8a227d3bacb52f2574b5de.tar.gz
emacs-ba42ce1405319d612e8a227d3bacb52f2574b5de.zip
(Info-find-node): Add 1 to the position read from the
tag table. Don't fail if the node delimiter ^_ is the first character in the file. (Info-insert-dir): Don't fail when the node delimiter ^_ is the first character in the file. (Info-read-subfile): Likewise. (Info-select-node): Likewise. (Info-build-node-completions): Likewise.
-rw-r--r--lisp/info.el49
1 files changed, 42 insertions, 7 deletions
diff --git a/lisp/info.el b/lisp/info.el
index 1febb4d1195..371849a4b87 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -474,7 +474,7 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
474 (setq found-in-tag-table 474 (setq found-in-tag-table
475 (re-search-forward regexp nil t)) 475 (re-search-forward regexp nil t))
476 (if found-in-tag-table 476 (if found-in-tag-table
477 (setq guesspos (read (current-buffer)))) 477 (setq guesspos (1+ (read (current-buffer)))))
478 (setq found-mode major-mode)) 478 (setq found-mode major-mode))
479 479
480 ;; Indirect file among split files 480 ;; Indirect file among split files
@@ -502,6 +502,15 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
502 ;; (or from beg of buffer) 502 ;; (or from beg of buffer)
503 ;; to find the actual node. 503 ;; to find the actual node.
504 (catch 'foo 504 (catch 'foo
505 (if (and (eq (point) (point-min))
506 (looking-at "\^_")
507 (= (forward-line 1) 0))
508 (let ((beg (point)))
509 (forward-line 1)
510 (if (re-search-backward regexp beg t)
511 (progn
512 (beginning-of-line)
513 (throw 'foo t)))))
505 (while (search-forward "\n\^_" nil t) 514 (while (search-forward "\n\^_" nil t)
506 (forward-line 1) 515 (forward-line 1)
507 (let ((beg (point))) 516 (let ((beg (point)))
@@ -517,6 +526,15 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
517 ;; Now search from our advised position (or from beg of buffer) 526 ;; Now search from our advised position (or from beg of buffer)
518 ;; to find the actual node. 527 ;; to find the actual node.
519 (catch 'foo 528 (catch 'foo
529 (if (and (eq (point) (point-min))
530 (looking-at "\^_")
531 (= (forward-line 1) 0))
532 (let ((beg (point)))
533 (forward-line 1)
534 (if (re-search-backward regexp beg t)
535 (progn
536 (beginning-of-line)
537 (throw 'foo t)))))
520 (while (search-forward "\n\^_" nil t) 538 (while (search-forward "\n\^_" nil t)
521 (forward-line 1) 539 (forward-line 1)
522 (let ((beg (point))) 540 (let ((beg (point)))
@@ -643,7 +661,9 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
643 (let (beg nodename end) 661 (let (beg nodename end)
644 (forward-line 1) 662 (forward-line 1)
645 (setq beg (point)) 663 (setq beg (point))
646 (search-backward "\n\^_") 664 (or (search-backward "\n\^_" nil 'move)
665 (looking-at "\^_")
666 (signal 'search-failed (list "\n\^_")))
647 (search-forward "Node: ") 667 (search-forward "Node: ")
648 (setq nodename (Info-following-node-name)) 668 (setq nodename (Info-following-node-name))
649 (search-forward "\n\^_" nil 'move) 669 (search-forward "\n\^_" nil 'move)
@@ -682,7 +702,7 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
682 (let ((nodename (car (car nodes)))) 702 (let ((nodename (car (car nodes))))
683 (goto-char (point-min)) 703 (goto-char (point-min))
684 ;; Find the like-named node in the main buffer. 704 ;; Find the like-named node in the main buffer.
685 (if (re-search-forward (concat "\n\^_.*\n.*Node: " 705 (if (re-search-forward (concat "^\^_.*\n.*Node: "
686 (regexp-quote nodename) 706 (regexp-quote nodename)
687 "[,\n\t]") 707 "[,\n\t]")
688 nil t) 708 nil t)
@@ -719,7 +739,8 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
719 (save-excursion 739 (save-excursion
720 (set-buffer (marker-buffer Info-tag-table-marker)) 740 (set-buffer (marker-buffer Info-tag-table-marker))
721 (goto-char (point-min)) 741 (goto-char (point-min))
722 (search-forward "\n\^_") 742 (or (looking-at "\^_")
743 (search-forward "\n\^_"))
723 (forward-line 2) 744 (forward-line 2)
724 (catch 'foo 745 (catch 'foo
725 (while (not (looking-at "\^_")) 746 (while (not (looking-at "\^_"))
@@ -750,7 +771,9 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
750 (set-buffer-modified-p nil) 771 (set-buffer-modified-p nil)
751 (setq Info-current-subfile lastfilename))) 772 (setq Info-current-subfile lastfilename)))
752 (goto-char (point-min)) 773 (goto-char (point-min))
753 (search-forward "\n\^_") 774 (if (looking-at "\^_")
775 (forward-char 1)
776 (search-forward "\n\^_"))
754 (if (numberp nodepos) 777 (if (numberp nodepos)
755 (+ (- nodepos lastfilepos) (point))))) 778 (+ (- nodepos lastfilepos) (point)))))
756 779
@@ -760,8 +783,11 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
760 (let ((case-fold-search t)) 783 (let ((case-fold-search t))
761 (save-excursion 784 (save-excursion
762 ;; Find beginning of node. 785 ;; Find beginning of node.
763 (search-backward "\n\^_") 786 (if (search-backward "\n\^_" nil 'move)
764 (forward-line 2) 787 (forward-line 2)
788 (if (looking-at "\^_")
789 (forward-line 1)
790 (signal 'search-failed (list "\n\^_"))))
765 ;; Get nodename spelled as it is in the node. 791 ;; Get nodename spelled as it is in the node.
766 (re-search-forward "Node:[ \t]*") 792 (re-search-forward "Node:[ \t]*")
767 (setq Info-current-node 793 (setq Info-current-node
@@ -866,6 +892,15 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
866 compl)))) 892 compl))))
867 (widen) 893 (widen)
868 (goto-char (point-min)) 894 (goto-char (point-min))
895 (if (and (looking-at "\^_")
896 (= (forward-line 1) 0))
897 (let ((beg (point)))
898 (forward-line 1)
899 (if (re-search-backward "Node: *\\([^,\n]*\\) *[,\n\t]"
900 beg t)
901 (setq compl
902 (list (buffer-substring (match-beginning 1)
903 (match-end 1)))))))
869 (while (search-forward "\n\^_" nil t) 904 (while (search-forward "\n\^_" nil t)
870 (forward-line 1) 905 (forward-line 1)
871 (let ((beg (point))) 906 (let ((beg (point)))