]> git.donarmstrong.com Git - org-ref.git/commitdiff
add user function for opening notes
authorJohn Kitchin <jkitchin@andrew.cmu.edu>
Thu, 25 Sep 2014 13:03:09 +0000 (09:03 -0400)
committerJohn Kitchin <jkitchin@andrew.cmu.edu>
Thu, 25 Sep 2014 13:03:09 +0000 (09:03 -0400)
org-ref.org

index 9685dca2929357c0301c64ef9830e23ccca17285..59fc131c8a1f87f448e17533f848535f2de38071 100644 (file)
@@ -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"