unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Saving when the coding system can't code all buffer characters
@ 2006-12-21 22:40 Lennart Borgman
  2006-12-22 10:50 ` Eli Zaretskii
  2006-12-22 21:03 ` Richard Stallman
  0 siblings, 2 replies; 36+ messages in thread
From: Lennart Borgman @ 2006-12-21 22:40 UTC (permalink / raw)


After a paste of some info to an Emacs buffer I got this message when 
trying to save the buffer:

These default coding systems were tried to encode text
in the buffer `temp-lang.c':
iso-latin-1-dos
However, each of them encountered these problematic characters:
iso-latin-1-dos: ’
The first problematic character is at point in the displayed buffer,
and C-u C-x = will give information about it.

At the prompt "Select coding system (default mule-utf-8):" this just 
gives information about the minibuffer. And when using C-g to quit the 
problematic character disappears from screen. Quite inconvenient IMHO. 
Could it be made a bit easier to use please?

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-21 22:40 Lennart Borgman
@ 2006-12-22 10:50 ` Eli Zaretskii
  2006-12-22 21:03 ` Richard Stallman
  1 sibling, 0 replies; 36+ messages in thread
From: Eli Zaretskii @ 2006-12-22 10:50 UTC (permalink / raw)
  Cc: emacs-devel

> Date: Thu, 21 Dec 2006 23:40:53 +0100
> From: Lennart Borgman <lennart.borgman.073@student.lu.se>
> 
> At the prompt "Select coding system (default mule-utf-8):" this just 
> gives information about the minibuffer.

??? What do you mean by that?  I think it tells you what encoding will
be used if you just hit RET.

> And when using C-g to quit the problematic character disappears from
> screen. Quite inconvenient IMHO.

The text is still available in the buffer names "*Warning*", and you
can always get back to it if you try to save the buffer again.

> Could it be made a bit easier to use please?

Please suggest an easier way, given that just hitting RET will DTRT.

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

* Re: Saving when the coding system can't code all buffer characters
@ 2006-12-22 11:15 LENNART BORGMAN
  2006-12-22 11:50 ` Eli Zaretskii
  0 siblings, 1 reply; 36+ messages in thread
From: LENNART BORGMAN @ 2006-12-22 11:15 UTC (permalink / raw)
  Cc: emacs-devel

From: Eli Zaretskii <eliz@gnu.org>
Date: Friday, December 22, 2006 11:50 am
Subject: Re: Saving when the coding system can't code all buffer characters

> > Date: Thu, 21 Dec 2006 23:40:53 +0100
> > From: Lennart Borgman <lennart.borgman.073@student.lu.se>
> > 
> > At the prompt "Select coding system (default mule-utf-8):" this 
> just 
> > gives information about the minibuffer.
> 
> ??? What do you mean by that?  I think it tells you what encoding will
> be used if you just hit RET.

I meant that 

  C-u C-x =

at the prompt gives information about the current position in the minibuffer. Or am I wrong?


> > And when using C-g to quit the problematic character disappears from
> > screen. Quite inconvenient IMHO.
> 
> The text is still available in the buffer names "*Warning*", and you
> can always get back to it if you try to save the buffer again.


But is not that hard to know?

 
> > Could it be made a bit easier to use please?
> 
> Please suggest an easier way, given that just hitting RET will DTRT.


It would IMHO be much more convenient if point in the buffer to save was left at the problematic character.

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-22 11:15 Saving when the coding system can't code all buffer characters LENNART BORGMAN
@ 2006-12-22 11:50 ` Eli Zaretskii
  2006-12-22 15:48   ` David Kastrup
                     ` (2 more replies)
  0 siblings, 3 replies; 36+ messages in thread
From: Eli Zaretskii @ 2006-12-22 11:50 UTC (permalink / raw)
  Cc: emacs-devel

> Date: Fri, 22 Dec 2006 12:15:45 +0100
> From: LENNART BORGMAN <lennart.borgman.073@student.lu.se>
> Cc: emacs-devel@gnu.org
> 
> I meant that 
> 
>   C-u C-x =
> 
> at the prompt gives information about the current position in the minibuffer. Or am I wrong?

You are supposed to type "C-u C-x =" in the buffer you are trying to
save.  To this end, you can type "C-x o" to get out of the minibuffer
and to the buffer being saved, and then type "C-u C-x =".

That is, if you don't understand what is wrong with the character in
the first place, since the (hollow) cursor is placed on it when you
are prompted for the encoding.

> > > Could it be made a bit easier to use please?
> > 
> > Please suggest an easier way, given that just hitting RET will DTRT.
> 
> 
> It would IMHO be much more convenient if point in the buffer to save was left at the problematic character.

Maybe we should simply include the information displayed by "C-u C-x ="
in the same *Warning* buffer that explains the problem.  That would
eliminate the need for telling about "C-u C-x =" and for an
arrangement to find the problematic characters after C-g.

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-22 11:50 ` Eli Zaretskii
@ 2006-12-22 15:48   ` David Kastrup
  2006-12-22 16:23     ` Lennart Borgman
  2006-12-22 17:35   ` Lennart Borgman
  2006-12-23 20:14   ` Richard Stallman
  2 siblings, 1 reply; 36+ messages in thread
From: David Kastrup @ 2006-12-22 15:48 UTC (permalink / raw)
  Cc: LENNART BORGMAN, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Fri, 22 Dec 2006 12:15:45 +0100
>> From: LENNART BORGMAN <lennart.borgman.073@student.lu.se>
>> Cc: emacs-devel@gnu.org
>> 
>> I meant that 
>> 
>>   C-u C-x =
>> 
>> at the prompt gives information about the current position in the
>> minibuffer. Or am I wrong?
>
> You are supposed to type "C-u C-x =" in the buffer you are trying to
> save.  To this end, you can type "C-x o" to get out of the
> minibuffer and to the buffer being saved, and then type "C-u C-x =".

I think that is far too much to suppose from an average user.  How
about putting a property on the character that will highlight it and
display the information on mouse-over in a tooltip?

> Maybe we should simply include the information displayed by "C-u C-x
> =" in the same *Warning* buffer that explains the problem.  That
> would eliminate the need for telling about "C-u C-x =" and for an
> arrangement to find the problematic characters after C-g.

Also an idea, but the warning is more dissociated from the buffer than
a highlight and tooltip would be.

-- 
David Kastrup

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-22 15:48   ` David Kastrup
@ 2006-12-22 16:23     ` Lennart Borgman
  2006-12-23  7:31       ` David Kastrup
  2006-12-31 14:36       ` Sascha Wilde
  0 siblings, 2 replies; 36+ messages in thread
From: Lennart Borgman @ 2006-12-22 16:23 UTC (permalink / raw)
  Cc: Eli Zaretskii, emacs-devel

David Kastrup wrote:
> Eli Zaretskii <eliz@gnu.org> writes:
>
>   
>>> Date: Fri, 22 Dec 2006 12:15:45 +0100
>>> From: LENNART BORGMAN <lennart.borgman.073@student.lu.se>
>>> Cc: emacs-devel@gnu.org
>>>
>>> I meant that 
>>>
>>>   C-u C-x =
>>>
>>> at the prompt gives information about the current position in the
>>> minibuffer. Or am I wrong?
>>>       
>> You are supposed to type "C-u C-x =" in the buffer you are trying to
>> save.  To this end, you can type "C-x o" to get out of the
>> minibuffer and to the buffer being saved, and then type "C-u C-x =".
>>     
>
> I think that is far too much to suppose from an average user.  How
> about putting a property on the character that will highlight it and
> display the information on mouse-over in a tooltip?
>   

Probably. Anyway I did not think of using C-x o here. I had no idea it 
worked from the minibuffer.

>   
>> Maybe we should simply include the information displayed by "C-u C-x
>> =" in the same *Warning* buffer that explains the problem.  That
>> would eliminate the need for telling about "C-u C-x =" and for an
>> arrangement to find the problematic characters after C-g.
>>     
>
> Also an idea, but the warning is more dissociated from the buffer than
> a highlight and tooltip would be.
>   

The warning stays visible afterwards and that is very good in a case 
like this. A highlight is also very good, but a tooltip is far to 
obscure IMHO.

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-22 11:50 ` Eli Zaretskii
  2006-12-22 15:48   ` David Kastrup
@ 2006-12-22 17:35   ` Lennart Borgman
  2006-12-23 20:14   ` Richard Stallman
  2 siblings, 0 replies; 36+ messages in thread
From: Lennart Borgman @ 2006-12-22 17:35 UTC (permalink / raw)
  Cc: emacs-devel

Eli Zaretskii wrote:
> Maybe we should simply include the information displayed by "C-u C-x ="
> in the same *Warning* buffer that explains the problem.  That would
> eliminate the need for telling about "C-u C-x =" and for an
> arrangement to find the problematic characters after C-g.
>   

It is a good suggestion to use the *Warning* buffer. However there 
should in my opinion also be a way to go to the problematic character.

How about a link from the warning buffer?

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-21 22:40 Lennart Borgman
  2006-12-22 10:50 ` Eli Zaretskii
@ 2006-12-22 21:03 ` Richard Stallman
  2006-12-23 12:09   ` Kenichi Handa
  1 sibling, 1 reply; 36+ messages in thread
From: Richard Stallman @ 2006-12-22 21:03 UTC (permalink / raw)
  Cc: handa, emacs-devel

Handa-san, would you please join in this?

    The first problematic character is at point in the displayed buffer,
    and C-u C-x = will give information about it.

    At the prompt "Select coding system (default mule-utf-8):" this just 
    gives information about the minibuffer.

That is true.  So you have to switch windows in order to use the command
C-u C-x = to get that information.

     And when using C-g to quit the 
    problematic character disappears from screen.

Of course, that is what C-g is supposed to do.

I see two things we could do:

* Change the message to say that you need to switch to that window
before you give the command.

* Make up some simpler command, and make it work without switching
  windows.  What command could it be?  It has to be typable on a tty.

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-22 16:23     ` Lennart Borgman
@ 2006-12-23  7:31       ` David Kastrup
  2006-12-31 14:36       ` Sascha Wilde
  1 sibling, 0 replies; 36+ messages in thread
From: David Kastrup @ 2006-12-23  7:31 UTC (permalink / raw)
  Cc: Eli Zaretskii, emacs-devel

Lennart Borgman <lennart.borgman.073@student.lu.se> writes:

> David Kastrup wrote:
>>
>> Also an idea, but the warning is more dissociated from the buffer
>> than a highlight and tooltip would be.
>>   
>
> The warning stays visible afterwards and that is very good in a case
> like this. A highlight is also very good, but a tooltip is far to
> obscure IMHO.

A tooltip may be too obscure as the sole source of information (hardly
surprising since that is pretty much generally true for tooltips).  As
additional info, it certainly is helpful.

We already put tooltips on raw/illicit bytes in utf-8 buffers.  It
seems like it would be natural to do this for unsaveable bytes, too.
Probably overlays rather than text properties are appropriate for
that, however, since the unsaveability is rather a property of the
buffer (and its encoding) than the text: with bad utf-8 bytes, it is
rather a text property, in contrast.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-22 21:03 ` Richard Stallman
@ 2006-12-23 12:09   ` Kenichi Handa
  2006-12-24  1:35     ` Richard Stallman
  0 siblings, 1 reply; 36+ messages in thread
From: Kenichi Handa @ 2006-12-23 12:09 UTC (permalink / raw)
  Cc: lennart.borgman.073, emacs-devel

In article <E1GxrXz-0006QO-Ja@fencepost.gnu.org>, Richard Stallman <rms@gnu.org> writes:

> Handa-san, would you please join in this?
>     The first problematic character is at point in the displayed buffer,
>     and C-u C-x = will give information about it.

>     At the prompt "Select coding system (default mule-utf-8):" this just 
>     gives information about the minibuffer.

> That is true.  So you have to switch windows in order to use the command
> C-u C-x = to get that information.

>      And when using C-g to quit the 
>     problematic character disappears from screen.

> Of course, that is what C-g is supposed to do.

But, *Warning* buffer is still there, and thus you can
click a character by mouse shown under the line:
"However, each of them encountered these problematic characters:"
to jump to that character.

> I see two things we could do:

> * Change the message to say that you need to switch to that window
> before you give the command.

> * Make up some simpler command, and make it work without switching
>   windows.  What command could it be?  It has to be typable on a tty.

How about typing C-g prints:
Jump to the first problematic character? (y or n)
and when 'y' is typed, move point to that character?

---
Kenichi Handa
handa@m17n.org

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-22 11:50 ` Eli Zaretskii
  2006-12-22 15:48   ` David Kastrup
  2006-12-22 17:35   ` Lennart Borgman
@ 2006-12-23 20:14   ` Richard Stallman
  2006-12-23 20:41     ` Lennart Borgman
  2 siblings, 1 reply; 36+ messages in thread
From: Richard Stallman @ 2006-12-23 20:14 UTC (permalink / raw)
  Cc: lennart.borgman.073, emacs-devel

    > It would IMHO be much more convenient if point in the buffer to save was left at the problematic character.

    Maybe we should simply include the information displayed by "C-u C-x ="
    in the same *Warning* buffer that explains the problem.  That would
    eliminate the need for telling about "C-u C-x =" and for an
    arrangement to find the problematic characters after C-g.

That sounds like a good approach.  Would someone please try it?

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-23 20:14   ` Richard Stallman
@ 2006-12-23 20:41     ` Lennart Borgman
  2006-12-24 17:09       ` Richard Stallman
  0 siblings, 1 reply; 36+ messages in thread
From: Lennart Borgman @ 2006-12-23 20:41 UTC (permalink / raw)
  Cc: Eli Zaretskii, emacs-devel

Richard Stallman wrote:
>     > It would IMHO be much more convenient if point in the buffer to save was left at the problematic character.
> 
>     Maybe we should simply include the information displayed by "C-u C-x ="
>     in the same *Warning* buffer that explains the problem.  That would
>     eliminate the need for telling about "C-u C-x =" and for an
>     arrangement to find the problematic characters after C-g.
> 
> That sounds like a good approach.  Would someone please try it?


I think it is important to have a simple way to find the problematic 
character too. As I wrote before something like a button field in the 
*Warning* buffer is one idea.

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-23 12:09   ` Kenichi Handa
@ 2006-12-24  1:35     ` Richard Stallman
  2006-12-25  6:00       ` Kenichi Handa
  0 siblings, 1 reply; 36+ messages in thread
From: Richard Stallman @ 2006-12-24  1:35 UTC (permalink / raw)
  Cc: lennart.borgman.073, emacs-devel

    How about typing C-g prints:
    Jump to the first problematic character? (y or n)
    and when 'y' is typed, move point to that character?

It is a very bad idea to make C-g do something strange.
Let's use a different solution.

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-23 20:41     ` Lennart Borgman
@ 2006-12-24 17:09       ` Richard Stallman
  0 siblings, 0 replies; 36+ messages in thread
From: Richard Stallman @ 2006-12-24 17:09 UTC (permalink / raw)
  Cc: eliz, emacs-devel

    I think it is important to have a simple way to find the problematic 
    character too. As I wrote before something like a button field in the 
    *Warning* buffer is one idea.

That has two drawbacks:

* It requires you to click on a button.

* It won't work on a tty at all.

The suggestion to put this into straight into that buffer,
and not require the user to type or click anything, is much better.
Would someone please implement that so we can try it?

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-24  1:35     ` Richard Stallman
@ 2006-12-25  6:00       ` Kenichi Handa
  2006-12-26  2:25         ` Richard Stallman
  0 siblings, 1 reply; 36+ messages in thread
From: Kenichi Handa @ 2006-12-25  6:00 UTC (permalink / raw)
  Cc: lennart.borgman.073, emacs-devel

In article <E1GyIHB-00033O-OT@fencepost.gnu.org>, Richard Stallman <rms@gnu.org> writes:

>     How about typing C-g prints:
>     Jump to the first problematic character? (y or n)
>     and when 'y' is typed, move point to that character?

> It is a very bad idea to make C-g do something strange.
> Let's use a different solution.

Then, is it ok that, after C-g, point is moved to the first
problematic character and the contents of *Warning* buffer
is a little bit changed to show what to do?

---
Kenichi Handa
handa@m17n.org

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-25  6:00       ` Kenichi Handa
@ 2006-12-26  2:25         ` Richard Stallman
  2006-12-27  1:39           ` Kenichi Handa
  0 siblings, 1 reply; 36+ messages in thread
From: Richard Stallman @ 2006-12-26  2:25 UTC (permalink / raw)
  Cc: lennart.borgman.073, emacs-devel

    Then, is it ok that, after C-g, point is moved to the first
    problematic character and the contents of *Warning* buffer
    is a little bit changed to show what to do?

No, C-g should JUST QUIT.

I suggested people make it show all the relevant information _at the
outset_.  Would you like to try implementing that, please?

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-26  2:25         ` Richard Stallman
@ 2006-12-27  1:39           ` Kenichi Handa
  2006-12-27  2:59             ` Lennart Borgman (gmail)
                               ` (2 more replies)
  0 siblings, 3 replies; 36+ messages in thread
From: Kenichi Handa @ 2006-12-27  1:39 UTC (permalink / raw)
  Cc: lennart.borgman.073, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1695 bytes --]

In article <E1Gz20e-0003eV-DX@fencepost.gnu.org>, Richard Stallman <rms@gnu.org> writes:

>     Then, is it ok that, after C-g, point is moved to the first
>     problematic character and the contents of *Warning* buffer
>     is a little bit changed to show what to do?

> No, C-g should JUST QUIT.

> I suggested people make it show all the relevant information _at the
> outset_.  Would you like to try implementing that, please?

Even if we put all the relevant information in *Warning*
buffer, as the window height is limited, a user have to
switch to *Warning* buffer and scroll up/down to see all of
them.  In addition, I don't know what is "all the relevant
information" for a user.   One may want to see the info
shown by C-u C-x =, one may want to see the docstring of
each coding system, ...

So, I just improved the content of *Warning* buffer a little
bit as below (the changed parts are indicated by ^^^^).

----------------------------------------------------------------------
These default coding systems were tried to encode text
in the buffer `temp':
  euc-japan-unix
However, each of them encountered these problematic characters:
  euc-japan-unix: 你 好

Click those characters to jump to the place they appear,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
and C-u C-x = will give information about it.

Select one of the following safe coding systems,
or cancel the writing by C-g and edit the buffer,
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
or specify any other coding system at the risk of
losing the problematic characters.
  utf-8 utf-16 utf-16 utf-16 utf-16be utf-16le iso-2022-7bit


---
Kenichi Handa
handa@m17n.org

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-27  1:39           ` Kenichi Handa
@ 2006-12-27  2:59             ` Lennart Borgman (gmail)
  2006-12-27  5:13               ` Kenichi Handa
  2006-12-27  8:28             ` Eli Zaretskii
  2006-12-27 21:16             ` Richard Stallman
  2 siblings, 1 reply; 36+ messages in thread
From: Lennart Borgman (gmail) @ 2006-12-27  2:59 UTC (permalink / raw)
  Cc: rms, emacs-devel

Kenichi Handa wrote:

> Even if we put all the relevant information in *Warning*
> buffer, as the window height is limited, a user have to
> switch to *Warning* buffer and scroll up/down to see all of
> them.  In addition, I don't know what is "all the relevant
> information" for a user.   One may want to see the info
> shown by C-u C-x =, one may want to see the docstring of
> each coding system, ...
> 
> So, I just improved the content of *Warning* buffer a little
> bit as below (the changed parts are indicated by ^^^^).


I think this version is very nice. I would however suggest another color
for the character links in the *Warning* buffer. That would make the
warning much more easy to understand quickly. Blue is the most common
color (like in Info).


> Click those characters to jump to the place they appear,
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> and C-u C-x = will give information about it.


Maybe "and there C-u C-x = will ..." is more easy to understand.

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-27  2:59             ` Lennart Borgman (gmail)
@ 2006-12-27  5:13               ` Kenichi Handa
  2006-12-27 13:27                 ` Eli Zaretskii
  0 siblings, 1 reply; 36+ messages in thread
From: Kenichi Handa @ 2006-12-27  5:13 UTC (permalink / raw)
  Cc: rms, emacs-devel

In article <4591E1AB.6080703@gmail.com>, "Lennart Borgman (gmail)" <lennart.borgman@gmail.com> writes:

> > So, I just improved the content of *Warning* buffer a little
> > bit as below (the changed parts are indicated by ^^^^).

> I think this version is very nice. I would however suggest another color
> for the character links in the *Warning* buffer. That would make the
> warning much more easy to understand quickly. Blue is the most common
> color (like in Info).

> > Click those characters to jump to the place they appear,
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > and C-u C-x = will give information about it.

> Maybe "and there C-u C-x = will ..." is more easy to understand.

Thank you.  I've changed the code according to your
suggestion.

---
Kenichi Handa
handa@m17n.org

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-27  1:39           ` Kenichi Handa
  2006-12-27  2:59             ` Lennart Borgman (gmail)
@ 2006-12-27  8:28             ` Eli Zaretskii
  2006-12-27 11:06               ` Kenichi Handa
  2006-12-27 21:16             ` Richard Stallman
  2 siblings, 1 reply; 36+ messages in thread
From: Eli Zaretskii @ 2006-12-27  8:28 UTC (permalink / raw)
  Cc: lennart.borgman.073, rms, emacs-devel

> From: Kenichi Handa <handa@m17n.org>
> Date: Wed, 27 Dec 2006 10:39:39 +0900
> Cc: lennart.borgman.073@student.lu.se, emacs-devel@gnu.org
> 
> > I suggested people make it show all the relevant information _at the
> > outset_.  Would you like to try implementing that, please?
> 
> Even if we put all the relevant information in *Warning*
> buffer, as the window height is limited, a user have to
> switch to *Warning* buffer and scroll up/down to see all of
> them.

We could make SPC scroll *Warning*, as we do with *Help* buffers.

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-27  8:28             ` Eli Zaretskii
@ 2006-12-27 11:06               ` Kenichi Handa
  2006-12-27 12:20                 ` Eli Zaretskii
  0 siblings, 1 reply; 36+ messages in thread
From: Kenichi Handa @ 2006-12-27 11:06 UTC (permalink / raw)
  Cc: lennart.borgman.073, rms, emacs-devel

In article <ur6ul215u.fsf@gnu.org>, Eli Zaretskii <eliz@gnu.org> writes:

> > From: Kenichi Handa <handa@m17n.org>
> > Date: Wed, 27 Dec 2006 10:39:39 +0900
> > Cc: lennart.borgman.073@student.lu.se, emacs-devel@gnu.org
> > 
> > > I suggested people make it show all the relevant information _at the
> > > outset_.  Would you like to try implementing that, please?
> > 
> > Even if we put all the relevant information in *Warning*
> > buffer, as the window height is limited, a user have to
> > switch to *Warning* buffer and scroll up/down to see all of
> > them.

> We could make SPC scroll *Warning*, as we do with *Help* buffers.

But, then, SPC can't be used for completion of coding system
names.

---
Kenichi Handa
handa@m17n.org

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-27 11:06               ` Kenichi Handa
@ 2006-12-27 12:20                 ` Eli Zaretskii
  2006-12-27 12:37                   ` Lennart Borgman (gmail)
  2006-12-28  0:31                   ` Kenichi Handa
  0 siblings, 2 replies; 36+ messages in thread
From: Eli Zaretskii @ 2006-12-27 12:20 UTC (permalink / raw)
  Cc: lennart.borgman.073, rms, emacs-devel

> From: Kenichi Handa <handa@m17n.org>
> CC: lennart.borgman.073@student.lu.se, rms@gnu.org, emacs-devel@gnu.org
> Date: Wed, 27 Dec 2006 20:06:44 +0900
> 
> > We could make SPC scroll *Warning*, as we do with *Help* buffers.
> 
> But, then, SPC can't be used for completion of coding system
> names.

Okay, then how about saying in the minibuffer "M-C-v to scroll" or
something like that?

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-27 12:20                 ` Eli Zaretskii
@ 2006-12-27 12:37                   ` Lennart Borgman (gmail)
  2006-12-27 14:17                     ` Eli Zaretskii
  2006-12-28  0:31                   ` Kenichi Handa
  1 sibling, 1 reply; 36+ messages in thread
From: Lennart Borgman (gmail) @ 2006-12-27 12:37 UTC (permalink / raw)
  Cc: lennart.borgman.073, emacs-devel, rms, Kenichi Handa

Eli Zaretskii wrote:
>> From: Kenichi Handa <handa@m17n.org>
>> CC: lennart.borgman.073@student.lu.se, rms@gnu.org, emacs-devel@gnu.org
>> Date: Wed, 27 Dec 2006 20:06:44 +0900
>>
>>> We could make SPC scroll *Warning*, as we do with *Help* buffers.
>> But, then, SPC can't be used for completion of coding system
>> names.
> 
> Okay, then how about saying in the minibuffer "M-C-v to scroll" or
> something like that?


Why is that necessary? The *Warning* buffer will stay visible even after 
  Ctrl-G, or?

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-27  5:13               ` Kenichi Handa
@ 2006-12-27 13:27                 ` Eli Zaretskii
  2006-12-27 21:16                   ` Richard Stallman
  2006-12-28  2:09                   ` Kenichi Handa
  0 siblings, 2 replies; 36+ messages in thread
From: Eli Zaretskii @ 2006-12-27 13:27 UTC (permalink / raw)
  Cc: lennart.borgman, rms, emacs-devel

> From: Kenichi Handa <handa@m17n.org>
> Date: Wed, 27 Dec 2006 14:13:19 +0900
> Cc: rms@gnu.org, emacs-devel@gnu.org
> 
> Thank you.  I've changed the code according to your
> suggestion.

I fixed the wording some more.

I really like how this works now; my only minor gripe is that clicking
on the problematic characters causes one to get out of the minibuffer
without deactivating it, so C-g will not gonna do what a naive user
expects, unless she returns to the minibuffer first.

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-27 12:37                   ` Lennart Borgman (gmail)
@ 2006-12-27 14:17                     ` Eli Zaretskii
  0 siblings, 0 replies; 36+ messages in thread
From: Eli Zaretskii @ 2006-12-27 14:17 UTC (permalink / raw)
  Cc: lennart.borgman.073, emacs-devel, rms, handa

> Date: Wed, 27 Dec 2006 13:37:50 +0100
> From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
> CC: Kenichi Handa <handa@m17n.org>,  lennart.borgman.073@student.lu.se, 
>  rms@gnu.org,  emacs-devel@gnu.org
> > 
> > Okay, then how about saying in the minibuffer "M-C-v to scroll" or
> > something like that?
> 
> Why is that necessary? The *Warning* buffer will stay visible even after 
>   Ctrl-G, or?

Because I might want to scroll it to read the text in its entirety, in
order to take the right action.  Why force me to quit in order to see
it?

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-27 13:27                 ` Eli Zaretskii
@ 2006-12-27 21:16                   ` Richard Stallman
  2006-12-28  2:09                   ` Kenichi Handa
  1 sibling, 0 replies; 36+ messages in thread
From: Richard Stallman @ 2006-12-27 21:16 UTC (permalink / raw)
  Cc: emacs-devel, lennart.borgman, handa

The new text makes things clearer, but meanwhile the suggestion of
putting some of the C-u C-x = output into the warning buffer
so that the user doesn't even have to type the command
has been ignored.

Also, the new advice to "click" won't work on a tty.

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-27  1:39           ` Kenichi Handa
  2006-12-27  2:59             ` Lennart Borgman (gmail)
  2006-12-27  8:28             ` Eli Zaretskii
@ 2006-12-27 21:16             ` Richard Stallman
  2006-12-28  1:32               ` Kenichi Handa
  2006-12-28  4:20               ` Eli Zaretskii
  2 siblings, 2 replies; 36+ messages in thread
From: Richard Stallman @ 2006-12-27 21:16 UTC (permalink / raw)
  Cc: lennart.borgman.073, emacs-devel

      In addition, I don't know what is "all the relevant
    information" for a user.   One may want to see the info
    shown by C-u C-x =, one may want to see the docstring of
    each coding system, ...

I am talking about the interesting parts of the output of C-u C-x =.
All or part of this:

  character: á (2273, #o4341, #x8e1, U+00E1)
    charset: latin-iso8859-1
	     (Right-Hand Part of Latin Alphabet 1 (ISO/IEC 8859-1): ISO-IR-100.)
   category: l:Latin
   to input: type "a'" with latin-1-postfix

How about putting some of that into the warning buffer?

It need not be ALL of those 5 lines -- just whatever part seems
useful.  And the parts we use could be combined so as to
occupy fewer lines.  That ought to avoid the problem of making the
warning too long so that it always needs scrolling.

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-27 12:20                 ` Eli Zaretskii
  2006-12-27 12:37                   ` Lennart Borgman (gmail)
@ 2006-12-28  0:31                   ` Kenichi Handa
  1 sibling, 0 replies; 36+ messages in thread
From: Kenichi Handa @ 2006-12-28  0:31 UTC (permalink / raw)
  Cc: lennart.borgman.073, rms, emacs-devel

In article <ulkkt1qe5.fsf@gnu.org>, Eli Zaretskii <eliz@gnu.org> writes:

> > From: Kenichi Handa <handa@m17n.org>
> > CC: lennart.borgman.073@student.lu.se, rms@gnu.org, emacs-devel@gnu.org
> > Date: Wed, 27 Dec 2006 20:06:44 +0900
> > 
> > > We could make SPC scroll *Warning*, as we do with *Help* buffers.
> > 
> > But, then, SPC can't be used for completion of coding system
> > names.

> Okay, then how about saying in the minibuffer "M-C-v to scroll" or
> something like that?

M-C-v is used to scroll the original buffer, not *Warning*
buffer.

---
Kenichi Handa
handa@m17n.org

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-27 21:16             ` Richard Stallman
@ 2006-12-28  1:32               ` Kenichi Handa
  2006-12-28  4:20               ` Eli Zaretskii
  1 sibling, 0 replies; 36+ messages in thread
From: Kenichi Handa @ 2006-12-28  1:32 UTC (permalink / raw)
  Cc: lennart.borgman.073, emacs-devel

In article <E1Gzg8o-0002iD-FW@fencepost.gnu.org>, Richard Stallman <rms@gnu.org> writes:

>       In addition, I don't know what is "all the relevant
>     information" for a user.   One may want to see the info
>     shown by C-u C-x =, one may want to see the docstring of
>     each coding system, ...

> I am talking about the interesting parts of the output of C-u C-x =.
> All or part of this:

>   character: á (2273, #o4341, #x8e1, U+00E1)
>     charset: latin-iso8859-1
> 	     (Right-Hand Part of Latin Alphabet 1 (ISO/IEC 8859-1): ISO-IR-100.)
>    category: l:Latin
>    to input: type "a'" with latin-1-postfix

> How about putting some of that into the warning buffer?

> It need not be ALL of those 5 lines -- just whatever part seems
> useful.  And the parts we use could be combined so as to
> occupy fewer lines.  That ought to avoid the problem of making the
> warning too long so that it always needs scrolling.

I think such a change is beyond the work that should be done
while feature freezing.  So, I put that in my TODO list.

---
Kenichi Handa
handa@m17n.org

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-27 13:27                 ` Eli Zaretskii
  2006-12-27 21:16                   ` Richard Stallman
@ 2006-12-28  2:09                   ` Kenichi Handa
  1 sibling, 0 replies; 36+ messages in thread
From: Kenichi Handa @ 2006-12-28  2:09 UTC (permalink / raw)
  Cc: lennart.borgman, rms, emacs-devel

In article <uhcvh1naz.fsf@gnu.org>, Eli Zaretskii <eliz@gnu.org> writes:

> I fixed the wording some more.

Thank you.

> I really like how this works now; my only minor gripe is that clicking
> on the problematic characters causes one to get out of the minibuffer
> without deactivating it, so C-g will not gonna do what a naive user
> expects, unless she returns to the minibuffer first.

I agree.  So, it is better to guide a user to type C-g
before clicking.

How about moving "Click a character ..." under "or cancel ..."
as this?

Select one of the safe coding systems listed below,
or cancel the writing with C-g and fix the problematic characters
   (click a problematic character above to jump to the place it appears,
    where `C-u C-x =' will give information about it),
or specify any other coding system (and risk losing
   the problematic characters).

---
Kenichi Handa
handa@m17n.org

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-27 21:16             ` Richard Stallman
  2006-12-28  1:32               ` Kenichi Handa
@ 2006-12-28  4:20               ` Eli Zaretskii
  2006-12-29 15:44                 ` Richard Stallman
  1 sibling, 1 reply; 36+ messages in thread
From: Eli Zaretskii @ 2006-12-28  4:20 UTC (permalink / raw)
  Cc: lennart.borgman.073, emacs-devel, handa

> From: Richard Stallman <rms@gnu.org>
> Date: Wed, 27 Dec 2006 16:16:50 -0500
> Cc: lennart.borgman.073@student.lu.se, emacs-devel@gnu.org
> 
> I am talking about the interesting parts of the output of C-u C-x =.
> All or part of this:
> 
>   character: á (2273, #o4341, #x8e1, U+00E1)
>     charset: latin-iso8859-1
> 	     (Right-Hand Part of Latin Alphabet 1 (ISO/IEC 8859-1): ISO-IR-100.)
>    category: l:Latin
>    to input: type "a'" with latin-1-postfix
> 
> How about putting some of that into the warning buffer?
> 
> It need not be ALL of those 5 lines -- just whatever part seems
> useful.  And the parts we use could be combined so as to
> occupy fewer lines.  That ought to avoid the problem of making the
> warning too long so that it always needs scrolling.

I suggested doing that, but I realize now that this isn't easy.  The
*Warning* buffer shows several characters for each encoding that is
unsafe, like this:

    However, each of them encountered characters it couldn't encode:
      cp1251-unix cannot encode these: x x x x x x x x x ...
      iso-latin-1-unix cannot encode these: y y y y y y y y y ...

Each one of `x' and `y' is a different character, potentially from
several different character sets.  How to display information about
them based on what "C-u C-x =" produces?

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-28  4:20               ` Eli Zaretskii
@ 2006-12-29 15:44                 ` Richard Stallman
  0 siblings, 0 replies; 36+ messages in thread
From: Richard Stallman @ 2006-12-29 15:44 UTC (permalink / raw)
  Cc: lennart.borgman.073, emacs-devel, handa

	However, each of them encountered characters it couldn't encode:
	  cp1251-unix cannot encode these: x x x x x x x x x ...
	  iso-latin-1-unix cannot encode these: y y y y y y y y y ...

    Each one of `x' and `y' is a different character, potentially from
    several different character sets.  How to display information about
    them based on what "C-u C-x =" produces?

My idea is to pick the first character and give more info about it.
To be sure, that is not ALL the information the user might conceivably
want.  He might be more interested in the others characters.  However,
most of the time, the info about ANY one character will be enough to
explain the problem.  Giving this extra info about just one character
(the first) is very likely to be enough.

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-22 16:23     ` Lennart Borgman
  2006-12-23  7:31       ` David Kastrup
@ 2006-12-31 14:36       ` Sascha Wilde
  2006-12-31 16:04         ` Lennart Borgman
  2007-01-09  7:23         ` Kenichi Handa
  1 sibling, 2 replies; 36+ messages in thread
From: Sascha Wilde @ 2006-12-31 14:36 UTC (permalink / raw)
  Cc: Eli Zaretskii, Richard M. Stallman, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 850 bytes --]

Lennart Borgman <lennart.borgman.073@student.lu.se> wrote:
> David Kastrup wrote:
>> Eli Zaretskii <eliz@gnu.org> writes:
[...]
>>> You are supposed to type "C-u C-x =" in the buffer you are trying to
>>> save.  To this end, you can type "C-x o" to get out of the
>>> minibuffer and to the buffer being saved, and then type "C-u C-x =".
>>
>> I think that is far too much to suppose from an average user.  How
>> about putting a property on the character that will highlight it and
>> display the information on mouse-over in a tooltip?
>
> Probably. Anyway I did not think of using C-x o here. I had no idea it
> worked from the minibuffer.

As this seems to be the only information missing from the *warning*
buffer for pure tty use (or mousephobics like me), maybe we should
simply add a note on C-x o to the text?

Here is my first try on this:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1084 bytes --]

diff -r e0ab6280c837 lisp/international/mule-cmds.el
*** a/lisp/international/mule-cmds.el	Sun Dec 31 12:25:06 2006 +0100
--- b/lisp/international/mule-cmds.el	Sun Dec 31 15:31:40 2006 +0100
***************
*** 792,798 ****
  
  Click on a character to jump to the place it appears,\n"
  		      (substitute-command-keys "\
! where `\\[universal-argument] \\[what-cursor-position]' will give information about it.\n"))))
  	  (insert (substitute-command-keys "\nSelect \
  one of the safe coding systems listed below,\n\
  or cancel the writing with \\[keyboard-quit] and edit the buffer\n\
--- 792,800 ----
  
  Click on a character to jump to the place it appears,\n"
  		      (substitute-command-keys "\
! where `\\[universal-argument] \\[what-cursor-position]' will give information about it.\n\
! You can also use `\\[other-window]' to witch to this window \n\
! and select the characters using RET.\n"))))
  	  (insert (substitute-command-keys "\nSelect \
  one of the safe coding systems listed below,\n\
  or cancel the writing with \\[keyboard-quit] and edit the buffer\n\


[-- Attachment #3: Type: text/plain, Size: 336 bytes --]


cheers
sascha
-- 
>++++++[<+++++++++++>-]<+.>+++[<++++++>-]<.---.---------.++++++.++++.---------
-.+++++++++++.+++++.>+++++++[<-------->-]<-.>++++++[<+++++++>-]<+.--.+++..----
---.-.>++++++[<------>-]<.>++++[<+++++++++++++>-]<.------------.---.>++++++[<-
----->-]<-.>+++++[<+++++++>-]<.--.>+++[<++++++>-]<+.>++++++++[<--------->-]<--.

[-- Attachment #4: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-31 14:36       ` Sascha Wilde
@ 2006-12-31 16:04         ` Lennart Borgman
  2006-12-31 19:27           ` Aidan Kehoe
  2007-01-09  7:23         ` Kenichi Handa
  1 sibling, 1 reply; 36+ messages in thread
From: Lennart Borgman @ 2006-12-31 16:04 UTC (permalink / raw)
  Cc: emacs-devel

Sascha Wilde wrote:

> ! You can also use `\\[other-window]' to witch to this window \n\


Looks good to me except for the witch.

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-31 16:04         ` Lennart Borgman
@ 2006-12-31 19:27           ` Aidan Kehoe
  0 siblings, 0 replies; 36+ messages in thread
From: Aidan Kehoe @ 2006-12-31 19:27 UTC (permalink / raw)
  Cc: emacs-devel


 Ar an t-aonú lá is triochad de mí na Nollaig, scríobh Lennart Borgman: 

 > Sascha Wilde wrote:
 > 
 > > ! You can also use `\\[other-window]' to witch to this window \n\
 > 
 > Looks good to me except for the witch.

Yes. Burn her!

-- 
When I was in the scouts, the leader told me to pitch a tent. I couldn't
find any pitch, so I used creosote.

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

* Re: Saving when the coding system can't code all buffer characters
  2006-12-31 14:36       ` Sascha Wilde
  2006-12-31 16:04         ` Lennart Borgman
@ 2007-01-09  7:23         ` Kenichi Handa
  1 sibling, 0 replies; 36+ messages in thread
From: Kenichi Handa @ 2007-01-09  7:23 UTC (permalink / raw)
  Cc: lennart.borgman.073, eliz, rms, emacs-devel

In article <m2ac14i13r.fsf@kenny.sha-bang.de>, Sascha Wilde <wilde@sha-bang.de> writes:

> > Probably. Anyway I did not think of using C-x o here. I had no idea it
> > worked from the minibuffer.

> As this seems to be the only information missing from the *warning*
> buffer for pure tty use (or mousephobics like me), maybe we should
> simply add a note on C-x o to the text?

> Here is my first try on this:

Sorry for the late response and thank you for a good
suggestion.  I've just installed this slightly modified
version.

diff -u -r1.307 -r1.308
--- mule-cmds.el	30 Dec 2006 06:27:30 -0000	1.307
+++ mule-cmds.el	9 Jan 2007 07:22:11 -0000	1.308
@@ -788,10 +788,10 @@
 					  (car coding)))))
 		    (setq i (1+ i))))
 		(insert "\n"))
-	      (insert "\
+	      (insert (substitute-command-keys "\
 
-Click on a character to jump to the place it appears,\n"
-		      (substitute-command-keys "\
+Click on a character (or switch to this window by `\\[other-window]'\n\
+and select the characters by RET) to jump to the place it appears,\n\
 where `\\[universal-argument] \\[what-cursor-position]' will give information about it.\n"))))
 	  (insert (substitute-command-keys "\nSelect \
 one of the safe coding systems listed below,\n\

---
Kenichi Handa
handa@m17n.org

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

end of thread, other threads:[~2007-01-09  7:23 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-22 11:15 Saving when the coding system can't code all buffer characters LENNART BORGMAN
2006-12-22 11:50 ` Eli Zaretskii
2006-12-22 15:48   ` David Kastrup
2006-12-22 16:23     ` Lennart Borgman
2006-12-23  7:31       ` David Kastrup
2006-12-31 14:36       ` Sascha Wilde
2006-12-31 16:04         ` Lennart Borgman
2006-12-31 19:27           ` Aidan Kehoe
2007-01-09  7:23         ` Kenichi Handa
2006-12-22 17:35   ` Lennart Borgman
2006-12-23 20:14   ` Richard Stallman
2006-12-23 20:41     ` Lennart Borgman
2006-12-24 17:09       ` Richard Stallman
  -- strict thread matches above, loose matches on Subject: below --
2006-12-21 22:40 Lennart Borgman
2006-12-22 10:50 ` Eli Zaretskii
2006-12-22 21:03 ` Richard Stallman
2006-12-23 12:09   ` Kenichi Handa
2006-12-24  1:35     ` Richard Stallman
2006-12-25  6:00       ` Kenichi Handa
2006-12-26  2:25         ` Richard Stallman
2006-12-27  1:39           ` Kenichi Handa
2006-12-27  2:59             ` Lennart Borgman (gmail)
2006-12-27  5:13               ` Kenichi Handa
2006-12-27 13:27                 ` Eli Zaretskii
2006-12-27 21:16                   ` Richard Stallman
2006-12-28  2:09                   ` Kenichi Handa
2006-12-27  8:28             ` Eli Zaretskii
2006-12-27 11:06               ` Kenichi Handa
2006-12-27 12:20                 ` Eli Zaretskii
2006-12-27 12:37                   ` Lennart Borgman (gmail)
2006-12-27 14:17                     ` Eli Zaretskii
2006-12-28  0:31                   ` Kenichi Handa
2006-12-27 21:16             ` Richard Stallman
2006-12-28  1:32               ` Kenichi Handa
2006-12-28  4:20               ` Eli Zaretskii
2006-12-29 15:44                 ` Richard Stallman

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