From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Note buffer killed unexpectedly Date: Thu, 24 Feb 2011 18:05:57 -0500 Message-ID: <5180.1298588757@alphaville> References: <201102241702.p1OH2PKN013160@hormel9.ieee.org> <98A64CDF94304DB5BAC2495A7B09DEAB@PHONON.COM> Reply-To: nicholas.dokos@hp.com Return-path: Received: from [140.186.70.92] (port=38143 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PskwO-0002vu-22 for emacs-orgmode@gnu.org; Thu, 24 Feb 2011 18:49:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PskwM-0006Or-St for emacs-orgmode@gnu.org; Thu, 24 Feb 2011 18:49:47 -0500 Received: from g6t0184.atlanta.hp.com ([15.193.32.61]:43486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PskwM-0006OW-Ot for emacs-orgmode@gnu.org; Thu, 24 Feb 2011 18:49:46 -0500 In-Reply-To: Message from "Raymond Zeitler" of "Thu, 24 Feb 2011 16:10:13 EST." <98A64CDF94304DB5BAC2495A7B09DEAB@PHONON.COM> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Raymond Zeitler Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org Raymond Zeitler wrote: > After typing a note, I pressed C-u C-c C-c and unintentionally killed the > buffer without saving the note. I should've pressed C-c C-c, but I'm so > used to pressing C-u C-c C-c to refile each new task, that I used that key > combination instead. > > Why would adding a prefix argument to C-c C-c kill *Org Note*? > It seems it's by design: org-store-log-note() contains the following code: ... (when (or current-prefix-arg org-note-abort) (when org-log-into-drawer (org-remove-empty-drawer-at (if (stringp org-log-into-drawer) org-log-into-drawer "LOGBOOK") org-log-note-marker)) (setq lines nil)) so current-prefix-arg causes lines to be set to nil, and the note is just thrown away. > In general I'm nervous about using scratch buffers such as *Org Note* for > anything I wish to save. Is there an option to auto-save its contents to a > visited file called something like ~/#Org Note#? Or can I add a > confirmation before I close the buffer? Perhaps if I modified > org-add-log-note to somehow change the call to > (org-switch-to-buffer-other-window "Org Note")...? > You can try getting rid of the current-prefix-arg and see if you get into other problems, but only Carsten can say why it is that way to begin with. Nick PS. I did some git archaelogy: commit 3d2e1c0f04c4bb3eaeb2627d00c8cba6e376f8eb modified things a bit in this part of the code, but the current-prefix-arg behavior predated it. The earliest commits I found were commit 2b3fe71634d8afb7e5e6da7606223e82481f0fa8 which added the capability to add a note interactively and also remotely from the agenda, and commit fe939ecb95d36377162bf1cb9ce63c2b6047612b which was a massive structure cleanup/reorg with no substantive code changes, but I think the org-store-log-note() function existed before the git era.