From 9a5ffb3364a8d0704cbcd4eb96ce31010fcbe065 Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Mon, 26 Aug 2019 19:42:37 -0400 Subject: [PATCH] emacs: add reftex --- .emacs.d/init.el | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index d0d5307..6c17967 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -1564,6 +1564,23 @@ For disabling the behaviour for certain buffers and/or modes." (use-package biblio) +(use-package reftex + :hook (latex-mode . reftex-mode)) + +(use-package reftex-cite + :after reftex + :disabled ; enable to disable + ; reftex-cite's default choice + ; of previous word + :config + (defun reftex-get-bibkey-default () + "If the cursor is in a citation macro, return the word before the macro." + (let* ((macro (reftex-what-macro 1))) + (save-excursion + (when (and macro (string-match "cite" (car macro))) + (goto-char (cdr macro))) + (reftex-this-word))))) + ;;; Email (with Gnus) -- 2.20.1