From ea5e6e0dda7e2a74d23ef404448b0e883ce74bb3 Mon Sep 17 00:00:00 2001 From: David Holm Date: Sat, 15 Mar 2014 18:53:37 +0100 Subject: [PATCH] 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 0d41574c2..b5c1f5d8e 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))