<<< Date Index >>>     <<< Thread Index >>>

Re: viewing URLs (muttils or lynx?)



On 2008-02-19, Peter M?nster <pmlists@xxxxxxx> wrote:
> On Mon, Feb 18 2008, Christian Ebert wrote:
> 
> > >> I only know how this would work with w3m.
> > > 
> > > Could you tell me how?
> > 
> > See Gary's message.
> 
> Thanks to you and Gary. Indeed, w3m seems to be better that I thought in
> the beginning.
> But I'm a bit difficult (I've been using pine for about 10 years):
> - it would be nice, if MARK_URL was called automatically at start-up

That's what I thought, too, so I modified the w3m code to accept a 
new option, -k, that accepts a list of characters that are read at 
startup before input is read from the keyboard.  The only thing I 
ever use it for is as "-k :" in various mutt hooks.  Here's the 
"diff -c" from the 0.5.2 version of main.c to my modified version, 
if you're interested.

You may also want to set "Treat URL-like strings as links in all 
pages" to "Yes" under Miscellaneous Settings in w3m's Option Setting 
Panel.  Otherwise, w3m searches only the currently displayed page 
for such strings.

Regards,
Gary

P.S.

I tried sending this message to the list yesterday, but it was 
rejected.  I'll try again today and hope it doesn't appear twice.

----------------------------- cut here -----------------------------
*** main.c.orig Wed May 30 18:19:50 2007
--- main.c      Fri Jun  1 01:50:23 2007
***************
*** 257,262 ****
--- 257,263 ----
      fprintf(f, "    -o opt=value     assign value to config option\n");
      fprintf(f, "    -show-option     print all config options\n");
      fprintf(f, "    -config file     specify config file\n");
+     fprintf(f, "    -k keys          specify initial keystrokes\n");
      fprintf(f, "    -help            print this usage message\n");
      fprintf(f, "    -version         print w3m version\n");
      fprintf(f, "    -reqlog          write request logfile\n");
***************
*** 384,389 ****
--- 385,391 ----
      char search_header = FALSE;
      char *default_type = NULL;
      char *post_file = NULL;
+     char *keys = NULL;
      Str err_msg;
  #ifdef USE_M17N
      char *Locale = NULL;
***************
*** 735,740 ****
--- 737,747 ----
                    usage();
                }
            }
+           else if (!strcmp("-k", argv[i])) {
+               if (++i >= argc)
+                   usage();
+               keys = argv[i];
+           }
            else if (!strcmp("-dummy", argv[i])) {
                /* do nothing */
            }
***************
*** 1133,1138 ****
--- 1140,1162 ----
        else
  #endif
  #endif
+       if (keys && *keys) {
+           c = *keys++;
+           if (c == '\\' && *keys) {
+               switch (c = *keys++) {
+                   case 'a': c = '\a'; break;
+                   case 'b': c = '\b'; break;
+                   case 'f': c = '\f'; break;
+                   case 'n': c = '\n'; break;
+                   case 'r': c = '\r'; break;
+                   case 't': c = '\t'; break;
+                   case 'v': c = '\v'; break;
+               }
+           }
+       }
+       else {
+           c = getch();
+       }
  #ifdef SIGWINCH
        {
            do {



> -- 
> http://pmrb.free.fr/contact/
> 
>