use-package icon indicating copy to clipboard operation
use-package copied to clipboard

What's the mode hook defined in `helm-bibtex` to conditionally activate it when AUCTeX's `LaTeX-mode` is called?

Open hongyi-zhao opened this issue 1 year ago • 1 comments

I'm using the following configuration for helm-bibtex:

(use-package helm
  :demand t
  :config (require 'helm-autoloads))
(use-package helm-bibtex
  :demand t
  :init
  (setq
   ;;https://github.com/tmalsburg/helm-bibtex#insert-latex-cite-commands
   bibtex-completion-cite-prompt-for-optional-arguments nil)

  :bind-keymap
  ("<menu>" . helm-command-prefix)
  :bind
  (
   :map helm-command-map
   ("b" . helm-bibtex)
   ("B" . helm-bibtex-with-local-bibliography)
   ("n" . helm-bibtex-with-notes)
   ("<menu>" . helm-resume)
   )
  )

The above configuration will always enable the above packages during the starting process of Emacs, but I want to conditionally activate helm-bibtex when AUCTeX's LaTeX-mode is called and enabled.

For this purpose, it seems that the mode hook based method should be used, but I don't know what's the appropriate hooks defined in helm-bibtex which can help me to achieve this goal. Any tips will be appreciated.

See here for the related discussion.

Regards, Zhao

hongyi-zhao avatar May 17 '23 11:05 hongyi-zhao

If I understand you correctly, you should be able to do something like this:

(use-package helm-bibtex
  :after latex-mode
  ...)

skangas avatar Aug 05 '23 15:08 skangas