summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmin Bandali <bandali@gnu.org>2019-08-26 19:42:37 -0400
committerAmin Bandali <bandali@gnu.org>2019-08-26 19:42:37 -0400
commit9a5ffb3364a8d0704cbcd4eb96ce31010fcbe065 (patch)
tree34d60413c7604cda294a9461c378b825635d7851
parent057a83828a8bf86b27a70031f41c9a99d333bf56 (diff)
downloadconfigs-9a5ffb3364a8d0704cbcd4eb96ce31010fcbe065.tar.gz
configs-9a5ffb3364a8d0704cbcd4eb96ce31010fcbe065.tar.xz
configs-9a5ffb3364a8d0704cbcd4eb96ce31010fcbe065.zip
emacs: add reftex
Diffstat (limited to '')
-rw-r--r--.emacs.d/init.el17
1 files changed, 17 insertions, 0 deletions
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)