Closed Liorst4 closed 3 months ago
Hi @Liorst4:
Very thanks for the detailed report. Certainly this command was something I have never tried before. But following your steps I could reproduce the issue and got this backtrace:
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
(project--read-file-cpd-relative "Find file" nil nil file-name-history #("/" 0 1 (face font-lock-comment-delimiter-face c-in-sws t c-is-sws t fontified t)))
(project--read-file-name (:gtagsroot "/home/ergus/algorithms" :cache nil) "Find file" nil nil file-name-history #("/" 0 1 (face font-lock-comment-delimiter-face c-in-sws t c-is-sws t fontified t)))
(project-find-file-in #("/" 0 1 (face font-lock-comment-delimiter-face c-in-sws t c-is-sws t fontified t)) ("/home/ergus/algorithms") (:gtagsroot "/home/ergus/algorithms/algorithms" :cache nil) nil)
(project-find-file nil)
(funcall-interactively project-find-file nil)
(project-switch-project "~/algorithms/")
(funcall-interactively project-switch-project "~/algorithms/")
(call-interactively project-switch-project record nil)
(command-execute project-switch-project record)
(execute-extended-command nil "project-switch-project" nil)
(funcall-interactively execute-extended-command nil "project-switch-project" nil)
(call-interactively execute-extended-command nil nil)
(command-execute execute-extended-command)
I will attempt to fix it when I have some time.
Please test it now, thanks
Please test it now, thanks
Updated to version 1.1 from the gnu elpa, works perfectly, thanks :)
Steps to reproduce:
project-switch-project
) into a non gtags project (vc Git
project for example)project-switch-project
and pressingf
After the error occurs, switching to the
*Messages*
buffer reveals a "GTAGS not found" error message. I believe the issue comes from calling theglobal
executable not in the project directory.When calling
project-switch-project
and choosing thef
option it callsproject-find-file-in
https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/progmodes/project.el?h=emacs-29.1#n1731 https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/progmodes/project.el?h=emacs-29.1#n1084This calls to the override of
project-files
, which executesglobal --path-style=through --path
https://github.com/Ergus/gtags-mode/blob/681f210eeedb11234ceea206509185051ea0a5c0/gtags-mode.el#L314C15-L326If I'm correct, setting
default-directory
with alet
to(project-root)
before executing could fix the issue.