aboutsummaryrefslogtreecommitdiff
path: root/.emacs
diff options
context:
space:
mode:
authorRyan Kavanagh <rak@rak.ac>2021-12-11 14:39:49 -0500
committerRyan Kavanagh <rak@rak.ac>2021-12-11 14:39:49 -0500
commit2052adecbcbbc62a18e9236387999be424dd8847 (patch)
tree49200f80d56daf9748862cb95cc2a8a8e585f3cf /.emacs
parentAdded a single-lines-only function to emacs (diff)
Allow forcing a key with bibtex/emacs
Diffstat (limited to '.emacs')
-rw-r--r--.emacs4
1 files changed, 4 insertions, 0 deletions
diff --git a/.emacs b/.emacs
index 40ed9e7..3e0cd34 100644
--- a/.emacs
+++ b/.emacs
@@ -131,6 +131,10 @@
("C-c C-c" . org-ref-clean-bibtex-entry)
("C-c s" . bibtex-sort-buffer))
:config
+ (defun my/bibtex-generate-autokey (autogenerated)
+ (let ((key (bibtex-autokey-get-field "_key")))
+ (if (string= "" key) autogenerated key)))
+ (advice-add 'bibtex-generate-autokey :filter-return #'my/bibtex-generate-autokey)
;; stolen from bibtex.el and modified to handle "Mac Lane"
(defun my/bibtex-autokey-demangle-name (fullname)
"Get the last part from a well-formed FULLNAME and perform abbreviations."