universal-ctags / citre

A superior code reading & auto-completion tool with pluggable backends.
GNU General Public License v3.0
326 stars 26 forks source link

citre conflicts with tramp #77

Closed e665107 closed 3 years ago

e665107 commented 3 years ago

When i use tramp in the dired mode, press the 'v' to open a file, it will be stopped, my friend, you can have a try. eg: Tramp: Inserting ‘/ssh:root@192.168.100.140:/root/gmssl/gmssl/GmSSL-master/apps/asn1pars.c’...done

My config code as follow: (use-package citre :defer t :init (require 'citre-config) (defun prog-mode-citre-bindings() (local-set-key (kbd "C-c j") 'citre-jump) (local-set-key (kbd "C-c l") 'citre-jump-back) (local-set-key (kbd "C-SPC o") 'citre-peek) (local-set-key (kbd "C-c i") 'custom-citre-completion-at-point) ) (defun prog-mode-citre-c-bindings() (local-set-key (kbd "C-SPC o") 'citre-peek) (local-set-key (kbd "C-SPC i") 'citre-peek-through) (local-set-key (kbd "C-SPC f") 'citre-peek-chain-forward) (local-set-key (kbd "C-SPC j") 'citre-peek-chain-backward) (local-set-key (kbd "C-SPC p") 'citre-peek-next-definition) (local-set-key (kbd "C-SPC n") 'citre-peek-prev-definition) (local-set-key (kbd "C-c i") 'custom-citre-completion-at-point) ) (add-hook 'verilog-mode-hook 'prog-mode-citre-bindings) (add-hook 'c-mode-hook 'prog-mode-citre-c-bindings) (setq ;; Set these if readtags/ctags is not in your path. ;; citre-readtags-program "/path/to/readtags" ;; citre-ctags-program "/path/to/ctags" ;; Set this if you use project management plugin like projectile. It's ;; used for things like displaying paths relatively, see its docstring. citre-project-root-function #'projectile-project-root ;; Set this if you want to always use one location to create a tags file. citre-default-create-tags-file-location 'global-cache ;; See the "Create tags file" section above to know these options citre-use-project-root-when-creating-tags t citre-prompt-language-for-ctags-command t) ) Please give a advice on this problem! Thank you!

masatake commented 3 years ago

How large the tags file is?

e665107 commented 3 years ago

No tags file in the current directory!

e665107 commented 3 years ago

You can install the tramp, and have a try!

AmaiKinono commented 3 years ago

Hi.

First, I don't have a remote machine to work with, so I opened files on my own machine (by /sshx:localhost:/path/to/file).

I intentionally picked directories that don't contain a tags file. Unfortunately I can't reproduce the bug. The file just opens smoothly.

For now I can only guess the reason:

  1. I don't use projectile. Maybe it's because projectile spending too much time finding the project root.
  2. Maybe it's because Citre spending too much time finding a tags file for the file you've opened. You can remove :defer t and (require 'citre-config) in your config, and give it another try.

I also suggest you try to reproduce it using $ emacs -Q (and follow the instructions in README to manually load Citre). Sometimes it's not the package you suspect that causes the problems.

e665107 commented 3 years ago

Yes, When i comment the :defert and (require 'citre-config), it works well! I think this issue has been sovled!Thanks a lot,friend!

AmaiKinono commented 3 years ago

I think this issue has been sovled

No. This line:

(add-hook 'find-file-hook #'citre-auto-enable-citre-mode)

in citre-config.el causes the problem. If you remove (require 'citre-config), then citre-mode won't be automatically enabled when a tags file could be found.

First, I still suspect it's projectile's problem. If you open the file that has the problem, then eval (projectile-project-root), how is the speed?

If it's fast, then it's Citre's problem. If you are interested in the problem, I'd like you to do a little more tests:

e665107 commented 3 years ago

It works well now,after the .tags has been generated, the citre-jump and citre-peek can be exectued as usual! But after question comes: Error in post-command-hook (citre-peek--update-display): (void-variable start), when i use the citre-peek mode, but citre-jump is ok!

AmaiKinono commented 3 years ago

Let's focus on one problem in one issue.

For the original problem: if you are still interested in it, please, do the test I described. but it's ok if you think it's solved, then please close this issue.

For the citre-peek problem: I can't understand why this happens, but you can open a new issue for it. Open debug-on-error (by M-x toggle-debug-on-error. After you've encounterd the problem, eval (citre-peek--update-display) and paste the backtrace there.