comparison lisp/progmodes/etags.el @ 43881:e9654452ad5e

* progmodes/etags.el (tag-exact-file-name-match-p) (tag-file-name-match-p, tag-partial-file-name-match-p): Use a simpler regexp.
author Francesco Potortì <pot@gnu.org>
date Wed, 13 Mar 2002 14:48:00 +0000
parents 815a7e661d37
children 43143e459aae
comparison
equal deleted inserted replaced
43880:054519242c8b 43881:e9654452ad5e
1504 (looking-at "\\b")))) 1504 (looking-at "\\b"))))
1505 1505
1506 ;; exact file name match, i.e. searched tag must match complete file 1506 ;; exact file name match, i.e. searched tag must match complete file
1507 ;; name including directories parts if there are some. 1507 ;; name including directories parts if there are some.
1508 (defun tag-exact-file-name-match-p (tag) 1508 (defun tag-exact-file-name-match-p (tag)
1509 (and (looking-at ",[0-9]\\|\n") 1509 (and (looking-at ",[0-9\n]")
1510 (save-excursion (backward-char (+ 2 (length tag))) 1510 (save-excursion (backward-char (+ 2 (length tag)))
1511 (looking-at "\f\n")))) 1511 (looking-at "\f\n"))))
1512 ;; file name match as above, but searched tag must match the file 1512 ;; file name match as above, but searched tag must match the file
1513 ;; name not including the directories if there are some. 1513 ;; name not including the directories if there are some.
1514 (defun tag-file-name-match-p (tag) 1514 (defun tag-file-name-match-p (tag)
1515 (and (looking-at ",[0-9]\\|\n") 1515 (and (looking-at ",[0-9\n]")
1516 (save-excursion (backward-char (1+ (length tag))) 1516 (save-excursion (backward-char (1+ (length tag)))
1517 (looking-at "/")))) 1517 (looking-at "/"))))
1518 ;; this / to detect we are after a directory separator is ok for unix, 1518 ;; this / to detect we are after a directory separator is ok for unix,
1519 ;; is there a variable that contains the regexp for directory separator 1519 ;; is there a variable that contains the regexp for directory separator
1520 ;; on whatever operating system ? 1520 ;; on whatever operating system ?
1521 ;; Looks like ms-win will lose here :). 1521 ;; Looks like ms-win will lose here :).
1522 1522
1523 ;; partial file name match, i.e. searched tag must match a substring 1523 ;; partial file name match, i.e. searched tag must match a substring
1524 ;; of the file name (potentially including a directory separator). 1524 ;; of the file name (potentially including a directory separator).
1525 (defun tag-partial-file-name-match-p (tag) 1525 (defun tag-partial-file-name-match-p (tag)
1526 (and (looking-at ".*,[0-9]\\|\n") 1526 (and (looking-at ".*,[0-9\n]")
1527 (save-excursion (beginning-of-line) 1527 (save-excursion (beginning-of-line)
1528 (backward-char 2) 1528 (backward-char 2)
1529 (looking-at "\f\n")))) 1529 (looking-at "\f\n"))))
1530 1530
1531 ;; t if point is in a tag line with a tag containing TAG as a substring. 1531 ;; t if point is in a tag line with a tag containing TAG as a substring.