all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* getting rid of ^M displayed by emacs-w3m
@ 2007-03-23 23:00 Alexey Pustyntsev
  2007-03-24 18:27 ` Alexey Pustyntsev
  0 siblings, 1 reply; 8+ messages in thread
From: Alexey Pustyntsev @ 2007-03-23 23:00 UTC (permalink / raw)
  To: help-gnu-emacs

Hi all!

Strangely, I have upgraded my emacs to 22.0.95.1 (it was 22.0.50
before) and emacs-w3 now shows ^M characters in php documentation
files, which I usually browse from within emacs. The html page looks
as follows.

----------------------start snippet-----------------------------
Chapter 11. Types

Table of Contents
Introduction
Booleans
Integers
Floating point numbers
Strings
Arrays
Objects
Resource
NULL
Pseudo-types used in this documentation
Type Juggling

Introduction

 ^MPHP supports eight primitive types.

 ^MFour scalar types:

  • ^Mboolean
   
  • ^Minteger
   
  • ^Mfloat (floating-point number, aka 'double')
   
  • ^Mstring
---------------------end  snippet-------------------------------

I didn't have this problem with 22.0.50. Everything was fine. I have
tried to follow the *troubleshooting* section of the emacs-w3m
documentation but it doesn't really help. The w3m itself displays the
page absolutely correctly if started in xterm, so that doesn't seem to
be the problem of w3m. Could you please hint to me what may be wrong?

--
Rgds
Alexey

Today is Pungenday, the 10th day of Discord in the YOLD 3173

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

* Re: getting rid of ^M displayed by emacs-w3m
  2007-03-23 23:00 getting rid of ^M displayed by emacs-w3m Alexey Pustyntsev
@ 2007-03-24 18:27 ` Alexey Pustyntsev
  2007-03-24 19:03   ` Peter Dyballa
  0 siblings, 1 reply; 8+ messages in thread
From: Alexey Pustyntsev @ 2007-03-24 18:27 UTC (permalink / raw)
  To: help-gnu-emacs


It turned out that ^M (or \015 in octal form) is what emacs displays
when it encounters the carriage return control character.

After some experimenting, I put the following code

(standard-display-ascii ?\015 "")

in my .emacs and it seems to have done the job.

However, I am still not very sure if this is the right way to deal
with the problem, as I feel that, normally, it should be solved by
default, not requiring user intervention, except in special cases,
of course.  

-- 
Rgds
Alexey

Today is Prickle-Prickle, the 11st day of Discord in the YOLD 3173

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

* Re: getting rid of ^M displayed by emacs-w3m
  2007-03-24 18:27 ` Alexey Pustyntsev
@ 2007-03-24 19:03   ` Peter Dyballa
  2007-03-24 21:07     ` Alexey Pustyntsev
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Dyballa @ 2007-03-24 19:03 UTC (permalink / raw)
  To: Alexey Pustyntsev; +Cc: help-gnu-emacs


Am 24.03.2007 um 19:27 schrieb Alexey Pustyntsev:

> it should be solved by default

You could consider to set a default encoding, and that encoding's  
name should end in -mac, because it's a Mac feature to end lines with  
Carriage Return. Or are the lines ending in Carriage Return + Line  
Feed? Then a -dos ending of the encoding's name is more suitable.

	set-default-coding-systems
	prefer-coding-system
	setq default-file-name-coding-system
	setq default-buffer-file-coding-system

I am not a regular user of w3m. When I used it I never encountered  
such an effect.

--
Greetings

   Pete

Remember: use logout to logout.

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

* Re: getting rid of ^M displayed by emacs-w3m
  2007-03-24 19:03   ` Peter Dyballa
@ 2007-03-24 21:07     ` Alexey Pustyntsev
  2007-03-24 21:17       ` David Hansen
  0 siblings, 1 reply; 8+ messages in thread
From: Alexey Pustyntsev @ 2007-03-24 21:07 UTC (permalink / raw)
  To: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> Am 24.03.2007 um 19:27 schrieb Alexey Pustyntsev:
>
>> it should be solved by default
>
> You could consider to set a default encoding, and that encoding's
> name should end in -mac, because it's a Mac feature to end lines with
> Carriage Return. Or are the lines ending in Carriage Return + Line
> Feed? Then a -dos ending of the encoding's name is more suitable.
>
> 	set-default-coding-systems
> 	prefer-coding-system
> 	setq default-file-name-coding-system
> 	setq default-buffer-file-coding-system
>
> I am not a regular user of w3m. When I used it I never encountered
> such an effect.
>
> --
> Greetings
>
>   Pete
>

Thanks for the comments. I am using GNU/Linux on a P4 box. w3m is
really handy. As I said earlier, w3m displays everything fine in
terminal, and my default coding system is utf-8 (both OS and emacs). 

Below are the snippets from the html source of the pages in question.

----------------------start snippet 1---------------------------
;; -- put to distinguish the snippet from quoted text

;; >&#13;     <A
;; HREF="preface.html#contributors"
;; >And several others</A
;; >

----------------------end snippet 1-----------------------------



----------------------start snippet 2---------------------------
;; -- put to distinguish the snippet from quoted text

;; ><P
;; >&#13;   PHP supports eight primitive types.
;;   </P
;; ><P
;; >&#13;   Four scalar types:
----------------------end snippet 2-----------------------------

^M comes after '>' and before 'And several' in the first snippet and
after '&#13' and before 'PHP supports' or 'Four scalar' in the
second. It seems there are no line feeds there.

I am inclined to think it is the problem of emacs-w3m, (not emacs, not
w3m), I am unsure, though.

-- 
Rgds
Alexey

Today is Prickle-Prickle, the 11st day of Discord in the YOLD 3173

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

* Re: getting rid of ^M displayed by emacs-w3m
  2007-03-24 21:07     ` Alexey Pustyntsev
@ 2007-03-24 21:17       ` David Hansen
  2007-03-24 23:58         ` Alexey Pustyntsev
  0 siblings, 1 reply; 8+ messages in thread
From: David Hansen @ 2007-03-24 21:17 UTC (permalink / raw)
  To: help-gnu-emacs

On Sun, 25 Mar 2007 08:07:15 +1100 Alexey Pustyntsev wrote:

> Thanks for the comments. I am using GNU/Linux on a P4 box. w3m is
> really handy. As I said earlier, w3m displays everything fine in
> terminal, and my default coding system is utf-8 (both OS and emacs).
>
> Below are the snippets from the html source of the pages in question.
>
> ----------------------start snippet 1---------------------------
> ;; -- put to distinguish the snippet from quoted text
>
> ;; >&#13;     <A
> ;; HREF="preface.html#contributors"
> ;; >And several others</A
> ;; >
>
> ----------------------end snippet 1-----------------------------

To me this looks like the page explicitly asked to display a
carriage return.  So I think what emacs w3m does here is reasonable.
But maybe this "&#13;" is some html trick I don't know...

How do you think should emacs-w3m render a carriage return?

David

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

* Re: getting rid of ^M displayed by emacs-w3m
  2007-03-24 21:17       ` David Hansen
@ 2007-03-24 23:58         ` Alexey Pustyntsev
  2007-03-25  0:50           ` David Hansen
  0 siblings, 1 reply; 8+ messages in thread
From: Alexey Pustyntsev @ 2007-03-24 23:58 UTC (permalink / raw)
  To: help-gnu-emacs

David Hansen <david.hansen@gmx.net> writes:


> To me this looks like the page explicitly asked to display a
> carriage return.  So I think what emacs w3m does here is reasonable.
> But maybe this "&#13;" is some html trick I don't know...

Thanks David.

What I don't understand here is why w3m doesn't display
^M (or, perhaps, something else) in xterm when the page explicitly
asks to do so.

> How do you think should emacs-w3m render a carriage return?

I consider ^M to be garbage in the rendered html so it should not be
displayed by default unless, of course, specifically requested.

-- 
Rgds
Alexey

Today is Prickle-Prickle, the 11st day of Discord in the YOLD 3173

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

* Re: getting rid of ^M displayed by emacs-w3m
  2007-03-24 23:58         ` Alexey Pustyntsev
@ 2007-03-25  0:50           ` David Hansen
  2007-03-25  9:48             ` Daniel Rubin
  0 siblings, 1 reply; 8+ messages in thread
From: David Hansen @ 2007-03-25  0:50 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: emacs-w3m


X-Post to the emacs-w3m mailing list.

[ summary for the w3m devels: some html page includes the string
"&#13;" and emacs-w3m inserts a raw carriage return into the
buffer, which of course looks kind off ugly ]

On Sun, 25 Mar 2007 10:58:37 +1100 Alexey Pustyntsev wrote:

> David Hansen <david.hansen@gmx.net> writes:
>
>> To me this looks like the page explicitly asked to display a
>> carriage return.  So I think what emacs w3m does here is reasonable.
>> But maybe this "&#13;" is some html trick I don't know...
>
> Thanks David.
>
> What I don't understand here is why w3m doesn't display
> ^M (or, perhaps, something else) in xterm when the page explicitly
> asks to do so.

Some of the rendering is done by w3m and some within emacs.  The
translation of entities to characters is one of the things that
happens in emacs.

>> How do you think should emacs-w3m render a carriage return?
>
> I consider ^M to be garbage in the rendered html so it should not be
> displayed by default unless, of course, specifically requested.

If the html source includes the entity "&#13;" it explicitly
requested the display of a carriage return (whatever this means), at
least in my opinion.  But again, this might be some html "feature" I
don't know about.

IMHO the right thing to do here is to read up in the HTML specs how
whitespaces encoded with html entities should be treated.

David

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

* Re: getting rid of ^M displayed by emacs-w3m
  2007-03-25  0:50           ` David Hansen
@ 2007-03-25  9:48             ` Daniel Rubin
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Rubin @ 2007-03-25  9:48 UTC (permalink / raw)
  To: help-gnu-emacs

David Hansen wrote:

> X-Post to the emacs-w3m mailing list.
> 
> [ summary for the w3m devels: some html page includes the string
> "&#13;" and emacs-w3m inserts a raw carriage return into the
> buffer, which of course looks kind off ugly ]
> 
> On Sun, 25 Mar 2007 10:58:37 +1100 Alexey Pustyntsev wrote:
> 
>> David Hansen <david.hansen@gmx.net> writes:
>>
>>> To me this looks like the page explicitly asked to display a
>>> carriage return.  So I think what emacs w3m does here is reasonable.
>>> But maybe this "&#13;" is some html trick I don't know...
>> Thanks David.
>>
>> What I don't understand here is why w3m doesn't display
>> ^M (or, perhaps, something else) in xterm when the page explicitly
>> asks to do so.
> 
> Some of the rendering is done by w3m and some within emacs.  The
> translation of entities to characters is one of the things that
> happens in emacs.
> 
>>> How do you think should emacs-w3m render a carriage return?
>> I consider ^M to be garbage in the rendered html so it should not be
>> displayed by default unless, of course, specifically requested.
> 
> If the html source includes the entity "&#13;" it explicitly
> requested the display of a carriage return (whatever this means), at
> least in my opinion.  But again, this might be some html "feature" I
> don't know about.
> 
> IMHO the right thing to do here is to read up in the HTML specs how
> whitespaces encoded with html entities should be treated.

Could it be the HTML file contains _both_, line-endings indicated 
by CR as well as some by newline or CR/LF?
So maybe Emacs is somehow tricked to believe it's displaying a 
-unix or -dos encoded file and rejects to recognise the discrete 
^Ms as newlines, while the terminal unconditionally displays 
anything looking like it might be a newline as such.

Just a thought.

Have fun
----Daniel

-- 
Daniel Rubin
daniel warum-ada de

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

end of thread, other threads:[~2007-03-25  9:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-23 23:00 getting rid of ^M displayed by emacs-w3m Alexey Pustyntsev
2007-03-24 18:27 ` Alexey Pustyntsev
2007-03-24 19:03   ` Peter Dyballa
2007-03-24 21:07     ` Alexey Pustyntsev
2007-03-24 21:17       ` David Hansen
2007-03-24 23:58         ` Alexey Pustyntsev
2007-03-25  0:50           ` David Hansen
2007-03-25  9:48             ` Daniel Rubin

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.