unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Unrecoverable data loss
@ 2008-05-18 18:21 Stephen Berman
  2008-05-18 21:25 ` martin rudalics
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Stephen Berman @ 2008-05-18 18:21 UTC (permalink / raw
  To: emacs-devel

1. emacs -Q

2. Type text in a buffer in accordance with normal Emacs usage (plain
text, code in some suitable mode, email in e.g. Gnus, etc.).  I'll call
this buffer A.
 
3. Type (in any buffer) C-u C-x =, which pops up a *Help* buffer.

4. Return to buffer A, if you're not still there, and type `M-x
insert-buffer RET *Help*', thereby inserting the output of the command
in step 3 into buffer A.

5. The inserted text retains the properties in buffer A that it has in
the *Help* buffer, in particular clickable links.  Click on the link
displaying the value of the preferred charset, or, if there are text
properties in the description, you can click on one of these links.
(Clicking the link of the value of the code point, or the button
labelled "customize what to show" does not produce the problem.)

6. Now buffer A is in Help mode and contains only the Help text of the
clicked link; the text you had previously type is gone.  If you type
C-_, Emacs beeps and says "Buffer is read-only".  If you toggle the
read-only status and type C-_ again, Emacs beeps again and says "No undo
information in this buffer".  If you were typing in a buffer that does
not have auto-save, its contents prior to step 5 is AFAICT unrecoverably
lost.

Note that if, instead of using insert-buffer, you copy the content of
the *Help* buffer either with M-w or with the mouse and then yank it
into buffer A, then the yanked text does not have clickable links.

In GNU Emacs 23.0.60.2 (i686-pc-linux-gnu, GTK+ Version 2.12.0) of
2008-05-15 on escher

Steve Berman





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

* Re: Unrecoverable data loss
  2008-05-18 18:21 Unrecoverable data loss Stephen Berman
@ 2008-05-18 21:25 ` martin rudalics
  2008-05-20  1:33   ` Stefan Monnier
  2008-05-19  6:40 ` Richard M Stallman
  2008-05-20  6:00 ` tomas
  2 siblings, 1 reply; 7+ messages in thread
From: martin rudalics @ 2008-05-18 21:25 UTC (permalink / raw
  To: Stephen Berman; +Cc: emacs-devel

 > 5. The inserted text retains the properties in buffer A that it has in
 > the *Help* buffer, in particular clickable links.  Click on the link
 > displaying the value of the preferred charset, or, if there are text
 > properties in the description, you can click on one of these links.
 > (Clicking the link of the value of the code point, or the button
 > labelled "customize what to show" does not produce the problem.)
 >
 > 6. Now buffer A is in Help mode and contains only the Help text of the
 > clicked link; the text you had previously type is gone.  If you type
 > C-_, Emacs beeps and says "Buffer is read-only".  If you toggle the
 > read-only status and type C-_ again, Emacs beeps again and says "No undo
 > information in this buffer".  If you were typing in a buffer that does
 > not have auto-save, its contents prior to step 5 is AFAICT unrecoverably
 > lost.

`describe-character-set' uses

     (with-output-to-temp-buffer (help-buffer)

where `help-buffer' is defined as

(defun help-buffer ()
   (buffer-name				;for with-output-to-temp-buffer
    (if help-xref-following
        (current-buffer)
      (get-buffer-create "*Help*"))))

hence turning your current buffer into a help buffer thus clearing its
contents and undo-list, making it read-only, ...

Maybe `help-buffer' should refuse to return a buffer if it is not
read-only, `buffer-undo-list' is not t, ...





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

* Re: Unrecoverable data loss
  2008-05-18 18:21 Unrecoverable data loss Stephen Berman
  2008-05-18 21:25 ` martin rudalics
@ 2008-05-19  6:40 ` Richard M Stallman
  2008-05-19  8:34   ` Stephen Berman
  2008-05-20  6:00 ` tomas
  2 siblings, 1 reply; 7+ messages in thread
From: Richard M Stallman @ 2008-05-19  6:40 UTC (permalink / raw
  To: Stephen Berman; +Cc: emacs-devel

This may deserve to be considered a matter of giving you enough
rope to hang yourself.  But it would be easy to make some of those
commands give errors when not in Help mode.




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

* Re: Unrecoverable data loss
  2008-05-19  6:40 ` Richard M Stallman
@ 2008-05-19  8:34   ` Stephen Berman
  2008-05-19 16:26     ` Drew Adams
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Berman @ 2008-05-19  8:34 UTC (permalink / raw
  To: emacs-devel

On Mon, 19 May 2008 02:40:14 -0400 Richard M Stallman <rms@gnu.org> wrote:

> This may deserve to be considered a matter of giving you enough
> rope to hang yourself.  

I think it's more like Emacs luring the unsuspecting or forgetful into a
trap.  At least this is how I felt when it happened to me as I was
preparing a post with Gnus, did what I described in my OP, was surprised
to see that the links of the inserted text were clickable, and decided
to click the one on the face value, unsuspecting or forgetful as I was
that this would obliterate my post.  If I had instead chosen to click
the link on the code point value, it would have popped to a different
buffer and I wouldn't have had to retype my post.  Maybe Emacs was just
trying to educate me not to click any link unless I know exactly what
the consequences of doing so are.

>                         But it would be easy to make some of those
> commands give errors when not in Help mode.

That's the least amount of help I would expect from Help mode.

Steve Berman





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

* RE: Unrecoverable data loss
  2008-05-19  8:34   ` Stephen Berman
@ 2008-05-19 16:26     ` Drew Adams
  0 siblings, 0 replies; 7+ messages in thread
From: Drew Adams @ 2008-05-19 16:26 UTC (permalink / raw
  To: 'Stephen Berman', emacs-devel

> see that the links of the inserted text were clickable, and decided
> to click the one on the face value, unsuspecting or forgetful as I was
> that this would obliterate my post.  If I had instead chosen to click
> the link on the code point value, it would have popped to a different
> buffer and I wouldn't have had to retype my post.  Maybe Emacs was
> just trying to educate me not to click any link unless I know exactly
> what the consequences of doing so are.
> 
> > But it would be easy to make some of those
> > commands give errors when not in Help mode.
> 
> That's the least amount of help I would expect from Help mode.

Actually, I wonder if *Help* couldn't have undo enabled. No flames please; it's
just a naive question.

I sometimes do C-x C-q and edit some *Help* text to use it elsewhere, and undo
would be useful during such editing. If enabling undo would have negative
consequences, then forget about it - just wondering.





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

* Re: Unrecoverable data loss
  2008-05-18 21:25 ` martin rudalics
@ 2008-05-20  1:33   ` Stefan Monnier
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2008-05-20  1:33 UTC (permalink / raw
  To: martin rudalics; +Cc: Stephen Berman, emacs-devel

> (defun help-buffer ()
>   (buffer-name				;for with-output-to-temp-buffer
>    (if help-xref-following
>        (current-buffer)
>      (get-buffer-create "*Help*"))))

> hence turning your current buffer into a help buffer thus clearing its
> contents and undo-list, making it read-only, ...

> Maybe `help-buffer' should refuse to return a buffer if it is not
> read-only, `buffer-undo-list' is not t, ...

Yes, I guess we should sanity-check before obeying help-xref-following.


        Stefan




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

* Re: Unrecoverable data loss
  2008-05-18 18:21 Unrecoverable data loss Stephen Berman
  2008-05-18 21:25 ` martin rudalics
  2008-05-19  6:40 ` Richard M Stallman
@ 2008-05-20  6:00 ` tomas
  2 siblings, 0 replies; 7+ messages in thread
From: tomas @ 2008-05-20  6:00 UTC (permalink / raw
  To: Stephen Berman; +Cc: emacs-devel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, May 18, 2008 at 08:21:02PM +0200, Stephen Berman wrote:
> 1. emacs -Q

[insert contents of help buffer into "normal" then follow link,
obliterating said normal buffer]

The natural thing to do here seems to me to pop to a *new* help buffer
when the link comes from a non-help buffer. Would that be difficult?

Regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIMmkNBcgs9XrR2kYRArT4AJ4w9C03gygAttePRJsKWnITePu+LACeO4OZ
ieFb/p1H1KlmkhYBN5KdKHo=
=qsy9
-----END PGP SIGNATURE-----




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

end of thread, other threads:[~2008-05-20  6:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-18 18:21 Unrecoverable data loss Stephen Berman
2008-05-18 21:25 ` martin rudalics
2008-05-20  1:33   ` Stefan Monnier
2008-05-19  6:40 ` Richard M Stallman
2008-05-19  8:34   ` Stephen Berman
2008-05-19 16:26     ` Drew Adams
2008-05-20  6:00 ` tomas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).