comparison lisp/progmodes/etags.el @ 55715:7c48b959658d

(etags-tags-completion-table): Show parsing progress.
author Masatake YAMATO <jet@gyve.org>
date Fri, 21 May 2004 08:36:46 +0000
parents 7b91de4a810f
children 8699eccc1a33 4c90ffeb71c5
comparison
equal deleted inserted replaced
55714:7b91de4a810f 55715:7c48b959658d
1246 (expand-file-name str 1246 (expand-file-name str
1247 (file-truename default-directory)))))) 1247 (file-truename default-directory))))))
1248 1248
1249 1249
1250 (defun etags-tags-completion-table () 1250 (defun etags-tags-completion-table ()
1251 (let ((table (make-vector 511 0))) 1251 (let ((table (make-vector 511 0))
1252 (point-max (/ (float (point-max)) 100.0))
1253 (msg-fmt (format
1254 "Making tags completion table for %s...%%d%%%%"
1255 buffer-file-name)))
1252 (save-excursion 1256 (save-excursion
1253 (goto-char (point-min)) 1257 (goto-char (point-min))
1254 ;; This monster regexp matches an etags tag line. 1258 ;; This monster regexp matches an etags tag line.
1255 ;; \1 is the string to match; 1259 ;; \1 is the string to match;
1256 ;; \2 is not interesting; 1260 ;; \2 is not interesting;
1262 (while (re-search-forward 1266 (while (re-search-forward
1263 "^\\(\\([^\177]+[^-a-zA-Z0-9_+*$:\177]+\\)?\ 1267 "^\\(\\([^\177]+[^-a-zA-Z0-9_+*$:\177]+\\)?\
1264 \\([-a-zA-Z0-9_+*$?:]+\\)[^-a-zA-Z0-9_+*$?:\177]*\\)\177\ 1268 \\([-a-zA-Z0-9_+*$?:]+\\)[^-a-zA-Z0-9_+*$?:\177]*\\)\177\
1265 \\(\\([^\n\001]+\\)\001\\)?\\([0-9]+\\)?,\\([0-9]+\\)?\n" 1269 \\(\\([^\n\001]+\\)\001\\)?\\([0-9]+\\)?,\\([0-9]+\\)?\n"
1266 nil t) 1270 nil t)
1267 (intern (if (match-beginning 5) 1271 (intern (prog1 (if (match-beginning 5)
1268 ;; There is an explicit tag name. 1272 ;; There is an explicit tag name.
1269 (buffer-substring (match-beginning 5) (match-end 5)) 1273 (buffer-substring (match-beginning 5) (match-end 5))
1270 ;; No explicit tag name. Best guess. 1274 ;; No explicit tag name. Best guess.
1271 (buffer-substring (match-beginning 3) (match-end 3))) 1275 (buffer-substring (match-beginning 3) (match-end 3)))
1276 (message msg-fmt (/ (point) point-max)))
1272 table))) 1277 table)))
1273 table)) 1278 table))
1274 1279
1275 (defun etags-snarf-tag (&optional use-explicit) 1280 (defun etags-snarf-tag (&optional use-explicit)
1276 (let (tag-text line startpos explicit-start) 1281 (let (tag-text line startpos explicit-start)