emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [PATCH] org-log-note-headings buffer-local value


From: John J Foerch
Subject: [O] [PATCH] org-log-note-headings buffer-local value
Date: Tue, 20 Nov 2012 15:41:45 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

Hello,

I am exploring org-mode's potential for collaborative editing, and I
found that the main difficulty with this is that different users editing
the same document may have different org-mode configurations.  Most of
the important options that I have found so far can be dealt with by
setting buffer-local values on the file to be jointly edited.  One that
could not was org-log-note-headings.  I found that this is because when
its value is taken, in org-store-log-note, the current buffer is the
"*Org Note*" buffer, rather than the document buffer.  A patch is
attached that addresses this.  Note, for clarity's sake, the patch does
not reindent org-store-log-note.

As an aside, I do realize that org-log-note-headings is a somewhat
fragile variable, with some known problems (with agenda, iirc)
associated with changing its value.  However, I do find it useful to
change its value for my use, and this patch will obviate one little
difficulty with collaborative editing.

Thank you,
John Foerch

>From 7703373e55d760911e01f7c622203b4a4d8ea6a7 Mon Sep 17 00:00:00 2001
From: John Foerch <address@hidden>
Date: Tue, 20 Nov 2012 15:25:04 -0500
Subject: [PATCH] org-store-log-note: access org-log-note-headings in org
 buffer

This change allows org-mode to respect a buffer-local value of
org-log-note-headings, by accessing its value in the org buffer
instead of in the "*Org Note*" buffer.
---
 lisp/org.el |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index e3354c6..2ae3b90 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -12732,10 +12732,10 @@ EXTRA is additional text that will be inserted into 
the notes buffer."
 (defvar org-note-abort nil) ; dynamically scoped
 (defun org-store-log-note ()
   "Finish taking a log note, and insert it to where it belongs."
-  (let ((txt (buffer-string))
-       (note (cdr (assq org-log-note-purpose org-log-note-headings)))
-       lines ind bul)
+  (let ((txt (buffer-string)))
     (kill-buffer (current-buffer))
+    (let ((note (cdr (assq org-log-note-purpose org-log-note-headings)))
+         lines ind bul)
     (while (string-match "\\`# .*\n[ \t\n]*" txt)
       (setq txt (replace-match "" t t txt)))
     (if (string-match "\\s-+\\'" txt)
@@ -12802,7 +12802,7 @@ EXTRA is additional text that will be inserted into the 
notes buffer."
              (insert (pop lines))))
          (message "Note stored")
          (org-back-to-heading t)
-         (org-cycle-hide-drawers 'children)))))
+         (org-cycle-hide-drawers 'children))))))
   (set-window-configuration org-log-note-window-configuration)
   (with-current-buffer (marker-buffer org-log-note-return-to)
     (goto-char org-log-note-return-to))
-- 
1.7.10.4


reply via email to

[Prev in Thread] Current Thread [Next in Thread]