From dyonisiaque at gmail.com Sun Aug 1 08:59:00 2010 From: dyonisiaque at gmail.com (=?iso-8859-1?Q?Micha=EBl?= Malter) Date: Sun, 1 Aug 2010 10:59:00 +0200 Subject: [Vimprobable-users] Keybindings configuration Message-ID: <20100801085859.GA7962@gmail.com> Hi everybody! Thanks for working on this great software. I think you got it all right. I'm using vimprobable2 and a specific keyboard layout, bepo-fr. It's great to have a config file with the map command but i didn't find how to reconfigure jklm. I tried the commmands up/down, scrollup/scrolldown, no one is recognized. I tried to modify the keymap.h but it didn't work either. A few ideas for the future : having the noremap command and having the source command. I have in my home directory a file called vimrc.bepo with all my keyboard specific options. It is sourced by my main vimrc, my vimperatorrc and other programs following the same paradigm. I don't code very well but I would like to help if you needed anything. Have a nice day! Micha?l Malter www.michaelmalter.fr -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 490 bytes Desc: not available URL: From hannes at yllr.net Sun Aug 1 09:18:39 2010 From: hannes at yllr.net (Hannes =?UTF-8?B?U2Now7xsbGVy?=) Date: Sun, 1 Aug 2010 11:18:39 +0200 Subject: [Vimprobable-users] Keybindings configuration In-Reply-To: <20100801085859.GA7962@gmail.com> References: <20100801085859.GA7962@gmail.com> Message-ID: <20100801111839.128f29ac@workstation> Hi! Micha?l Malter wrote: > I'm using vimprobable2 and a specific keyboard layout, bepo-fr. It's > great to have a config file with the map command but i didn't find how > to reconfigure jklm. I tried the commmands up/down, > scrollup/scrolldown, no one is recognized. I tried to modify the > keymap.h but it didn't work either. As discussed on IRC, this is only possible through keymap.h right now, not through the map command as it's lacking a symbol for that action. > having the noremap command Doing what? > having the source command Wouldn't it be easier to write a wrapper script which sources whatever script you want and then runs the browser? Hannes -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dyonisiaque at gmail.com Sun Aug 1 09:44:55 2010 From: dyonisiaque at gmail.com (=?iso-8859-1?Q?Micha=EBl?= Malter) Date: Sun, 1 Aug 2010 11:44:55 +0200 Subject: [Vimprobable-users] Keybindings configuration In-Reply-To: <20100801111839.128f29ac@workstation> References: <20100801085859.GA7962@gmail.com> <20100801111839.128f29ac@workstation> Message-ID: <20100801094455.GA25700@gmail.com> The noremap command exchanges two keybindings, it prevents overlapping keybindings. For example, if I do noremap j k in my vimrc, the behavior of the jk keys will be reversed. You're right for the wrapper script. It's more flexible. Anyway, it depends on your preferences. If you prefer keeping things away from the code as uzbl do, rely on scripts. I was advocating for the vim and vimperator way. I'll post my keymap.h when I'll have a working version. I don't think I'm alone with this problem. Thanks Micha?l Malter www.michaelmalter.fr Le dimanche 01 ao?t 2010 ? 11:18:39 (+0200), Hannes Sch?ller a ?crit : > Hi! > > Micha?l Malter wrote: > > I'm using vimprobable2 and a specific keyboard layout, bepo-fr. It's > > great to have a config file with the map command but i didn't find how > > to reconfigure jklm. I tried the commmands up/down, > > scrollup/scrolldown, no one is recognized. I tried to modify the > > keymap.h but it didn't work either. > > As discussed on IRC, this is only possible through keymap.h right now, > not through the map command as it's lacking a symbol for that action. > > > having the noremap command > > Doing what? > > > having the source command > > Wouldn't it be easier to write a wrapper script which sources whatever > script you want and then runs the browser? > > Hannes > _______________________________________________ > Vimprobable-users mailing list > Vimprobable-users at vimprobable.org > http://vimprobable.org/mailman/listinfo/vimprobable-users -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 490 bytes Desc: not available URL: From hannes at yllr.net Sun Aug 1 10:03:01 2010 From: hannes at yllr.net (Hannes =?UTF-8?B?U2Now7xsbGVy?=) Date: Sun, 1 Aug 2010 12:03:01 +0200 Subject: [Vimprobable-users] Keybindings configuration In-Reply-To: <20100801094455.GA25700@gmail.com> References: <20100801085859.GA7962@gmail.com> <20100801111839.128f29ac@workstation> <20100801094455.GA25700@gmail.com> Message-ID: <20100801120301.79995848@workstation> Hi! Micha?l Malter wrote: > You're right for the wrapper script. It's more flexible. Anyway, it > depends on your preferences. If you prefer keeping things away from > the code as uzbl do, rely on scripts. I was advocating for the vim and > vimperator way. I'm sure you see the irony of advocating a method to avoid using a script in order to be able to run a script :) The question is not as one-dimensional as you make it. What would you call 'like uzbl' in this case? Using a wrapper script or providing a hook to source external scripts? I'd say the latter, but you seem to disagree. > I'll post my keymap.h when I'll have a working version. I don't think > I'm alone with this problem. ...it's actually *very* simple. You just look for this line: { 0, 0, GDK_j, scroll, {ScrollMove | DirectionBottom | UnitLine} }, Then, you change GDK_j to whatever key you want to fulfil that function. Same with h, k and l. Hannes -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dyonisiaque at gmail.com Sun Aug 1 10:16:40 2010 From: dyonisiaque at gmail.com (=?iso-8859-1?Q?Micha=EBl?= Malter) Date: Sun, 1 Aug 2010 12:16:40 +0200 Subject: [Vimprobable-users] Keybindings configuration In-Reply-To: <20100801120301.79995848@workstation> References: <20100801085859.GA7962@gmail.com> <20100801111839.128f29ac@workstation> <20100801094455.GA25700@gmail.com> <20100801120301.79995848@workstation> Message-ID: <20100801101640.GB25700@gmail.com> That's exactly what I thought and done and I do find it extremly clear and easy. Anyway I didn't get it to work. I'll be extremly precise about what I have done in order to be sure. I've cloned the repo with git. Then I modify the keymap.h I post the only line I've modified : { 0, 0, GDK_s, scroll, {ScrollMove | DirectionBottom | UnitLine} }, Then I do a make clean install and observe that the key s doesn't do a thing. I'll try on another PC?because it seems supernatural. Micha?l Malter www.michaelmalter.fr Le dimanche 01 ao?t 2010 ? 12:03:01 (+0200), Hannes Sch?ller a ?crit : > Hi! > > Micha?l Malter wrote: > > You're right for the wrapper script. It's more flexible. Anyway, it > > depends on your preferences. If you prefer keeping things away from > > the code as uzbl do, rely on scripts. I was advocating for the vim and > > vimperator way. > > I'm sure you see the irony of advocating a method to avoid using a > script in order to be able to run a script :) > > The question is not as one-dimensional as you make it. What would you > call 'like uzbl' in this case? Using a wrapper script or providing a > hook to source external scripts? I'd say the latter, but you seem to > disagree. > > > I'll post my keymap.h when I'll have a working version. I don't think > > I'm alone with this problem. > > ...it's actually *very* simple. You just look for this line: > > { 0, 0, GDK_j, scroll, > {ScrollMove | DirectionBottom | UnitLine} }, > > Then, you change GDK_j to whatever key you want to fulfil that > function. Same with h, k and l. > > Hannes > _______________________________________________ > Vimprobable-users mailing list > Vimprobable-users at vimprobable.org > http://vimprobable.org/mailman/listinfo/vimprobable-users -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 490 bytes Desc: not available URL: From hannes at yllr.net Sun Aug 1 10:32:50 2010 From: hannes at yllr.net (Hannes =?UTF-8?B?U2Now7xsbGVy?=) Date: Sun, 1 Aug 2010 12:32:50 +0200 Subject: [Vimprobable-users] Keybindings configuration In-Reply-To: <20100801101640.GB25700@gmail.com> References: <20100801085859.GA7962@gmail.com> <20100801111839.128f29ac@workstation> <20100801094455.GA25700@gmail.com> <20100801120301.79995848@workstation> <20100801101640.GB25700@gmail.com> Message-ID: <20100801123250.426317fb@workstation> Hi, sorry, quick fix: make the change in config.h instead. keymap.h doesn't even seem to be read on compilation... there is something wrong there, but this should work for now. Hannes -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dyonisiaque at gmail.com Sun Aug 1 10:50:17 2010 From: dyonisiaque at gmail.com (=?iso-8859-1?Q?Micha=EBl?= Malter) Date: Sun, 1 Aug 2010 12:50:17 +0200 Subject: [Vimprobable-users] Keybindings configuration In-Reply-To: <20100801123250.426317fb@workstation> References: <20100801085859.GA7962@gmail.com> <20100801111839.128f29ac@workstation> <20100801094455.GA25700@gmail.com> <20100801120301.79995848@workstation> <20100801101640.GB25700@gmail.com> <20100801123250.426317fb@workstation> Message-ID: <20100801105017.GC25700@gmail.com> Works like a charm. I should have looked in this file. Thanks a lot. Keep up the good work! Micha?l Malter www.michaelmalter.fr Le dimanche 01 ao?t 2010 ? 12:32:50 (+0200), Hannes Sch?ller a ?crit : > Hi, > > sorry, quick fix: make the change in config.h instead. keymap.h doesn't > even seem to be read on compilation... there is something wrong there, > but this should work for now. > > Hannes > _______________________________________________ > Vimprobable-users mailing list > Vimprobable-users at vimprobable.org > http://vimprobable.org/mailman/listinfo/vimprobable-users -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 490 bytes Desc: not available URL: From rnestler at hsr.ch Tue Aug 3 13:11:45 2010 From: rnestler at hsr.ch (Raphael Nestler) Date: Tue, 3 Aug 2010 15:11:45 +0200 Subject: [Vimprobable-users] gt/gT patch for better tabbed integration In-Reply-To: <20100515193813.GA3012@shuttle.home> References: <20100421222503.GA8664@tuxpad.hsr.ch> <20100505211547.06b28ab4@workstation> <20100506094802.173d8664@workstation> <20100507123723.GA5406@tuxpad.hsr.ch> <20100515193813.GA3012@shuttle.home> Message-ID: <20100803131142.GA4675@tuxpad> On Sat, May 15, 2010 at 09:38:15PM +0200, Thomas Adam wrote: > On Fri, May 07, 2010 at 02:37:23PM +0200, Raphael Nestler wrote: > > On Thu, May 06, 2010 at 09:48:02AM +0200, Hannes Sch?ller wrote: > > > Thomas Adam wrote: > > > > 2010/5/5 Hannes Sch?ller : > > > > >> Attached you will find a "quick&dirty" solution for a better > > > > >> integration of vimprobable in tabbed. > > > > >> > > > > >> My target was to change between tabs with 'gt' and 'gT'. To achieve > > > > >> this I call the "xdotool" which sends the needed keystrokes to > > > > >> tabbed. > > > > > > > > > > Ok, apparantely, there are no obviously superior solutions anyone > > > > > can think of, so I'll merge this with the next update and add a > > > > > note to the man page about this dependency. Thanks, Raphael! > > > > > > > > There are better solutions, yes. It would be better to simply write a > > > > wrapper around XSendEvent() to send a synthetic KeyPress event through > > > > to a given application. That way, there's no silly dependency, and > > > > can all be done via config.h for example. > > > > > > Sounds good! Raphael, you want to give modifying your own patch a try? > > > > > I'll give it a try, doesn't seem to be too difficult. > > How you getting on with this? Do you need any help? > Sorry for not answering for such a long time. I finaly have my patch in a state that is worth to post ;) It doesn't use xdotool anymore but includes the Xlib.h and uses XSendEvent() to send the keystokes to tabbed. It's the first time I've used the Xlib functions directly, so maybe the code could be made cleaner. Regards, Raphael -------------- next part -------------- diff --git a/main.c b/main.c index 9ac9224..13945d4 100644 --- a/main.c +++ b/main.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "vimprobable.h" #include "javascript.h" @@ -65,6 +66,7 @@ static gboolean yank(const Arg *arg); static gboolean view_source(const Arg * arg); static gboolean zoom(const Arg *arg); static gboolean quickmark(const Arg *arg); +static gboolean callback(const Arg *arg); static void update_url(const char *uri); static void update_state(void); @@ -1280,6 +1282,40 @@ quickmark(const Arg *a) { else { return false; } } +gboolean +callback(const Arg *a) { + if(embed) + { + Display *xdpy = XOpenDisplay(NULL); + + XKeyEvent xk; + xk.display = xdpy; + xk.subwindow = None; + xk.time = CurrentTime; + xk.same_screen = True; + xk.x = xk.y = xk.x_root = xk.y_root = 1; + + xk.window = embed; + xk.keycode = XKeysymToKeycode(xdpy, XStringToKeysym(a->s)); + xk.state = a->i; + xk.type = KeyPress; + if( !XSendEvent(xdpy, embed, True, KeyPressMask, (XEvent *)&xk) ) + { + fprintf(stderr, "XSendEvent failed!\n"); + return false; + } + XFlush(xdpy); + xk.type = KeyRelease; + if( !XSendEvent(xdpy, embed, True, KeyReleaseMask, (XEvent *)&xk) ) + { + fprintf(stderr, "XSendEvent failed!\n"); + return false; + } + XFlush(xdpy); + } + return true; +} + gboolean toggle_plugins(const Arg *arg) { static gboolean plugins; From thomas at xteddy.org Thu Aug 5 13:03:09 2010 From: thomas at xteddy.org (Thomas Adam) Date: Thu, 5 Aug 2010 14:03:09 +0100 Subject: [Vimprobable-users] gt/gT patch for better tabbed integration In-Reply-To: <20100803131142.GA4675@tuxpad> References: <20100421222503.GA8664@tuxpad.hsr.ch> <20100505211547.06b28ab4@workstation> <20100506094802.173d8664@workstation> <20100507123723.GA5406@tuxpad.hsr.ch> <20100515193813.GA3012@shuttle.home> <20100803131142.GA4675@tuxpad> Message-ID: <20100805130307.GC1872@debian> On Tue, Aug 03, 2010 at 03:11:45PM +0200, Raphael Nestler wrote: > It's the first time I've used the Xlib functions directly, so maybe the code > could be made cleaner. Can you regenerate this diff against latest HEAD? It doesn't apply cleanly for me. Having said that, see in-line comments below as well... > diff --git a/main.c b/main.c > index 9ac9224..13945d4 100644 > --- a/main.c > +++ b/main.c > @@ -12,6 +12,7 @@ > #include > #include > #include > +#include > #include "vimprobable.h" > #include "javascript.h" > > @@ -65,6 +66,7 @@ static gboolean yank(const Arg *arg); > static gboolean view_source(const Arg * arg); > static gboolean zoom(const Arg *arg); > static gboolean quickmark(const Arg *arg); > +static gboolean callback(const Arg *arg); Can we have a better name here? Perhaps propagate_fake_key_event()? > static void update_url(const char *uri); > static void update_state(void); > @@ -1280,6 +1282,40 @@ quickmark(const Arg *a) { > else { return false; } > } > > +gboolean > +callback(const Arg *a) { > + if(embed) > + { Rather than containing a batch of code in a huge if block, I'd rather see this: if (!embed) { return FALSE; } /* Code follows here. */ > + Display *xdpy = XOpenDisplay(NULL); *Always* check the return value of this. *Always*. Display *xdpy; if ((xdpy = XOpenDisplay(NULL)) == NULL) { fprintf(stderr, "Couldn't find the XDisplay.\n"); } > + XKeyEvent xk; > + xk.display = xdpy; If this is NULL, we'd have segfaulted! (See above.) > + xk.subwindow = None; > + xk.time = CurrentTime; Unfortunately, the XServer still can't do this for us. I don't think using "CurrentTime" is completely portable, but it will do. > + xk.same_screen = True; > + xk.x = xk.y = xk.x_root = xk.y_root = 1; > + > + xk.window = embed; > + xk.keycode = XKeysymToKeycode(xdpy, XStringToKeysym(a->s)); Ah. Again, it's important we do some checking on what XKeysymToKeycode() is doing here -- if we can't translate the keysym at this point, and we send the event, we'll get very unpredictable results... here: KeyCode somecode; if ( (somecode = XKeysymToKeycode( ... ) == NoSymbol) ) { fprintf(stderr, "Couldn't translate keysym...\n"); return FALSE: } xk.keycode = somecode; > + xk.state = a->i; > + xk.type = KeyPress; > + if( !XSendEvent(xdpy, embed, True, KeyPressMask, (XEvent *)&xk) ) > + { > + fprintf(stderr, "XSendEvent failed!\n"); > + return false; > + } > + XFlush(xdpy); > + xk.type = KeyRelease; Don't bother with the release check, it's not supported on all XServers. > + if( !XSendEvent(xdpy, embed, True, KeyReleaseMask, (XEvent *)&xk) ) > + { > + fprintf(stderr, "XSendEvent failed!\n"); > + return false; > + } > + XFlush(xdpy); > + } > + return true; > +} No "return FALSE;"? I hope you can understand my ramblings. Any questions, just shout. -- Thomas Adam -- "It was the cruelest game I've ever played and it's played inside my head." -- "Hush The Warmth", Gorky's Zygotic Mynci. From thomas at xteddy.org Thu Aug 5 13:06:54 2010 From: thomas at xteddy.org (Thomas Adam) Date: Thu, 5 Aug 2010 14:06:54 +0100 Subject: [Vimprobable-users] gt/gT patch for better tabbed integration In-Reply-To: <20100805130307.GC1872@debian> References: <20100421222503.GA8664@tuxpad.hsr.ch> <20100505211547.06b28ab4@workstation> <20100506094802.173d8664@workstation> <20100507123723.GA5406@tuxpad.hsr.ch> <20100515193813.GA3012@shuttle.home> <20100803131142.GA4675@tuxpad> <20100805130307.GC1872@debian> Message-ID: <20100805130653.GD1872@debian> On Thu, Aug 05, 2010 at 02:03:09PM +0100, Thomas Adam wrote: > On Tue, Aug 03, 2010 at 03:11:45PM +0200, Raphael Nestler wrote: > > It's the first time I've used the Xlib functions directly, so maybe the code > > could be made cleaner. > > Can you regenerate this diff against latest HEAD? It doesn't apply cleanly > for me. Having said that, see in-line comments below as well... Forgot to mention, rather than using fprintf() for error messages, it might be worth using the Arg type, and echo() to put a mesasage at the bottom of Vimprobable instead? -- Thomas Adam -- "It was the cruelest game I've ever played and it's played inside my head." -- "Hush The Warmth", Gorky's Zygotic Mynci. From eivind at linux.com Thu Aug 5 15:30:37 2010 From: eivind at linux.com (Eivind Michael Skretting) Date: Thu, 5 Aug 2010 17:30:37 +0200 Subject: [Vimprobable-users] International hinting mode? In-Reply-To: <20100803131142.GA4675@tuxpad> References: <20100421222503.GA8664@tuxpad.hsr.ch> <20100505211547.06b28ab4@workstation> <20100506094802.173d8664@workstation> <20100507123723.GA5406@tuxpad.hsr.ch> <20100515193813.GA3012@shuttle.home> <20100803131142.GA4675@tuxpad> Message-ID: <20100805153037.GB7955@myhost.getinternet.no> Hello, Thanks for your work on this browser. Being a Vimperator user, I really hope this is what will eventually will replace it (Vimperator is intolerably big and slow). The only thing keeping me from switching is the hinting. I am norwegian and I need the hinting mode to support ???. Is there any way I can do this? I use vimprobable1 by the way. Eivind From hannes at yllr.net Thu Aug 5 15:39:42 2010 From: hannes at yllr.net (Hannes =?iso-8859-1?Q?Sch=FCller?=) Date: Thu, 5 Aug 2010 17:39:42 +0200 Subject: [Vimprobable-users] International hinting mode? In-Reply-To: <20100805153037.GB7955@myhost.getinternet.no> References: <20100421222503.GA8664@tuxpad.hsr.ch> <20100505211547.06b28ab4@workstation> <20100506094802.173d8664@workstation> <20100507123723.GA5406@tuxpad.hsr.ch> <20100515193813.GA3012@shuttle.home> <20100803131142.GA4675@tuxpad> <20100805153037.GB7955@myhost.getinternet.no> Message-ID: <20100805153941.GA13494@laptop2.lan.localhost> Hello Eivind! On Thu, Aug 05, 2010 at 05:30:37PM +0200, Eivind Michael Skretting wrote: > The only thing keeping me from switching is the hinting. I am > norwegian and I need the hinting mode to support ???. Is there any way > I can do this? I use vimprobable1 by the way. We could probable run into character encoding issues (both system locale and encoding used by the website) there. I'll have to test it. Hannes P.S. Please don't use 'reply' to start a new topic. It breaks threading. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From eivind at linux.com Thu Aug 5 16:15:19 2010 From: eivind at linux.com (Eivind Michael Skretting) Date: Thu, 5 Aug 2010 18:15:19 +0200 Subject: [Vimprobable-users] Sorry + Internationalization Message-ID: <20100805161519.GA8212@myhost.getinternet.no> Hello Thanks for a quick answer! Sorry for the reply thing, I'm not that used to mailing lists. After thinking about it, I remember it's not only the hinting mode that has trouble with international characters. The normal search function (:open) has it too. It is not a font issue or anything, because the characters display correctly in the browser. I am no expert in c, so it is difficult for me to track down the problem. And a bit more hinting-nagging: Is it possible to make it case insensitive? It feels more intuitive for me, but it's no big deal. Eivind From hannes at yllr.net Thu Aug 5 20:25:01 2010 From: hannes at yllr.net (Hannes =?iso-8859-1?Q?Sch=FCller?=) Date: Thu, 5 Aug 2010 22:25:01 +0200 Subject: [Vimprobable-users] Sorry + Internationalization In-Reply-To: <20100805161519.GA8212@myhost.getinternet.no> References: <20100805161519.GA8212@myhost.getinternet.no> Message-ID: <20100805202500.GB13494@laptop2.lan.localhost> Hi! On Thu, Aug 05, 2010 at 06:15:19PM +0200, Eivind Michael Skretting wrote: > After thinking about it, I remember it's not only the hinting mode > that has trouble with international characters. The normal search > function (:open) has it too. You mean the tab completion from history/bookmarks? This works for me. > And a bit more hinting-nagging: Is it possible to make it case > insensitive? It feels more intuitive for me, but it's no big deal. Not sure there is a common consensus here. Personally, I prefer case sensitive matching, because unlike searching for a string on the page itself, I can already see the word I'm going to type in this case. I think there has been a short discussion about this before... doesn't Vimperator have this very complicated scheme of 'automatically' deciding whether to use case sensitive or not depending on... the first character typed? Hannes -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From eivind at linux.com Fri Aug 6 06:27:24 2010 From: eivind at linux.com (Eivind Michael Skretting) Date: Fri, 6 Aug 2010 08:27:24 +0200 Subject: [Vimprobable-users] Sorry + Internationalization In-Reply-To: <20100805202500.GB13494@laptop2.lan.localhost> References: <20100805161519.GA8212@myhost.getinternet.no> <20100805202500.GB13494@laptop2.lan.localhost> Message-ID: <20100806062724.GB9920@myhost.getinternet.no> On Thu, Aug 05, 2010 at 10:25:01PM +0200, Hannes Sch?ller wrote: > You mean the tab completion from history/bookmarks? This works for me. > No, I meant for using search engines. For example, the word "?rn" shows up as "?,l", which is really annoying. But I've just discovered that this behavior is gone when using other search engines than google, which I guess I should do anyway, so thanks ;) > Not sure there is a common consensus here. Personally, I prefer case > sensitive matching, because unlike searching for a string on the page > itself, I can already see the word I'm going to type in this case. > I don't think this will be very hard to get used to, so like I said this is no big deal. But if it were easy to change, it *could* have been an option in the config.h. Eivind From hannes at yllr.net Fri Aug 6 14:29:46 2010 From: hannes at yllr.net (Hannes =?iso-8859-1?Q?Sch=FCller?=) Date: Fri, 6 Aug 2010 16:29:46 +0200 Subject: [Vimprobable-users] Sorry + Internationalization In-Reply-To: <20100806062724.GB9920@myhost.getinternet.no> References: <20100805161519.GA8212@myhost.getinternet.no> <20100805202500.GB13494@laptop2.lan.localhost> <20100806062724.GB9920@myhost.getinternet.no> Message-ID: <20100806142946.GA2038@laptop2.lan.localhost> On Fri, Aug 06, 2010 at 08:27:24AM +0200, Eivind Michael Skretting wrote: > On Thu, Aug 05, 2010 at 10:25:01PM +0200, Hannes Sch?ller wrote: > > You mean the tab completion from history/bookmarks? This works for me. > > > No, I meant for using search engines. For example, the word "?rn" shows > up as "?,l", which is really annoying. > > But I've just discovered that this behavior is gone when using other > search engines than google, which I guess I should do anyway, so > thanks ;) Yes, well, that seems to be a problem with Unicode encoding on Google's side. Little a browser can do about this. > > Not sure there is a common consensus here. Personally, I prefer case > > sensitive matching, because unlike searching for a string on the page > > itself, I can already see the word I'm going to type in this case. > > I don't think this will be very hard to get used to, so like I said this > is no big deal. But if it were easy to change, it *could* have been an > option in the config.h. Yes, I'll put it on my list - I see this could be useful. Hannes -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From hannes at yllr.net Fri Aug 6 14:33:16 2010 From: hannes at yllr.net (Hannes =?iso-8859-1?Q?Sch=FCller?=) Date: Fri, 6 Aug 2010 16:33:16 +0200 Subject: [Vimprobable-users] Keybindings configuration In-Reply-To: <20100801085859.GA7962@gmail.com> References: <20100801085859.GA7962@gmail.com> Message-ID: <20100806143315.GB2038@laptop2.lan.localhost> Hello again! > I'm using vimprobable2 and a specific keyboard layout, bepo-fr. It's > great to have a config file with the map command but i didn't find how > to reconfigure jklm. I tried the commmands up/down, scrollup/scrolldown, > no one is recognized. I tried to modify the keymap.h but it didn't work > either. The latest version now has a few more mapping symbols. Amongst others: scrollleft scrollright scrollup scrolldown These should do what you want. Hannes -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From hannes at yllr.net Fri Aug 6 14:36:36 2010 From: hannes at yllr.net (Hannes =?iso-8859-1?Q?Sch=FCller?=) Date: Fri, 6 Aug 2010 16:36:36 +0200 Subject: [Vimprobable-users] International hinting mode? In-Reply-To: <20100805153037.GB7955@myhost.getinternet.no> References: <20100421222503.GA8664@tuxpad.hsr.ch> <20100505211547.06b28ab4@workstation> <20100506094802.173d8664@workstation> <20100507123723.GA5406@tuxpad.hsr.ch> <20100515193813.GA3012@shuttle.home> <20100803131142.GA4675@tuxpad> <20100805153037.GB7955@myhost.getinternet.no> Message-ID: <20100806143635.GC2038@laptop2.lan.localhost> Hi! On Thu, Aug 05, 2010 at 05:30:37PM +0200, Eivind Michael Skretting wrote: > The only thing keeping me from switching is the hinting. I am > norwegian and I need the hinting mode to support ???. Is there any way > I can do this? I use vimprobable1 by the way. Could you try the latest version? I added lots of international key symbols, but I only tested it with German characters. Works for those, now. Hannes -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From eivind at linux.com Fri Aug 6 20:33:23 2010 From: eivind at linux.com (Eivind Michael Skretting) Date: Fri, 6 Aug 2010 22:33:23 +0200 Subject: [Vimprobable-users] International hinting mode? In-Reply-To: <20100806143635.GC2038@laptop2.lan.localhost> References: <20100421222503.GA8664@tuxpad.hsr.ch> <20100505211547.06b28ab4@workstation> <20100506094802.173d8664@workstation> <20100507123723.GA5406@tuxpad.hsr.ch> <20100515193813.GA3012@shuttle.home> <20100803131142.GA4675@tuxpad> <20100805153037.GB7955@myhost.getinternet.no> <20100806143635.GC2038@laptop2.lan.localhost> Message-ID: <20100806203323.GA11236@myhost.getinternet.no> On Fri, Aug 06, 2010 at 04:36:36PM +0200, Hannes Sch?ller wrote: > Hi! > > On Thu, Aug 05, 2010 at 05:30:37PM +0200, Eivind Michael Skretting wrote: > > The only thing keeping me from switching is the hinting. I am > > norwegian and I need the hinting mode to support ???. Is there any way > > I can do this? I use vimprobable1 by the way. > > Could you try the latest version? I added lots of international key > symbols, but I only tested it with German characters. Works for those, > now. > > Hannes My bad, works like a charm now. Thanks! Eivind > _______________________________________________ > Vimprobable-users mailing list > Vimprobable-users at vimprobable.org > http://vimprobable.org/mailman/listinfo/vimprobable-users From hannes at yllr.net Fri Aug 6 20:39:46 2010 From: hannes at yllr.net (Hannes =?iso-8859-1?Q?Sch=FCller?=) Date: Fri, 6 Aug 2010 22:39:46 +0200 Subject: [Vimprobable-users] International hinting mode? In-Reply-To: <20100806203323.GA11236@myhost.getinternet.no> References: <20100421222503.GA8664@tuxpad.hsr.ch> <20100505211547.06b28ab4@workstation> <20100506094802.173d8664@workstation> <20100507123723.GA5406@tuxpad.hsr.ch> <20100515193813.GA3012@shuttle.home> <20100803131142.GA4675@tuxpad> <20100805153037.GB7955@myhost.getinternet.no> <20100806143635.GC2038@laptop2.lan.localhost> <20100806203323.GA11236@myhost.getinternet.no> Message-ID: <20100806203945.GD2038@laptop2.lan.localhost> On Fri, Aug 06, 2010 at 10:33:23PM +0200, Eivind Michael Skretting wrote: > On Fri, Aug 06, 2010 at 04:36:36PM +0200, Hannes Sch?ller wrote: > > On Thu, Aug 05, 2010 at 05:30:37PM +0200, Eivind Michael Skretting wrote: > > > The only thing keeping me from switching is the hinting. I am > > > norwegian and I need the hinting mode to support ???. Is there any way > > > I can do this? I use vimprobable1 by the way. > > > > Could you try the latest version? I added lots of international key > > symbols, but I only tested it with German characters. Works for those, > > now. > > My bad, works like a charm now. Thanks! No, no, I didn't mean "hey, you lazy bugger, it's already there", but "I've tried implementing this based on your suggestion, please try it out". Glad it's turned out to your satisfaction :) Hannes -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From eivind at linux.com Fri Aug 6 21:07:29 2010 From: eivind at linux.com (Eivind Michael Skretting) Date: Fri, 6 Aug 2010 23:07:29 +0200 Subject: [Vimprobable-users] International hinting mode? In-Reply-To: <20100806203945.GD2038@laptop2.lan.localhost> References: <20100505211547.06b28ab4@workstation> <20100506094802.173d8664@workstation> <20100507123723.GA5406@tuxpad.hsr.ch> <20100515193813.GA3012@shuttle.home> <20100803131142.GA4675@tuxpad> <20100805153037.GB7955@myhost.getinternet.no> <20100806143635.GC2038@laptop2.lan.localhost> <20100806203323.GA11236@myhost.getinternet.no> <20100806203945.GD2038@laptop2.lan.localhost> Message-ID: <20100806210729.GA17956@myhost.getinternet.no> On Fri, Aug 06, 2010 at 10:39:46PM +0200, Hannes Sch?ller wrote: > On Fri, Aug 06, 2010 at 10:33:23PM +0200, Eivind Michael Skretting wrote: > > On Fri, Aug 06, 2010 at 04:36:36PM +0200, Hannes Sch?ller wrote: > > > On Thu, Aug 05, 2010 at 05:30:37PM +0200, Eivind Michael Skretting wrote: > > > > The only thing keeping me from switching is the hinting. I am > > > > norwegian and I need the hinting mode to support ???. Is there any way > > > > I can do this? I use vimprobable1 by the way. > > > > > > Could you try the latest version? I added lots of international key > > > symbols, but I only tested it with German characters. Works for those, > > > now. > > > > My bad, works like a charm now. Thanks! > > No, no, I didn't mean "hey, you lazy bugger, it's already there", but > "I've tried implementing this based on your suggestion, please try it > out". Glad it's turned out to your satisfaction :) > > Hannes I didn't think so either, but it's true that some mailing lists are quite hostile. Good to know this one isn't :) Eivind From eivind at linux.com Sun Aug 8 02:54:24 2010 From: eivind at linux.com (Eivind Michael Skretting) Date: Sun, 8 Aug 2010 04:54:24 +0200 Subject: [Vimprobable-users] Open in external editor? Message-ID: <20100808025424.GA23516@myhost.getinternet.no> Hi Well, subject says it all. In vimperator you can press Ctrl-i in insert mode to open the text field in an external editor (so we can use vim when we need actual text editing). Are there plans of implementing this? I find it very useful when editing wiki entries, mails, etc. Using vimprobable fulltime, by the way. Eivind From matto at matto.nl Sun Aug 8 13:18:28 2010 From: matto at matto.nl (Matto Fransen) Date: Sun, 8 Aug 2010 15:18:28 +0200 Subject: [Vimprobable-users] Open in external editor? In-Reply-To: <20100808025424.GA23516@myhost.getinternet.no> References: <20100808025424.GA23516@myhost.getinternet.no> Message-ID: <20100808131827.GA1441@aspire.tradesystem.nl> Hi Eivind, On Sun, Aug 08, 2010 at 04:54:24AM +0200, Eivind Michael Skretting wrote: > Well, subject says it all. In vimperator you can press Ctrl-i in insert > mode to open the text field in an external editor (so we can use vim > when we need actual text editing). Are there plans of implementing this? Well, if webkit support this, then it must be doable. > I find it very useful when editing wiki entries, mails, etc. It sounds like a great feature indeed. So if Hannes agrees, we put this on the wishlist :) > Using vimprobable fulltime, by the way. Great! Cheers, Matto -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From thomas at xteddy.org Sun Aug 8 13:20:27 2010 From: thomas at xteddy.org (Thomas Adam) Date: Sun, 8 Aug 2010 14:20:27 +0100 Subject: [Vimprobable-users] Open in external editor? In-Reply-To: <20100808131827.GA1441@aspire.tradesystem.nl> References: <20100808025424.GA23516@myhost.getinternet.no> <20100808131827.GA1441@aspire.tradesystem.nl> Message-ID: <20100808132025.GA2988@shuttle.home> On Sun, Aug 08, 2010 at 03:18:28PM +0200, Matto Fransen wrote: > Hi Eivind, > > On Sun, Aug 08, 2010 at 04:54:24AM +0200, Eivind Michael Skretting wrote: > > > Well, subject says it all. In vimperator you can press Ctrl-i in insert > > mode to open the text field in an external editor (so we can use vim > > when we need actual text editing). Are there plans of implementing this? > > Well, if webkit support this, then it must be doable. It doesn't though. For this to work, you'd need to use Javascript (again, due to Webkit's lack of proper DOM support). I believe the Uzbl folks have already solved this in this way -- someone more interested in this will have to check. :) -- Thomas Adam -- "Deep in my heart I wish I was wrong. But deep in my heart I know I am not." -- Morrissey ("Girl Least Likely To" -- off of Viva Hate.) From rnestler at hsr.ch Mon Aug 9 14:22:09 2010 From: rnestler at hsr.ch (Raphael Nestler) Date: Mon, 9 Aug 2010 16:22:09 +0200 Subject: [Vimprobable-users] gt/gT patch for better tabbed integration In-Reply-To: <20100805130653.GD1872@debian> References: <20100421222503.GA8664@tuxpad.hsr.ch> <20100505211547.06b28ab4@workstation> <20100506094802.173d8664@workstation> <20100507123723.GA5406@tuxpad.hsr.ch> <20100515193813.GA3012@shuttle.home> <20100803131142.GA4675@tuxpad> <20100805130307.GC1872@debian> <20100805130653.GD1872@debian> Message-ID: <20100809142207.GA2866@tuxpad> On Thu, Aug 05, 2010 at 03:06:54PM +0200, Thomas Adam wrote: > On Thu, Aug 05, 2010 at 02:03:09PM +0100, Thomas Adam wrote: > > On Tue, Aug 03, 2010 at 03:11:45PM +0200, Raphael Nestler wrote: > > > It's the first time I've used the Xlib functions directly, so maybe the code > > > could be made cleaner. > > > > Can you regenerate this diff against latest HEAD? It doesn't apply cleanly I used git diff origin/HEAD to generate the diff. Is this the correct way or is there any better method? > > for me. Having said that, see in-line comments below as well... I've applied most of the suggestions you made. But two things remain unclear to me: 1. Should I check XStringToKeysym() and XKeysymToKeycode() seperate or does it work with if( (xk.keycode = XKeysymToKeycode( xdpy, XStringToKeysym(a->s))) == NoSymbol ) ? 2. What do you mean with "Don't bother with the release check"? Just don't send the KeyRelease event? > Forgot to mention, rather than using fprintf() for error messages, it might > be worth using the Arg type, and echo() to put a mesasage at the bottom of > Vimprobable instead? I've replaced the fprintf() calls with calls to echo(). Thanks for your feedback :) -- Raphael Nestler -------------- next part -------------- diff --git a/config.h b/config.h index db6e413..f6c913c 100644 --- a/config.h +++ b/config.h @@ -104,6 +104,8 @@ static Key keys[] = { { 0, GDK_q, GDK_9, quickmark, { .s = "9" } }, { 0, 0, GDK_0, scroll, {ScrollJumpTo | DirectionLeft} }, { GDK_SHIFT_MASK, 0, GDK_dollar, scroll, {ScrollJumpTo | DirectionRight} }, + { 0, GDK_g, GDK_t, fake_key_event, { .s = "l", .i = ShiftMask + ControlMask }}, + { GDK_SHIFT_MASK, GDK_g, GDK_T, fake_key_event, { .s = "h", .i = ShiftMask + ControlMask }}, { 0, GDK_g, GDK_g, scroll, {ScrollJumpTo | DirectionTop} }, { GDK_SHIFT_MASK, 0, GDK_G, scroll, {ScrollJumpTo | DirectionBottom} }, { 0, 0, GDK_h, scroll, {ScrollMove | DirectionLeft | UnitLine} }, diff --git a/main.c b/main.c index 9d51bd9..1930ee1 100644 --- a/main.c +++ b/main.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "vimprobable.h" #include "javascript.h" @@ -65,6 +66,7 @@ static gboolean yank(const Arg *arg); static gboolean view_source(const Arg * arg); static gboolean zoom(const Arg *arg); static gboolean quickmark(const Arg *arg); +static gboolean fake_key_event(const Arg *arg); static void update_url(const char *uri); static void update_state(void); @@ -1334,6 +1336,54 @@ quickmark(const Arg *a) { else { return false; } } +gboolean +fake_key_event(const Arg *a) { + if(!embed) { + return FALSE; + } + Arg err; + err.i = Error; + Display *xdpy; + if ( (xdpy = XOpenDisplay(NULL)) == NULL ) { + err.s = "Couldn't find the XDisplay."; + echo(&err); + return FALSE; + } + + XKeyEvent xk; + xk.display = xdpy; + xk.subwindow = None; + xk.time = CurrentTime; + xk.same_screen = True; + xk.x = xk.y = xk.x_root = xk.y_root = 1; + xk.window = embed; + xk.state = a->i; + + if( (xk.keycode = XKeysymToKeycode(xdpy, XStringToKeysym(a->s))) == NoSymbol ) { + err.s = "Couldn't translate keysym..."; + echo(&err); + return FALSE; + } + + xk.type = KeyPress; + if( !XSendEvent(xdpy, embed, True, KeyPressMask, (XEvent *)&xk) ) { + err.s = "XSendEvent failed"; + echo(&err); + return FALSE; + } + XFlush(xdpy); + + xk.type = KeyRelease; + if( !XSendEvent(xdpy, embed, True, KeyReleaseMask, (XEvent *)&xk) ) { + err.s = "XSendEvent failed"; + echo(&err); + return FALSE; + } + XFlush(xdpy); + + return TRUE; +} + gboolean toggle_plugins(const Arg *arg) { static gboolean plugins; From thomas at xteddy.org Mon Aug 9 14:26:05 2010 From: thomas at xteddy.org (Thomas Adam) Date: Mon, 9 Aug 2010 15:26:05 +0100 Subject: [Vimprobable-users] gt/gT patch for better tabbed integration In-Reply-To: <20100809142207.GA2866@tuxpad> References: <20100421222503.GA8664@tuxpad.hsr.ch> <20100505211547.06b28ab4@workstation> <20100506094802.173d8664@workstation> <20100507123723.GA5406@tuxpad.hsr.ch> <20100515193813.GA3012@shuttle.home> <20100803131142.GA4675@tuxpad> <20100805130307.GC1872@debian> <20100805130653.GD1872@debian> <20100809142207.GA2866@tuxpad> Message-ID: <20100809142602.GA4776@abacus.soton.smoothwall.net> On Mon, Aug 09, 2010 at 04:22:09PM +0200, Raphael Nestler wrote: > On Thu, Aug 05, 2010 at 03:06:54PM +0200, Thomas Adam wrote: > > On Thu, Aug 05, 2010 at 02:03:09PM +0100, Thomas Adam wrote: > > > On Tue, Aug 03, 2010 at 03:11:45PM +0200, Raphael Nestler wrote: > > > > It's the first time I've used the Xlib functions directly, so maybe the code > > > > could be made cleaner. > > > > > > Can you regenerate this diff against latest HEAD? It doesn't apply cleanly > > I used git diff origin/HEAD to generate the diff. Is this the correct > way or is there any better method? This should be OK. > > > for me. Having said that, see in-line comments below as well... > > I've applied most of the suggestions you made. But two things remain > unclear to me: > 1. Should I check XStringToKeysym() and XKeysymToKeycode() seperate > or does it work with if( (xk.keycode = XKeysymToKeycode( xdpy, > XStringToKeysym(a->s))) == NoSymbol ) ? Ideally check them separately, since trying to assign NoSymbol is still valid from inside XKeysymToKeycode() -- and gives no guarantee that the call to XKeysymToKeycode() is going to return NoSymbol either. > 2. What do you mean with "Don't bother with the release check"? Just > don't send the KeyRelease event? Correct. > > Forgot to mention, rather than using fprintf() for error messages, it might > > be worth using the Arg type, and echo() to put a mesasage at the bottom of > > Vimprobable instead? > > I've replaced the fprintf() calls with calls to echo(). > > Thanks for your feedback :) No problem. Can you send v4 based on this, please? :) -- Thomas Adam From hannes at yllr.net Mon Aug 9 14:32:44 2010 From: hannes at yllr.net (Hannes =?UTF-8?B?U2Now7xsbGVy?=) Date: Mon, 9 Aug 2010 16:32:44 +0200 Subject: [Vimprobable-users] gt/gT patch for better tabbed integration In-Reply-To: <20100809142207.GA2866@tuxpad> References: <20100421222503.GA8664@tuxpad.hsr.ch> <20100505211547.06b28ab4@workstation> <20100506094802.173d8664@workstation> <20100507123723.GA5406@tuxpad.hsr.ch> <20100515193813.GA3012@shuttle.home> <20100803131142.GA4675@tuxpad> <20100805130307.GC1872@debian> <20100805130653.GD1872@debian> <20100809142207.GA2866@tuxpad> Message-ID: <20100809163244.20e10bc2@workstation> Hi! Raphael Nestler wrote: > On Thu, Aug 05, 2010 at 03:06:54PM +0200, Thomas Adam wrote: > > On Thu, Aug 05, 2010 at 02:03:09PM +0100, Thomas Adam wrote: > > > On Tue, Aug 03, 2010 at 03:11:45PM +0200, Raphael Nestler wrote: > > > > It's the first time I've used the Xlib functions directly, so > > > > maybe the code could be made cleaner. > > > > > > Can you regenerate this diff against latest HEAD? It doesn't > > > apply cleanly > > I used git diff origin/HEAD to generate the diff. Is this the correct > way or is there any better method? Thomas, for your information, Raphael is obviously using the vimprobable1 branch where all his patches are applying just fine. Hannes -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From hannes at yllr.net Mon Aug 9 14:34:14 2010 From: hannes at yllr.net (Hannes =?UTF-8?B?U2Now7xsbGVy?=) Date: Mon, 9 Aug 2010 16:34:14 +0200 Subject: [Vimprobable-users] Open in external editor? In-Reply-To: <20100808131827.GA1441@aspire.tradesystem.nl> References: <20100808025424.GA23516@myhost.getinternet.no> <20100808131827.GA1441@aspire.tradesystem.nl> Message-ID: <20100809163414.3bbc4eeb@workstation> Hi! Matto Fransen wrote: > On Sun, Aug 08, 2010 at 04:54:24AM +0200, Eivind Michael Skretting > wrote: > > I find it very useful when editing wiki entries, mails, etc. > > It sounds like a great feature indeed. So if Hannes agrees, we put > this on the wishlist :) I don't think I'll use it myself, but absolutely no objection. I think this would be a very popular feature. Hannes -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From thomas at xteddy.org Mon Aug 9 14:34:42 2010 From: thomas at xteddy.org (Thomas Adam) Date: Mon, 9 Aug 2010 15:34:42 +0100 Subject: [Vimprobable-users] gt/gT patch for better tabbed integration In-Reply-To: <20100809163244.20e10bc2@workstation> References: <20100421222503.GA8664@tuxpad.hsr.ch> <20100505211547.06b28ab4@workstation> <20100506094802.173d8664@workstation> <20100507123723.GA5406@tuxpad.hsr.ch> <20100515193813.GA3012@shuttle.home> <20100803131142.GA4675@tuxpad> <20100805130307.GC1872@debian> <20100805130653.GD1872@debian> <20100809142207.GA2866@tuxpad> <20100809163244.20e10bc2@workstation> Message-ID: 2010/8/9 Hannes Sch?ller : > Hi! > > Raphael Nestler wrote: >> On Thu, Aug 05, 2010 at 03:06:54PM +0200, Thomas Adam wrote: >> > On Thu, Aug 05, 2010 at 02:03:09PM +0100, Thomas Adam wrote: >> > > On Tue, Aug 03, 2010 at 03:11:45PM +0200, Raphael Nestler wrote: >> > > > It's the first time I've used the Xlib functions directly, so >> > > > maybe the code could be made cleaner. >> > > >> > > Can you regenerate this diff against latest HEAD? ?It doesn't >> > > apply cleanly >> >> I used git diff origin/HEAD to generate the diff. Is this the correct >> way or is there any better method? > > Thomas, for your information, Raphael is obviously using the > vimprobable1 branch where all his patches are applying just fine. Ah, of course! That would explain it. Thanks. Raphael, please can I have some patches against origin/vimprobable2? -- Thomas Adam From hannes at yllr.net Mon Aug 9 14:45:03 2010 From: hannes at yllr.net (Hannes =?UTF-8?B?U2Now7xsbGVy?=) Date: Mon, 9 Aug 2010 16:45:03 +0200 Subject: [Vimprobable-users] gt/gT patch for better tabbed integration In-Reply-To: References: <20100421222503.GA8664@tuxpad.hsr.ch> <20100505211547.06b28ab4@workstation> <20100506094802.173d8664@workstation> <20100507123723.GA5406@tuxpad.hsr.ch> <20100515193813.GA3012@shuttle.home> <20100803131142.GA4675@tuxpad> <20100805130307.GC1872@debian> <20100805130653.GD1872@debian> <20100809142207.GA2866@tuxpad> <20100809163244.20e10bc2@workstation> Message-ID: <20100809164503.45cba042@workstation> Thomas Adam wrote: > 2010/8/9 Hannes Sch?ller : > > Raphael Nestler wrote: > >> On Thu, Aug 05, 2010 at 03:06:54PM +0200, Thomas Adam wrote: > >> > On Thu, Aug 05, 2010 at 02:03:09PM +0100, Thomas Adam wrote: > >> > > On Tue, Aug 03, 2010 at 03:11:45PM +0200, Raphael Nestler > >> > > wrote: > >> > > > It's the first time I've used the Xlib functions directly, so > >> > > > maybe the code could be made cleaner. > >> > > > >> > > Can you regenerate this diff against latest HEAD? ?It doesn't > >> > > apply cleanly > >> > >> I used git diff origin/HEAD to generate the diff. Is this the > >> correct way or is there any better method? > > > > Thomas, for your information, Raphael is obviously using the > > vimprobable1 branch where all his patches are applying just fine. > > Ah, of course! That would explain it. Thanks. > > Raphael, please can I have some patches against origin/vimprobable2? Seriously, what for? I've been porting patches back and forth between the branches all the time (amongst those, many from yourself). This patch is completely trivial, it simply adds one monolithic function to main.c and a few lines to config.h. Porting it is simply a matter of copying & pasting the new code into the respective files. Hannes -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From thomas at xteddy.org Mon Aug 9 14:48:14 2010 From: thomas at xteddy.org (Thomas Adam) Date: Mon, 9 Aug 2010 15:48:14 +0100 Subject: [Vimprobable-users] gt/gT patch for better tabbed integration In-Reply-To: <20100809164503.45cba042@workstation> References: <20100506094802.173d8664@workstation> <20100507123723.GA5406@tuxpad.hsr.ch> <20100515193813.GA3012@shuttle.home> <20100803131142.GA4675@tuxpad> <20100805130307.GC1872@debian> <20100805130653.GD1872@debian> <20100809142207.GA2866@tuxpad> <20100809163244.20e10bc2@workstation> <20100809164503.45cba042@workstation> Message-ID: <20100809144810.GB4776@abacus.soton.smoothwall.net> On Mon, Aug 09, 2010 at 04:45:03PM +0200, Hannes Sch?ller wrote: > Seriously, what for? I've been porting patches back and forth between > the branches all the time (amongst those, many from yourself). This > patch is completely trivial, it simply adds one monolithic function to > main.c and a few lines to config.h. Porting it is simply a matter of > copying & pasting the new code into the respective files. Completely selfish reasons. The patch is being regenerated anyway, and given I'm rather busy at the moment, I don't -want- the hassle of having to do all the cut and pasting. Given I took to reviewing it cursively *only* last time, the least I can do is apply it to my tree this time round, but I won't do it if I have to go chopping/changing hunks around. -- Thomas Adam From rnestler at hsr.ch Mon Aug 9 21:11:17 2010 From: rnestler at hsr.ch (Raphael Nestler) Date: Mon, 9 Aug 2010 23:11:17 +0200 Subject: [Vimprobable-users] gt/gT patch for better tabbed integration In-Reply-To: References: <20100506094802.173d8664@workstation> <20100507123723.GA5406@tuxpad.hsr.ch> <20100515193813.GA3012@shuttle.home> <20100803131142.GA4675@tuxpad> <20100805130307.GC1872@debian> <20100805130653.GD1872@debian> <20100809142207.GA2866@tuxpad> <20100809163244.20e10bc2@workstation> Message-ID: <20100809211117.GA2732@tuxpad.hsr.ch> On Mon, Aug 09, 2010 at 04:34:42PM +0200, Thomas Adam wrote: > 2010/8/9 Hannes Sch?ller : > > Hi! > > > > Raphael Nestler wrote: > >> On Thu, Aug 05, 2010 at 03:06:54PM +0200, Thomas Adam wrote: > >> > On Thu, Aug 05, 2010 at 02:03:09PM +0100, Thomas Adam wrote: > >> > > On Tue, Aug 03, 2010 at 03:11:45PM +0200, Raphael Nestler wrote: > >> > > > It's the first time I've used the Xlib functions directly, so > >> > > > maybe the code could be made cleaner. > >> > > > >> > > Can you regenerate this diff against latest HEAD? ?It doesn't > >> > > apply cleanly > >> > >> I used git diff origin/HEAD to generate the diff. Is this the correct > >> way or is there any better method? > > > > Thomas, for your information, Raphael is obviously using the > > vimprobable1 branch where all his patches are applying just fine. > > Ah, of course! That would explain it. Thanks. > > Raphael, please can I have some patches against origin/vimprobable2? So here is v4 of my patch, both for vimprobable1 and 2 :) I couldn't directly diff against origin/vimprobable2 since it would diff the whole changes between vimprobable1 and 2. So I cloned vimprobable2 and applied the patch manually. Btw: Are there any plans to deprecate vimprobable1? It doesn't seem to make sense to maintain both in a long run. -- Raphael -------------- next part -------------- diff --git a/config.h b/config.h index db6e413..f6c913c 100644 --- a/config.h +++ b/config.h @@ -104,6 +104,8 @@ static Key keys[] = { { 0, GDK_q, GDK_9, quickmark, { .s = "9" } }, { 0, 0, GDK_0, scroll, {ScrollJumpTo | DirectionLeft} }, { GDK_SHIFT_MASK, 0, GDK_dollar, scroll, {ScrollJumpTo | DirectionRight} }, + { 0, GDK_g, GDK_t, fake_key_event, { .s = "l", .i = ShiftMask + ControlMask }}, + { GDK_SHIFT_MASK, GDK_g, GDK_T, fake_key_event, { .s = "h", .i = ShiftMask + ControlMask }}, { 0, GDK_g, GDK_g, scroll, {ScrollJumpTo | DirectionTop} }, { GDK_SHIFT_MASK, 0, GDK_G, scroll, {ScrollJumpTo | DirectionBottom} }, { 0, 0, GDK_h, scroll, {ScrollMove | DirectionLeft | UnitLine} }, diff --git a/main.c b/main.c index 9d51bd9..dbdbe7d 100644 --- a/main.c +++ b/main.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "vimprobable.h" #include "javascript.h" @@ -65,6 +66,7 @@ static gboolean yank(const Arg *arg); static gboolean view_source(const Arg * arg); static gboolean zoom(const Arg *arg); static gboolean quickmark(const Arg *arg); +static gboolean fake_key_event(const Arg *arg); static void update_url(const char *uri); static void update_state(void); @@ -1334,6 +1336,59 @@ quickmark(const Arg *a) { else { return false; } } +gboolean +fake_key_event(const Arg *a) { + if(!embed) { + return FALSE; + } + Arg err; + err.i = Error; + Display *xdpy; + if ( (xdpy = XOpenDisplay(NULL)) == NULL ) { + err.s = "Couldn't find the XDisplay."; + echo(&err); + return FALSE; + } + + XKeyEvent xk; + xk.display = xdpy; + xk.subwindow = None; + xk.time = CurrentTime; + xk.same_screen = True; + xk.x = xk.y = xk.x_root = xk.y_root = 1; + xk.window = embed; + xk.state = a->i; + + if( ! a->s ) { + err.s = "Zero pointer as argument! Check your config.h"; + echo(&err); + return FALSE; + } + + KeySym keysym; + if( (keysym = XStringToKeysym(a->s)) == NoSymbol ) { + err.s = g_strdup_printf("Couldn't translate %s to keysym", a->s ); + echo(&err); + return FALSE; + } + + if( (xk.keycode = XKeysymToKeycode(xdpy, keysym)) == NoSymbol ) { + err.s = "Couldn't translate keysym to keycode"; + echo(&err); + return FALSE; + } + + xk.type = KeyPress; + if( !XSendEvent(xdpy, embed, True, KeyPressMask, (XEvent *)&xk) ) { + err.s = "XSendEvent failed"; + echo(&err); + return FALSE; + } + XFlush(xdpy); + + return TRUE; +} + gboolean toggle_plugins(const Arg *arg) { static gboolean plugins; -------------- next part -------------- diff --git a/config.h b/config.h index 8787915..b34349b 100644 --- a/config.h +++ b/config.h @@ -118,6 +118,9 @@ Key keys[] = { { GDK_CONTROL_MASK, 0, GDK_e, scroll, {ScrollMove | DirectionBottom | UnitLine} }, { GDK_CONTROL_MASK, 0, GDK_y, scroll, {ScrollMove | DirectionTop | UnitLine} }, + { 0, GDK_g, GDK_t, fake_key_event, { .s = "l", .i = ShiftMask + ControlMask }}, + { GDK_SHIFT_MASK, GDK_g, GDK_T, fake_key_event, { .s = "h", .i = ShiftMask + ControlMask }}, + { GDK_CONTROL_MASK, 0, GDK_i, navigate, {NavigationBack} }, { GDK_CONTROL_MASK, 0, GDK_o, navigate, {NavigationForward} }, { GDK_SHIFT_MASK, 0, GDK_H, navigate, {NavigationBack} }, diff --git a/main.c b/main.c index e567f10..c146d0e 100644 --- a/main.c +++ b/main.c @@ -5,6 +5,7 @@ see LICENSE file */ +#include #include "includes.h" #include "vimprobable.h" #include "utilities.h" @@ -59,6 +60,7 @@ static gboolean scroll(const Arg *arg); static gboolean yank(const Arg *arg); static gboolean view_source(const Arg * arg); static gboolean zoom(const Arg *arg); +static gboolean fake_key_event(const Arg *arg); static void update_url(const char *uri); static void setup_modkeys(void); @@ -1438,6 +1440,60 @@ zoom(const Arg *arg) { return TRUE; } +gboolean +fake_key_event(const Arg *a) { + if(!embed) { + return FALSE; + } + Arg err; + err.i = Error; + Display *xdpy; + if ( (xdpy = XOpenDisplay(NULL)) == NULL ) { + err.s = "Couldn't find the XDisplay."; + echo(&err); + return FALSE; + } + + XKeyEvent xk; + xk.display = xdpy; + xk.subwindow = None; + xk.time = CurrentTime; + xk.same_screen = True; + xk.x = xk.y = xk.x_root = xk.y_root = 1; + xk.window = embed; + xk.state = a->i; + + if( ! a->s ) { + err.s = "Zero pointer as argument! Check your config.h"; + echo(&err); + return FALSE; + } + + KeySym keysym; + if( (keysym = XStringToKeysym(a->s)) == NoSymbol ) { + err.s = g_strdup_printf("Couldn't translate %s to keysym", a->s ); + echo(&err); + return FALSE; + } + + if( (xk.keycode = XKeysymToKeycode(xdpy, keysym)) == NoSymbol ) { + err.s = "Couldn't translate keysym to keycode"; + echo(&err); + return FALSE; + } + + xk.type = KeyPress; + if( !XSendEvent(xdpy, embed, True, KeyPressMask, (XEvent *)&xk) ) { + err.s = "XSendEvent failed"; + echo(&err); + return FALSE; + } + XFlush(xdpy); + + return TRUE; +} + + gboolean commandhistoryfetch(const Arg *arg) { if (arg->i == DirectionPrev) { From thomas at xteddy.org Mon Aug 9 21:12:56 2010 From: thomas at xteddy.org (Thomas Adam) Date: Mon, 9 Aug 2010 22:12:56 +0100 Subject: [Vimprobable-users] gt/gT patch for better tabbed integration In-Reply-To: <20100809211117.GA2732@tuxpad.hsr.ch> References: <20100506094802.173d8664@workstation> <20100507123723.GA5406@tuxpad.hsr.ch> <20100515193813.GA3012@shuttle.home> <20100803131142.GA4675@tuxpad> <20100805130307.GC1872@debian> <20100805130653.GD1872@debian> <20100809142207.GA2866@tuxpad> <20100809163244.20e10bc2@workstation> <20100809211117.GA2732@tuxpad.hsr.ch> Message-ID: <20100809211254.GA4101@shuttle.home> On Mon, Aug 09, 2010 at 11:11:17PM +0200, Raphael Nestler wrote: > On Mon, Aug 09, 2010 at 04:34:42PM +0200, Thomas Adam wrote: > > 2010/8/9 Hannes Sch?ller : > > > Hi! > > > > > > Raphael Nestler wrote: > > >> On Thu, Aug 05, 2010 at 03:06:54PM +0200, Thomas Adam wrote: > > >> > On Thu, Aug 05, 2010 at 02:03:09PM +0100, Thomas Adam wrote: > > >> > > On Tue, Aug 03, 2010 at 03:11:45PM +0200, Raphael Nestler wrote: > > >> > > > It's the first time I've used the Xlib functions directly, so > > >> > > > maybe the code could be made cleaner. > > >> > > > > >> > > Can you regenerate this diff against latest HEAD? ?It doesn't > > >> > > apply cleanly > > >> > > >> I used git diff origin/HEAD to generate the diff. Is this the correct > > >> way or is there any better method? > > > > > > Thomas, for your information, Raphael is obviously using the > > > vimprobable1 branch where all his patches are applying just fine. > > > > Ah, of course! That would explain it. Thanks. > > > > Raphael, please can I have some patches against origin/vimprobable2? > > So here is v4 of my patch, both for vimprobable1 and 2 :) Hannes -- go ahead and apply this, it looks fine. Raphael -- good job! > I couldn't directly diff against origin/vimprobable2 since it would diff > the whole changes between vimprobable1 and 2. So I cloned vimprobable2 > and applied the patch manually. > > Btw: Are there any plans to deprecate vimprobable1? It doesn't seem to > make sense to maintain both in a long run. Maybe. Depends on how many users are using vimprobable1. -- Thomas Adam -- "Deep in my heart I wish I was wrong. But deep in my heart I know I am not." -- Morrissey ("Girl Least Likely To" -- off of Viva Hate.) From hannes at yllr.net Tue Aug 10 11:34:28 2010 From: hannes at yllr.net (Hannes =?iso-8859-1?Q?Sch=FCller?=) Date: Tue, 10 Aug 2010 13:34:28 +0200 Subject: [Vimprobable-users] gt/gT patch for better tabbed integration In-Reply-To: <20100809211117.GA2732@tuxpad.hsr.ch> References: <20100506094802.173d8664@workstation> <20100507123723.GA5406@tuxpad.hsr.ch> <20100515193813.GA3012@shuttle.home> <20100803131142.GA4675@tuxpad> <20100805130307.GC1872@debian> <20100805130653.GD1872@debian> <20100809142207.GA2866@tuxpad> <20100809163244.20e10bc2@workstation> <20100809211117.GA2732@tuxpad.hsr.ch> Message-ID: <20100810113427.GA2096@laptop2.lan.localhost> > Btw: Are there any plans to deprecate vimprobable1? It doesn't seem to > make sense to maintain both in a long run. Right now, vimprobable1 is still the branch most users use. So at least bugfixes will continue to appear. *On the long run*, vimprobable2 is the future, of course. The '1' branch has almost all the features it should have, so most new things appear in '2'. Hannes -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From eivind at linux.com Tue Aug 10 13:43:34 2010 From: eivind at linux.com (Eivind Michael Skretting) Date: Tue, 10 Aug 2010 15:43:34 +0200 Subject: [Vimprobable-users] gt/gT patch for better tabbed integration In-Reply-To: <20100810113427.GA2096@laptop2.lan.localhost> References: <20100507123723.GA5406@tuxpad.hsr.ch> <20100515193813.GA3012@shuttle.home> <20100803131142.GA4675@tuxpad> <20100805130307.GC1872@debian> <20100805130653.GD1872@debian> <20100809142207.GA2866@tuxpad> <20100809163244.20e10bc2@workstation> <20100809211117.GA2732@tuxpad.hsr.ch> <20100810113427.GA2096@laptop2.lan.localhost> Message-ID: <20100810134333.GC3632@myhost.getinternet.no> On Tue, Aug 10, 2010 at 01:34:28PM +0200, Hannes Sch?ller wrote: > > Btw: Are there any plans to deprecate vimprobable1? It doesn't seem to > > make sense to maintain both in a long run. > > Right now, vimprobable1 is still the branch most users use. So at least > bugfixes will continue to appear. *On the long run*, vimprobable2 is the > future, of course. The '1' branch has almost all the features it should > have, so most new things appear in '2'. > > Hannes Then I hope this is not in the near future? I really like the "modify config.h" approach, not sure I understand what's better with "set" and "map" commands. Willing to learn, though :) Eivind > _______________________________________________ > Vimprobable-users mailing list > Vimprobable-users at vimprobable.org > http://vimprobable.org/mailman/listinfo/vimprobable-users From hannes at yllr.net Tue Aug 10 13:49:14 2010 From: hannes at yllr.net (Hannes =?iso-8859-1?Q?Sch=FCller?=) Date: Tue, 10 Aug 2010 15:49:14 +0200 Subject: [Vimprobable-users] gt/gT patch for better tabbed integration In-Reply-To: <20100810134333.GC3632@myhost.getinternet.no> References: <20100515193813.GA3012@shuttle.home> <20100803131142.GA4675@tuxpad> <20100805130307.GC1872@debian> <20100805130653.GD1872@debian> <20100809142207.GA2866@tuxpad> <20100809163244.20e10bc2@workstation> <20100809211117.GA2732@tuxpad.hsr.ch> <20100810113427.GA2096@laptop2.lan.localhost> <20100810134333.GC3632@myhost.getinternet.no> Message-ID: <20100810134914.GB2096@laptop2.lan.localhost> On Tue, Aug 10, 2010 at 03:43:34PM +0200, Eivind Michael Skretting wrote: > On Tue, Aug 10, 2010 at 01:34:28PM +0200, Hannes Sch?ller wrote: > > > Btw: Are there any plans to deprecate vimprobable1? It doesn't seem to > > > make sense to maintain both in a long run. > > > > Right now, vimprobable1 is still the branch most users use. So at least > > bugfixes will continue to appear. *On the long run*, vimprobable2 is the > > future, of course. The '1' branch has almost all the features it should > > have, so most new things appear in '2'. > > Then I hope this is not in the near future? As far as I'm concerned, "on the long run" means "not in the near future". I think it's good that a few '1' users are speaking up now, because some people don't seem to believe you guys exist ;) > I really like the "modify > config.h" approach, not sure I understand what's better with "set" and > "map" commands. Willing to learn, though :) The advantage is obviously that you don't need to compile anything. Which means you don't need lots and lots of header files on your system and infinitely higher chances of convincing your system administrator to install the application for you if you don't have the privileges to do that yourself (e.g. on work computers, probably even with home partitions mounted with noexec, so you couldn't even compile and execute the browser from there if you wanted.). Hannes -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From eivind at linux.com Tue Aug 10 14:06:06 2010 From: eivind at linux.com (Eivind Michael Skretting) Date: Tue, 10 Aug 2010 16:06:06 +0200 Subject: [Vimprobable-users] gt/gT patch for better tabbed integration In-Reply-To: <20100810134914.GB2096@laptop2.lan.localhost> References: <20100803131142.GA4675@tuxpad> <20100805130307.GC1872@debian> <20100805130653.GD1872@debian> <20100809142207.GA2866@tuxpad> <20100809163244.20e10bc2@workstation> <20100809211117.GA2732@tuxpad.hsr.ch> <20100810113427.GA2096@laptop2.lan.localhost> <20100810134333.GC3632@myhost.getinternet.no> <20100810134914.GB2096@laptop2.lan.localhost> Message-ID: <20100810140606.GD3632@myhost.getinternet.no> On Tue, Aug 10, 2010 at 03:49:14PM +0200, Hannes Sch?ller wrote: > I think it's good that a few '1' users are speaking up now, because some > people don't seem to believe you guys exist ;) > Well, I do ;) I'm using both vimprobable, tabbed(occationally) and dwm, and find just as easy to recompile such a small program as modifying a config file. And it feels more right/simple/elegant (pick a nerd-buzzword). > (e.g. on work computers, probably even with home > partitions mounted with noexec, so you couldn't even compile and execute > the browser from there if you wanted.). Good point, never thought of that. Eivind From hannes at yllr.net Wed Aug 11 09:23:42 2010 From: hannes at yllr.net (Hannes =?iso-8859-1?Q?Sch=FCller?=) Date: Wed, 11 Aug 2010 11:23:42 +0200 Subject: [Vimprobable-users] gt/gT patch for better tabbed integration In-Reply-To: <20100809211117.GA2732@tuxpad.hsr.ch> References: <20100506094802.173d8664@workstation> <20100507123723.GA5406@tuxpad.hsr.ch> <20100515193813.GA3012@shuttle.home> <20100803131142.GA4675@tuxpad> <20100805130307.GC1872@debian> <20100805130653.GD1872@debian> <20100809142207.GA2866@tuxpad> <20100809163244.20e10bc2@workstation> <20100809211117.GA2732@tuxpad.hsr.ch> Message-ID: <20100811092341.GA31328@laptop2.lan.localhost> The patch has been merged. Thanks again! Hannes -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From thomas at xteddy.org Sat Aug 14 22:05:48 2010 From: thomas at xteddy.org (Thomas Adam) Date: Sat, 14 Aug 2010 23:05:48 +0100 Subject: [Vimprobable-users] [PATCH] Implement locking on revive() logic. Message-ID: <20100814220525.GA31284@debian> When writing out the file for the use of reviving the last URL (which is useful if Vimprobable is being used inside tabbed, for example), ensure we at least try and not clobber the same file if two or more instances of Vimprobable try and write to the same file. Note that this isn't so much about ensuring searialisation as it is about crudely disallowing file corruption when writing/reading from the URL file. --- There might well be whitespace corruption, but the entire file is already broken in that regard, so apologies. main.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/main.c b/main.c index 672235a..eaaebed 100644 --- a/main.c +++ b/main.c @@ -1167,7 +1167,9 @@ quit(const Arg *arg) { filename = g_strdup_printf(CLOSED_URL_FILENAME); f = fopen(filename, "w"); if (f != NULL) { + flockfile(f); fprintf(f, "%s", uri); + funlockfile(f); fclose(f); } } @@ -1185,8 +1187,10 @@ revive(const Arg *arg) { filename = g_strdup_printf(CLOSED_URL_FILENAME); f = fopen(filename, "r"); if (f != NULL) { + flockfile(f); fgets(buffer, 512, f); - fclose(f); + funlockfile(f); + fclose(f); } if (strlen(buffer) > 0) { a.s = buffer; -- 1.7.1 From matto at matto.nl Sun Aug 15 18:52:13 2010 From: matto at matto.nl (Matto Fransen) Date: Sun, 15 Aug 2010 20:52:13 +0200 Subject: [Vimprobable-users] patch to open several bookmarked urls at once Message-ID: <20100815185210.GA2179@aspire.tradesystem.nl> Hi, Attached please find a small patch that adds functionality to open several sites at once. The idea is that tags are added to the bookmark-file. Tags are on the end of the line and are put between square brackets [ and ] A bookmark can have zero, one or more tags. To open all the bookmarks of a certain tag, type the following command in vimprobable: :qt Then, all the urls in the bookmarkfile which have a tag [tagname] will be opened. I am not sure about the right command, for now I have settled with :qt I don't know if Hannes would like this kind of functionality or that he sees it as 'bloat', but I did like comparable functionality in another browser :) Cheers, Matto -------------- next part -------------- A non-text attachment was scrubbed... Name: batchopen.patch Type: text/x-diff Size: 2609 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From hannes at yllr.net Mon Aug 16 09:52:54 2010 From: hannes at yllr.net (Hannes =?UTF-8?B?U2Now7xsbGVy?=) Date: Mon, 16 Aug 2010 11:52:54 +0200 Subject: [Vimprobable-users] [PATCH] Implement locking on revive() logic. In-Reply-To: <20100814220525.GA31284@debian> References: <20100814220525.GA31284@debian> Message-ID: <20100816115254.346142e8@workstation> Applied, will be in the next release. Thanks! Hannes -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From hannes at yllr.net Mon Aug 16 10:02:18 2010 From: hannes at yllr.net (Hannes =?UTF-8?B?U2Now7xsbGVy?=) Date: Mon, 16 Aug 2010 12:02:18 +0200 Subject: [Vimprobable-users] patch to open several bookmarked urls at once In-Reply-To: <20100815185210.GA2179@aspire.tradesystem.nl> References: <20100815185210.GA2179@aspire.tradesystem.nl> Message-ID: <20100816120218.77957a07@workstation> Hi! Matto Fransen wrote: > Attached please find a small patch that adds functionality to > open several sites at once. > > The idea is that tags are added to the bookmark-file. > Tags are on the end of the line and are put between square brackets > [ and ] A bookmark can have zero, one or more tags. I think the idea of tagging bookmarks is certainly good and useful. Batch opening doesn't seem to be a huge function, so I have no objections. What I would like to see is this, though: :bma tag1 tag2 tag2 :bma tag4 :bma ...should all work. I.e. the bookmark function should take an optional string argument writing everything after the first space into the bookmarks file as tags. Do you think you can do that? About the patch so far: > + { "qt", search_tag, {0} }, Why :qt? Wouldn't 'q' be associated with quitting or quickmarks? I don't particularly object, but I'd really like to learn what prompted that decision :) > k = strlen(tag); > if ( strncmp( tag, foundtag, k ) == 0 ) Here, you don't actually make sure the strings match. All you check is that tag is a substring of foundtag since foundtag can be longer. Is that intentional? Hannes -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From thomas at xteddy.org Mon Aug 16 13:05:30 2010 From: thomas at xteddy.org (Thomas Adam) Date: Mon, 16 Aug 2010 14:05:30 +0100 Subject: [Vimprobable-users] patch to open several bookmarked urls at once In-Reply-To: <20100815185210.GA2179@aspire.tradesystem.nl> References: <20100815185210.GA2179@aspire.tradesystem.nl> Message-ID: <20100816130528.GD26732@abacus.soton.smoothwall.net> Hey Matto -- On Sun, Aug 15, 2010 at 08:52:13PM +0200, Matto Fransen wrote: > Hi, > > Attached please find a small patch that adds functionality to > open several sites at once. Couple of minor points to consider about the code. > diff -crB a/config.h b/config.h > *** a/config.h Sun Aug 15 18:24:03 2010 > --- b/config.h Sun Aug 15 18:25:29 2010 > *************** > *** 108,113 **** > --- 108,114 ---- > { "re!", navigate, {NavigationForceReload} }, > { "reload", navigate, {NavigationReload} }, > { "reload!", navigate, {NavigationForceReload} }, > + { "qt", search_tag, {0} }, > { "st", navigate, {NavigationCancel} }, > { "stop", navigate, {NavigationCancel} }, > { "t", open, {TargetNew} }, > diff -crB a/main.c b/main.c > *** a/main.c Sun Aug 15 18:24:03 2010 > --- b/main.c Sun Aug 15 18:25:29 2010 > *************** > *** 57,62 **** > --- 57,63 ---- > static gboolean set(const Arg *arg); > static gboolean script(const Arg *arg); > static gboolean scroll(const Arg *arg); > + static gboolean search_tag (const Arg * arg); > static gboolean yank(const Arg *arg); > static gboolean view_source(const Arg * arg); > static gboolean zoom(const Arg *arg); > *************** > *** 2311,2313 **** > --- 2312,2376 ---- > > return EXIT_SUCCESS; > } > + > + static gboolean > + search_tag (const Arg * a) > + { > + FILE *f; > + const char *filename; > + const char *tag = a->s; > + char s[255], foundtag[40], url[255]; > + int t, i, intag, k; > + > + filename = g_strdup_printf (BOOKMARKS_STORAGE_FILENAME); > + f = fopen (filename, "r"); Locking? > + if (f == NULL) > + return TRUE; > + while (fgets (s, 254, f)) 254? Can this magic number not be some sort of #define? > + { > + intag = 0; > + t = strlen (s) -1; > + while (isspace (s[t])) > + t--; > + if ( s[t] != ']' ) continue; > + while (t > 0) > + { > + if (s[t] == ']') > + { > + if (!intag) > + intag = t; > + else > + intag = 0; > + } > + else > + { > + if (s[t] == '[') > + { > + if (intag) > + { > + i = 0; > + k = t + 1; > + while (k < intag) > + foundtag[i++] = s[k++]; > + foundtag[i] = '\0'; > + /* foundtag now contains the tag */ We've spoke about the use of glib in the past (no, I've not forgotten), but perhaps this could be rewritten using that? Other than that, it looks fine. :) -- Thomas Adam From matto at matto.nl Mon Aug 16 15:03:29 2010 From: matto at matto.nl (Matto Fransen) Date: Mon, 16 Aug 2010 17:03:29 +0200 Subject: [Vimprobable-users] patch to open several bookmarked urls at once In-Reply-To: <20100816120218.77957a07@workstation> References: <20100815185210.GA2179@aspire.tradesystem.nl> <20100816120218.77957a07@workstation> Message-ID: <20100816150326.GA4046@debian64.tradesystem.nl> Hi, On Mon, Aug 16, 2010 at 12:02:18PM +0200, Hannes Sch?ller wrote: > I think the idea of tagging bookmarks is certainly good and useful. > Batch opening doesn't seem to be a huge function, so I have no > objections. What I would like to see is this, though: > > :bma tag1 tag2 tag2 > :bma tag4 > :bma > > ...should all work. I.e. the bookmark function should take an optional > string argument writing everything after the first space into the > bookmarks file as tags. Do you think you can do that? I will try :) > About the patch so far: > > > + { "qt", search_tag, {0} }, > > Why :qt? Wouldn't 'q' be associated with quitting or quickmarks? I > don't particularly object, but I'd really like to learn what prompted > that decision :) That is a q from quick and a t from tags :) But like I wrote in my email, I didn't have much inspiration for a better command. > > k = strlen(tag); > > if ( strncmp( tag, foundtag, k ) == 0 ) > > Here, you don't actually make sure the strings match. All you check is > that tag is a substring of foundtag since foundtag can be longer. Is > that intentional? Nope, that was not the intention, just trying to prevents complaints by using strcmp. I could first check to see if both tag and foundtag are within a reasonable limit and then we can strcmp :) I'll look into that. Thanks for your feedback! Cheers, Matto -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From matto at matto.nl Mon Aug 16 15:08:16 2010 From: matto at matto.nl (Matto Fransen) Date: Mon, 16 Aug 2010 17:08:16 +0200 Subject: [Vimprobable-users] patch to open several bookmarked urls at once In-Reply-To: <20100816130528.GD26732@abacus.soton.smoothwall.net> References: <20100815185210.GA2179@aspire.tradesystem.nl> <20100816130528.GD26732@abacus.soton.smoothwall.net> Message-ID: <20100816150811.GB4046@debian64.tradesystem.nl> Hi, On Mon, Aug 16, 2010 at 02:05:30PM +0100, Thomas Adam wrote: > Hey Matto -- > > On Sun, Aug 15, 2010 at 08:52:13PM +0200, Matto Fransen wrote: > > Hi, > > > > Attached please find a small patch that adds functionality to > > open several sites at once. > > Couple of minor points to consider about the code. > [ ... ] > > + filename = g_strdup_printf (BOOKMARKS_STORAGE_FILENAME); > > + f = fopen (filename, "r"); > > Locking? Could do, but here we are only reading. Should we lock there too? > > + if (f == NULL) > > + return TRUE; > > + while (fgets (s, 254, f)) > > 254? Can this magic number not be some sort of #define? It is just to make sure we keep within the boundaries of the buffer s. I will change it into some #defined value :) > > + { > > + intag = 0; > > + t = strlen (s) -1; [ ... ] > > + foundtag[i++] = s[k++]; > > + foundtag[i] = '\0'; > > + /* foundtag now contains the tag */ > > We've spoke about the use of glib in the past (no, I've not forgotten), but > perhaps this could be rewritten using that? Well, I am not that acquinted with glib. Some pointers here might help :) > Other than that, it looks fine. :) Thank for your input ! Cheers, Matto -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From matto at matto.nl Mon Aug 16 17:29:29 2010 From: matto at matto.nl (Matto Fransen) Date: Mon, 16 Aug 2010 19:29:29 +0200 Subject: [Vimprobable-users] Improved patch to open several bookmarked urls at once In-Reply-To: <20100816120218.77957a07@workstation> References: <20100815185210.GA2179@aspire.tradesystem.nl> <20100816120218.77957a07@workstation> Message-ID: <20100816172927.GA2826@debian64.tradesystem.nl> Hello, On Mon, Aug 16, 2010 at 12:02:18PM +0200, Hannes Sch?ller wrote: [ ... ] > I think the idea of tagging bookmarks is certainly good and useful. > Batch opening doesn't seem to be a huge function, so I have no > objections. What I would like to see is this, though: > > :bma tag1 tag2 tag2 > :bma tag4 > :bma > > ...should all work. I.e. the bookmark function should take an optional > string argument writing everything after the first space into the > bookmarks file as tags. Do you think you can do that? Done :) See the attached patch. :bma tag1 tag2 tag3 will result in a new bookmark [tag1] [tag2] [tag3] > About the patch so far: > > > + { "qt", search_tag, {0} }, > > Why :qt? Wouldn't 'q' be associated with quitting or quickmarks? I > don't particularly object, but I'd really like to learn what prompted > that decision :) > > > k = strlen(tag); > > if ( strncmp( tag, foundtag, k ) == 0 ) > > Here, you don't actually make sure the strings match. All you check is > that tag is a substring of foundtag since foundtag can be longer. Is > that intentional? Solved in the attached pattch :) Cheers, Matto -------------- next part -------------- diff -crB a/config.h b/config.h *** a/config.h Sun Aug 15 18:24:03 2010 --- b/config.h Mon Aug 16 17:18:48 2010 *************** *** 108,113 **** --- 108,114 ---- { "re!", navigate, {NavigationForceReload} }, { "reload", navigate, {NavigationReload} }, { "reload!", navigate, {NavigationForceReload} }, + { "qt", search_tag, {0} }, { "st", navigate, {NavigationCancel} }, { "stop", navigate, {NavigationCancel} }, { "t", open, {TargetNew} }, diff -crB a/main.c b/main.c *** a/main.c Sun Aug 15 18:24:03 2010 --- b/main.c Mon Aug 16 17:18:48 2010 *************** *** 57,62 **** --- 57,63 ---- static gboolean set(const Arg *arg); static gboolean script(const Arg *arg); static gboolean scroll(const Arg *arg); + static gboolean search_tag (const Arg * arg); static gboolean yank(const Arg *arg); static gboolean view_source(const Arg * arg); static gboolean zoom(const Arg *arg); *************** *** 1508,1513 **** --- 1510,1518 ---- fprintf(f, "%s", " "); fprintf(f, "%s", title); } + if ( strlen(arg->s )) { + build_taglist ( arg, f ); + } fprintf(f, "%s", "\n"); fclose(f); return TRUE; *************** *** 2311,2313 **** --- 2316,2381 ---- return EXIT_SUCCESS; } + + static gboolean + search_tag (const Arg * a) + { + FILE *f; + const char *filename; + const char *tag = a->s; + char s[BUFFERSIZE], foundtag[40], url[BUFFERSIZE]; + int t, i, intag, k; + + if ( strlen(tag ) > MAXTAGSIZE ) return; + + filename = g_strdup_printf (BOOKMARKS_STORAGE_FILENAME); + f = fopen (filename, "r"); + if (f == NULL) + return TRUE; + while (fgets (s, BUFFERSIZE-1, f)) + { + intag = 0; + t = strlen (s) -1; + while (isspace (s[t])) + t--; + if ( s[t] != ']' ) continue; + while (t > 0) + { + if (s[t] == ']') + { + if (!intag) + intag = t; + else + intag = 0; + } + else + { + if (s[t] == '[') + { + if (intag) + { + i = 0; + k = t + 1; + while (k < intag) + foundtag[i++] = s[k++]; + foundtag[i] = '\0'; + /* foundtag now contains the tag */ + if ( strlen(foundtag) < MAXTAGSIZE && strcmp( tag, foundtag ) == 0 ) + { + i=0; + while (isspace(s[i])) i++; + k=0; + while (s[i] && !isspace(s[i]) ) url[k++] = s[i++]; + url[k]='\0'; + Arg x = {.i = TargetNew,.s = url }; + open (&x); + } + } + intag = 0; + } + } + t--; + } + } + return TRUE; + } diff -crB a/utilities.c b/utilities.c *** a/utilities.c Sun Aug 15 18:24:03 2010 --- b/utilities.c Mon Aug 16 17:18:48 2010 *************** *** 142,144 **** --- 142,175 ---- i++; } } + + gboolean + build_taglist ( Arg * arg, FILE * f ) + { + int k=0, in_tag=0; + int t, marker; + char foundtab[MAXTAGSIZE+1]; + while ( arg->s[k] ) + { + if ( !isspace(arg->s[k] ) && !in_tag ) { + in_tag = 1; + marker = k; + } + if ( isspace(arg->s[k] ) && in_tag ) + { + /* found a tag */ + t = 0; + while ( marker < k && t < MAXTAGSIZE) foundtab[t++] = arg->s[marker++]; + foundtab[t] = '\0'; + fprintf(f, " [%s]", foundtab ); + in_tag = 0; + } + k++; + } + if ( in_tag ) + { + while ( marker < strlen(arg->s) && t < MAXTAGSIZE) foundtab[t++] = arg->s[marker++]; + foundtab[t] = '\0'; + fprintf(f, " [%s]", foundtab ); + } + } diff -crB a/vimprobable.h b/vimprobable.h *** a/vimprobable.h Sun Aug 15 18:24:03 2010 --- b/vimprobable.h Mon Aug 16 17:18:48 2010 *************** *** 147,152 **** --- 147,154 ---- #define MOUSE_BUTTON_3 3 #define MOUSE_BUTTON_4 4 #define MOUSE_BUTTON_5 5 + #define BUFFERSIZE 255 + #define MAXTAGSIZE 200 /* quickmarks */ #define QUICKMARK_FILE "%s/.config/vimprobable/quickmarks", getenv("HOME") -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: <http://vimprobable.org/pipermail/vimprobable-users/attachments/20100816/10cb63eb/attachment-0001.bin> From hpdeifel at gmx.de Tue Aug 17 19:18:05 2010 From: hpdeifel at gmx.de (Hans-Peter Deifel) Date: Tue, 17 Aug 2010 21:18:05 +0200 Subject: [Vimprobable-users] [PATCH] Better handling of multiple simultaneous downloads Message-ID: <1282072685-8784-1-git-send-email-hpdeifel@gmx.de> Keep track of every download and show the number of downloads in the statusbar. If the ascii progressbar is enabled, show the average progress of all downloads. --- main.c | 129 ++++++++++++++++++++++++++++++++++++++-------------------------- 1 files changed, 77 insertions(+), 52 deletions(-) diff --git a/main.c b/main.c index 672235a..d325f80 100644 --- a/main.c +++ b/main.c @@ -112,7 +112,6 @@ static char **args; static unsigned int mode = ModeNormal; static unsigned int count = 0; static float zoomstep; -static char scroll_state[4] = "\0"; static char *modkeys; static char current_modkey; static char *search_handle; @@ -128,7 +127,8 @@ static char inputKey[5]; static char inputBuffer[65] = ""; static char chars[65] = "0000000000000000000000000000000000000000000000000000000000000000\n"; static char followTarget[8] = ""; -static WebKitDownload *activeDownload = NULL; + +GList *activeDownloads; #include "config.h" #include "keymap.h" @@ -265,33 +265,31 @@ webview_download_cb(WebKitWebView *webview, WebKitDownload *download, gpointer u else a.s = g_strdup_printf("Download %s started (unknown size)...", filename); echo(&a); - activeDownload = download; - g_signal_connect(activeDownload, "notify::progress", G_CALLBACK(download_progress), NULL); - g_signal_connect(activeDownload, "notify::status", G_CALLBACK(download_progress), NULL); + activeDownloads = g_list_prepend(activeDownloads, download); + g_signal_connect(download, "notify::progress", G_CALLBACK(download_progress), NULL); + g_signal_connect(download, "notify::status", G_CALLBACK(download_progress), NULL); update_state(); return TRUE; } void download_progress(WebKitDownload *d, GParamSpec *pspec) { - WebKitDownloadStatus status; Arg a; + WebKitDownloadStatus status = webkit_download_get_status(d); - if (activeDownload != NULL) { - status = webkit_download_get_status(activeDownload); - if (status != WEBKIT_DOWNLOAD_STATUS_STARTED && status != WEBKIT_DOWNLOAD_STATUS_CREATED) { - if (status != WEBKIT_DOWNLOAD_STATUS_FINISHED) { - a.i = Error; - echo(&a); - } else { - a.i = Info; - a.s = g_strdup_printf("Download finished"); - echo(&a); - } - activeDownload = NULL; + if (status != WEBKIT_DOWNLOAD_STATUS_STARTED && status != WEBKIT_DOWNLOAD_STATUS_CREATED) { + if (status != WEBKIT_DOWNLOAD_STATUS_FINISHED) { + a.i = Error; + a.s = g_strdup_printf("Error while downloading %s", webkit_download_get_suggested_filename(d)); + echo(&a); + } else { + a.i = Info; + a.s = g_strdup_printf("Download %s finished", webkit_download_get_suggested_filename(d)); + echo(&a); } - update_state(); + activeDownloads = g_list_remove(activeDownloads, d); } + update_state(); } @@ -2051,46 +2049,73 @@ update_url(const char *uri) { void update_state() { - int max = gtk_adjustment_get_upper(adjust_v) - gtk_adjustment_get_page_size(adjust_v); - int val = (int)(gtk_adjustment_get_value(adjust_v) / max * 100); char *markup; -#ifdef ENABLE_WGET_PROGRESS_BAR - double progress; - char progressbar[progressbartick + 1]; - WebKitDownloadStatus status; + int download_count = g_list_length(activeDownloads); + GString *status = g_string_new(""); - g_object_get((GObject*)webview, "progress", &progress, NULL); -#endif + /* construct the status line */ + + /* count, modkey and input buffer */ + g_string_append_printf(status, "%.0d", count); + if (current_modkey) g_string_append_c(status, current_modkey); + if (inputBuffer[0]) g_string_append_printf(status, " %s", inputBuffer); + + /* the number of active downloads */ + if (activeDownloads) { + g_string_append_printf(status, " %d active %s", download_count, + (download_count == 1) ? "download" : "downloads"); + } - if (max == 0) - sprintf(&scroll_state[0], "All"); - else if (val == 0) - sprintf(&scroll_state[0], "Top"); - else if (val == 100) - sprintf(&scroll_state[0], "Bot"); - else - sprintf(&scroll_state[0], "%d%%", val); #ifdef ENABLE_WGET_PROGRESS_BAR - if (activeDownload != NULL) { - status = webkit_download_get_status(activeDownload); - if (status == WEBKIT_DOWNLOAD_STATUS_STARTED || status == WEBKIT_DOWNLOAD_STATUS_CREATED) { - progress = (gint)(webkit_download_get_progress(activeDownload) * 100); - ascii_bar(progressbartick, (int)(progress * progressbartick / 100), (char*)progressbar); - markup = (char*)g_markup_printf_escaped("<span font=\"%s\">%.0d%c %s %c%s%c %s</span>", - statusfont, count, current_modkey, inputBuffer, progressborderleft, progressbar, progressborderright, scroll_state); - } else { - markup = (char*)g_markup_printf_escaped("<span font=\"%s\">%.0d%c %s %s</span>", statusfont, count, current_modkey, inputBuffer, scroll_state); + /* the progressbar */ + { + int progress = -1; + char progressbar[progressbartick + 1]; + + if (activeDownloads) { + progress = 0; + GList *ptr; + + for (ptr = activeDownloads; ptr; ptr = g_list_next(ptr)) { + progress += 100 * webkit_download_get_progress(ptr->data); + } + + progress /= download_count; + + } else if (webkit_web_view_get_load_status(webview) != WEBKIT_LOAD_FINISHED + && webkit_web_view_get_load_status(webview) != WEBKIT_LOAD_FAILED) { + + progress = webkit_web_view_get_progress(webview) * 100; } - } else if ((webkit_web_view_get_load_status(webview) != WEBKIT_LOAD_FINISHED) && - (activeDownload != NULL)) { - ascii_bar(progressbartick, (int)(progress * progressbartick), (char*)progressbar); - markup = (char*)g_markup_printf_escaped("<span font=\"%s\">%.0d%c %s %c%s%c %s</span>", - statusfont, count, current_modkey, inputBuffer, progressborderleft, progressbar, progressborderright, scroll_state); - } else + + if (progress >= 0) { + ascii_bar(progressbartick, progress * progressbartick / 100, progressbar); + g_string_append_printf(status, " %c%s%c", + progressborderleft, progressbar, progressborderright); + } + } #endif - markup = (char*)g_markup_printf_escaped("<span font=\"%s\">%.0d%c %s %s</span>", statusfont, count, current_modkey, inputBuffer, scroll_state); - /*markup = (char*)g_markup_printf_escaped("<span font=\"%s\">%.0d%c %s</span>", statusfont, count, current_modkey, scroll_state);*/ + + /* and the current scroll position */ + { + int max = gtk_adjustment_get_upper(adjust_v) - gtk_adjustment_get_page_size(adjust_v); + int val = (int)(gtk_adjustment_get_value(adjust_v) / max * 100); + + if (max == 0) + g_string_append(status, " All"); + else if (val == 0) + g_string_append(status, " Top"); + else if (val == 100) + g_string_append(status, " Bot"); + else + g_string_append_printf(status, " %d%%", val); + } + + + markup = g_markup_printf_escaped("<span font=\"%s\">%s</span>", statusfont, status->str); gtk_label_set_markup(GTK_LABEL(status_state), markup); + + g_string_free(status, TRUE); } void -- 1.7.1 From hannes at yllr.net Wed Aug 18 12:59:03 2010 From: hannes at yllr.net (Hannes =?UTF-8?B?U2Now7xsbGVy?=) Date: Wed, 18 Aug 2010 14:59:03 +0200 Subject: [Vimprobable-users] Improved patch to open several bookmarked urls at once In-Reply-To: <20100816172927.GA2826@debian64.tradesystem.nl> References: <20100815185210.GA2179@aspire.tradesystem.nl> <20100816120218.77957a07@workstation> <20100816172927.GA2826@debian64.tradesystem.nl> Message-ID: <20100818145903.45c0b1ff@workstation> > See the attached patch. I get this: main.c: In function ?quit?: main.c:1166: warning: implicit declaration of function ?flockfile? main.c:1168: warning: implicit declaration of function ?funlockfile? main.c: In function ?bookmark?: main.c:1512: warning: implicit declaration of function ?build_taglist? main.c: In function ?search_tag?: main.c:2116: warning: ?return? with no value, in function returning non-void From thomas at xteddy.org Wed Aug 18 15:13:22 2010 From: thomas at xteddy.org (Thomas Adam) Date: Wed, 18 Aug 2010 16:13:22 +0100 Subject: [Vimprobable-users] Improved patch to open several bookmarked urls at once In-Reply-To: <20100818145903.45c0b1ff@workstation> References: <20100815185210.GA2179@aspire.tradesystem.nl> <20100816120218.77957a07@workstation> <20100816172927.GA2826@debian64.tradesystem.nl> <20100818145903.45c0b1ff@workstation> Message-ID: <AANLkTim9QVsyoWv1jCKrxDWK5MVicKt77KsQo8A+sHLy@mail.gmail.com> Hi! 2010/8/18 Hannes Sch?ller <hannes at yllr.net>: >> See the attached patch. > > I get this: > > main.c: In function ?quit?: > main.c:1166: warning: implicit declaration of function ?flockfile? > main.c:1168: warning: implicit declaration of function ?funlockfile? That comes from "stdio.h", which means this patch is probably older than the changes I made? -- Thomas Adam From hannes at yllr.net Wed Aug 18 20:16:19 2010 From: hannes at yllr.net (Hannes =?UTF-8?B?U2Now7xsbGVy?=) Date: Wed, 18 Aug 2010 22:16:19 +0200 Subject: [Vimprobable-users] Improved patch to open several bookmarked urls at once In-Reply-To: <AANLkTim9QVsyoWv1jCKrxDWK5MVicKt77KsQo8A+sHLy@mail.gmail.com> References: <20100815185210.GA2179@aspire.tradesystem.nl> <20100816120218.77957a07@workstation> <20100816172927.GA2826@debian64.tradesystem.nl> <20100818145903.45c0b1ff@workstation> <AANLkTim9QVsyoWv1jCKrxDWK5MVicKt77KsQo8A+sHLy@mail.gmail.com> Message-ID: <20100818221619.622284fb@workstation> Thomas Adam <thomas at xteddy.org> wrote: > 2010/8/18 Hannes Sch?ller <hannes at yllr.net>: > >> See the attached patch. > > > > I get this: > > > > main.c: In function ?quit?: > > main.c:1166: warning: implicit declaration of function ?flockfile? > > main.c:1168: warning: implicit declaration of function ?funlockfile? > > That comes from "stdio.h", which means this patch is probably older > than the changes I made? Yes, forget about these two. I applied the patch to the wrong tree. The rest remains. Hannes -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: not available URL: <http://vimprobable.org/pipermail/vimprobable-users/attachments/20100818/c5c474e6/attachment.bin> From rm at deconfused.org Wed Aug 18 21:15:14 2010 From: rm at deconfused.org (Ryan Mullen) Date: Wed, 18 Aug 2010 17:15:14 -0400 Subject: [Vimprobable-users] Whitelisting for cookies and javascript Message-ID: <AANLkTi=z336T_GMyWOe+bxxb7mQS5126Zp9fphGY9UAa@mail.gmail.com> Hi all, I'm currently trying to figure out what browser I want to use (between surf and vimprobable2) as a Firefox replacement. The Firefox extensions which I used heavily were Noscript, Cookiesafe, and Adblock. I've taken care of blocking ads by using a Polipo proxy, which I am quite happy with. I am now interested in configuring whitelists for noscript and cookiesafe, as these were the main uses I had for noscript and cookiesafe. I was able to patch surf to do some rudimentary cookie whitelisting - the interface is crappy, but it works fine. I maintain a text file with the domains of the cookies I wish to accept, and every cookie that does not match against this list is rejected. I plan on extending the interface to this, as well as increasing performance by caching the whitelist in memory (eventually). I'm sure I could add this to vimprobable2 if desired, since surf is similar (webkit) to vimprobable2. What I couldn't figure out was a really critical feature for me - javascript whitelisting. I wish to do something similar to my cookie whitelist and just keep a textfile with allowed domains, with perhaps a simple regex feature to extend the subdomain matching. Does vimprobable2 have anything like this, or is anybody working on something like this? Thanks, Ryan From skottish97215 at gmail.com Sun Aug 22 02:09:48 2010 From: skottish97215 at gmail.com (Skottish) Date: Sat, 21 Aug 2010 19:09:48 -0700 Subject: [Vimprobable-users] What just happened? Message-ID: <AANLkTimKyngro7UO=foNbPVMLY+aOKoxMg4mR8ECKHkQ@mail.gmail.com> vimprobable2 has rejected the keys section in config.h. I can't build it now and keep my settings. What happened? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://vimprobable.org/pipermail/vimprobable-users/attachments/20100821/41641a5d/attachment.html> From hannes at yllr.net Sun Aug 22 08:23:08 2010 From: hannes at yllr.net (Hannes =?iso-8859-1?Q?Sch=FCller?=) Date: Sun, 22 Aug 2010 10:23:08 +0200 Subject: [Vimprobable-users] Whitelisting for cookies and javascript In-Reply-To: <AANLkTi=z336T_GMyWOe+bxxb7mQS5126Zp9fphGY9UAa@mail.gmail.com> References: <AANLkTi=z336T_GMyWOe+bxxb7mQS5126Zp9fphGY9UAa@mail.gmail.com> Message-ID: <20100822082307.GA2003@laptop2.lan.localhost> Hi! On Wed, Aug 18, 2010 at 05:15:14PM -0400, Ryan Mullen wrote: > I was able to patch surf to do some rudimentary cookie whitelisting - > the interface is crappy, but it works fine. I maintain a text file > with the domains of the cookies I wish to accept, and every cookie > that does not match against this list is rejected. I plan on extending > the interface to this, as well as increasing performance by caching > the whitelist in memory (eventually). I'm sure I could add this to > vimprobable2 if desired, since surf is similar (webkit) to > vimprobable2. > > What I couldn't figure out was a really critical feature for me - > javascript whitelisting. I wish to do something similar to my cookie > whitelist and just keep a textfile with allowed domains, with perhaps > a simple regex feature to extend the subdomain matching. Does > vimprobable2 have anything like this, or is anybody working on > something like this? I haven't heard of anyone working on this, but I think it would be great features for the Vimprobable2 branch which, even if it doesn't look like it based on the lack of response, will be quite popular. Hannes -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: <http://vimprobable.org/pipermail/vimprobable-users/attachments/20100822/9e293efe/attachment.bin> From hannes at yllr.net Sun Aug 22 08:24:33 2010 From: hannes at yllr.net (Hannes =?iso-8859-1?Q?Sch=FCller?=) Date: Sun, 22 Aug 2010 10:24:33 +0200 Subject: [Vimprobable-users] What just happened? In-Reply-To: <AANLkTimKyngro7UO=foNbPVMLY+aOKoxMg4mR8ECKHkQ@mail.gmail.com> References: <AANLkTimKyngro7UO=foNbPVMLY+aOKoxMg4mR8ECKHkQ@mail.gmail.com> Message-ID: <20100822082432.GB2003@laptop2.lan.localhost> Hi! On Sat, Aug 21, 2010 at 07:09:48PM -0700, Skottish wrote: > vimprobable2 has rejected the keys section in config.h. I can't build it now > and keep my settings. What happened? The keybindings definition has been moved to keymap.h Hannes -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: <http://vimprobable.org/pipermail/vimprobable-users/attachments/20100822/331c2355/attachment-0001.bin> From skottish97215 at gmail.com Sun Aug 22 11:50:34 2010 From: skottish97215 at gmail.com (Skottish) Date: Sun, 22 Aug 2010 04:50:34 -0700 Subject: [Vimprobable-users] What just happened? In-Reply-To: <20100822082432.GB2003@laptop2.lan.localhost> References: <AANLkTimKyngro7UO=foNbPVMLY+aOKoxMg4mR8ECKHkQ@mail.gmail.com> <20100822082432.GB2003@laptop2.lan.localhost> Message-ID: <AANLkTikDMNP6sg5F0_CsY1A287k7C-nFEK4cqG_891VO@mail.gmail.com> Sweet! Thanks brother. 2010/8/22 Hannes Sch?ller <hannes at yllr.net> > Hi! > > On Sat, Aug 21, 2010 at 07:09:48PM -0700, Skottish wrote: > > vimprobable2 has rejected the keys section in config.h. I can't build it > now > > and keep my settings. What happened? > > The keybindings definition has been moved to keymap.h > > Hannes > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (GNU/Linux) > > iEYEARECAAYFAkxw3sAACgkQmR0MDT+hJJptkACfdw9O8OEEFHR5mNMHp1dfeDj7 > QMsAoK2sNswkZN8bXkZZGijlFUD+4hUq > =3EMk > -----END PGP SIGNATURE----- > > _______________________________________________ > Vimprobable-users mailing list > Vimprobable-users at vimprobable.org > http://vimprobable.org/mailman/listinfo/vimprobable-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://vimprobable.org/pipermail/vimprobable-users/attachments/20100822/50654fef/attachment.html> From stettberger at dokucode.de Tue Aug 24 19:23:39 2010 From: stettberger at dokucode.de (Christian Dietrich) Date: Tue, 24 Aug 2010 21:23:39 +0200 Subject: [Vimprobable-users] [PATCH] set InsertMode on focus_input() Message-ID: <1282677819-5050-1-git-send-email-stettberger@dokucode.de> Before i couldn't get input on the site blutschwerter.de because ModeInsert wasn't triggered. --- main.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/main.c b/main.c index 672235a..4caa1c6 100644 --- a/main.c +++ b/main.c @@ -177,6 +177,9 @@ webview_load_committed_cb(WebKitWebView *webview, WebKitWebFrame *frame, gpointe Arg a = { .i = Silent, .s = JS_SETUP_HINTS }; const char *uri = webkit_web_view_get_uri(webview); + Arg b = { .i = ModeNormal }; + set(&b); + update_url(uri); script(&a); } @@ -187,6 +190,7 @@ webview_load_finished_cb(WebKitWebView *webview, WebKitWebFrame *frame, gpointer if (HISTORY_MAX_ENTRIES > 0) history(); + update_state(); script(&a); } @@ -1614,10 +1618,13 @@ mappings(const Arg *arg) { static gboolean focus_input(const Arg *arg) { - static Arg a; + static Arg a, b = { .i = ModeInsert }; + + set(&b); a.s = g_strconcat("vimprobable_focus_input()", NULL); a.i = Silent; + script(&a); update_state(); return TRUE; -- 1.7.1 From hannes at yllr.net Wed Aug 25 14:01:17 2010 From: hannes at yllr.net (Hannes =?iso-8859-1?Q?Sch=FCller?=) Date: Wed, 25 Aug 2010 16:01:17 +0200 Subject: [Vimprobable-users] [PATCH] set InsertMode on focus_input() In-Reply-To: <1282677819-5050-1-git-send-email-stettberger@dokucode.de> References: <1282677819-5050-1-git-send-email-stettberger@dokucode.de> Message-ID: <20100825140116.GB2449@laptop2.lan.localhost> Hello Christian! On Tue, Aug 24, 2010 at 09:23:39PM +0200, Christian Dietrich wrote: > Before i couldn't get input on the site blutschwerter.de because > ModeInsert wasn't triggered. I was really baffled there, because activating INSERT mode through gi worked for me on that site. Thankfully, one of the nice people on IRC figured it out - the problem occurs when Javascript is activated in the browser. The reason is that the vBulletin board redefines some central objects of the language so that the browser can't use them properly anymore. I don't believe your patch is the right solution, though. Two things: - It is incomplete. Meaning this particular issue is 'worked around', but any other problem resulting from that board's redefinitions will prevail. - It will activate INSERT even if no appropriate input field has been found. Which it shouldn't. Hans-Peter/rootzlevel suggested saving window.console into some other variable so we can use it internally. I have to test this approach still, but it sounds promising. Hannes -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: <http://vimprobable.org/pipermail/vimprobable-users/attachments/20100825/4d6ae8aa/attachment.bin> From eivind at linux.com Wed Aug 25 15:55:52 2010 From: eivind at linux.com (Eivind Michael Skretting) Date: Wed, 25 Aug 2010 17:55:52 +0200 Subject: [Vimprobable-users] [PATCH] set InsertMode on focus_input() In-Reply-To: <20100825140116.GB2449@laptop2.lan.localhost> References: <1282677819-5050-1-git-send-email-stettberger@dokucode.de> <20100825140116.GB2449@laptop2.lan.localhost> Message-ID: <20100825155552.GC4581@myhost.getinternet.no> On Wed, Aug 25, 2010 at 04:01:17PM +0200, Hannes Sch?ller wrote: > - It will activate INSERT even if no appropriate input field has been > found. Which it shouldn't. On the other hand this happens with some sites already(mainly google as I know of). Well, there is an appropriate input field, but while the INSERT mode gets activated with "gi", that field does not get focus. I don't know if it's a related problem. Eivind From hannes at yllr.net Wed Aug 25 16:10:31 2010 From: hannes at yllr.net (Hannes =?iso-8859-1?Q?Sch=FCller?=) Date: Wed, 25 Aug 2010 18:10:31 +0200 Subject: [Vimprobable-users] [PATCH] set InsertMode on focus_input() In-Reply-To: <20100825155552.GC4581@myhost.getinternet.no> References: <1282677819-5050-1-git-send-email-stettberger@dokucode.de> <20100825140116.GB2449@laptop2.lan.localhost> <20100825155552.GC4581@myhost.getinternet.no> Message-ID: <20100825161030.GC2449@laptop2.lan.localhost> On Wed, Aug 25, 2010 at 05:55:52PM +0200, Eivind Michael Skretting wrote: > On Wed, Aug 25, 2010 at 04:01:17PM +0200, Hannes Sch?ller wrote: > > - It will activate INSERT even if no appropriate input field has been > > found. Which it shouldn't. > > On the other hand this happens with some sites already(mainly google as > I know of). Well, there is an appropriate input field, but while the > INSERT mode gets activated with "gi", that field does not get focus. I > don't know if it's a related problem. I can at least give you a reason for half of this problem: Google doesn't define its text input field as a text input field. I.e. their HTML code is badly broken. What the browser *should* do in such a case, of course, is to sit still and do nothing. Apparantely, it finds some other input field which is presumably invisible and tries to focus it. That's wrong behaviour on Vimprobable's side, of course. The main problem lies with Google here, though. Hannes -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: <http://vimprobable.org/pipermail/vimprobable-users/attachments/20100825/c0a0a22b/attachment.bin> From hannes at yllr.net Wed Aug 25 16:12:21 2010 From: hannes at yllr.net (Hannes =?iso-8859-1?Q?Sch=FCller?=) Date: Wed, 25 Aug 2010 18:12:21 +0200 Subject: [Vimprobable-users] [PATCH] set InsertMode on focus_input() In-Reply-To: <20100825155552.GC4581@myhost.getinternet.no> References: <1282677819-5050-1-git-send-email-stettberger@dokucode.de> <20100825140116.GB2449@laptop2.lan.localhost> <20100825155552.GC4581@myhost.getinternet.no> Message-ID: <20100825161220.GD2449@laptop2.lan.localhost> On Wed, Aug 25, 2010 at 05:55:52PM +0200, Eivind Michael Skretting wrote: > On Wed, Aug 25, 2010 at 04:01:17PM +0200, Hannes Sch?ller wrote: > > - It will activate INSERT even if no appropriate input field has been > > found. Which it shouldn't. > > On the other hand this happens with some sites already(mainly google as > I know of). Well, there is an appropriate input field, but while the > INSERT mode gets activated with "gi", that field does not get focus. I > don't know if it's a related problem. Found the culprit which turns INSERT mode on on Google's site: <textarea id=csi style=display:none></textarea> Hannes -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: <http://vimprobable.org/pipermail/vimprobable-users/attachments/20100825/44427314/attachment.bin> From eivind at linux.com Thu Aug 26 12:56:04 2010 From: eivind at linux.com (Eivind Michael Skretting) Date: Thu, 26 Aug 2010 14:56:04 +0200 Subject: [Vimprobable-users] [PATCH] set InsertMode on focus_input() In-Reply-To: <20100825161030.GC2449@laptop2.lan.localhost> References: <1282677819-5050-1-git-send-email-stettberger@dokucode.de> <20100825140116.GB2449@laptop2.lan.localhost> <20100825155552.GC4581@myhost.getinternet.no> <20100825161030.GC2449@laptop2.lan.localhost> Message-ID: <20100826125604.GD4581@myhost.getinternet.no> On Wed, Aug 25, 2010 at 06:10:31PM +0200, Hannes Sch?ller wrote: > On Wed, Aug 25, 2010 at 05:55:52PM +0200, Eivind Michael Skretting wrote: > > On Wed, Aug 25, 2010 at 04:01:17PM +0200, Hannes Sch?ller wrote: > > > - It will activate INSERT even if no appropriate input field has been > > > found. Which it shouldn't. > > > > On the other hand this happens with some sites already(mainly google as > > I know of). Well, there is an appropriate input field, but while the > > INSERT mode gets activated with "gi", that field does not get focus. I > > don't know if it's a related problem. > > I can at least give you a reason for half of this problem: > > Google doesn't define its text input field as a text input field. I.e. > their HTML code is badly broken. > > What the browser *should* do in such a case, of course, is to sit still > and do nothing. Apparantely, it finds some other input field which is > presumably invisible and tries to focus it. That's wrong behaviour on > Vimprobable's side, of course. The main problem lies with Google here, > though. > > Hannes Looks like it usually does :) Thanks for the info! Eivind From hannes at yllr.net Thu Aug 26 13:02:16 2010 From: hannes at yllr.net (Hannes =?iso-8859-1?Q?Sch=FCller?=) Date: Thu, 26 Aug 2010 15:02:16 +0200 Subject: [Vimprobable-users] [PATCH] set InsertMode on focus_input() In-Reply-To: <20100826125604.GD4581@myhost.getinternet.no> References: <1282677819-5050-1-git-send-email-stettberger@dokucode.de> <20100825140116.GB2449@laptop2.lan.localhost> <20100825155552.GC4581@myhost.getinternet.no> <20100825161030.GC2449@laptop2.lan.localhost> <20100826125604.GD4581@myhost.getinternet.no> Message-ID: <20100826130215.GA5787@laptop2.lan.localhost> On Thu, Aug 26, 2010 at 02:56:04PM +0200, Eivind Michael Skretting wrote: > On Wed, Aug 25, 2010 at 06:10:31PM +0200, Hannes Sch?ller wrote: > > On Wed, Aug 25, 2010 at 05:55:52PM +0200, Eivind Michael Skretting wrote: > > > On Wed, Aug 25, 2010 at 04:01:17PM +0200, Hannes Sch?ller wrote: > > > > - It will activate INSERT even if no appropriate input field has been > > > > found. Which it shouldn't. > > > > > > On the other hand this happens with some sites already(mainly google as > > > I know of). Well, there is an appropriate input field, but while the > > > INSERT mode gets activated with "gi", that field does not get focus. I > > > don't know if it's a related problem. > > > > I can at least give you a reason for half of this problem: > > > > Google doesn't define its text input field as a text input field. I.e. > > their HTML code is badly broken. > > > > What the browser *should* do in such a case, of course, is to sit still > > and do nothing. Apparantely, it finds some other input field which is > > presumably invisible and tries to focus it. That's wrong behaviour on > > Vimprobable's side, of course. The main problem lies with Google here, > > though. > > Looks like it usually does :) Thanks for the info! I've put some code to ignore text input fields which are invisible in my local branch. Will be in the next version. At least, then, INSERT will not be activated anymore needlessly. Hannes -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: <http://vimprobable.org/pipermail/vimprobable-users/attachments/20100826/15a2d51d/attachment-0001.bin>