diff options
| author | Eric S. Raymond | 1991-12-08 09:58:46 +0000 |
|---|---|---|
| committer | Eric S. Raymond | 1991-12-08 09:58:46 +0000 |
| commit | e15bee3f9698fa643407510aba7057be3204acc2 (patch) | |
| tree | 82231141d782616ef4ac2cb33e727a2d93ebc338 | |
| parent | d940e0e442093af6b22d46b4db3675c73add7e11 (diff) | |
| download | emacs-e15bee3f9698fa643407510aba7057be3204acc2.tar.gz emacs-e15bee3f9698fa643407510aba7057be3204acc2.zip | |
*** empty log message ***
| -rw-r--r-- | lisp/progmodes/etags.el | 43 |
1 files changed, 4 insertions, 39 deletions
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index cdad48a4701..705a688c574 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el | |||
| @@ -151,46 +151,11 @@ See documentation of variable tags-file-name." | |||
| 151 | (interactive (if current-prefix-arg | 151 | (interactive (if current-prefix-arg |
| 152 | '(nil t) | 152 | '(nil t) |
| 153 | (find-tag-tag "Find tag: "))) | 153 | (find-tag-tag "Find tag: "))) |
| 154 | (let (buffer file linebeg startpos) | 154 | (let ((tagbuf (find-tag-noselect tagname nil next))) |
| 155 | (save-excursion | ||
| 156 | (visit-tags-table-buffer) | ||
| 157 | (if (not next) | ||
| 158 | (goto-char (point-min)) | ||
| 159 | (setq tagname last-tag)) | ||
| 160 | (setq last-tag tagname) | ||
| 161 | (while (progn | ||
| 162 | (if (not (search-forward tagname nil t)) | ||
| 163 | (error "No %sentries containing %s" | ||
| 164 | (if next "more " "") tagname)) | ||
| 165 | (not (looking-at "[^\n\177]*\177")))) | ||
| 166 | (search-forward "\177") | ||
| 167 | (setq file (expand-file-name (file-of-tag) | ||
| 168 | (file-name-directory tags-file-name))) | ||
| 169 | (setq linebeg | ||
| 170 | (buffer-substring (1- (point)) | ||
| 171 | (save-excursion (beginning-of-line) (point)))) | ||
| 172 | (search-forward ",") | ||
| 173 | (setq startpos (read (current-buffer)))) | ||
| 174 | (if other-window | 155 | (if other-window |
| 175 | (find-file-other-window file) | 156 | (switch-to-buffer-other-window tagbuf) |
| 176 | (find-file file)) | 157 | (switch-to-buffer tagbuf)) |
| 177 | (widen) | 158 | ) |
| 178 | (push-mark) | ||
| 179 | (let ((offset 1000) | ||
| 180 | found | ||
| 181 | (pat (concat "^" (regexp-quote linebeg)))) | ||
| 182 | (or startpos (setq startpos (point-min))) | ||
| 183 | (while (and (not found) | ||
| 184 | (progn | ||
| 185 | (goto-char (- startpos offset)) | ||
| 186 | (not (bobp)))) | ||
| 187 | (setq found | ||
| 188 | (re-search-forward pat (+ startpos offset) t)) | ||
| 189 | (setq offset (* 3 offset))) | ||
| 190 | (or found | ||
| 191 | (re-search-forward pat nil t) | ||
| 192 | (error "%s not found in %s" pat file))) | ||
| 193 | (beginning-of-line)) | ||
| 194 | (setq tags-loop-form '(find-tag nil t)) | 159 | (setq tags-loop-form '(find-tag nil t)) |
| 195 | ;; Return t in case used as the tags-loop-form. | 160 | ;; Return t in case used as the tags-loop-form. |
| 196 | t) | 161 | t) |