Closed lynnux closed 2 years ago
like this gif:
And I tested if correctly set
DIR
arg, read-file-name
will work as expected.
A few thoughts:
C-x C-e at this code end, after select tag, this will get the file path of citre-ctags.el, not the tag path
I guess you did this in citre-ctags.el
? This would make citre
the current project.
I select yes, the whole file content is replaced by the tag content generate by ctags, it's a disaster!
Sounds like your minibuffer completion tool (ivy, selectrum, etc) made your current file the default tag file, and citre then overwrote the file.
To validate these points, I suggest:
emacs -Q
and load only citre).M-:
):
(citre-tags-file-path)
--> unexpected result indicates a bug in citre.(read-file-name "Tags file: " (citre-tags-file-path))
--> unexpected result indicates a bug in emacs.Hope it helps.
With emacs -Q
and loaded citre, without any completion tool, in citre-update-tags-file
:
(citre-tags-file-path)
--> get correct tag pathcitre-ctags.el
, not the tag path.But if set DIR
to nil, will get corect result.
Thanks a lot for the report and investigation @lynnux @chen-chao ! This should be fixed, please test.
I could confirm the bug. I think this usage works well in Emacs 27 but not Emacs 28. I've recently updated to Emacs 28 and have not tagging any new project since then. Maybe that's why I haven't notice it.
Emacs 29.0.50, win10 64. When I open one file in project, and M-x
citre-update-tags-file
, it will prompt me to select the tag file, and then tip mexxx doesn't contain recipe for updating. Edit its recipe?
, and I select yes, the whole file content is replaced by the tag content generate by ctags, it's a disaster! And I find the code has bug incitre-update-tags-file
:(read-file-name "Tags file: "(citre-tags-file-path))
C-x C-e at this code end, after select tag, this will get the file path ofcitre-ctags.el
, not the tag path, causethe
DIR
should not be the file path. The other place useread-file-name
some are right, some are wrong. I don't know whether it's a bug in Emacs 29.0.50 or not.