Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quick fixes for compatibility and search problem #44

Open
wants to merge 2 commits into
base: note-files
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions helm-bibtex.el
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ values."
concat (car p))
nil))


(defun helm-bibtex-open-pdf (_)
"Open the PDF associated with the entry using the function
specified in `helm-bibtex-pdf-open-function',"
Expand All @@ -458,7 +457,10 @@ specified in `helm-bibtex-pdf-open-function',"
(let ((path (f-join helm-bibtex-library-path (s-concat key ".pdf"))))
(if (f-exists? path)
(funcall helm-bibtex-pdf-open-function path)
(message "No PDF for this entry: %s" key))))))
(let ((path (f-join helm-bibtex-library-path (s-concat key ".txt"))))
(if (f-exists? path)
(funcall helm-bibtex-pdf-open-function path)
(message "No PDF or TXT for this entry: %s" key))))))))

(defun helm-bibtex-open-url-or-doi (_)
"Open the associated URL or DOI in a browser."
Expand Down Expand Up @@ -711,11 +713,9 @@ defined. Surrounding curly braces are stripped."
;; from the template:
(find-file helm-bibtex-notes-path)
(goto-char (point-min))
(if (re-search-forward (concat "\\b" key "\\b") nil t)
(if (or (search-forward (concat ":BIBTEX-KEY: " key) nil t) (search-forward (concat "* " key) nil t))
(when (eq major-mode 'org-mode)
(outline-hide-other)
(outline-show-subtree)
(outline-previous-visible-heading 1)
(org-show-context)
(recenter-top-bottom 1))
(goto-char (point-max))
(insert (s-format helm-bibtex-notes-template
Expand Down