Function: etags-regen-mode

etags-regen-mode is an autoloaded, interactive and byte-compiled function defined in etags-regen.el.gz.

Signature

(etags-regen-mode &optional ARG)

Documentation

Minor mode to automatically generate and update tags tables.

This minor mode generates the tags table automatically based on the current project configuration, and later updates it as you edit the files and save the changes.

If you select a tags table manually (for example, using M-x visit-tags-table (visit-tags-table)), then this mode will be effectively disabled for the entire session. Use M-x tags-reset-tags-tables (tags-reset-tags-tables) to countermand the effect of a previous M-x visit-tags-table (visit-tags-table).

This is a global minor mode. If called interactively, toggle the Etags-Regen mode mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode.

If called from Lisp, toggle the mode if ARG is toggle. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number.

To check whether the minor mode is enabled in the current buffer, evaluate (default-value \=etags-regen-mode)'.

The mode's hook is called both when the mode is enabled and when it is disabled.

View in manual

Probably introduced at or before Emacs version 30.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/etags-regen.el.gz
;;;###autoload
(define-minor-mode etags-regen-mode
  "Minor mode to automatically generate and update tags tables.

This minor mode generates the tags table automatically based on
the current project configuration, and later updates it as you
edit the files and save the changes.

If you select a tags table manually (for example, using
\\[visit-tags-table]), then this mode will be effectively
disabled for the entire session.  Use \\[tags-reset-tags-tables]
to countermand the effect of a previous \\[visit-tags-table]."
  :global t
  (if etags-regen-mode
      (progn
        (advice-add 'etags--xref-backend :before
                    #'etags-regen--maybe-generate)
        (advice-add 'tags-completion-at-point-function :before
                    #'etags-regen--maybe-generate))
    (advice-remove 'etags--xref-backend #'etags-regen--maybe-generate)
    (advice-remove 'tags-completion-at-point-function #'etags-regen--maybe-generate)
    (etags-regen--tags-cleanup)))