help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Possible etags-table.el BUG. Can anyone approve?


From: Oleksandr Gavenko
Subject: Possible etags-table.el BUG. Can anyone approve?
Date: Tue, 25 Jan 2011 19:15:18 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7

I download http://www.emacswiki.org/emacs/etags-table.el ,
load and set

(setq etags-table-alist
      (list
'(".*\\.[ch]" "c:/Program Files/Microsoft SDKs/Windows/v6.1/include/TAGS") '(".*\\.cpp" "c:/Program Files/Microsoft SDKs/Windows/v6.1/include/TAGS")
       ))

and got error in *.cpp files when try visit file by M-. :

ad-Orig-visit-tags-table-buffer: File c:/Program Files/Microsoft SDKs/Windows/v6.1/Include/TAGSpp is not a valid tags table

I will contact with author but little more later.

After debug I found from which place it come:

  'etags-table-build-table-list'  function.

This peace of code look strange for me and original place of error:

;; Go through mapping alist
(mapc (lambda (mapping)
        (let ((key (car mapping))
              (tag-files (cdr mapping)))
          (when (string-match key filename)
            (mapc (lambda (tag-file)
(add-to-list 'tables (file-truename (replace-match tag-file t nil filename)) t))
                  tag-files))))
      etags-table-alist)

I don't understand why code contain:

  (replace-match tag-file t nil filename)

For me this code must be rewritten to:

(mapc (lambda (mapping)
        (let ((key (car mapping))
              (tag-files (cdr mapping)))
          (when (string-match key filename)
(setq tables (append tables (mapcar 'file-truename tag-files))))))
      etags-table-alist)

Originally author in 'etags-table-alist' docs write $ at the end of regex
so if I rewrite regex all work OK. But why do replace-match????




reply via email to

[Prev in Thread] Current Thread [Next in Thread]