diff options
| author | Roland McGrath | 1993-04-01 02:11:02 +0000 |
|---|---|---|
| committer | Roland McGrath | 1993-04-01 02:11:02 +0000 |
| commit | 4a92b718e07fd4f70f7efb5b806b97891f77edf9 (patch) | |
| tree | ffd1e508fb439bde6225815a32abf6ebe60740ea | |
| parent | 77328ee1d334aa0cf2c3ca9990c6fa568d5d02fa (diff) | |
| download | emacs-4a92b718e07fd4f70f7efb5b806b97891f77edf9.tar.gz emacs-4a92b718e07fd4f70f7efb5b806b97891f77edf9.zip | |
(etags-tags-completion-table): Rewritten with a mondo regexp.
| -rw-r--r-- | lisp/progmodes/etags.el | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index b1aae1b2db5..45528ccef8f 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el | |||
| @@ -851,24 +851,24 @@ See documentation of variable `tags-file-name'." | |||
| 851 | (let ((table (make-vector 511 0))) | 851 | (let ((table (make-vector 511 0))) |
| 852 | (save-excursion | 852 | (save-excursion |
| 853 | (goto-char (point-min)) | 853 | (goto-char (point-min)) |
| 854 | (while (search-forward "\177" nil t) | 854 | ;; This monster regexp matches an etags tag line. |
| 855 | ;; Handle multiple \177's on a line. | 855 | ;; \1 is the string to match; |
| 856 | (save-excursion | 856 | ;; \2 is not interesting; |
| 857 | (skip-syntax-backward "w_") | 857 | ;; \3 is the guessed tag name; XXX guess should be better eg DEFUN |
| 858 | (or (bolp) | 858 | ;; \4 is the char to start searching at; |
| 859 | (intern (buffer-substring | 859 | ;; \5 is the line to start searching at; |
| 860 | (point) | 860 | ;; \6 is not interesting; |
| 861 | (progn | 861 | ;; \7 is the explicitly-specified tag name. |
| 862 | (skip-syntax-backward "w_") | 862 | (while (re-search-forward |
| 863 | ;; ??? New | 863 | "^\\(\\(.+[ \t]+\\)?\\([-a-zA-Z0-9_$]+\\)[^-a-zA-Z0-9_$]*\\)\177\ |
| 864 | ;; `::' in the middle of a C++ tag. | 864 | \\([0-9]+\\),\\([0-9]+\\)\\(,\001\\([^\n]+\\)\\)?\n" |
| 865 | (and (= (preceding-char) ?:) | 865 | nil t) |
| 866 | (= (char-after (- (point) 2)) ?:) | 866 | (intern (if (match-beginning 6) |
| 867 | (progn | 867 | ;; There is an explicit tag name. |
| 868 | (backward-char 2) | 868 | (buffer-substring (match-beginning 6) (match-end 6)) |
| 869 | (skip-syntax-backward "w_"))) | 869 | ;; No explicit tag name. Best guess. |
| 870 | (point))) | 870 | (buffer-substring (match-beginning 3) (match-end 3))) |
| 871 | table))))) | 871 | table))) |
| 872 | table)) | 872 | table)) |
| 873 | 873 | ||
| 874 | (defun etags-snarf-tag () | 874 | (defun etags-snarf-tag () |