 
 (defun ectags-scan-external ()
   "Search the `ectags--file-name' for the `ectags--regexp'.
-
 Calls `ectags-match' for each line that matches."
   ;; vlf-re-search-forward - too slow
   ;; binary search - too slow and the tags file has to be sorted

    (when (string= tagname "")
      (setq tagname (find-tag-default)))
    (ectags-find tagname)))

;; (defun c-eldoc-scope ()
;;   "Try to figure out our scope."
;;   (save-excursion
;;     (c-end-of-defun)
;;     (c-beginning-of-defun-1)
;;     (forward-line -1)
;;     (c-syntactic-re-search-forward "::")
;;     (backward-char 2)
;;     (when (c-on-identifier)
;;       (let* ((id-end (point))
;;              (id-start (progn (backward-char 1) (c-beginning-of-current-token) (point))))
;;         (buffer-substring-no-properties id-start id-end)))))

(defun ectags-current-symbol (&optional limit)
  "Finds the current function and position in argument list."

(defvar ectags--fn-name nil
  "Holds the current function name (from where the tag search was initiated).")

(defun ectags--verify-tags-file (file)
  "Validate that the FILE is a valid ctags table."
  (string-prefix-p
   "!_TAG_FILE_FORMAT"
   (shell-command-to-string (format "head -n1 %s" file))))

(defun ectags-visit-tags-table (&optional force)
  "Visit an exuberant ctags file and add it to the current list of tags tables.
If FORCE is not nill, it will force the directory rescan and file checking."
  (when (or (not ectags--file-name) force)
    (let* ((tags-file-dir (locate-dominating-file default-directory "tags"))
           (tags-file-path (expand-file-name "tags" tags-file-dir)))
      (if (not tags-file-dir)
          (setq ectags--file-name nil)
        (if (ectags--verify-tags-file tags-file-path)
            (setq ectags--file-name tags-file-path)
          (message "File %s is not a valid tags file!" tags-file-path)
          (setq ectags--file-name nil))))))

(defun ectags-match-tagname (tag-match)
  "Return the tag name from the TAG-MATCH."
