I would like to get the bibtex key of references in my
.bib database as a string via
(defun get-bibtex-key () (interactive) (with-temp-buffer (helm-bibtex) (if (string-prefix-p "cite" (buffer-string)) (substring (buffer-string) 5) ;; Remove "cite: " from string. (buffer-string)) (buffer-string)))
The code above correctly returns the desired value, but inserts text into the current buffer instead of storing its value within the
get-bibtex-key function-variable as a string, which makes further deployment such as this impossible:
The above code when run just dumps the value returned by
(get-bibtex-key) into the current buffer.
How can I get output from
(helm-bibtex) behave like the code below?
(with-temp-buffer (insert "Hi!") (buffer-string))
.bibdatabase would also be appreciated.