emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Raymond Zeitler <r.zeitler@ieee.org>
Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org
Subject: Re: Note buffer killed unexpectedly
Date: Thu, 24 Feb 2011 18:05:57 -0500	[thread overview]
Message-ID: <5180.1298588757@alphaville> (raw)
In-Reply-To: Message from "Raymond Zeitler" <r.zeitler@ieee.org> of "Thu, 24 Feb 2011 16:10:13 EST." <98A64CDF94304DB5BAC2495A7B09DEAB@PHONON.COM>

Raymond Zeitler <r.zeitler@ieee.org> 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.

  reply	other threads:[~2011-02-24 23:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201102241702.p1OH2PKN013160@hormel9.ieee.org>
2011-02-24 21:10 ` Note buffer killed unexpectedly Raymond Zeitler
2011-02-24 23:05   ` Nick Dokos [this message]
2011-03-03 16:27     ` Raymond Zeitler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5180.1298588757@alphaville \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=r.zeitler@ieee.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).