From: John Kitchin Date: Thu, 25 Sep 2014 13:03:09 +0000 (-0400) Subject: add user function for opening notes X-Git-Url: https://git.donarmstrong.com/?p=org-ref.git;a=commitdiff_plain;h=ab07368ecf45494687b0492ddf19a522d4376d5a add user function for opening notes --- diff --git a/org-ref.org b/org-ref.org index 9685dca..59fc131 100644 --- a/org-ref.org +++ b/org-ref.org @@ -103,6 +103,17 @@ There are some variables needed later to tell this library where you store your "string to format an entry. Just the reference, no numbering at the beginning, etc... see the `org-ref-reftex-format-citation' docstring for the escape codes." :type 'string :group 'org-ref) + +(defcustom org-ref-open-notes-function + (lambda () + (org-show-entry) + (show-branches) + (show-children) + (org-cycle '(64)) + ;;(org-tree-to-indirect-buffer) + (outline-previous-visible-heading 1) + (recenter-top-bottom 0)) + "User-defined way to open a notes entry. This is excecuted after the entry is found, with the cursor at the beginning of the headline. The default setting fully expands the notes, and moves the headline to the top of the buffer") #+END_SRC This next variable determines the citation types that are available in org-ref. Links for each one are automatically generated, and completion functions are automatically generated. Users may add to this list in their own init files. @@ -1731,14 +1742,7 @@ construct the heading by hand." (goto-char (point-min)) ;; put new entry in notes if we don't find it. (if (re-search-forward (format ":Custom_ID: %s$" key) nil 'end) - (progn - (org-show-entry) - (show-branches) - (show-children) - (org-cycle '(64)) - ;(org-tree-to-indirect-buffer) - (outline-previous-visible-heading 1) - (recenter-top-bottom 0)) + (funcall org-ref-open-notes-function) ;; no entry found, so add one (insert (format "\n** TODO %s - %s" year title)) (insert (format"