This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- gscholar/gscholar/gscholar.py | |
+++ gscholar/gscholar/gscholar.py | |
@@ -57,8 +57,10 @@ | |
def query(searchstr, outformat, allresults=False): | |
"""Return a list of bibtex items.""" | |
- logging.debug("Query: %s" % searchstr) | |
- searchstr = '/scholar?q='+urllib2.quote(searchstr) | |
+ author = searchstr[0] | |
+ title = searchstr[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Pretty printing lib | |
(require 'pp) | |
;; Associative list for filters | |
(defvar filters-alist()) | |
(defvar filters-already-loaded nil) | |
(setq filter-ignore-case t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ebib-key index "y" ebib-add-keyword-entries t) | |
(defun ebib-add-keyword-entries () | |
"Add keyword to marked entries" | |
(interactive) | |
(if (ebib-called-with-prefix) | |
(ebib-execute-when | |
((marked-entries) | |
(let ((minibuffer-local-completion-map `(keymap (keymap (32)) ,@minibuffer-local-completion-map)) | |
(collection (ebib-keywords-for-database ebib-cur-db)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun ebib-load-filter () | |
(interactive) | |
(ebib-execute-when | |
((filtered-db) | |
(error "A saved filter can only be applied to a real database") | |
)) | |
(ebib-execute-when | |
((real-db) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun ebib-delete-filter () | |
(interactive) | |
(let ((filter-name (completing-read (format "Choose a saved filter: ") | |
(mapcar #'(lambda(x) | |
(cons x 0)) | |
(filter-all-names)) | |
nil t))) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq arxiv-dir "~/Papers/arxiv/") | |
(defun ebib-import-arxiv (arxiv-url) | |
(interactive) | |
(let ((tempbuff (get-buffer-create "*arxiv*")) | |
(arxiv-id (car (cdr (split-string arxiv-url "abs/")))) | |
(arxiv-pdf-url (concat (replace-regexp-in-string "abs" "pdf" arxiv-url) ".pdf"))) | |
(call-process-shell-command "arxiv2bib.py" nil tempbuff nil arxiv-id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ebib_import_arxiv (url) { | |
var cmd_str = 'emacsclient -ne \'(ebib-import-arxiv \"' + url + '\")\''; | |
shell_command_blind(cmd_str); | |
} | |
interactive("arxiv2ebib", "Download PDF and add bibtex entry for current preprint to ebib", | |
function (I) { | |
ebib_import_arxiv(I.buffer.display_uri_string); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun ebib-filter-n-days (n) | |
"Filter entries added in the last n days" | |
(let* ((field (intern-soft "timestamp")) | |
(day-of-year (string-to-number (format-time-string "%j"))) | |
(n-days-ago (- day-of-year (- n 1))) | |
(days-between (number-sequence n-days-ago day-of-year)) | |
(regexp-days-between (mapconcat #'(lambda (x) | |
(concat "\\(" (number-to-string x) "d\\)")) | |
days-between "\\|"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun ebib-attach-file () | |
"Attach file to gnus/mu4e composition buffer" | |
(interactive) | |
(ebib-execute-when | |
((entries) | |
(let ((filename (to-raw (car (ebib-get-field-value ebib-standard-file-field | |
(edb-cur-entry ebib-cur-db)))))) | |
(if filename | |
(ebib-dired-attach filename) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'mm-url) | |
(defun ebib-import-bibtex (url) | |
(interactive) | |
(let ((tempbuff (get-buffer-create "*bibtex*"))) | |
(with-current-buffer tempbuff | |
(mm-url-insert-file-contents url) | |
(ebib-import) | |
(kill-buffer (current-buffer)) |
OlderNewer