vimprobable-users Mailing List for Vimprobable (Page 20)
Vimprobable is a lean web browser optimised for full keyboard control
Brought to you by:
hanness
You can subscribe to this list here.
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(77) |
Sep
(44) |
Oct
(43) |
Nov
(38) |
Dec
(14) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2012 |
Jan
(40) |
Feb
(18) |
Mar
(12) |
Apr
(25) |
May
(12) |
Jun
(13) |
Jul
(17) |
Aug
(3) |
Sep
(20) |
Oct
(42) |
Nov
(9) |
Dec
(2) |
2013 |
Jan
(9) |
Feb
(29) |
Mar
(9) |
Apr
(7) |
May
(38) |
Jun
|
Jul
(7) |
Aug
|
Sep
(5) |
Oct
(10) |
Nov
(11) |
Dec
(1) |
2014 |
Jan
(16) |
Feb
(18) |
Mar
(11) |
Apr
(5) |
May
(13) |
Jun
(5) |
Jul
(5) |
Aug
(7) |
Sep
(30) |
Oct
|
Nov
|
Dec
(26) |
2015 |
Jan
(5) |
Feb
(19) |
Mar
(8) |
Apr
(15) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(16) |
Dec
(10) |
2016 |
Jan
|
Feb
(1) |
Mar
(14) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Hannes S. <ha...@yl...> - 2012-04-17 06:57:35
|
This is quite a complex subject, so let me first describe thec current behaviour of the patch. Shorthand definitions: - state S1: default settings (as defined at compile time plus rc file) - state S2: site-specific settings for site X as defined in rc file - setting T1: a custom setting manually set by the user at runtime which is not covered by the difference between S1 and S2 (i.e. the site specific settings don't change this) - setting T2: a custom setting manually set by the user at runtime which is covered by the difference between S1 and S2 (i.e. the site specific settings change this) Case A: - start with S1 - go to X -> get S2 - go to another site -> get S1 back Case B: - start with S1 - set T1 -> S1+T1 - go to X -> S2+T1 - go to another site -> S1+T1 Case C: - start with S1 - set T2 -> S1+T2 - go to X -> S2 (T2 overwritten) - go to another site -> S1+T2 (T2 restored) Case D: - start with S1 - go to X -> S2 - set T1 -> S2+T1 - go to another site -> S1+T1 (T1 survives) Case E: - start with S1 - go to X -> S2 - set T2 -> S2+T2 - go to another site -> S1 (T2 overridden with respective setting from S1) So if we're talking about user expectations, the only case I believe we could have a problem is E. Do you agree so far? Sidenote: If T2 is a boolean setting, there is no problem, because S1+T2 = S1. Implementation aside, I'm not sure how this should be ideall handled. The alternative policy would be to retain T2, i.e. end up with S1+T2, but that could be non-intuitive as well. So I don't see a clear advantage over the current behaviour (as described in E). Opinions welcome! Hannes |
From: Daniel C. <dan...@gm...> - 2012-04-16 13:22:14
|
Hi! Another topic that's should be clear is, how manually set values (:set ...) are handled during browsing and where they are stored as default options or the sitespecific. In my opinion we should set the values that are explicitly set to site specific, if the current URL matches a configured site, else it should be handled like we know it. vimprobablerc: set fontsize=11 ... site http://foo.bar fontsize=14 When browsing on http://bar.baz we have fontsize 11, changing the value to 13 by :set fontsize=13 will set the value for all sites accept those that define another value (like http://foo.bar does). If http://foo.bar/... is opened, we should have fontsize 14. If the value is changed now to 9 this should take effect on all pages under http://foo.bar (should be saved in the struct used for the site). If another page, without special settings is opened the previously set fontsize of 13 should be used again. I think this behaviour would lead to least confusion compared to other behaviours. Daniel |
From: Daniel C. <dan...@gm...> - 2012-04-16 12:40:46
|
Hi! On Mon, Apr 16, 2012 at 08:19:53AM +0200, Hannes Schüller wrote: > This (using webview_load_committed) is an idea I had considered, too, > but it does not work correctly. Try to apply a proxy setting and you > will see what I mean. It would need to be triggered even earlier than > this. We also have the problem that the site settings revert previously done changes every time a new page ist loaded. That means, I navigate to a page with special settings, change a value via :set ... and navigate to another page on this site or use reload and the explicit set value will be reverted. But this would be easy to avoid in the apply_settings() function. I'm not sure, but I didn't see any earlier event to use for the configuration changes. Daniel |
From: Hannes S. <ha...@yl...> - 2012-04-16 06:21:12
|
Daniel Carl <dan...@gm...> wrote: > On Sun, Apr 15, 2012 at 06:19:32PM +0200, Hannes Sch__ller wrote: > > Good catch - this needs to be adapted. Will need to consider what > > the b est way is (suggestions welcome). > > Attached patch could be one way to handle the problem. This (using webview_load_committed) is an idea I had considered, too, but it does not work correctly. Try to apply a proxy setting and you will see what I mean. It would need to be triggered even earlier than this. Hannes |
From: Daniel C. <dan...@gm...> - 2012-04-16 00:45:21
|
Hi! On Sun, Apr 15, 2012 at 06:19:32PM +0200, Hannes Schüller wrote: > Good catch - this needs to be adapted. Will need to consider what the b > est way is (suggestions welcome). Attached patch could be one way to handle the problem. Daniel |
From: Daniel C. <dan...@gm...> - 2012-04-15 17:28:30
|
Hi Hannes! On Sun, Apr 15, 2012 at 06:19:32PM +0200, Hannes Schüller wrote: > This should not be a problem. The function only looks for the first > occurence of whitespace, i.e. the separation between the URL and the > settings. URLs can't contain whitespace, so there is no danger. The > settings are separated with pipe symbols exactly due to this reason. So > I don't see why setting a custom useragent (and other configuration > options) should not work. You're right, I didn't took the time to get into the function. Daniel |
From: Hannes S. <ha...@yl...> - 2012-04-15 16:19:54
|
Daniel Carl <dan...@gm...> wrote: > At the moment the per site settings aren't applied if a site is > requested via link click or hinting, it works only for urls entered > to url box. I suppose we have to use a callback to set the settings > when a page is opened by hinting or a javascript. Good catch - this needs to be adapted. Will need to consider what the b est way is (suggestions welcome). > In the function read_rcfile() a splitting for the site is done via > index = split_string_at_whitespace(buffer); > > How can set values containing whitespace (for example useragent) per > site if we split it by whitespace? This should not be a problem. The function only looks for the first occurence of whitespace, i.e. the separation between the URL and the settings. URLs can't contain whitespace, so there is no danger. The settings are separated with pipe symbols exactly due to this reason. So I don't see why setting a custom useragent (and other configuration options) should not work. Hannes |
From: Daniel C. <dan...@gm...> - 2012-04-15 16:13:25
|
Hi Hannes! At the moment the per site settings aren't applied if a site is requested via link click or hinting, it works only for urls entered to url box. I suppose we have to use a callback to set the settings when a page is opened by hinting or a javascript. In the function read_rcfile() a splitting for the site is done via index = split_string_at_whitespace(buffer); How can set values containing whitespace (for example useragent) per site if we split it by whitespace? Daniel |
From: Hannes S. <ha...@yl...> - 2012-04-12 21:29:50
|
--- main.c | 37 +++++++++++++++++++++++-------------- 1 files changed, 23 insertions(+), 14 deletions(-) diff --git a/main.c b/main.c index 63b9245..29e01c6 100644 --- a/main.c +++ b/main.c @@ -102,6 +102,7 @@ void fill_suggline(char * suggline, const char * command, const char *fill_with) GtkWidget * fill_eventbox(const char * completion_line); static void mop_up(void); void apply_settings(char *uri); +void revert_settings(void); #include "main.h" @@ -2566,8 +2567,11 @@ apply_settings(char *uri) { char temp[MAX_SETTING_SIZE], *temp2, temp3[MAX_SETTING_SIZE]; guint i, j, len, len2, len3; - /* check for site-specific settings */ if (siteSettings != NULL) { + /* to ensure consistency in case several defined sites are visited one after another, + * temporarily revert back to standard settings */ + revert_settings(); + /* check for site-specific settings */ len = g_list_length(siteSettings); for (i = 0; i < len; i++) { l = g_list_nth(siteSettings, i); @@ -2596,21 +2600,26 @@ apply_settings(char *uri) { return; } } - if (strlen(backupsettings) > 0) { - /* revert to standard settings - * the string has to be applied from right to left - * this ensures that if various values have been set for the same key in the meantime, - * we will still get back to the most basic state - */ + } +} + +void revert_settings(void) { + char *temp2; + + if (strlen(backupsettings) > 0) { + /* revert to standard settings + * the string has to be applied from right to left + * this ensures that if various values have been set for the same key in the meantime, + * we will still get back to the most basic state + */ + temp2 = strrchr(backupsettings, '|'); + while (temp2 != NULL) { + process_set_line(temp2 + 1); + memset(temp2, 0, strlen(temp2)); temp2 = strrchr(backupsettings, '|'); - while (temp2 != NULL) { - process_set_line(temp2 + 1); - memset(temp2, 0, strlen(temp2)); - temp2 = strrchr(backupsettings, '|'); - } - /* erase remembered settings */ - memset(backupsettings, 0, MAX_SETTING_SIZE); } + /* erase remembered settings */ + memset(backupsettings, 0, MAX_SETTING_SIZE); } } -- 1.7.2.5 |
From: Hannes S. <ha...@yl...> - 2012-04-12 21:29:44
|
--- main.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- utilities.c | 7 ++--- 2 files changed, 62 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index aecd7a8..63b9245 100644 --- a/main.c +++ b/main.c @@ -101,6 +101,7 @@ gboolean process_keypress(GdkEventKey *event); void fill_suggline(char * suggline, const char * command, const char *fill_with); GtkWidget * fill_eventbox(const char * completion_line); static void mop_up(void); +void apply_settings(char *uri); #include "main.h" @@ -143,7 +144,8 @@ char *error_msg = NULL; char *config_base = NULL; static gboolean manual_focus = FALSE; -GList *activeDownloads; +GList *activeDownloads, *siteSettings = NULL; +char backupsettings[MAX_SETTING_SIZE] = ""; #include "config.h" #include "keymap.h" @@ -1240,6 +1242,7 @@ open_arg(const Arg *arg) { memcpy(&new[sizeof("http://") - 1], s, len + 1); } } + apply_settings(new); webkit_web_view_load_uri(webview, new); g_free(new); } else @@ -2557,6 +2560,61 @@ load_all_cookies(void) #endif void +apply_settings(char *uri) { + SSettings *s; + GList *l; + char temp[MAX_SETTING_SIZE], *temp2, temp3[MAX_SETTING_SIZE]; + guint i, j, len, len2, len3; + + /* check for site-specific settings */ + if (siteSettings != NULL) { + len = g_list_length(siteSettings); + for (i = 0; i < len; i++) { + l = g_list_nth(siteSettings, i); + s = (SSettings *)l->data; + if (strlen(uri) >= strlen(s->url) && strncmp(s->url, uri, strlen(s->url)) == 0) { + /* match found */ + memset(temp, 0, MAX_SETTING_SIZE); + strncpy(temp, s->settings, MAX_SETTING_SIZE); + temp2 = strtok(temp, "|"); + while (temp2 != NULL) { + /* remember current standard settings */ + memset(temp3, 0, MAX_SETTING_SIZE); + len2 = strcspn(temp2, "="); + len3 = LENGTH(browsersettings); + for (j = 0; j < len3; j++) { + if (strlen(browsersettings[j].name) == len2 && strncmp(browsersettings[j].name, temp2, len2) == 0) { + strncat(backupsettings, "|", 1); + strncat(backupsettings, temp2, len2 + 1); + strncat(backupsettings, browsersettings[j].var, strlen(browsersettings[j].var)); + } + } + /* apply the setting */ + process_set_line(temp2); + temp2 = strtok(NULL, "|"); + } + return; + } + } + if (strlen(backupsettings) > 0) { + /* revert to standard settings + * the string has to be applied from right to left + * this ensures that if various values have been set for the same key in the meantime, + * we will still get back to the most basic state + */ + temp2 = strrchr(backupsettings, '|'); + while (temp2 != NULL) { + process_set_line(temp2 + 1); + memset(temp2, 0, strlen(temp2)); + temp2 = strrchr(backupsettings, '|'); + } + /* erase remembered settings */ + memset(backupsettings, 0, MAX_SETTING_SIZE); + } + } +} + +void mop_up(void) { /* Free up any nasty globals before exiting. */ #ifdef ENABLE_COOKIE_SUPPORT diff --git a/utilities.c b/utilities.c index 856eb36..4a7e1df 100644 --- a/utilities.c +++ b/utilities.c @@ -12,7 +12,7 @@ #include "main.h" #include "utilities.h" -extern GList *commandhistory; +extern GList *commandhistory, *siteSettings; extern int commandpointer; extern Command commands[COMMANDSIZE]; extern KeyList *keylistroot; @@ -20,7 +20,7 @@ extern Key keys[]; extern char *error_msg; extern char *config_base; extern VSettings cursettings; -static GList *dynamic_searchengines = NULL, *dynamic_uri_handlers = NULL, *site_settings = NULL; +static GList *dynamic_searchengines = NULL, *dynamic_uri_handlers = NULL; void add_modkeys(char key); @@ -757,7 +757,7 @@ read_rcfile(const char *config) } newsettings->url = g_strdup(buffer); newsettings->settings = g_strdup(buffer+index); - site_settings = g_list_prepend(site_settings, newsettings); + siteSettings = g_list_prepend(siteSettings, newsettings); } else if (strncmp(s, "searchengine", 12) == 0) { buffer = (s + 12); while (buffer[0] == ' ') @@ -862,4 +862,3 @@ open_handler(char *uri) { } return FALSE; } - -- 1.7.2.5 |
From: Hannes S. <ha...@yl...> - 2012-04-12 21:29:40
|
--- utilities.c | 24 ++++++++++++++++++++++-- vimprobable.h | 5 +++++ vimprobablerc.5 | 18 ++++++++++++++++++ 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/utilities.c b/utilities.c index 78f4586..856eb36 100644 --- a/utilities.c +++ b/utilities.c @@ -20,7 +20,7 @@ extern Key keys[]; extern char *error_msg; extern char *config_base; extern VSettings cursettings; -static GList *dynamic_searchengines = NULL, *dynamic_uri_handlers = NULL; +static GList *dynamic_searchengines = NULL, *dynamic_uri_handlers = NULL, *site_settings = NULL; void add_modkeys(char key); @@ -721,6 +721,7 @@ read_rcfile(const char *config) gboolean found_malformed_lines = FALSE; Searchengine *new; URIHandler *newhandler; + SSettings *newsettings; if (access(config, F_OK) != 0) return FILE_NOT_FOUND; @@ -738,7 +739,26 @@ read_rcfile(const char *config) continue; t = strlen(s); s[t - 1] = '\0'; - if (strncmp(s, "searchengine", 12) == 0) { + if (strncmp(s, "site ", 5) == 0) { + buffer = (s + 4); + while (buffer[0] == ' ') + buffer++; + /* split line at whitespace */ + index = split_string_at_whitespace(buffer); + if (index < 0 || buffer[0] == '\0' || buffer[index] == '\0') { + fprintf(stderr, "site settings: syntax error on line %d\n", linum); + found_malformed_lines = TRUE; + continue; + } + newsettings = malloc(sizeof(SSettings)); + if (newsettings == NULL) { + fprintf(stderr, "Memory exhausted while loading site settings.\n"); + exit(EXIT_FAILURE); + } + newsettings->url = g_strdup(buffer); + newsettings->settings = g_strdup(buffer+index); + site_settings = g_list_prepend(site_settings, newsettings); + } else if (strncmp(s, "searchengine", 12) == 0) { buffer = (s + 12); while (buffer[0] == ' ') buffer++; diff --git a/vimprobable.h b/vimprobable.h index 16d4ee9..f24bc56 100644 --- a/vimprobable.h +++ b/vimprobable.h @@ -144,6 +144,11 @@ typedef struct { } VSettings; typedef struct { + char *url; + char *settings; +} SSettings; + +typedef struct { guint mask; guint modkey; guint key; diff --git a/vimprobablerc.5 b/vimprobablerc.5 index f69dda9..cf1773c 100644 --- a/vimprobablerc.5 +++ b/vimprobablerc.5 @@ -263,6 +263,24 @@ handler <URI schema> <handler command with exactly one %s> where the %s serves as a placeholder for the rest of the URI. +.SH PER-SITE SETTINGS + +You can define overrides for many internal settings on a website basis. This +includes anything you can define interactively using the :set command. This +is useful to define exceptions to the default settings using a whitelist or +blacklist approach. + +The following syntax must be used in the configuration file +(without the angle brackets): + +.RS 4 +site <URL schema> <list of settings separated by pipe symbols (|)> +.RE + +where any site which begins with the defined URL schema will use the defined +special settings. Visiting another URL again in the same browser window will +automatically revert the browser to the default settings. + .SH BUGS There has not been any significant bug-hunting yet. .SH AUTHORS -- 1.7.2.5 |
From: Hannes S. <ha...@yl...> - 2012-04-12 21:29:35
|
--- config.h | 158 ++++++++++++++++++++++++++++++++------------------------- keymap.h | 6 +- main.c | 127 +++++++++++++++++++++++++++------------------ utilities.c | 4 +- vimprobable.h | 52 +++++++++++++++++-- 5 files changed, 216 insertions(+), 131 deletions(-) diff --git a/config.h b/config.h index ce79178..1623fa1 100644 --- a/config.h +++ b/config.h @@ -1,6 +1,6 @@ /* (c) 2009 by Leon Winter - (c) 2009-2011 by Hannes Schueller + (c) 2009-2012 by Hannes Schueller (c) 2009-2010 by Matto Fransen (c) 2010-2011 by Hans-Peter Deifel (c) 2010-2011 by Thomas Adam @@ -13,20 +13,54 @@ #define INTERNAL_VERSION "Vimprobable2/"VERSION /* general settings */ -char startpage[MAX_SETTING_SIZE] = "http://www.vimprobable.org/"; -char useragent[MAX_SETTING_SIZE] = "Vimprobable2/" VERSION; -char acceptlanguage[MAX_SETTING_SIZE] = ""; -static const gboolean enablePlugins = TRUE; /* TRUE keeps plugins enabled */ -static const gboolean enableJava = TRUE; /* FALSE disables Java applets */ -static const gboolean enablePagecache = FALSE; /* TRUE turns on the page cache. */ -static gboolean escape_input_on_load = TRUE; /* TRUE will disable automatic focusing of input fields via Javascript*/ - -/* appearance */ -char statusbgcolor[MAX_SETTING_SIZE] = "#000000"; /* background color for status bar */ -char statuscolor[MAX_SETTING_SIZE] = "#ffffff"; /* color for status bar */ -char sslbgcolor[MAX_SETTING_SIZE] = "#b0ff00"; /* background color for status bar with SSL url */ -char sslinvalidbgcolor[MAX_SETTING_SIZE]= "#ff0000"; /* background color for status bar with unverified SSL url */ -char sslcolor[MAX_SETTING_SIZE] = "#000000"; /* color for status bar with SSL url */ +VSettings cursettings = { + .startpage = "http://www.vimprobable.org/", + .useragent = "Vimprobable2/" VERSION, + .acceptLanguage = "", + .enableScripts = "true", /* TRUE keeps JavaScript enabled */ + .enablePlugins = "true", /* TRUE keeps plugins enabled */ + .enableJava = "true", /* FALSE disables Java applets */ + .enablePagecache = "false", /* TRUE turns on the page cache. */ + .escapeInputOnLoad = "true", /* TRUE will disable automatic focusing of input fields via Javascript */ + .enableImages = "true", + .shrinkImages = "true", + .backgrounds = "true", + .defaultEncoding = "iso-8859-1", + /* website fonts */ + .defaultFont = "sans-serif", + .cursiveFont = "serif", + .fantasyFont = "serif", + .monoFont = "monospace", + .sansFont = "sans-serif", + .serifFont = "serif", + .fontSize = "12", + .monoFontSize = "10", + .minimumFontSize = "5", + /* site customisation */ + .caret = "false", + .webInspector = "false", + .stylesheet = "%svimprobable/style.css", /* %s will be replaced with config_base */ + /* browser appearance */ + .statusBgColor = "#000000", /* background color for status bar */ + .statusColor = "#ffffff", /* color for status bar */ + .SSLBgColor = "#b0ff00", /* background color for status bar with SSL url */ + .SSLInvalidBgColor = "#ff0000", /* background color for status bar with unverified SSL url */ + .SSLColor = "#000000", /* color for status bar with SSL url */ + .scrollbars = "false", + .statusBar = "true", + .inputBox = "true", + /* browser behaviour */ + .defaultSearch = "i", /* shortcut of the default search engine */ + + .useProxy = "true", /* TRUE if you're going to use a proxy (whose address + is specified in http_proxy environment variable), false otherwise */ + .completionCase = "true", + .escapeInput = "true", + /* SSL verification */ + .strictSSL = "true", /* FALSE will accept any SSL certificate at face value */ + .caBundle = "/etc/ssl/certs/ca-certificates.crt" + +}; /* normal, warning, error */ static const char *urlboxfont[] = { "monospace normal 8", "monospace normal 8", "monospace bold 8"}; @@ -76,28 +110,13 @@ static URIHandler uri_handlers[] = { /* downloads directory */ #define DOWNLOADS_PATH "%s", getenv("HOME") -/* font size */ -#define DEFAULT_FONT_SIZE 12 - -/* user styles */ -#define USER_STYLESHEET "%s/vimprobable/style.css", config_base - -/* ssl */ -static gboolean strict_ssl = TRUE; /* FALSE will accept any SSL certificate at face value */ -static char ca_bundle[MAX_SETTING_SIZE] = "/etc/ssl/certs/ca-certificates.crt"; - -/* proxy */ -static const gboolean use_proxy = TRUE; /* TRUE if you're going to use a proxy (whose address - is specified in http_proxy environment variable), false otherwise */ /* scrolling */ static unsigned int scrollstep = 40; /* cursor difference in pixel */ static unsigned int pagingkeep = 40; /* pixels kept when paging */ -#define DISABLE_SCROLLBAR /* searching */ #define ENABLE_MATCH_HIGHLITING static const int searchoptions = CaseInsensitive | Wrapping; -gboolean complete_case_sensitive = TRUE; /* search engines */ static Searchengine searchengines[] = { @@ -108,8 +127,6 @@ static Searchengine searchengines[] = { { "dd", "https://duckduckgo.com/html/?q=%s&t=Vimprobable" }, }; -static char defaultsearch[MAX_SETTING_SIZE] = "i"; - /* command mapping */ Command commands[COMMANDSIZE] = { /* command, function, argument */ @@ -169,43 +186,44 @@ static Mouse mouse[] = { /* settings (arguments of :set command) */ static Setting browsersettings[] = { /* public name, internal variable webkit setting integer value? boolean value? colour value? reload page? */ - { "useragent", useragent, "user-agent", FALSE, FALSE, FALSE, FALSE }, - { "scripts", NULL, "enable-scripts", FALSE, TRUE, FALSE, FALSE }, - { "plugins", NULL, "enable-plugins", FALSE, TRUE, FALSE, FALSE }, - { "pagecache", NULL, "enable-page-cache", FALSE, TRUE, FALSE, FALSE }, - { "java", NULL, "enable-java-applet", FALSE, TRUE, FALSE, FALSE }, - { "images", NULL, "auto-load-images", FALSE, TRUE, FALSE, FALSE }, - { "shrinkimages", NULL, "auto-shrink-images", FALSE, TRUE, FALSE, FALSE }, - { "cursivefont", NULL, "cursive-font-family", FALSE, FALSE, FALSE, FALSE }, - { "defaultencoding", NULL, "default-encoding", FALSE, FALSE, FALSE, FALSE }, - { "defaultfont", NULL, "default-font-family", FALSE, FALSE, FALSE, FALSE }, - { "fontsize", NULL, "default-font-size", TRUE, FALSE, FALSE, FALSE }, - { "monofontsize", NULL, "default-monospace-font-size", TRUE, FALSE, FALSE, FALSE }, - { "caret", NULL, "enable-caret-browsing", FALSE, TRUE, FALSE, FALSE }, - { "fantasyfont", NULL, "fantasy-font-family", FALSE, FALSE, FALSE, FALSE }, - { "minimumfontsize", NULL, "minimum-font-size", TRUE, FALSE, FALSE, FALSE }, - { "monofont", NULL, "monospace-font-family", FALSE, FALSE, FALSE, FALSE }, - { "backgrounds", NULL, "print-backgrounds", FALSE, TRUE, FALSE, FALSE }, - { "sansfont", NULL, "sans-serif-font-family", FALSE, FALSE, FALSE, FALSE }, - { "seriffont", NULL, "serif-font-family", FALSE, FALSE, FALSE, FALSE }, - { "stylesheet", NULL, "user-stylesheet-uri", FALSE, FALSE, FALSE, FALSE }, - { "resizetextareas", NULL, "resizable-text-areas", FALSE, TRUE, FALSE, FALSE }, - { "webinspector", NULL, "enable-developer-extras", FALSE, TRUE, FALSE, FALSE }, - - { "homepage", startpage, "", FALSE, FALSE, FALSE, FALSE }, - { "statusbgcolor", statusbgcolor, "", FALSE, FALSE, TRUE, TRUE }, - { "statuscolor", statuscolor, "", FALSE, FALSE, TRUE, TRUE }, - { "sslbgcolor", sslbgcolor, "", FALSE, FALSE, TRUE, TRUE }, - { "sslcolor", sslcolor, "", FALSE, FALSE, TRUE, TRUE }, - { "acceptlanguage", acceptlanguage, "", FALSE, FALSE, FALSE, FALSE }, - { "defaultsearch", defaultsearch, "", FALSE, FALSE, FALSE, FALSE }, + { "useragent", cursettings.useragent, "user-agent", FALSE, FALSE, FALSE, FALSE }, + { "scripts", cursettings.enableScripts, "enable-scripts", FALSE, TRUE, FALSE, FALSE }, + { "plugins", cursettings.enablePlugins, "enable-plugins", FALSE, TRUE, FALSE, FALSE }, + { "pagecache", cursettings.enablePagecache, "enable-page-cache", FALSE, TRUE, FALSE, FALSE }, + { "java", cursettings.enableJava, "enable-java-applet", FALSE, TRUE, FALSE, FALSE }, + { "images", cursettings.enableImages, "auto-load-images", FALSE, TRUE, FALSE, FALSE }, + { "shrinkimages", cursettings.shrinkImages, "auto-shrink-images", FALSE, TRUE, FALSE, FALSE }, + { "defaultencoding", cursettings.defaultEncoding, "default-encoding", FALSE, FALSE, FALSE, FALSE }, + { "defaultfont", cursettings.defaultFont, "default-font-family", FALSE, FALSE, FALSE, FALSE }, + { "cursivefont", cursettings.cursiveFont, "cursive-font-family", FALSE, FALSE, FALSE, FALSE }, + { "fantasyfont", cursettings.fantasyFont, "fantasy-font-family", FALSE, FALSE, FALSE, FALSE }, + { "monofont", cursettings.monoFont, "monospace-font-family", FALSE, FALSE, FALSE, FALSE }, + { "sansfont", cursettings.sansFont, "sans-serif-font-family", FALSE, FALSE, FALSE, FALSE }, + { "seriffont", cursettings.serifFont, "serif-font-family", FALSE, FALSE, FALSE, FALSE }, + { "fontsize", cursettings.fontSize, "default-font-size", TRUE, FALSE, FALSE, FALSE }, + { "monofontsize", cursettings.monoFontSize, "default-monospace-font-size", TRUE, FALSE, FALSE, FALSE }, + { "minimumfontsize", cursettings.minimumFontSize, "minimum-font-size", TRUE, FALSE, FALSE, FALSE }, + { "caret", cursettings.caret, "enable-caret-browsing", FALSE, TRUE, FALSE, FALSE }, + { "backgrounds", cursettings.backgrounds, "print-backgrounds", FALSE, TRUE, FALSE, FALSE }, + { "stylesheet", cursettings.stylesheet, "user-stylesheet-uri", FALSE, FALSE, FALSE, FALSE }, + { "resizetextareas", cursettings.resizeTextAreas, "resizable-text-areas", FALSE, TRUE, FALSE, FALSE }, + { "webinspector", cursettings.webInspector, "enable-developer-extras", FALSE, TRUE, FALSE, FALSE }, + + { "homepage", cursettings.startpage, "", FALSE, FALSE, FALSE, FALSE }, + { "statusbgcolor", cursettings.statusBgColor, "", FALSE, FALSE, TRUE, TRUE }, + { "statuscolor", cursettings.statusColor, "", FALSE, FALSE, TRUE, TRUE }, + { "sslbgcolor", cursettings.SSLBgColor, "", FALSE, FALSE, TRUE, TRUE }, + { "sslinvalidbgcolor",cursettings.SSLInvalidBgColor, "", FALSE, FALSE, TRUE, TRUE }, + { "sslcolor", cursettings.SSLColor, "", FALSE, FALSE, TRUE, TRUE }, + { "acceptlanguage", cursettings.acceptLanguage, "", FALSE, FALSE, FALSE, FALSE }, + { "defaultsearch", cursettings.defaultSearch, "", FALSE, FALSE, FALSE, FALSE }, { "qmark", NULL, "", FALSE, FALSE, FALSE, FALSE }, - { "proxy", NULL, "", FALSE, TRUE, FALSE, FALSE }, - { "scrollbars", NULL, "", FALSE, TRUE, FALSE, FALSE }, - { "statusbar", NULL, "", FALSE, TRUE, FALSE, FALSE }, - { "inputbox", NULL, "", FALSE, TRUE, FALSE, FALSE }, - { "completioncase", NULL, "", FALSE, TRUE, FALSE, FALSE }, - { "escapeinput", NULL, "", FALSE, TRUE, FALSE, FALSE }, - { "strictssl", NULL, "", FALSE, TRUE, FALSE, FALSE }, - { "cabundle", ca_bundle, "", FALSE, FALSE, FALSE, FALSE }, + { "proxy", cursettings.useProxy, "", FALSE, TRUE, FALSE, FALSE }, + { "scrollbars", cursettings.scrollbars, "", FALSE, TRUE, FALSE, FALSE }, + { "statusbar", cursettings.statusBar, "", FALSE, TRUE, FALSE, FALSE }, + { "inputbox", cursettings.inputBox, "", FALSE, TRUE, FALSE, FALSE }, + { "completioncase", cursettings.completionCase, "", FALSE, TRUE, FALSE, FALSE }, + { "escapeinput", cursettings.escapeInput, "", FALSE, TRUE, FALSE, FALSE }, + { "strictssl", cursettings.strictSSL, "", FALSE, TRUE, FALSE, FALSE }, + { "cabundle", cursettings.caBundle, "", FALSE, FALSE, FALSE, FALSE }, }; diff --git a/keymap.h b/keymap.h index 7ba5d0b..3038e1d 100644 --- a/keymap.h +++ b/keymap.h @@ -1,6 +1,6 @@ /* (c) 2009 by Leon Winter - (c) 2009-2011 by Hannes Schueller + (c) 2009-2012 by Hannes Schueller (c) 2009-2010 by Matto Fransen (c) 2010-2011 by Hans-Peter Deifel (c) 2010-2011 by Thomas Adam @@ -80,8 +80,8 @@ Key keys[] = { { 0, GDK_g, GDK_u, descend, {NthSubdir} }, { 0, GDK_g, GDK_U, descend, {Rootdir} }, - { 0, GDK_g, GDK_h, open_arg, {TargetCurrent, startpage} }, - { 0, GDK_g, GDK_H, open_arg, {TargetNew, startpage} }, + { 0, GDK_g, GDK_h, open_arg, {TargetCurrent, cursettings.startpage} }, + { 0, GDK_g, GDK_H, open_arg, {TargetNew, cursettings.startpage} }, { 0, 0, GDK_p, paste, {TargetCurrent | ClipboardPrimary | ClipboardGTK} }, { 0, 0, GDK_P, paste, {TargetNew | ClipboardPrimary | ClipboardGTK} }, diff --git a/main.c b/main.c index 029ac7c..aecd7a8 100644 --- a/main.c +++ b/main.c @@ -221,7 +221,7 @@ webview_load_finished_cb(WebKitWebView *webview, WebKitWebFrame *frame, gpointer gboolean scripts; g_object_get(settings, "enable-scripts", &scripts, NULL); - if (escape_input_on_load && scripts && !manual_focus && !gtk_widget_is_focus(inputbox)) { + if (cursettings.escapeInputOnLoad && scripts && !manual_focus && !gtk_widget_is_focus(inputbox)) { Arg a = { .i = Silent, .s = g_strdup("hints.clearFocus();") }; script(&a); g_free(a.s); @@ -1228,7 +1228,7 @@ open_arg(const Arg *arg) { strcpy(new, "file://"); memcpy(&new[sizeof("file://") - 1], s, len + 1); } else if (p || !strchr(s, '.')) { /* whitespaces or no dot? */ - search_uri = find_uri_for_searchengine(defaultsearch); + search_uri = find_uri_for_searchengine(cursettings.defaultSearch); if (search_uri != NULL) { search_term = soup_uri_encode(s, "&"); new = g_strdup_printf(search_uri, search_term); @@ -1926,21 +1926,17 @@ process_set_line(char *line) { if (strlen(browsersettings[i].webkit) > 0) { /* activate appropriate webkit setting */ if (browsersettings[i].boolval) { - g_object_set((GObject*)settings, browsersettings[i].webkit, boolval, NULL); + g_object_set(G_OBJECT(settings), browsersettings[i].webkit, boolval, NULL); } else if (browsersettings[i].intval) { - g_object_set((GObject*)settings, browsersettings[i].webkit, atoi(my_pair.value), NULL); + g_object_set(G_OBJECT(settings), browsersettings[i].webkit, atoi(my_pair.value), NULL); } else { - g_object_set((GObject*)settings, browsersettings[i].webkit, my_pair.value, NULL); + g_object_set(G_OBJECT(settings), browsersettings[i].webkit, my_pair.value, NULL); } webkit_web_view_set_settings(webview, settings); } - if (strlen(my_pair.what) == 14) { - if (strncmp("acceptlanguage", my_pair.what, 14) == 0) { - g_object_set(G_OBJECT(session), "accept-language", acceptlanguage, NULL); - } else if (strncmp("completioncase", my_pair.what, 14) == 0) { - complete_case_sensitive = boolval; - } + if (strlen(my_pair.what) == 14 && strncmp("acceptlanguage", my_pair.what, 14) == 0) { + g_object_set(G_OBJECT(session), "accept-language", cursettings.acceptLanguage, NULL); } else if (strlen(my_pair.what) == 5 && strncmp("proxy", my_pair.what, 5) == 0) { toggle_proxy(boolval); } else if (strlen(my_pair.what) == 10 && strncmp("scrollbars", my_pair.what, 10) == 0) { @@ -1949,22 +1945,14 @@ process_set_line(char *line) { gtk_widget_set_visible(GTK_WIDGET(statusbar), boolval); } else if (strlen(my_pair.what) == 8 && strncmp("inputbox", my_pair.what, 8) == 0) { gtk_widget_set_visible(inputbox, boolval); - } else if (strlen(my_pair.what) == 11 && strncmp("escapeinput", my_pair.what, 11) == 0) { - escape_input_on_load = boolval; } /* SSL certificate checking */ if (strlen(my_pair.what) == 9 && strncmp("strictssl", my_pair.what, 9) == 0) { - if (boolval) { - strict_ssl = TRUE; - g_object_set(G_OBJECT(session), "ssl-strict", TRUE, NULL); - } else { - strict_ssl = FALSE; - g_object_set(G_OBJECT(session), "ssl-strict", FALSE, NULL); - } + g_object_set(G_OBJECT(session), "ssl-strict", boolval, NULL); } if (strlen(my_pair.what) == 8 && strncmp("cabundle", my_pair.what, 8) == 0) { - g_object_set(G_OBJECT(session), SOUP_SESSION_SSL_CA_FILE, ca_bundle, NULL); + g_object_set(G_OBJECT(session), SOUP_SESSION_SSL_CA_FILE, cursettings.caBundle, NULL); } /* reload page? */ @@ -2170,13 +2158,13 @@ update_url(const char *uri) { msg = webkit_network_request_get_message(request); ssl_ok = soup_message_get_flags(msg) & SOUP_MESSAGE_CERTIFICATE_TRUSTED; if (ssl_ok) - sslactivecolor = sslbgcolor; + sslactivecolor = cursettings.SSLBgColor; else - sslactivecolor = sslinvalidbgcolor; + sslactivecolor = cursettings.SSLInvalidBgColor; } - gdk_color_parse(ssl ? sslactivecolor : statusbgcolor, &color); + gdk_color_parse(ssl ? sslactivecolor : cursettings.statusBgColor, &color); gtk_widget_modify_bg(eventbox, GTK_STATE_NORMAL, &color); - gdk_color_parse(ssl ? sslcolor : statuscolor, &color); + gdk_color_parse(ssl ? cursettings.SSLColor : cursettings.statusColor, &color); gtk_widget_modify_fg(GTK_WIDGET(status_url), GTK_STATE_NORMAL, &color); gtk_widget_modify_fg(GTK_WIDGET(status_state), GTK_STATE_NORMAL, &color); } @@ -2292,20 +2280,21 @@ setup_gui() { clipboards[0] = gtk_clipboard_get(GDK_SELECTION_PRIMARY); clipboards[1] = gtk_clipboard_get(GDK_NONE); setup_settings(); - gdk_color_parse(statusbgcolor, &bg); + gdk_color_parse(cursettings.statusBgColor, &bg); gtk_widget_modify_bg(eventbox, GTK_STATE_NORMAL, &bg); gtk_widget_set_name(GTK_WIDGET(window), "Vimprobable2"); gtk_window_set_geometry_hints(window, NULL, &hints, GDK_HINT_MIN_SIZE); keymap = gdk_keymap_get_default(); -#ifdef DISABLE_SCROLLBAR - viewport = gtk_scrolled_window_new(NULL, NULL); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(viewport), GTK_POLICY_NEVER, GTK_POLICY_NEVER); -#else - /* Ensure we still see scrollbars. */ - GtkWidget *viewport = gtk_scrolled_window_new(adjust_h, adjust_v); -#endif + GtkWidget *viewport; + if (strncmp(cursettings.scrollbars, "true", 4) == 0) { + /* Ensure we still see scrollbars. */ + viewport = gtk_scrolled_window_new(adjust_h, adjust_v); + } else { + viewport = gtk_scrolled_window_new(NULL, NULL); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(viewport), GTK_POLICY_NEVER, GTK_POLICY_NEVER); + } setup_signals(); gtk_container_add(GTK_CONTAINER(viewport), GTK_WIDGET(webview)); @@ -2338,27 +2327,63 @@ setup_gui() { void setup_settings() { WebKitWebSettings *settings = (WebKitWebSettings*)webkit_web_settings_new(); - char *filename, *file_url; + char *file_url, temp[MAX_SETTING_SIZE]; + gchar *line; + int i, len; session = webkit_get_default_session(); - g_object_set(G_OBJECT(session), "ssl-ca-file", ca_bundle, NULL); - g_object_set(G_OBJECT(session), "ssl-strict", strict_ssl, NULL); - g_object_set(G_OBJECT(settings), "default-font-size", DEFAULT_FONT_SIZE, NULL); - g_object_set(G_OBJECT(settings), "enable-scripts", enablePlugins, NULL); - g_object_set(G_OBJECT(settings), "enable-plugins", enablePlugins, NULL); - g_object_set(G_OBJECT(settings), "enable-java-applet", enableJava, NULL); - g_object_set(G_OBJECT(settings), "enable-page-cache", enablePagecache, NULL); - filename = g_strdup_printf(USER_STYLESHEET); - file_url = g_strdup_printf("file://%s", filename); - g_object_set(G_OBJECT(settings), "user-stylesheet-uri", file_url, NULL); - g_free(file_url); - g_free(filename); - g_object_set(G_OBJECT(settings), "user-agent", useragent, NULL); g_object_get(G_OBJECT(settings), "zoom-step", &zoomstep, NULL); webkit_web_view_set_settings(webview, settings); - + line = g_strconcat("cabundle=", cursettings.caBundle, NULL); + process_set_line(line); + g_free(line); + line = g_strconcat("strictssl=", cursettings.strictSSL, NULL); + process_set_line(line); + g_free(line); + line = g_strconcat("fontsize=", cursettings.fontSize, NULL); + process_set_line(line); + g_free(line); + line = g_strconcat("scripts=", cursettings.enableScripts, NULL); + process_set_line(line); + g_free(line); + line = g_strconcat("plugins=", cursettings.enablePlugins, NULL); + process_set_line(line); + g_free(line); + line = g_strconcat("java=", cursettings.enableJava, NULL); + process_set_line(line); + g_free(line); + line = g_strconcat("pagecache=", cursettings.enablePagecache, NULL); + process_set_line(line); + g_free(line); + line = g_strconcat("useragent=", cursettings.useragent, NULL); + process_set_line(line); + g_free(line); + /* user stylesheet */ + memset(temp, 0, MAX_SETTING_SIZE); + file_url = cursettings.stylesheet; + len = strlen(file_url); + for (i = 0; i < len; i++) { + if (strncmp(file_url, "%s", 2) == 0) { + strncat(temp, config_base, strlen(config_base)); + file_url += 2; + } else { + strncat(temp, file_url, 1); + file_url++; + } + } + if (temp[0] == '/') { + file_url = g_strdup_printf("file://%s", temp); + } else { + file_url = g_strdup_printf("%s", temp); + } + line = g_strconcat("stylesheet=", file_url, NULL); + process_set_line(line); + g_free(line); + g_free(file_url); /* proxy */ - toggle_proxy(use_proxy); + line = g_strconcat("proxy=", cursettings.useProxy, NULL); + process_set_line(line); + g_free(line); } void @@ -2369,7 +2394,7 @@ setup_signals() { g_signal_connect_after(G_OBJECT(session), "request-started", G_CALLBACK(new_generic_request), NULL); #endif /* Accept-language header */ - g_object_set(G_OBJECT(session), "accept-language", acceptlanguage, NULL); + g_object_set(G_OBJECT(session), "accept-language", cursettings.acceptLanguage, NULL); /* window */ g_object_connect(G_OBJECT(window), "signal::destroy", G_CALLBACK(window_destroyed_cb), NULL, @@ -2622,7 +2647,7 @@ main(int argc, char *argv[]) { if (argc > 1) { strncpy(url, argv[argc - 1], 255); } else { - strncpy(url, startpage, 255); + strncpy(url, cursettings.startpage, 255); } a.i = TargetCurrent; diff --git a/utilities.c b/utilities.c index 9bb4f49..78f4586 100644 --- a/utilities.c +++ b/utilities.c @@ -18,8 +18,8 @@ extern Command commands[COMMANDSIZE]; extern KeyList *keylistroot; extern Key keys[]; extern char *error_msg; -extern gboolean complete_case_sensitive; extern char *config_base; +extern VSettings cursettings; static GList *dynamic_searchengines = NULL, *dynamic_uri_handlers = NULL; void add_modkeys(char key); @@ -546,7 +546,7 @@ complete_list(const char *searchfor, const int mode, Listelement *elementlist) candidatepointer = candidatelist; while (candidatepointer != NULL) { strncpy(s, candidatepointer->element, sizeof(s)); - if (!complete_case_sensitive) { + if (!cursettings.completionCase) { g_strdown(s); } if (!strlen(searchfor) || strstr(s, searchfor) != NULL) { diff --git a/vimprobable.h b/vimprobable.h index 5a6c2df..16d4ee9 100644 --- a/vimprobable.h +++ b/vimprobable.h @@ -10,6 +10,11 @@ /* macros */ #define LENGTH(x) (sizeof(x)/sizeof(x[0])) +/* maximum size of internal string variable handled by :set + * if you set this to anything lower than 8, colour values + * will stop working */ +#define MAX_SETTING_SIZE 1024 + /* enums */ enum { ModeNormal, ModePassThrough, ModeSendKey, ModeInsert, ModeHints }; /* modes */ enum { TargetCurrent, TargetNew }; /* target */ @@ -97,6 +102,48 @@ typedef struct { } Arg; typedef struct { + char startpage[MAX_SETTING_SIZE]; + char useragent[MAX_SETTING_SIZE]; + char acceptLanguage[MAX_SETTING_SIZE]; + char enableScripts[MAX_SETTING_SIZE]; + char enablePlugins[MAX_SETTING_SIZE]; + char enableJava[MAX_SETTING_SIZE]; + char enablePagecache[MAX_SETTING_SIZE]; + char escapeInputOnLoad[MAX_SETTING_SIZE]; + char enableImages[MAX_SETTING_SIZE]; + char shrinkImages[MAX_SETTING_SIZE]; + char backgrounds[MAX_SETTING_SIZE]; + char webInspector[MAX_SETTING_SIZE]; + char defaultEncoding[MAX_SETTING_SIZE]; + char defaultFont[MAX_SETTING_SIZE]; + char cursiveFont[MAX_SETTING_SIZE]; + char fantasyFont[MAX_SETTING_SIZE]; + char monoFont[MAX_SETTING_SIZE]; + char sansFont[MAX_SETTING_SIZE]; + char serifFont[MAX_SETTING_SIZE]; + char fontSize[MAX_SETTING_SIZE]; + char monoFontSize[MAX_SETTING_SIZE]; + char minimumFontSize[MAX_SETTING_SIZE]; + char caret[MAX_SETTING_SIZE]; + char stylesheet[MAX_SETTING_SIZE]; + char resizeTextAreas[MAX_SETTING_SIZE]; + char statusBgColor[MAX_SETTING_SIZE]; + char statusColor[MAX_SETTING_SIZE]; + char SSLBgColor[MAX_SETTING_SIZE]; + char SSLInvalidBgColor[MAX_SETTING_SIZE]; + char SSLColor[MAX_SETTING_SIZE]; + char defaultSearch[MAX_SETTING_SIZE]; + char useProxy[MAX_SETTING_SIZE]; + char scrollbars[MAX_SETTING_SIZE]; + char statusBar[MAX_SETTING_SIZE]; + char inputBox[MAX_SETTING_SIZE]; + char completionCase[MAX_SETTING_SIZE]; + char escapeInput[MAX_SETTING_SIZE]; + char strictSSL[MAX_SETTING_SIZE]; + char caBundle[MAX_SETTING_SIZE]; +} VSettings; + +typedef struct { guint mask; guint modkey; guint key; @@ -184,10 +231,5 @@ enum ConfigFileError { /* Command size */ #define COMMANDSIZE 1024 -/* maximum size of internal string variable handled by :set - * if you set this to anything lower than 8, colour values - * will stop working */ -#define MAX_SETTING_SIZE 1024 - /* completion list size */ #define MAX_LIST_SIZE 40 -- 1.7.2.5 |
From: Hannes S. <ha...@yl...> - 2012-04-12 21:29:22
|
This (highly experimental) patchset allows site-specific browser settings to be defined in vimprobablerc. Any :set command can be issued on a website basis. This allows for whitelisting or blacklisting approaches to deviate from the standard settings for certain websites. For example, to turn off your proxy and enable JavaScript, enter site http://www.example.org proxy=false|scripts=true in vimprobablerc. An abstract description can be found in vimprobablerc(5). Hannes Schueller (4): moving all internal flags into a new global struct of the type VSettings read per-site settings from the rc file applying per-site settings on URL match and reverting when visiting another site handle cases of various 'defined' sites being visited subsequently by reverting back to standard settings in between in order to ensure consistent states config.h | 158 +++++++++++++++++++++++++-------------------- keymap.h | 6 +- main.c | 196 ++++++++++++++++++++++++++++++++++++++++--------------- utilities.c | 29 +++++++-- vimprobable.h | 57 +++++++++++++++-- vimprobablerc.5 | 18 +++++ 6 files changed, 329 insertions(+), 135 deletions(-) -- 1.7.2.5 |
From: Hannes S. <ha...@yl...> - 2012-04-10 18:57:42
|
Hannes Schüller <ha...@yl...> wrote: > Alexander Foremny <ale...@go...> wrote: > > It might be nice to have options to *download* a file, *open* a file > > and *download and open* a file. However, I would not want to see a > > dialog showing up for this. Maybe this can be done by different > > hinting modes > > Thanks for this - sounds like a decent plan to me. The default (i.e. > "clicking") could still be plain downloading, but with hinting, we can > distinguish between these user intentions. Would that be alright with > everyone? Steffen, any plans from your side to implement this? Hannes |
From: Hannes S. <ha...@yl...> - 2012-04-10 16:18:36
|
Daniel Carl <dan...@gm...> wrote: > On Tue, Apr 10, 2012 at 05:21:36PM +0200, Hannes Schüller wrote: > > While I appreciate the bug being fixed, I don't like the functional > > change. The only time I really use the command history is when I > > mistyped something. So I recall what I typed and correct it. This > > would not be possible anymore. > > You are right, vim does also save wrong types commands, and so we > shoud do it also. > > Attached patch fixed mentioned bug and allowes also to save invalid > commands in history. Looking good - thanks! Hannes |
From: Daniel C. <dan...@gm...> - 2012-04-10 15:48:10
|
Hi Hannes! On Tue, Apr 10, 2012 at 05:21:36PM +0200, Hannes Schüller wrote: > While I appreciate the bug being fixed, I don't like the functional > change. The only time I really use the command history is when I > mistyped something. So I recall what I typed and correct it. This would > not be possible anymore. > > Hannes You are right, vim does also save wrong types commands, and so we shoud do it also. Attached patch fixed mentioned bug and allowes also to save invalid commands in history. |
From: Hannes S. <ha...@yl...> - 2012-04-10 15:22:12
|
Hi! Daniel Carl <dan...@gm...> wrote: > The attached patch fixes this behaviour by writing the history before > running the function associated with the command and only if the > command was found. While I appreciate the bug being fixed, I don't like the functional change. The only time I really use the command history is when I mistyped something. So I recall what I typed and correct it. This would not be possible anymore. Hannes |
From: Daniel C. <dan...@gm...> - 2012-04-10 14:30:26
|
Hi! I'm using the command history in vim, so I often was disappointed that the command history didn't work well in vimprobable. For example: Run a command writing to message window :echo alert(1); that prints 'undefined' to the message window. If I looked for the last run comand in history by tying : and hitting cursor key up, vimprobable suggests ':ndefined', but not the previous called command. The attached patch fixes this behaviour by writing the history before running the function associated with the command and only if the command was found. Daniel |
From: Hannes S. <ha...@yl...> - 2012-04-03 19:02:45
|
Here is the first maintenance release of Vimprobable1 and Vimprobable2. This includes two bugfixes: - Correct URL bar colouration if sslstrict=false (Hannes Schueller) - Missing SSL settings documentation on man page (Jason Ryan) I.e. codename "what 1.0.0 should have been". Hannes |
From: Hannes S. <ha...@yl...> - 2012-04-01 09:24:46
|
Hello everyone, so this is finally it - the big 1.0 releases! Both branches have now reached the magical number indicating infinite and unbreakable maturity (right). Here are the latest changes in detail: New features: - Basic SSL support (Hannes Schueller): As discussed various times here on the mailing list and on IRC, Vimprobable will now check SSL certificates instead of simply accepting each one at face value. By default, connections to sites using unverified certificates will not be made. This can be overridden if the user specifically requests it. Then, the unverified status of the connection will be indicated in the URL bar (red background colour). Bug fixes: - Don't crash if jsapi_evaluate_script returns NULL (Hans-Peter Deifel) - Tweak of the automatic focus escaping introduced in the last release (Hannes Schueller) Since this is "1.0", I'd also like to use the opportunity to once again thank the many people who have contributed code, fixes and advice to the project over the years. Without you, Vimprobable would be much smaller and much less usable now! A quick word on version numbering: As you can see, we've lost one digit with this release. In the future, this is what the digits x.y.z should be interpreted as: x: Major rewrite of significant overall proportions y: New features z: Bug fixes only As announced, for the Vimprobable1 branch, this is also the end of the line as far as major development is concerned. Vimprobable2 has eclipsed it in basically any imaginable way and the number of users, as far as it is discernable, speaks for itself. Vimprobable1 will still receive bugfixes, but new features will be developed for Vimprobable2 only. That is, as far as I'm concerned. If a Vimprobable1 user would like to take over maintainership of that branch to extend it even further, drop me a line! Hannes |
From: Matthew C. <je...@gm...> - 2012-03-15 02:20:24
|
Hi all, Hinting sounds good to me, you could always have it as an extra configuration option for the default behavior as well, since chances are each user has a preference for the majority of cases (I'm a download on click kinda guy myself). -Matt On Mon, Mar 12, 2012 at 06:33:29PM +0100, Hannes Schüller wrote: > Hello Alexander! > > Alexander Foremny <ale...@go...> wrote: > > It might be nice to have options to *download* a file, *open* a file > > and *download and open* a file. However, I would not want to see a > > dialog showing up for this. Maybe this can be done by different > > hinting modes > > Thanks for this - sounds like a decent plan to me. The default (i.e. > "clicking") could still be plain downloading, but with hinting, we can > distinguish between these user intentions. Would that be alright with > everyone? > > Hannes > ------------------------------------------------------------------------------ > Try before you buy = See our experts in action! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-dev2 > _______________________________________________ > Vimprobable-users mailing list > Vim...@li... > https://lists.sourceforge.net/lists/listinfo/vimprobable-users -- Matthew Carter je...@gm... |
From: Hannes S. <ha...@yl...> - 2012-03-12 17:33:08
|
Hello Alexander! Alexander Foremny <ale...@go...> wrote: > It might be nice to have options to *download* a file, *open* a file > and *download and open* a file. However, I would not want to see a > dialog showing up for this. Maybe this can be done by different > hinting modes Thanks for this - sounds like a decent plan to me. The default (i.e. "clicking") could still be plain downloading, but with hinting, we can distinguish between these user intentions. Would that be alright with everyone? Hannes |
From: Alexander F. <ale...@go...> - 2012-03-12 16:44:13
|
Hello, since it appears that there is not a uniform settlement upon how to do this I just want to report what I'd like to see. I don't want to imply that this is how I think it should be done since there's a lot of personal preference involved as pointed out by others. I'd rather see mailcap to be used than xdg-open from the freedesktop project. I consider opening a file and downloading a file to be distinct operations. Since I'd like to see a file which is downloaded only to be opened to be downloaded in a temporary place instead of the regular download folder. It might be nice to have options to *download* a file, *open* a file and *download and open* a file. However, I would not want to see a dialog showing up for this. Maybe this can be done by different hinting modes but maybe this might be overkill to have three different key combinations for this. Feel free to disagree with any point mentioned here. Just wanted to share my expectations. However, this seems to be the way most popular browsers handle this, including Firefox's vimperator plugin if I am not mistaken. Regards Alexander Foremny |
From: Steffen S. <ssc...@un...> - 2012-03-04 18:36:05
|
On 03/04/2012 07:02 PM, Hannes Schüller wrote: > Before we get into code details, I think the concept should be clear > and agreed on. Apart from the mailcap question which ruskie already > asked, I see the following potential irritation: > > As you currently implemented this, a file is first downloaded to the > regular download location (which I would assume to be some sort of > permanent storage space) and then, if a definition is found for this > MIME type, opened. What other browsers do is offer a choice to *either* > download a file to permanent storage *or* open it. > > Not getting into the discussion of "opening" also involving downloading > the file, it is usually stored in non-permanent space for that purpose, > because when a file is selected to be "opened", I guess the assumption > is that the user does not want to store it permanently. The other way > around, it could also get annoying not to be able to simply *save* a > file anymore *without* opening it immediately afterwards. > > So, what's everyone's views on this? My workflow with this is as follows: - My DOWNLOADS_PATH is pretty much a "temporary place": If I want to keep something permanently, I move it to a specialized location, like papers/, doc/, ... - It's wiped every now and then by myself, manually. - During a (work / browsing) "session", I like to keep all the stuff I downloaded, because that way, I can postpone the decision if it's worth to be kept permanently. - Of course one can argue that then, I'd want the same thing for web pages. - Maybe my next patch ;) I do very well see that this is my very personal way of working, which I don't want to force on anyone, but I've always been annoyed by this "open or save" question. For the "not being able to just save a file anymore" issue: Yes, that's probably annoying. We could set a flag to prevent opening when a user explicitly chose "Download linked file". Can we somehow attach a piece of arbitrary "payload" to a WebKitDownload? (other than storing a map (WebKitDownload*) -> MyPayload ...) -- Steffen |
From: Andraž 'r. L. <ru...@co...> - 2012-03-04 18:04:40
|
:2012-03-04T19:02:Hannes Schüller: > Not getting into the discussion of "opening" also involving downloading > the file, it is usually stored in non-permanent space for that purpose, > because when a file is selected to be "opened", I guess the assumption > is that the user does not want to store it permanently. The other way > around, it could also get annoying not to be able to simply *save* a > file anymore *without* opening it immediately afterwards. > > So, what's everyone's views on this? I'm for download first then ask me what to do with it(i.e. nothing or open). But yes most browsers I believe will download to $TMP or something like that and then open it. -- Andraž 'ruskie' Levstik Source Mage GNU/Linux Games/Xorg grimoire guru Re-Alpine Coordinator http://sourceforge.net/projects/re-alpine/ Geek/Hacker/Tinker Tuam Libera Mentem. |