FelipeLema / emacs-counsel-gtags

GNU Global with ivy completion
22 stars 5 forks source link

global:invalid regular expression. #10

Open yunyanan opened 4 years ago

yunyanan commented 4 years ago

Hi, about ten days ago, my gtags can't be used normally, when I use counsel-gtags-find-definition and counsel-gtags-find-reference commands, emacs will give me an error message: global:invalid regular expression.

some version information :

OS: Ubuntu 1604 Emacs version: 26.2 Global version: 6.6 My emacs config:

(use-package counsel-gtags :ensure t :init (add-hook 'c-mode-hook 'counsel-gtags-mode) (add-hook 'after-save-hook 'counsel-gtags-update-tags) :bind (:map counsel-gtags-mode-map ("M-t" . counsel-gtags-find-definition) ("M-r" . counsel-gtags-find-reference) ("M-s" . counsel-gtags-find-symbol) ("M-," . counsel-gtags-go-backward)))


I've tried to reinstall global and counsel-gtags to address the problem,but I failed. I've noticed that counsel-gtags have been updated recently,so I'm guessing if it's because of the gtags update. When I rolled back the gtags version to 5df12da 29 days ago, the problem went away, but I don't know why?

FelipeLema commented 4 years ago

ah, it looks like https://github.com/FelipeLema/emacs-counsel-gtags/commit/1df9b2ee9b6d3773ce1c45c94cb3225606de246b did the trick.

can you run unit tests by yourself? stand on the root of this package and run make test. Paste the output here so we can take a look at it.

yunyanan commented 4 years ago

1df9b2e


Emmmm, counsel is installed in my emacs, I don't quite understand the error

FelipeLema commented 4 years ago

It's using straight.el to booststrap necessary packages.

The other thing you can do is open test/unit-tests.el, M-x eval-buffer and M-x ert to run all tests manually.

a1406 commented 4 years ago

I found the same error. image image

And I tried to run the test, almost all the test passed. two tramp test failed image

a1406 commented 4 years ago

And in this project, there are many "main" functions. image

FelipeLema commented 4 years ago

a-ha... I can sniff that ag or your favorite grep program is printing special terminal characters (for coloring the terminal). This may pinpoint to the problem.

what's the value of your grep-program?

a1406 commented 4 years ago

grep-program is grep And after a lot of test, I can avoid this error now. After delete (eshell) in (add-hook 'after-init-hook , My emacs works well with counsel-gtags now. BTW, is global-tags.el released ? Why not add it to the melpa?

a1406 commented 4 years ago

BTW, when I use the global-tags.el . when I use xref-find-references, some symbol works well, but some symbol not. The error message is eieio--validate-slot-value: Invalid slot type: xref-file-location, file, string, nil But if I use counsel-gtags-find-reference, they all works well.

FelipeLema commented 4 years ago

@a1406 glad to hear you got it working all right.

global-tags.el is currently being added to melpa, see https://github.com/melpa/melpa/pull/6442

You can file a bug report to global-tags.el for the error you mention here. If you do so, please add the stacktrace (by running toggle-debug-on-error before).

not closing, though, hope @MarthaDora will answer back

a1406 commented 4 years ago

Thank you. I reported the global-tags.el bug with a stacktrace screenshot.

Ergus commented 3 years ago

II think this is fixed too, please confirm