From c88e44f16d3dfc2e9268050f4ce7ea76cacf6da7 Mon Sep 17 00:00:00 2001
From: David Holm <dholmster@gmail.com>
Date: Sat, 15 Mar 2014 18:53:37 +0100
Subject: [PATCH 2/4] Pass storage-file as a parameter to
 org-annotate-file-show-section

* contrib/lisp/org-annotate-file.el (org-annotate-file,
org-annotate-file-show-storage-section): Permit a used to control
where to store the annotation when using
`org-annotate-file-show-section`.

By making the storage file a parameter the user can create their own
custom implementations of org-annotate-file and decide where to store
the annotation.

Personally I'm trying to use org-annotate-file to do code reviews and
I have set up my Emacs to write annotations into a file at the current
project root.  This makes it easier for me to email my comments to
whoever wrote the code I just reviewed as I can now keep multiple
reviews separate.
---
 contrib/lisp/org-annotate-file.el | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/contrib/lisp/org-annotate-file.el b/contrib/lisp/org-annotate-file.el
index 0d41574..b5c1f5d 100644
--- a/contrib/lisp/org-annotate-file.el
+++ b/contrib/lisp/org-annotate-file.el
@@ -88,10 +88,10 @@ Trim whitespace at beginning and end of STRING and replace any
   (interactive)
   (unless (buffer-file-name)
     (error "This buffer has no associated file!"))
-  (org-annotate-file-show-section))
+  (org-annotate-file-show-section org-annotate-file-storage-file))
 
-(defun org-annotate-file-show-section (&optional buffer)
-  "Visit the buffer named `org-annotate-file-storage-file'.
+(defun org-annotate-file-show-section (storage-file &optional buffer)
+  "Visit the buffer named STORAGE-FILE.
 The cursor will be placed at the relevant section.  If BUFFER is
   specified the annotation will be referencing it, otherwise the
   current buffer is used."
@@ -101,7 +101,7 @@ The cursor will be placed at the relevant section.  If BUFFER is
          (search-link (org-make-link-string
                        (concat "file:" filename "::" line)
                                (org-annotate-file-ellipsify-desc line))))
-    (with-current-buffer (find-file org-annotate-file-storage-file)
+    (with-current-buffer (find-file storage-file)
       (unless (eq major-mode 'org-mode)
         (org-mode))
       (goto-char (point-min))
-- 
1.9.0

