[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: following .txt link point at eob



In [emacs-w3m : No.11292] Kevin Ryde wrote:
> In the current w3m-el cvs with recent debian emacs 23.2, when following
> a link to a .txt file like in foo.html below using Ret
> (w3m-view-this-url), point is left at the end of the buffer, and if the
> file is more than a screen full it seems to have the window-start
> positioned on the last line.

> I hoped point and window start would be at the start of the buffer
> following such a .txt link.  The last line only bit is particularly
> disconcerting as it may trick you into thinking the file is one line
> long.

Fixed in CVS.  A patch follows.  I realized that inconvenience when
viewing Jidanni's text/plain page[1] today. :)  Thanks for pointing.

> I suppose .txt links are not very common.  I struck it in some of the
> asciidoc examples on debian

>     /usr/share/doc/asciidoc/examples/website/asciimathml.html

> where the Page Source link at the left is to its originating
> "asciimathml.txt" source code (in the same directory).

> <a href="/usr/share/emacs/23.2/etc/rgb.txt">follow me</a>

[1] http://article.gmane.org/gmane.emacs.gnus.general/69890
--- w3m.el~	2010-08-05 05:18:47 +0000
+++ w3m.el	2010-08-10 01:40:41 +0000
@@ -6227,6 +6227,7 @@
 	(widen)
 	(delete-region (point-min) (point-max))
 	(insert-buffer-substring result-buffer)
+	(goto-char (point-min))
 	(w3m-copy-local-variables result-buffer)
 	(set-buffer-file-coding-system w3m-current-coding-system)
 	(when (string= "text/html" type) (w3m-fontify))