On Thu, Apr 30, 2009 at 03:31:09PM -0400, James Vega wrote: > When reading an HTTP URL with NetRW, the default behavior varies > depending on which binaries are detected on the user's system. If > (e)links is detected, NetRW retrieves the rendered HTML instead of the > source. > > This is inconsistent with the default behavior when using the other > binaries and breaks expected behavior from previous NetRW versions. > > Could the defaults be changed back to the previous behavior and the > g:netrw_http_xcmd documentation be updated to show how to get the > rendered text?
Attached patch does this. -- James GPG Key: 1024D/61326D40 2003-09-02 James Vega <[email protected]>
diff -Naur netrw.orig/autoload/netrw.vim netrw/autoload/netrw.vim
--- netrw.orig/autoload/netrw.vim 2009-05-28 14:34:31.000000000 -0400
+++ netrw/autoload/netrw.vim 2009-05-28 14:29:07.000000000 -0400
@@ -99,19 +99,13 @@
if !exists("g:netrw_http_cmd")
if executable("elinks")
let g:netrw_http_cmd = "elinks"
- if !exists("g:netrw_http_xcmd")
- let g:netrw_http_xcmd= "-dump >"
- endif
+ call s:NetrwInit("g:netrw_http_xcmd","-source >")
elseif executable("links")
let g:netrw_http_cmd = "links"
- if !exists("g:netrw_http_xcmd")
- let g:netrw_http_xcmd= "-dump >"
- endif
+ call s:NetrwInit("g:netrw_http_xcmd","-source >")
elseif executable("curl")
let g:netrw_http_cmd = "curl"
- if !exists("g:netrw_http_xcmd")
- let g:netrw_http_xcmd= "-o"
- endif
+ call s:NetrwInit("g:netrw_http_xcmd","-o")
elseif executable("wget")
let g:netrw_http_cmd = "wget"
call s:NetrwInit("g:netrw_http_xcmd","-q -O")
diff -Naur netrw.orig/doc/pi_netrw.txt netrw/doc/pi_netrw.txt
--- netrw.orig/doc/pi_netrw.txt 2009-05-28 14:34:42.000000000 -0400
+++ netrw/doc/pi_netrw.txt 2009-05-28 14:33:04.000000000 -0400
@@ -178,17 +178,20 @@
sftp: *g:netrw_sftp_cmd* = "sftp"
*g:netrw_http_xcmd* : the option string for http://... protocols are
- specified via this variable and may be independently oveerridden.
+ specified via this variable and may be independently oveerridden. >
- elinks : "-dump >"
- links : "-dump >"
+ elinks : "-source >"
+ links : "-source >"
curl : "-o"
wget : "-q -O"
fetch : "-o"
+<
+ For example, if your system has elinks but you want to see the text
+ rendering rather than the html source, you may wish to have >
- For example, if your system has elinks but you want to see the html
- source in detail rather than a text rendering thereof, you may wish
- to have let g:netrw_http_xcmd= "-source >" in your .vimrc.
+ let g:netrw_http_xcmd= "-dump >"
+<
+ in your .vimrc.
READING *netrw-read* *netrw-nread* {{{2
@@ -1308,12 +1311,12 @@
*netrw-rexplore* *netrw-sexplore* *netrw-texplore* *netrw-vexplore*
DIRECTORY EXPLORATION COMMANDS {{{2
- :[N]Explore[!] [dir]... Explore directory of current file *:Explore*
- :[N]Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore*
- :Rexplore ... Return to Explorer *:Rexplore*
- :[N]Sexplore[!] [dir]... Split&Explore current file's directory*:Sexplore*
- :Texplore [dir]... Tab & Explore *:Texplore*
- :[N]Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore*
+ :[N]Explore[!] [dir]... Explore directory of current file *:Explore*
+ :[N]Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore*
+ :Rexplore ... Return to Explorer *:Rexplore*
+ :[N]Sexplore[!] [dir]... Split&Explore current file's directory *:Sexplore*
+ :Texplore [dir]... Tab & Explore *:Texplore*
+ :[N]Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore*
Used with :Explore **/pattern : (also see |netrw-starstar|)
:Nexplore............. go to next matching file *:Nexplore*
signature.asc
Description: Digital signature

