Skip to content

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

Closed
psprint wants to merge 3 commits into
zdharma-continuum:mainfrom
psprint:tags-robustness-via-hardlink
Closed

Tags get generated to a .TAGS dotfile to then replace TAGS via hardlinks#389
psprint wants to merge 3 commits into
zdharma-continuum:mainfrom
psprint:tags-robustness-via-hardlink

Conversation

@psprint

@psprint psprint commented Oct 1, 2022

Copy link
Copy Markdown
Contributor

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

psprint commented Dec 24, 2022

Copy link
Copy Markdown
Contributor Author

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

psprint commented Dec 24, 2022

Copy link
Copy Markdown
Contributor Author

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