I would like to get the bibtex key of references in my .bib
database as a string via helm-bibtex
.
(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:
(bibtex-completion-get-entry (get-bibtex-key))
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))
.bib
database would also be appreciated.bibtex-map-entries
.