(cond
;; If region is active assume we want it
((region-active-p)
- (buffer-substring (region-beginning) (region-end)))
+ (replace-regexp-in-string
+ "\n" " "
+ (buffer-substring (region-beginning) (region-end))))
;; type or paste it in
(t
nil)))
(setq json-string (buffer-substring url-http-end-of-headers (point-max)))
(setq json-data (json-read-from-string json-string)))
- (let* ((name (format "Crossref hits for %s" query))
+ (let* ((name (format "Crossref hits for %s"
+ ;; remove carriage returns. they cause problems in helm.
+ (replace-regexp-in-string "\n" " " query)))
(helm-candidates (mapcar (lambda (x)
(cons
(concat
#+BEGIN_SRC emacs-lisp :tangle doi-utils.el
(defun isbn-to-bibtex-lead (isbn)
"Search lead.to for ISBN bibtex entry. You have to copy the entry if it is on the page to your bibtex file."
- (interactive "ISBN: ")
+ (interactive "sISBN: ")
(browse-url
(format "http://lead.to/amazon/en/?key=%s+&si=all&op=bt&bn=&so=sa&ht=us" isbn)))
#+END_SRC