emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: Org loses data if the user types C-u C-c C-c while composing a state change note [9.0.9 (9.0.9-elpaplus @ /home/jorge/.emacs.d/elpa/org-plus-contrib-20170622/)]
@ 2017-06-26 14:58 Jorge Morais Neto
  2017-06-26 20:30 ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Jorge Morais Neto @ 2017-06-26 14:58 UTC (permalink / raw)
  To: org mode

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

     http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.
------------------------------------------------------------------------

1. emacs -q
2. M-x package-initialize
3. M-x org-version
   - Just to confirm we are running Org 9.0.9.
4. M-x customize-option RET org-todo-keywords RET
5. Add "(@)" to DONE and set it for current session (C-c C-c)
6. C-x C-f /tmp/bug.org
7. C-S-RET
8. C-c C-t
   - This should change to DONE and prompt for a note.
9. In the note, type "- " to start a plain list
10. Hit C-u C-c C-c to add an empty checkbox

In step 10, the user made a mistake; he wanted to add a checkbox and,
from muscle memory, typed C-u C-c C-c.  However, he was composing a
note, so C-c C-c has different behavior.  The problem is that in this
situation Org discards the note.  When this happened to me, I had spent
at least 15 minutes gathering data and writing it in the note buffer.
This data was lost.  Luckily I can gather the same data a second time,
so I just lost some 15 minutes of my time (plus more than an hour to
report this bug), but it could have been worse.

I am not good at usability design and I do not know precisely how Org
should respond to C-u C-c C-c in this situation, but clearly there are
better options than losing data.  A very simple alternative would be to,
when C-c C-c is given any prefix argument, do nothing except warn that
C-c C-c in that situation closes the note and does not accept a prefix
argument.  Probably this measure also applies to analogous situations in
which valuable data could be lost.

While we are at it, there may be other situations in which the user
might discard a note by accident.  Perhaps Org should prompt before
discarding, or make it reversible.

Regards

Emacs  : GNU Emacs 26.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
 of 2017-06-07
Package: Org mode version 9.0.9 (9.0.9-elpaplus @
/home/jorge/.emacs.d/elpa/org-plus-contrib-20170622/)

-- 
- I am Brazilian.  I hope my English is correct and I welcome feedback.
- Please adopt free formats like PDF, ODF, Org, LaTeX, Opus, WebM, 7z.
- Free (as in free speech) software for Android: https://f-droid.org/.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Bug: Org loses data if the user types C-u C-c C-c while composing a state change note [9.0.9 (9.0.9-elpaplus @ /home/jorge/.emacs.d/elpa/org-plus-contrib-20170622/)]
  2017-06-26 14:58 Bug: Org loses data if the user types C-u C-c C-c while composing a state change note [9.0.9 (9.0.9-elpaplus @ /home/jorge/.emacs.d/elpa/org-plus-contrib-20170622/)] Jorge Morais Neto
@ 2017-06-26 20:30 ` Nicolas Goaziou
  2017-07-01 19:19   ` Kyle Meyer
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2017-06-26 20:30 UTC (permalink / raw)
  To: Jorge Morais Neto; +Cc: org mode

Hello,

Jorge Morais Neto <jorge13515@gmail.com> writes:

> 1. emacs -q
> 2. M-x package-initialize
> 3. M-x org-version
>    - Just to confirm we are running Org 9.0.9.
> 4. M-x customize-option RET org-todo-keywords RET
> 5. Add "(@)" to DONE and set it for current session (C-c C-c)
> 6. C-x C-f /tmp/bug.org
> 7. C-S-RET
> 8. C-c C-t
>    - This should change to DONE and prompt for a note.
> 9. In the note, type "- " to start a plain list
> 10. Hit C-u C-c C-c to add an empty checkbox
>
> In step 10, the user made a mistake; he wanted to add a checkbox and,
> from muscle memory, typed C-u C-c C-c.  However, he was composing a
> note, so C-c C-c has different behavior.  The problem is that in this
> situation Org discards the note.  When this happened to me, I had spent
> at least 15 minutes gathering data and writing it in the note buffer.
> This data was lost.  Luckily I can gather the same data a second time,
> so I just lost some 15 minutes of my time (plus more than an hour to
> report this bug), but it could have been worse.
>
> I am not good at usability design and I do not know precisely how Org
> should respond to C-u C-c C-c in this situation, but clearly there are
> better options than losing data.  A very simple alternative would be to,
> when C-c C-c is given any prefix argument, do nothing except warn that
> C-c C-c in that situation closes the note and does not accept a prefix
> argument.  Probably this measure also applies to analogous situations in
> which valuable data could be lost.
>
> While we are at it, there may be other situations in which the user
> might discard a note by accident.  Perhaps Org should prompt before
> discarding, or make it reversible.

FWIW, long ago, I added

  (defun ngz-org-capture-hook-handler ()
    (define-key org-capture-mode-map "\C-x\C-s" 'org-capture-finalize)
    (define-key org-capture-mode-map "\C-c\C-c" 'org-ctrl-c-ctrl-c))
  (add-hook 'org-capture-mode-hook 'ngz-org-capture-hook-handler)

to my config file. I'm pretty happy with it.

One solution would be to have C-x C-s (or some other binding, I don't
really mind) calling `org-finish-function' instead of the very busy C-c
C-c. 

C-x C-s makes sense as Log buffers are not attached to any file, so
`save-buffer' is morally equivalent to C-x C-w, aka `write-file'.

Fellow Orgers, WDYT?

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Bug: Org loses data if the user types C-u C-c C-c while composing a state change note [9.0.9 (9.0.9-elpaplus @ /home/jorge/.emacs.d/elpa/org-plus-contrib-20170622/)]
  2017-06-26 20:30 ` Nicolas Goaziou
@ 2017-07-01 19:19   ` Kyle Meyer
  2017-07-01 19:55     ` Samuel Wales
  2017-07-03 23:14     ` Nicolas Goaziou
  0 siblings, 2 replies; 5+ messages in thread
From: Kyle Meyer @ 2017-07-01 19:19 UTC (permalink / raw)
  To: Nicolas Goaziou, Jorge Morais Neto; +Cc: org mode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

[...]

> FWIW, long ago, I added
>
>   (defun ngz-org-capture-hook-handler ()
>     (define-key org-capture-mode-map "\C-x\C-s" 'org-capture-finalize)
>     (define-key org-capture-mode-map "\C-c\C-c" 'org-ctrl-c-ctrl-c))
>   (add-hook 'org-capture-mode-hook 'ngz-org-capture-hook-handler)
>
> to my config file. I'm pretty happy with it.
>
> One solution would be to have C-x C-s (or some other binding, I don't
> really mind) calling `org-finish-function' instead of the very busy C-c
> C-c. 
>
> C-x C-s makes sense as Log buffers are not attached to any file, so
> `save-buffer' is morally equivalent to C-x C-w, aka `write-file'.
>
> Fellow Orgers, WDYT?

On the master branch, I'd be in favor of making a separate command for
calling org-finish-function and binding it to C-x C-s.  I'd also be OK
with changing org-capture-finalize's binding to C-x C-s.

On maint, can this issue be solved by just removing the prefix argument
check from org-store-log-note?  AFAICS, the prefix argument behavior
isn't documented anywhere, and the same behavior is already available
through org-kill-note-or-show-branches (C-c C-k).

-- 
Kyle

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Bug: Org loses data if the user types C-u C-c C-c while composing a state change note [9.0.9 (9.0.9-elpaplus @ /home/jorge/.emacs.d/elpa/org-plus-contrib-20170622/)]
  2017-07-01 19:19   ` Kyle Meyer
@ 2017-07-01 19:55     ` Samuel Wales
  2017-07-03 23:14     ` Nicolas Goaziou
  1 sibling, 0 replies; 5+ messages in thread
From: Samuel Wales @ 2017-07-01 19:55 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: Jorge Morais Neto, org mode, Nicolas Goaziou

random observations/ideas to be ignored or possibly considered:

  - iirc note taking uses after command hook or so, which felt
bug-inviting to me
  - note taking is like capture
  - could use similar or same mechanism, with indirect buffer and user
settings [i favor c-c c-c :]]

is it possible to make note taking /be/ capture?  never mind if this
is what nicolas meant to imply.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Bug: Org loses data if the user types C-u C-c C-c while composing a state change note [9.0.9 (9.0.9-elpaplus @ /home/jorge/.emacs.d/elpa/org-plus-contrib-20170622/)]
  2017-07-01 19:19   ` Kyle Meyer
  2017-07-01 19:55     ` Samuel Wales
@ 2017-07-03 23:14     ` Nicolas Goaziou
  1 sibling, 0 replies; 5+ messages in thread
From: Nicolas Goaziou @ 2017-07-03 23:14 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: Jorge Morais Neto, org mode

Hello,

Kyle Meyer <kyle@kyleam.com> writes:

> On maint, can this issue be solved by just removing the prefix argument
> check from org-store-log-note?  AFAICS, the prefix argument behavior
> isn't documented anywhere, and the same behavior is already available
> through org-kill-note-or-show-branches (C-c C-k).

Done. Thank you.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-07-03 23:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-26 14:58 Bug: Org loses data if the user types C-u C-c C-c while composing a state change note [9.0.9 (9.0.9-elpaplus @ /home/jorge/.emacs.d/elpa/org-plus-contrib-20170622/)] Jorge Morais Neto
2017-06-26 20:30 ` Nicolas Goaziou
2017-07-01 19:19   ` Kyle Meyer
2017-07-01 19:55     ` Samuel Wales
2017-07-03 23:14     ` Nicolas Goaziou

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).