unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Morgan Willcock <morgan@ice9.digital>
To: emacs-devel@gnu.org
Cc: Dmitry Gutov <dgutov@yandex.ru>
Subject: Setup process for etags-regen-mode (Emacs 30.0.91 feedback)
Date: Fri, 20 Sep 2024 19:14:09 +0100	[thread overview]
Message-ID: <878qvm42ha.fsf@ice9.digital> (raw)

When testing etags-regen-mode in the Emacs 30 pre-release I've found it
to be working well for my use-case, but one thing which appears to be
missing is an easy way for additional completion functions to opt-in to
the etags-regen-mode setup process.

Currently the completion functions which get advice added to them (to
call etags-regen--maybe-generate) are hard coded in the mode definition:

  (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))

I was looking for a stable entry point to opt-in to using it, rather
than having to do something like this:

  (advice-add 'my-completion-function-which-does-things-with-tags :before
              #'etags-regen--maybe-generate)

(Where the "--" in the function name is a sign that I probably shouldn't
be doing that.)

I wasn't sure whether it was intentional to hard-code the functions to
advise while etags-regen-mode was still so new, or whether opting in
other functions hadn't been considered.

Would it be possible to store the completion functions which will be
advised as a separate list, so that other packages can add completion
functions to that list and get the TAGS generation to trigger?  Or is
this an intentional boundary?

Thanks,
Morgan

-- 
Morgan Willcock



             reply	other threads:[~2024-09-20 18:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-20 18:14 Morgan Willcock [this message]
2024-09-23 17:17 ` Setup process for etags-regen-mode (Emacs 30.0.91 feedback) Dmitry Gutov
2024-09-23 19:03   ` Morgan Willcock

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878qvm42ha.fsf@ice9.digital \
    --to=morgan@ice9.digital \
    --cc=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).