X-Git-Url: https://git.donarmstrong.com/?p=org-ref.git;a=blobdiff_plain;f=doi-utils.org;h=a29996f6810caf99fed664eba77bf3da816567b1;hp=7a22e75452ba174a164791592dfa1987ff7d98f9;hb=25723f493debde941357f2fdf9150443a02b1a68;hpb=f401452f60e5a8458d70b1fc5bd5e920ff599356 diff --git a/doi-utils.org b/doi-utils.org index 7a22e75..a29996f 100644 --- a/doi-utils.org +++ b/doi-utils.org @@ -915,7 +915,9 @@ The idea here is to perform a query on Crossref, get a helm buffer of candidates (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))) @@ -935,7 +937,9 @@ The idea here is to perform a query on Crossref, get a helm buffer of candidates (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 @@ -1256,7 +1260,7 @@ I found this on the web. It can be handy, but the bibtex entry has a lot of stuf #+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