* [PATCH] org-log-note-headings buffer-local value
@ 2012-11-20 20:41 John J Foerch
2012-11-25 18:49 ` Nicolas Goaziou
0 siblings, 1 reply; 3+ messages in thread
From: John J Foerch @ 2012-11-20 20:41 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1005 bytes --]
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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: allow buffer-local value for org-log-note-headings --]
[-- Type: text/x-diff, Size: 1692 bytes --]
From 7703373e55d760911e01f7c622203b4a4d8ea6a7 Mon Sep 17 00:00:00 2001
From: John Foerch <jjfoerch@earthlink.net>
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] org-log-note-headings buffer-local value
2012-11-20 20:41 [PATCH] org-log-note-headings buffer-local value John J Foerch
@ 2012-11-25 18:49 ` Nicolas Goaziou
2012-11-25 19:13 ` John J Foerch
0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2012-11-25 18:49 UTC (permalink / raw)
To: John J Foerch; +Cc: emacs-orgmode
Hello,
John J Foerch <jjfoerch@earthlink.net> writes:
> 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.
Applied. Thank you.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] org-log-note-headings buffer-local value
2012-11-25 18:49 ` Nicolas Goaziou
@ 2012-11-25 19:13 ` John J Foerch
0 siblings, 0 replies; 3+ messages in thread
From: John J Foerch @ 2012-11-25 19:13 UTC (permalink / raw)
To: emacs-orgmode
Nicolas Goaziou <n.goaziou@gmail.com> writes:
> Hello,
>
> John J Foerch <jjfoerch@earthlink.net> writes:
>
>> 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.
>
> Applied. Thank you.
Thank you!
--
John Foerch
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-11-25 19:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-20 20:41 [PATCH] org-log-note-headings buffer-local value John J Foerch
2012-11-25 18:49 ` Nicolas Goaziou
2012-11-25 19:13 ` John J Foerch
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).