From mboxrd@z Thu Jan 1 00:00:00 1970 From: John J Foerch Subject: [PATCH] org-log-note-headings buffer-local value Date: Tue, 20 Nov 2012 15:41:45 -0500 Message-ID: <878v9wvwfq.fsf@hecubus.retroj.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:40973) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Taudu-0004IE-DF for emacs-orgmode@gnu.org; Tue, 20 Nov 2012 15:42:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Taudt-0005Ud-2w for emacs-orgmode@gnu.org; Tue, 20 Nov 2012 15:42:02 -0500 Received: from plane.gmane.org ([80.91.229.3]:54866) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tauds-0005UZ-Rt for emacs-orgmode@gnu.org; Tue, 20 Nov 2012 15:42:01 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Taudz-0005WC-Mk for emacs-orgmode@gnu.org; Tue, 20 Nov 2012 21:42:07 +0100 Received: from 198.sub-75-198-67.myvzw.com ([75.198.67.198]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 20 Nov 2012 21:42:07 +0100 Received: from jjfoerch by 198.sub-75-198-67.myvzw.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 20 Nov 2012 21:42:07 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= 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 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-org-store-log-note-access-org-log-note-headings-in-o.patch Content-Description: allow buffer-local value for org-log-note-headings >From 7703373e55d760911e01f7c622203b4a4d8ea6a7 Mon Sep 17 00:00:00 2001 From: John Foerch 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 --=-=-=--