emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH v1 2/4] contrib/lisp/org-annotate-file.el improvements
@ 2014-03-15 18:17 David Holm
  0 siblings, 0 replies; only message in thread
From: David Holm @ 2014-03-15 18:17 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 104 bytes --]

The second patch makes the annotation storage location a parameter to
`org-annotate-file-show-section`.

[-- Attachment #1.2: Type: text/html, Size: 125 bytes --]

[-- Attachment #2: 0002-Pass-storage-file-as-a-parameter-to-org-annotate-fil.patch --]
[-- Type: application/octet-stream, Size: 2348 bytes --]

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-03-15 18:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-15 18:17 [PATCH v1 2/4] contrib/lisp/org-annotate-file.el improvements David Holm

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).