Re: [Slightly OT] Allow for choosing browser to follow a link
On 2007-08-29, Gary Johnson <garyjohn@xxxxxxxxxxxxxxx> wrote:
> On 2007-08-29, Gary Johnson <garyjohn@xxxxxxxxxxxxxxx> wrote:
>
> > I hardly ever use the second or third external browser. I just
> > tried using them and they don't work. They did in previous releases
> > of w3m. Now though, 2M, 3M, 2<Esc>M and 3<Esc>M all open the
> > page/link in Firefox. I just tested w3m-0.5.1 and it works
> > correctly. Oh goody, one more thing to look into.
>
> I found the problem. It is a bug introduced in w3m-0.5.2 when the
> attempt was apparently made to fix another problem. The workaround
> is to set
>
> vi_prec_num 1
>
> in your ~/.w3m/config, either directly or via the Option Setting
> Panel, in the Miscellaneous Settings section:
>
> Enable vi-like numeric prefix (*)YES ( )NO
>
> I have submitted a bug report to the w3m developers.
I received a patch this morning that fixes the problem. It's small
enough that I've included it here.
Regards,
Gary
-------------------------------------------
Hironori SAKAMOTO <hsaka AT mth DOT biglobe DOT ne DOT jp>
--- main.c.orig Thu May 31 14:51:27 2007
+++ main.c Sun Jun 3 23:05:27 2007
@@ -1152,18 +1152,11 @@
mouse_inactive();
#endif /* USE_MOUSE */
if (IS_ASCII(c)) { /* Ascii */
- if( vi_prec_num ){
- if(((prec_num && c == '0') || '1' <= c) && (c <= '9')) {
- prec_num = prec_num * 10 + (int)(c - '0');
- if (prec_num > PREC_LIMIT)
- prec_num = PREC_LIMIT;
- }
- else {
- set_buffer_environ(Currentbuf);
- save_buffer_position(Currentbuf);
- keyPressEventProc((int)c);
- prec_num = 0;
- }
+ if (('0' <= c) && (c <= '9') &&
+ (prec_num || (GlobalKeymap[c] == FUNCNAME_nulcmd))) {
+ prec_num = prec_num * 10 + (int)(c - '0');
+ if (prec_num > PREC_LIMIT)
+ prec_num = PREC_LIMIT;
}
else {
set_buffer_environ(Currentbuf);