# RefTeX: How to modify the "select a reference format" menu?

I use Emacs + RefTeX + AUCTeX to write .tex files. I use the handy keyboard macro

C-c )


for cross-references. This shows a menu named SELECT A REFERENCE FORMAT and I can choose between a number of options, such as \ref,\pageref and the like. However, among these I am missing the \eqref format. This leads to my question: How can I modify the SELECT A REFERENCE FORMAT menu to add \eqref?

The following works for me, though it may be imperfect as I'm not very comfortable with RefTeX customization:

(defun my-add-to-alist (alist-var key value &optional append)
"Add an element to an association list.
If ALIST-VAR contains no element whose CAR is equal' to KEY, then add
(KEY . VALUE) to ALIST-VAR. If APPEND is nil, add it to the beginning of
ALIST-VAR, otherwise add it to the end of ALIST-VAR.

If there is already an element in ALIST-VAR whose CAR is equal' to KEY,
replace its CDR with VALUE."
(interactive)
(let ((cons-cell (assoc key (eval alist-var))))
(if cons-cell
(setcdr cons-cell value)
(add-to-list alist-var (cons key value) append))))

"AMSMath" '("amsmath" (("\\eqref" ?e))) t)

(require 'tex)
#'(lambda ()

;; Use RefTeX in LaTeX buffers