Prompt
Please make an emacs package that does the following:
- It should use use-package to configure it like the following:
(use-package aas :hook (LaTeX-mode . aas-activate-for-major-mode) :hook (latex-mode . aas-activate-for-major-mode) :hook (org-mode . aas-activate-for-major-mode) :hook (LaTeX/P . aas-activate-for-major-mode) :config (set-replacements ’text-mode ;; expand only while NOT in math :cond #’nottexmathp “pat” “paul” “dad” “mike” ) (set-replacements ’text-mode ;; expand only while NOT in math :cond #’texmathp “HH” “\\mathcal{H}” “NN” “\\mathbb{N}” ) )
This sets the conditions under which a replacement happens determined by the :cond condition. texmathp and nottexmathp are two functions that will be imported.
From the configuration, if the user is not in a math environment (as defined by ’texmathp or ’nottexmathp), when the user types the key “pat” the package should replace this with the key-replacement “paul”. But if the user types “HH” it would not replace “HH” with
“\mathcal{H}” because the user is not typing in a math environment.