Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tags get generated to a .TAGS dotfile to then replace TAGS via hardlinks #389

Closed

Conversation

psprint
Copy link
Contributor

@psprint psprint commented Oct 1, 2022

Basically:

ctags … -f .TAGS
ln -f .TAGS TAGS
rm -f .TAGS

for lowest possible inconsistency time when regenerating index.

Also, pass -G option to universal-ctags, so that shell files without .zsh extension get recognized by file constents (hashbangs and vim/emacs modelines). Also fixed modeline in zi-browse-symbol because it wasn't recognized.

Motivation and Context

When an editor reloads the file when its timestamp changes it might read incomplete contents. The hardlink way should be best possible (however it probably does the same what mv -f .TAGS TAGS does, but it's good to be as much explicit as possible).

Related Issue(s)

Usage examples

# Establish auto make every 5 seconds with `zservices/make-server`
zinit lucid service'make' param'MSERV_CONF_DIRS→~/github/zinit;
         MSERV_CONF_INTERVAL→5;MSERV_ARGS→tags-emacs' \
            for zservices/make-server

To then browse tags with Ctrl-k (or Alt-Shift-q after #387).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

…nks:

Basically:
ctags … -f .TAGS
ln -f .TAGS TAGS
rm -f .TAGS

for lowest possible inconsistency time when regenerating index.

Also, pass -G option to ctags, so that shell files without .zsh
extension get recognized by file constents (hashbangs and vim/emacs
modelines). It appears that it's the `--alias-zsh=+sh` and Emacs
`mode: sh` matching makes the non .zsh extension files properly
recognized and parsed.
@psprint psprint force-pushed the tags-robustness-via-hardlink branch from f1977e1 to 5d3165f Compare October 7, 2022 14:22
@github-actions github-actions bot added the docs label Dec 24, 2022
@psprint
Copy link
Contributor Author

psprint commented Dec 24, 2022

It's a documentation for the feature of browsing Ctags index and ln -f A B ; rm -f A robustness trick, safe to merge. It'l publish the extra feature of TAGS browser. Could it be merged, @vladdoster ?

@psprint
Copy link
Contributor Author

psprint commented Dec 24, 2022

Closed because overlaps #402,

@psprint psprint closed this Dec 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant