Skip to content

Commit

Permalink
Merge pull request #277 from akoehn/notes-correct-narrow
Browse files Browse the repository at this point in the history
Notes: narrow to the complete template instead of last org-heading
  • Loading branch information
tmalsburg authored Jan 13, 2019
2 parents af05ccb + 03fac83 commit f1fb797
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions bibtex-completion.el
Original file line number Diff line number Diff line change
Expand Up @@ -1327,15 +1327,16 @@ line."
(bibtex-completion-notes-mode 1))
; Create a new entry:
(goto-char (point-max))
(insert (s-format bibtex-completion-notes-template-one-file
'bibtex-completion-apa-get-value
entry)))
(when (eq major-mode 'org-mode)
(org-narrow-to-subtree)
(re-search-backward "^\*+ " nil t)
(org-cycle-hide-drawers nil)
(goto-char (point-max))
(bibtex-completion-notes-mode 1))))))
(save-excursion (insert (s-format bibtex-completion-notes-template-one-file
'bibtex-completion-apa-get-value
entry)))
(re-search-forward "^*+ " nil t))
(when (eq major-mode 'org-mode)
(org-narrow-to-subtree)
(re-search-backward "^\*+ " nil t)
(org-cycle-hide-drawers nil)
(goto-char (point-max))
(bibtex-completion-notes-mode 1))))))

(defun bibtex-completion-buffer-visiting (file)
(or (get-file-buffer file)
Expand Down

0 comments on commit f1fb797

Please sign in to comment.