Mercurial > emacs
comparison lisp/informat.el @ 10154:a864b7f97b56
(Info-tagify): Avoid 1-off error in position of a tag.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 13 Dec 1994 18:53:37 +0000 |
parents | 36ec0bfbb2c2 |
children | baf3b68f7e56 |
comparison
equal
deleted
inserted
replaced
10153:2279074cd821 | 10154:a864b7f97b56 |
---|---|
46 (message "Cannot tagify split info file") | 46 (message "Cannot tagify split info file") |
47 (let ((regexp "Node:[ \t]*\\([^,\n\t]*\\)[,\t\n]") | 47 (let ((regexp "Node:[ \t]*\\([^,\n\t]*\\)[,\t\n]") |
48 (case-fold-search t) | 48 (case-fold-search t) |
49 list) | 49 list) |
50 (while (search-forward "\n\^_" nil t) | 50 (while (search-forward "\n\^_" nil t) |
51 (forward-line 1) | 51 ;; We want the 0-origin character position of the ^_. |
52 (let ((beg (point))) | 52 ;; That is the same as the Emacs (1-origin) position |
53 (forward-line 1) | 53 ;; of the newline before it. |
54 (let ((beg (match-beginning 0))) | |
55 (forward-line 2) | |
54 (if (re-search-backward regexp beg t) | 56 (if (re-search-backward regexp beg t) |
55 (setq list | 57 (setq list |
56 (cons (list (buffer-substring | 58 (cons (list (buffer-substring |
57 (match-beginning 1) | 59 (match-beginning 1) |
58 (match-end 1)) | 60 (match-end 1)) |