X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fetags.el;h=56fc4782d1835cff3eabec376f580b2ce033a530;hb=42706302f44eb0322cea3e0655654d03e9e2e07e;hp=3414298049084062139cff11d0c79e480885b5cd;hpb=716cfba952c1dc0d2cf5c968971f3780ba728a89;p=chise%2Fxemacs-chise.git- diff --git a/lisp/etags.el b/lisp/etags.el index 3414298..56fc478 100644 --- a/lisp/etags.el +++ b/lisp/etags.el @@ -190,9 +190,12 @@ the current buffer." (when (file-readable-p parent-tag-file) (push parent-tag-file result))) ;; tag-table-alist - (let ((key (or buffer-file-name - (concat default-directory (buffer-name)))) - expression) + (let* ((key (or buffer-file-name + (concat default-directory (buffer-name)))) + (key (if (eq system-type 'windows-nt) + (replace-in-string key "\\\\" "/") + key)) + expression) (dolist (item tag-table-alist) (setq expression (car item)) ;; If the car of the alist item is a string, apply it as a regexp @@ -405,7 +408,7 @@ File name returned is relative to tag table file's directory." (defun buffer-tag-table-files () "Returns a list of all files referenced by all TAGS tables that this buffer uses." - (apply #'nconc + (apply #'append (mapcar #'tag-table-files (buffer-tag-table-list)))) @@ -502,6 +505,7 @@ this buffer uses." ((string-match "\\.scm\\'" filename) 'scheme-mode) (t nil))) + (defvar c-mode-syntax-table) (set-syntax-table (cond ((and (eq file-type 'c-mode) c-mode-syntax-table) c-mode-syntax-table) @@ -638,7 +642,7 @@ If it returns non-nil, this file needs processing by evalling (t (setq tag-table-currently-matching-exact t))) ;; \_ in the tagname is used to indicate a symbol boundary. - (setq exact-tagname (concat "\\_" tagname "\\_")) + (setq exact-tagname (format "\C-?\\_%s\\_\C-a\\|\\_%s\\_" tagname tagname)) (while (string-match "\\\\_" exact-tagname) (aset exact-tagname (1- (match-end 0)) ?b)) (save-excursion @@ -671,7 +675,9 @@ If it returns non-nil, this file needs processing by evalling ;; tag searches? (while (re-search-forward tag-target nil t) (and (save-match-data - (looking-at "[^\n\C-?]*\C-?")) + (save-excursion + (goto-char (match-beginning 0)) + (looking-at "[^\n\C-?]*\C-?"))) ;; If we're looking for inexact matches, skip ;; exact matches since we've visited them ;; already. @@ -690,6 +696,7 @@ If it returns non-nil, this file needs processing by evalling (if next "more " "") (if exact "matching" "containing") tagname)) + (beginning-of-line) (search-forward "\C-?") (setq file (expand-file-name (file-of-tag) ;; In XEmacs, this needs to be @@ -732,6 +739,16 @@ If it returns non-nil, this file needs processing by evalling (cons buf startpos)))) ;;;###autoload +(defun find-tag-at-point (tagname &optional other-window) + "*Find tag whose name contains TAGNAME. +Identical to `find-tag' but does not prompt for tag when called interactively; +instead, uses tag around or before point." + (interactive (if current-prefix-arg + '(nil nil) + (list (find-tag-default) nil))) + (find-tag tagname other-window)) + +;;;###autoload (defun find-tag (tagname &optional other-window) "*Find tag whose name contains TAGNAME. Selects the buffer that the tag is contained in @@ -768,7 +785,7 @@ Variables of note: '(find-tag find-tag-other-window tags-loop-continue)))) (push-tag-mark)) (if other-window - (pop-to-buffer tag-buf) + (pop-to-buffer tag-buf t) (switch-to-buffer tag-buf)) (widen) (push-mark) @@ -784,7 +801,7 @@ Variables of note: ;;;###autoload (defun find-tag-other-window (tagname &optional next) - "*Find tag whose name contains TAGNAME. + "*Find tag whose name contains TAGNAME, in another window. Selects the buffer that the tag is contained in in another window and puts point at its definition. If TAGNAME is a null string, the expression in the buffer