Re: [elinks-dev] [PATCH 1/2] Respect alphabetical order for the actions

2013-12-18 Thread Fabienne Ducroquet

I didn’t respect the right order when I added the functions to move up and down
by half a page a few years ago.

Signed-off-by: Fabienne Ducroquet 
---

Le mercredi 18 décembre 2013, Witold Filipczyk a écrit :
> Sorry, I aplied patch1 before patch0.
> Could you prepare new patch with correct order of functions?

That one applies after the one adding move-current-top.

 src/config/actions-main.inc |  4 ++--
 src/viewer/action.c | 16 
 src/viewer/text/view.h  |  4 ++--
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/config/actions-main.inc b/src/config/actions-main.inc
index 2e90ddc..abe6fa6 100644
--- a/src/config/actions-main.inc
+++ b/src/config/actions-main.inc
@@ -61,6 +61,8 @@ ACTION_(MAIN, "move-cursor-right", MOVE_CURSOR_RIGHT, 
N__("Move cursor right"),
 ACTION_(MAIN, "move-cursor-up", MOVE_CURSOR_UP, N__("Move cursor up"), 
ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-document-end", MOVE_DOCUMENT_END, N__("Move to the end of 
the document"), ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-document-start", MOVE_DOCUMENT_START, N__("Move to the 
start of the document"), ACTION_REQUIRE_VIEW_STATE),
+ACTION_(MAIN, "move-half-page-down", MOVE_HALF_PAGE_DOWN, N__("Move downwards 
by half a page"), ACTION_REQUIRE_VIEW_STATE),
+ACTION_(MAIN, "move-half-page-up", MOVE_HALF_PAGE_UP, N__("Move upwards by 
half a page"), ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-link-down", MOVE_LINK_DOWN, N__("Move one link down"), 
ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-link-down-line", MOVE_LINK_DOWN_LINE, N__("Move to the 
next line with a link"), ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-link-left", MOVE_LINK_LEFT, N__("Move one link left"), 
ACTION_REQUIRE_VIEW_STATE),
@@ -72,9 +74,7 @@ ACTION_(MAIN, "move-link-right-line", MOVE_LINK_RIGHT_LINE, 
N__("Move one link r
 ACTION_(MAIN, "move-link-up", MOVE_LINK_UP, N__("Move one link up"), 
ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-link-up-line", MOVE_LINK_UP_LINE, N__("Move to the 
previous line with a link"), ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-page-down", MOVE_PAGE_DOWN, N__("Move downwards by a 
page"), ACTION_REQUIRE_VIEW_STATE),
-ACTION_(MAIN, "move-half-page-down", MOVE_HALF_PAGE_DOWN, N__("Move downwards 
by half a page"), ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-page-up", MOVE_PAGE_UP, N__("Move upwards by a page"), 
ACTION_REQUIRE_VIEW_STATE),
-ACTION_(MAIN, "move-half-page-up", MOVE_HALF_PAGE_UP, N__("Move upwards by 
half a page"), ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "open-link-in-new-tab", OPEN_LINK_IN_NEW_TAB, N__("Open the 
current link in a new tab"), ACTION_REQUIRE_VIEW_STATE | ACTION_JUMP_TO_LINK | 
ACTION_REQUIRE_LINK),
 ACTION_(MAIN, "open-link-in-new-tab-in-background", 
OPEN_LINK_IN_NEW_TAB_IN_BACKGROUND, N__("Open the current link in a new tab in 
the background"), ACTION_REQUIRE_VIEW_STATE | ACTION_JUMP_TO_LINK | 
ACTION_REQUIRE_LINK),
 ACTION_(MAIN, "open-link-in-new-window", OPEN_LINK_IN_NEW_WINDOW, N__("Open 
the current link in a new window"), ACTION_RESTRICT_ANONYMOUS | 
ACTION_REQUIRE_VIEW_STATE | ACTION_JUMP_TO_LINK | ACTION_REQUIRE_LINK),
diff --git a/src/viewer/action.c b/src/viewer/action.c
index d33a4c8..6d15e33 100644
--- a/src/viewer/action.c
+++ b/src/viewer/action.c
@@ -359,6 +359,14 @@ do_action(struct session *ses, enum main_action action_id, 
int verbose)
status = move_cursor_line_start(ses, doc_view);
break;
 
+   case ACT_MAIN_MOVE_HALF_PAGE_DOWN:
+   status = move_half_page_down(ses, doc_view);
+   break;
+
+   case ACT_MAIN_MOVE_HALF_PAGE_UP:
+   status = move_half_page_up(ses, doc_view);
+   break;
+
case ACT_MAIN_MOVE_LINK_DOWN:
status = move_link_down(ses, doc_view);
break;
@@ -403,18 +411,10 @@ do_action(struct session *ses, enum main_action 
action_id, int verbose)
status = move_page_down(ses, doc_view);
break;
 
-   case ACT_MAIN_MOVE_HALF_PAGE_DOWN:
-   status = move_half_page_down(ses, doc_view);
-   break;
-
case ACT_MAIN_MOVE_PAGE_UP:
status = move_page_up(ses, doc_view);
break;
 
-   case ACT_MAIN_MOVE_HALF_PAGE_UP:
-   status = move_half_page_up(ses, doc_view);
-   break;
-
cas

[elinks-dev] [PATCH] elinks.conf.5, elinkskeys.5: Document undocumented features

2013-12-18 Thread Fabienne Ducroquet
I should have done that when I added them, mea culpa.

Signed-off-by: Fabienne Ducroquet 
---
 doc/man/man5/elinks.conf.5 |  5 +
 doc/man/man5/elinkskeys.5  | 15 +++
 2 files changed, 20 insertions(+)

diff --git a/doc/man/man5/elinks.conf.5 b/doc/man/man5/elinks.conf.5
index 54f5fd8..f6c54d4 100644
--- a/doc/man/man5/elinks.conf.5
+++ b/doc/man/man5/elinks.conf.5
@@ -591,6 +591,11 @@ document\&.browse\&.scrolling\&.margin \fB\fR 
(default: 3)
 Size of the virtual margin \(en when you click inside of that margin, document 
scrolls in that direction\&.
 .RE
 .PP
+document\&.browse\&.scrolling\&.vertical_overlap \fB\fR (default: 0)
+.RS 4
+Number of overlapping lines between the new page displayed and the previous 
one when scrolling one page up or down\&.
+.RE
+.PP
 document\&.browse\&.scrolling\&.vertical_step \fB\fR (default: 2)
 .RS 4
 Number of lines to scroll when a key bound to scroll\-up or scroll\-down is 
pressed and no prefix was given\&.
diff --git a/doc/man/man5/elinkskeys.5 b/doc/man/man5/elinkskeys.5
index 5aa39d1..ccec90e 100644
--- a/doc/man/man5/elinkskeys.5
+++ b/doc/man/man5/elinkskeys.5
@@ -324,6 +324,11 @@ menu
 Activate the menu\&.
 .RE
 .PP
+move\-current\-top
+.RS 4
+Move downwards to put the current line at the top of the screen\&.
+.RE
+.PP
 move\-cursor\-down
 .RS 4
 Move cursor down\&.
@@ -359,6 +364,16 @@ move\-document\-start
 Move to the start of the document\&.
 .RE
 .PP
+move\-half\-page\-down
+.RS 4
+Move downwards by half a page\&.
+.RE
+.PP
+move\-half\-page\-up
+.RS 4
+Move upwards by half a page\&.
+.RE
+.PP
 move\-link\-down
 .RS 4
 Move one link down\&.
-- 
1.8.5.1

___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


[elinks-dev] [PATCH 1/2] Respect alphabetical order for the actions

2013-12-18 Thread Fabienne Ducroquet
I didn’t follow the right order when I added the functions to move up and down
by half a page a few years ago.

Signed-off-by: Fabienne Ducroquet 
---
 src/config/actions-main.inc |  4 ++--
 src/viewer/action.c | 16 
 src/viewer/text/view.h  |  4 ++--
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/config/actions-main.inc b/src/config/actions-main.inc
index cb6c6bb..5f686b2 100644
--- a/src/config/actions-main.inc
+++ b/src/config/actions-main.inc
@@ -60,6 +60,8 @@ ACTION_(MAIN, "move-cursor-right", MOVE_CURSOR_RIGHT, 
N__("Move cursor right"),
 ACTION_(MAIN, "move-cursor-up", MOVE_CURSOR_UP, N__("Move cursor up"), 
ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-document-end", MOVE_DOCUMENT_END, N__("Move to the end of 
the document"), ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-document-start", MOVE_DOCUMENT_START, N__("Move to the 
start of the document"), ACTION_REQUIRE_VIEW_STATE),
+ACTION_(MAIN, "move-half-page-down", MOVE_HALF_PAGE_DOWN, N__("Move downwards 
by half a page"), ACTION_REQUIRE_VIEW_STATE),
+ACTION_(MAIN, "move-half-page-up", MOVE_HALF_PAGE_UP, N__("Move upwards by 
half a page"), ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-link-down", MOVE_LINK_DOWN, N__("Move one link down"), 
ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-link-down-line", MOVE_LINK_DOWN_LINE, N__("Move to the 
next line with a link"), ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-link-left", MOVE_LINK_LEFT, N__("Move one link left"), 
ACTION_REQUIRE_VIEW_STATE),
@@ -71,9 +73,7 @@ ACTION_(MAIN, "move-link-right-line", MOVE_LINK_RIGHT_LINE, 
N__("Move one link r
 ACTION_(MAIN, "move-link-up", MOVE_LINK_UP, N__("Move one link up"), 
ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-link-up-line", MOVE_LINK_UP_LINE, N__("Move to the 
previous line with a link"), ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-page-down", MOVE_PAGE_DOWN, N__("Move downwards by a 
page"), ACTION_REQUIRE_VIEW_STATE),
-ACTION_(MAIN, "move-half-page-down", MOVE_HALF_PAGE_DOWN, N__("Move downwards 
by half a page"), ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-page-up", MOVE_PAGE_UP, N__("Move upwards by a page"), 
ACTION_REQUIRE_VIEW_STATE),
-ACTION_(MAIN, "move-half-page-up", MOVE_HALF_PAGE_UP, N__("Move upwards by 
half a page"), ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "open-link-in-new-tab", OPEN_LINK_IN_NEW_TAB, N__("Open the 
current link in a new tab"), ACTION_REQUIRE_VIEW_STATE | ACTION_JUMP_TO_LINK | 
ACTION_REQUIRE_LINK),
 ACTION_(MAIN, "open-link-in-new-tab-in-background", 
OPEN_LINK_IN_NEW_TAB_IN_BACKGROUND, N__("Open the current link in a new tab in 
the background"), ACTION_REQUIRE_VIEW_STATE | ACTION_JUMP_TO_LINK | 
ACTION_REQUIRE_LINK),
 ACTION_(MAIN, "open-link-in-new-window", OPEN_LINK_IN_NEW_WINDOW, N__("Open 
the current link in a new window"), ACTION_RESTRICT_ANONYMOUS | 
ACTION_REQUIRE_VIEW_STATE | ACTION_JUMP_TO_LINK | ACTION_REQUIRE_LINK),
diff --git a/src/viewer/action.c b/src/viewer/action.c
index 402c4e1..77280e6 100644
--- a/src/viewer/action.c
+++ b/src/viewer/action.c
@@ -355,6 +355,14 @@ do_action(struct session *ses, enum main_action action_id, 
int verbose)
status = move_cursor_line_start(ses, doc_view);
break;
 
+   case ACT_MAIN_MOVE_HALF_PAGE_DOWN:
+   status = move_half_page_down(ses, doc_view);
+   break;
+
+   case ACT_MAIN_MOVE_HALF_PAGE_UP:
+   status = move_half_page_up(ses, doc_view);
+   break;
+
case ACT_MAIN_MOVE_LINK_DOWN:
status = move_link_down(ses, doc_view);
break;
@@ -399,18 +407,10 @@ do_action(struct session *ses, enum main_action 
action_id, int verbose)
status = move_page_down(ses, doc_view);
break;
 
-   case ACT_MAIN_MOVE_HALF_PAGE_DOWN:
-   status = move_half_page_down(ses, doc_view);
-   break;
-
case ACT_MAIN_MOVE_PAGE_UP:
status = move_page_up(ses, doc_view);
break;
 
-   case ACT_MAIN_MOVE_HALF_PAGE_UP:
-   status = move_half_page_up(ses, doc_view);
-   break;
-
case ACT_MAIN_MOVE_DOCUMENT_START:
status = move_document_start(ses, doc_view);
break;
diff --git a/src/viewer/text/view.h b/src/viewer/text/view.h
index f7032f2..d7721b1 100644
--- a/src/vie

[elinks-dev] [PATCH 2/2] Add a function to put the current line at the top of the screen

2013-12-18 Thread Fabienne Ducroquet
Signed-off-by: Fabienne Ducroquet 
---
 src/config/actions-main.inc | 1 +
 src/viewer/action.c | 4 
 src/viewer/text/view.c  | 6 ++
 src/viewer/text/view.h  | 1 +
 4 files changed, 12 insertions(+)

diff --git a/src/config/actions-main.inc b/src/config/actions-main.inc
index 5f686b2..abe6fa6 100644
--- a/src/config/actions-main.inc
+++ b/src/config/actions-main.inc
@@ -53,6 +53,7 @@ ACTION_(MAIN, "lua-console", LUA_CONSOLE, N__("Open a Lua 
console"), ACTION_REST
 ACTION_(MAIN, "mark-goto", MARK_GOTO, N__("Go at a specified mark"), 
ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "mark-set", MARK_SET, N__("Set a mark"), 
ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "menu", MENU, N__("Activate the menu"), 0),
+ACTION_(MAIN, "move-current-top", MOVE_CURRENT_TOP, N__("Move downwards to put 
the current line at the top"), ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-cursor-down", MOVE_CURSOR_DOWN, N__("Move cursor down"), 
ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-cursor-left", MOVE_CURSOR_LEFT, N__("Move cursor left"), 
ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-cursor-line-start", MOVE_CURSOR_LINE_START, N__("Move 
cursor to the start of the line"), ACTION_REQUIRE_VIEW_STATE),
diff --git a/src/viewer/action.c b/src/viewer/action.c
index 77280e6..6d15e33 100644
--- a/src/viewer/action.c
+++ b/src/viewer/action.c
@@ -335,6 +335,10 @@ do_action(struct session *ses, enum main_action action_id, 
int verbose)
activate_bfu_technology(ses, -1);
break;
 
+   case ACT_MAIN_MOVE_CURRENT_TOP:
+   status = move_current_top(ses, doc_view);
+   break;
+
case ACT_MAIN_MOVE_CURSOR_UP:
status = move_cursor_up(ses, doc_view);
break;
diff --git a/src/viewer/text/view.c b/src/viewer/text/view.c
index 8eb422d..943bd33 100644
--- a/src/viewer/text/view.c
+++ b/src/viewer/text/view.c
@@ -138,6 +138,12 @@ move_half_page_down(struct session *ses, struct 
document_view *doc_view)
return move_part_page_down(ses, doc_view, doc_view->box.height / 2);
 }
 
+enum frame_event_status
+move_current_top(struct session *ses, struct document_view *doc_view)
+{
+   return move_part_page_down(ses, doc_view, doc_view->box.height - 
ses->tab->y + 1);
+}
+
 /*! @a type == 0 -> PAGE_UP;
  * @a type == 1 -> UP */
 static void
diff --git a/src/viewer/text/view.h b/src/viewer/text/view.h
index d7721b1..7c11260 100644
--- a/src/viewer/text/view.h
+++ b/src/viewer/text/view.h
@@ -14,6 +14,7 @@ struct terminal;
  * But doesn't free() the @a doc_view. */
 void detach_formatted(struct document_view *doc_view);
 
+enum frame_event_status move_current_top(struct session *ses, struct 
document_view *doc_view);
 enum frame_event_status move_half_page_down(struct session *ses, struct 
document_view *doc_view);
 enum frame_event_status move_half_page_up(struct session *ses, struct 
document_view *doc_view);
 enum frame_event_status move_page_down(struct session *ses, struct 
document_view *doc_view);
-- 
1.8.5.1

___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] [PATCH 2/2] Add support for the CSS list-style-type property

2013-09-05 Thread Fabienne Ducroquet
Just a reminder in case one of the developers has the time to have 
a look at these patches.
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


[elinks-dev] [PATCH 2/2] Add support for the CSS list-style-type property

2013-04-02 Thread Fabienne Ducroquet
Use the same functions as for the list-style property since only the "type" part
of the list-style property is supported at this stage.

Signed-off-by: Fabienne Ducroquet 
---
 src/document/css/apply.c|1 +
 src/document/css/property.c |1 +
 src/document/css/property.h |1 +
 src/document/dom/util.c |1 +
 4 files changed, 4 insertions(+)

diff --git a/src/document/css/apply.c b/src/document/css/apply.c
index 8c3bd85..f94b481 100644
--- a/src/document/css/apply.c
+++ b/src/document/css/apply.c
@@ -149,6 +149,7 @@ static const css_applier_T css_appliers[CSS_PT_LAST] = {
/* CSS_PT_FONT_STYLE */ css_apply_font_attribute,
/* CSS_PT_FONT_WEIGHT */css_apply_font_attribute,
/* CSS_PT_LIST_STYLE */ css_apply_list_style,
+   /* CSS_PT_LIST_STYLE_TYPE */css_apply_list_style,
/* CSS_PT_TEXT_ALIGN */ css_apply_text_align,
/* CSS_PT_TEXT_DECORATION */css_apply_font_attribute,
/* CSS_PT_WHITE_SPACE */css_apply_font_attribute,
diff --git a/src/document/css/property.c b/src/document/css/property.c
index 3914fd1..570aeea 100644
--- a/src/document/css/property.c
+++ b/src/document/css/property.c
@@ -23,6 +23,7 @@ struct css_property_info css_property_info[CSS_PT_LAST] = {
{ "font-style", CSS_PT_FONT_STYLE,   CSS_VT_FONT_ATTRIBUTE, 
css_parse_font_style_value },
{ "font-weight",CSS_PT_FONT_WEIGHT,  CSS_VT_FONT_ATTRIBUTE, 
css_parse_font_weight_value },
{ "list-style", CSS_PT_LIST_STYLE,   CSS_VT_LIST_STYLE, 
css_parse_list_style_value },
+   { "list-style-type",CSS_PT_LIST_STYLE_TYPE,  CSS_VT_LIST_STYLE, 
css_parse_list_style_value },
{ "text-align", CSS_PT_TEXT_ALIGN,   CSS_VT_TEXT_ALIGN, 
css_parse_text_align_value },
{ "text-decoration",CSS_PT_TEXT_DECORATION,  CSS_VT_FONT_ATTRIBUTE, 
css_parse_text_decoration_value },
{ "white-space",CSS_PT_WHITE_SPACE,  CSS_VT_FONT_ATTRIBUTE, 
css_parse_white_space_value },
diff --git a/src/document/css/property.h b/src/document/css/property.h
index 3d96e66..9176624 100644
--- a/src/document/css/property.h
+++ b/src/document/css/property.h
@@ -25,6 +25,7 @@ struct css_property {
CSS_PT_FONT_STYLE,
CSS_PT_FONT_WEIGHT,
CSS_PT_LIST_STYLE,
+   CSS_PT_LIST_STYLE_TYPE,
CSS_PT_TEXT_ALIGN,
CSS_PT_TEXT_DECORATION,
CSS_PT_WHITE_SPACE,
diff --git a/src/document/dom/util.c b/src/document/dom/util.c
index fe03df7..a083a8b 100644
--- a/src/document/dom/util.c
+++ b/src/document/dom/util.c
@@ -63,6 +63,7 @@ init_template_by_style(struct screen_char *template, struct 
document_options *op
case CSS_PT_DISPLAY:
case CSS_PT_NONE:
case CSS_PT_LIST_STYLE:
+   case CSS_PT_LIST_STYLE_TYPE:
case CSS_PT_TEXT_ALIGN:
case CSS_PT_WHITE_SPACE:
case CSS_PT_LAST:
-- 
1.7.10.4

___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


[elinks-dev] [PATCH 1/2] Changes in the handling of the format flags for list elements

2013-04-02 Thread Fabienne Ducroquet
* Rename P_STAR as P_DISC and P_PLUS as P_SQUARE.

* Delete P_NONE because it was used only as the default flag in init_html_parser
  and a list with P_NONE then got bullets, so instead use P_DISC by default (as
  per the CSS specification), and P_NO_BULLET for lists with no bullets.

* Use as bullets the characters:
  - U+25E6 WHITE BULLET for the circle style;
  - U+25AA BLACK SMALL SQUARE (alias square bullet) for the square style;
  - U+2022 BULLET for the disc style (default).

Signed-off-by: Fabienne Ducroquet 
---
 src/document/css/apply.c   |4 ++--
 src/document/html/parser.c |2 +-
 src/document/html/parser.h |7 +++
 src/document/html/parser/general.c |   17 +++--
 4 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/src/document/css/apply.c b/src/document/css/apply.c
index 233d8bd..8c3bd85 100644
--- a/src/document/css/apply.c
+++ b/src/document/css/apply.c
@@ -104,9 +104,9 @@ css_apply_list_style(struct html_context *html_context,
element->parattr.list_number = (prop->value.list_style > 
CSS_LIST_ORDINAL);
switch (prop->value.list_style) {
case CSS_LIST_NONE: element->parattr.flags = P_NO_BULLET; break;
-   case CSS_LIST_DISC: element->parattr.flags = P_O; break;
+   case CSS_LIST_DISC: element->parattr.flags = P_DISC; break;
case CSS_LIST_CIRCLE: element->parattr.flags = P_O; break;
-   case CSS_LIST_SQUARE: element->parattr.flags = P_PLUS; break;
+   case CSS_LIST_SQUARE: element->parattr.flags = P_SQUARE; break;
case CSS_LIST_DECIMAL: element->parattr.flags = P_NUMBER; break;
case CSS_LIST_DECIMAL_LEADING_ZERO: element->parattr.flags = P_NUMBER; 
break;
case CSS_LIST_LOWER_ROMAN: element->parattr.flags = P_roman; break;
diff --git a/src/document/html/parser.c b/src/document/html/parser.c
index c10fd9d..332b527 100644
--- a/src/document/html/parser.c
+++ b/src/document/html/parser.c
@@ -805,7 +805,7 @@ init_html_parser(struct uri *uri, struct document_options 
*options,
par_format.width = options->box.width;
par_format.list_level = par_format.list_number = 0;
par_format.dd_margin = options->margin;
-   par_format.flags = P_NONE;
+   par_format.flags = P_DISC;
 
par_format.color.background = options->default_style.color.background;
 
diff --git a/src/document/html/parser.h b/src/document/html/parser.h
index e0e74db..cbc438d 100644
--- a/src/document/html/parser.h
+++ b/src/document/html/parser.h
@@ -73,18 +73,17 @@ struct text_attrib {
 
 /* This enum is pretty ugly, yes ;). */
 enum format_list_flag {
-   P_NONE = 0,
+   P_NO_BULLET = 0,
 
P_NUMBER = 1,
P_alpha = 2,
P_ALPHA = 3,
P_roman = 4,
P_ROMAN = 5,
-   P_NO_BULLET = 6,
 
-   P_STAR = 1,
+   P_DISC = 1,
P_O = 2,
-   P_PLUS = 3,
+   P_SQUARE = 3,
 
P_LISTMASK = 7,
 
diff --git a/src/document/html/parser/general.c 
b/src/document/html/parser/general.c
index 1bcef8a..570e061 100644
--- a/src/document/html/parser/general.c
+++ b/src/document/html/parser/general.c
@@ -744,14 +744,16 @@ html_ul(struct html_context *html_context, unsigned char 
*a,
/* dump_html_stack(html_context); */
par_format.list_level++;
par_format.list_number = 0;
-   par_format.flags = P_STAR;
+   par_format.flags = P_DISC;
 
al = get_attr_val(a, "type", html_context->doc_cp);
if (al) {
-   if (!c_strcasecmp(al, "disc") || !c_strcasecmp(al, "circle"))
+   if (!c_strcasecmp(al, "disc"))
+   par_format.flags = P_DISC;
+   else if (!c_strcasecmp(al, "circle"))
par_format.flags = P_O;
else if (!c_strcasecmp(al, "square"))
-   par_format.flags = P_PLUS;
+   par_format.flags = P_SQUARE;
mem_free(al);
}
par_format.leftmargin += 2 + (par_format.list_level > 1);
@@ -867,9 +869,12 @@ html_li(struct html_context *html_context, unsigned char 
*a,
if (t == P_NO_BULLET) {
/* Print nothing. */
} else if (!par_format.list_number) {
-   if (t == P_O) put_chrs(html_context, "○", 7); /* o */
-   else if (t == P_PLUS) put_chrs(html_context, "⎕", 7); /* 
+ */
-   else put_chrs(html_context, "•", 7); /* * */
+   if (t == P_O) /* Print U+25E6 WHITE BULLET. */
+   put_chrs(html_context, "◦", 7);
+   else if (t == P_SQUARE) /* Print U+25AA BLACK SMALL SQUARE. */
+   put_chrs(html_context, "▪", 7);
+   else /* Print U+2022 BULLET. */
+   put_chrs(html_conte

[elinks-dev] [PATCH 1/2] Add half-page-down and half-page-up commands

2010-09-14 Thread Fabienne Ducroquet

Signed-off-by: Fabienne Ducroquet 
---
 src/config/actions-main.inc |2 +
 src/viewer/action.c |8 ++
 src/viewer/text/view.c  |   51 ---
 src/viewer/text/view.h  |2 +
 4 files changed, 50 insertions(+), 13 deletions(-)

diff --git a/src/config/actions-main.inc b/src/config/actions-main.inc
index 6620d3f..cb6c6bb 100644
--- a/src/config/actions-main.inc
+++ b/src/config/actions-main.inc
@@ -71,7 +71,9 @@ ACTION_(MAIN, "move-link-right-line", MOVE_LINK_RIGHT_LINE, 
N__("Move one link r
 ACTION_(MAIN, "move-link-up", MOVE_LINK_UP, N__("Move one link up"), 
ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-link-up-line", MOVE_LINK_UP_LINE, N__("Move to the 
previous line with a link"), ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-page-down", MOVE_PAGE_DOWN, N__("Move downwards by a 
page"), ACTION_REQUIRE_VIEW_STATE),
+ACTION_(MAIN, "move-half-page-down", MOVE_HALF_PAGE_DOWN, N__("Move downwards 
by half a page"), ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-page-up", MOVE_PAGE_UP, N__("Move upwards by a page"), 
ACTION_REQUIRE_VIEW_STATE),
+ACTION_(MAIN, "move-half-page-up", MOVE_HALF_PAGE_UP, N__("Move upwards by 
half a page"), ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "open-link-in-new-tab", OPEN_LINK_IN_NEW_TAB, N__("Open the 
current link in a new tab"), ACTION_REQUIRE_VIEW_STATE | ACTION_JUMP_TO_LINK | 
ACTION_REQUIRE_LINK),
 ACTION_(MAIN, "open-link-in-new-tab-in-background", 
OPEN_LINK_IN_NEW_TAB_IN_BACKGROUND, N__("Open the current link in a new tab in 
the background"), ACTION_REQUIRE_VIEW_STATE | ACTION_JUMP_TO_LINK | 
ACTION_REQUIRE_LINK),
 ACTION_(MAIN, "open-link-in-new-window", OPEN_LINK_IN_NEW_WINDOW, N__("Open 
the current link in a new window"), ACTION_RESTRICT_ANONYMOUS | 
ACTION_REQUIRE_VIEW_STATE | ACTION_JUMP_TO_LINK | ACTION_REQUIRE_LINK),
diff --git a/src/viewer/action.c b/src/viewer/action.c
index 66e20bb..d22db6d 100644
--- a/src/viewer/action.c
+++ b/src/viewer/action.c
@@ -408,10 +408,18 @@ do_action(struct session *ses, enum main_action 
action_id, int verbose)
status = move_page_down(ses, doc_view);
break;
 
+   case ACT_MAIN_MOVE_HALF_PAGE_DOWN:
+   status = move_half_page_down(ses, doc_view);
+   break;
+
case ACT_MAIN_MOVE_PAGE_UP:
status = move_page_up(ses, doc_view);
break;
 
+   case ACT_MAIN_MOVE_HALF_PAGE_UP:
+   status = move_half_page_up(ses, doc_view);
+   break;
+
case ACT_MAIN_MOVE_DOCUMENT_START:
status = move_document_start(ses, doc_view);
break;
diff --git a/src/viewer/text/view.c b/src/viewer/text/view.c
index 3a031b3..e4a9648 100644
--- a/src/viewer/text/view.c
+++ b/src/viewer/text/view.c
@@ -85,7 +85,7 @@ detach_formatted(struct document_view *doc_view)
 /*! @a type == 0 -> PAGE_DOWN;
  * @a type == 1 -> DOWN */
 static void
-move_down(struct session *ses, struct document_view *doc_view, int type)
+move_down(struct session *ses, struct document_view *doc_view, int type, int 
overlap)
 {
int newpos;
 
@@ -94,7 +94,8 @@ move_down(struct session *ses, struct document_view 
*doc_view, int type)
 
assert(ses->navigate_mode == NAVIGATE_LINKWISE);/* XXX: drop it 
at some time. --Zas */
 
-   newpos = doc_view->vs->y + doc_view->box.height;
+   newpos = doc_view->vs->y + doc_view->box.height - overlap;
+
if (newpos < doc_view->document->height)
doc_view->vs->y = newpos;
 
@@ -109,23 +110,35 @@ move_down(struct session *ses, struct document_view 
*doc_view, int type)
return;
 }
 
-enum frame_event_status
-move_page_down(struct session *ses, struct document_view *doc_view)
+static enum frame_event_status
+move_part_page_down(struct session *ses, struct document_view *doc_view, int 
overlap)
 {
int oldy = doc_view->vs->y;
int count = eat_kbd_repeat_count(ses);
 
ses->navigate_mode = NAVIGATE_LINKWISE;
 
-   do move_down(ses, doc_view, 0); while (--count > 0);
+   do move_down(ses, doc_view, 0, overlap); while (--count > 0);
 
return doc_view->vs->y == oldy ? FRAME_EVENT_OK : FRAME_EVENT_REFRESH;
 }
 
+enum frame_event_status
+move_page_down(struct session *ses, struct document_view *doc_view)
+{
+   return move_part_page_down(ses, doc_view, 0);
+}
+
+enum frame_event_status
+move_half_page_down(struct session *ses, struct document_view *doc_view)
+{
+   return move_part_page_down(ses, doc_view, doc_view->box.height / 2);
+}
+
 /*! @a type ==

[elinks-dev] [PATCH 1/2] Add half-page-up and half-page-down commands

2010-08-19 Thread Fabienne Ducroquet

Signed-off-by: Fabienne Ducroquet 
---

The moderators don't seem to be active at the moment, so I tried
changing the subject and attaching the patch instead of putting it
inline, but my message still gets caught by the spam filter. I'm 
wondering whether it could be a date issue: my latest try had as date 
header:
Date: Thu, 19 Aug 2010 16:50:31 +0200
that's 14:50:31 UTC, while the reply saying that my message is awaiting 
moderator approval had:
Date: Thu, 19 Aug 2010 08:49:21 -0600
14:49:21 UTC, more than a minute before I sent my message. I don't know 
whether this is sufficient to get rejected by the spam filter and 
I don't understand why not all of my e-mails would be affected (maybe 
because the other ones were smaller?), but I fail to find another 
explication.
I'm sending this through gmane to see if it makes any difference.

 src/config/actions-main.inc |2 +
 src/viewer/action.c |8 ++
 src/viewer/text/view.c  |   51 ---
 src/viewer/text/view.h  |2 +
 4 files changed, 50 insertions(+), 13 deletions(-)

diff --git a/src/config/actions-main.inc b/src/config/actions-main.inc
index 6620d3f..cb6c6bb 100644
--- a/src/config/actions-main.inc
+++ b/src/config/actions-main.inc
@@ -71,7 +71,9 @@ ACTION_(MAIN, "move-link-right-line", MOVE_LINK_RIGHT_LINE, 
N__("Move one link r
 ACTION_(MAIN, "move-link-up", MOVE_LINK_UP, N__("Move one link up"), 
ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-link-up-line", MOVE_LINK_UP_LINE, N__("Move to the 
previous line with a link"), ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-page-down", MOVE_PAGE_DOWN, N__("Move downwards by a 
page"), ACTION_REQUIRE_VIEW_STATE),
+ACTION_(MAIN, "move-half-page-down", MOVE_HALF_PAGE_DOWN, N__("Move downwards 
by half a page"), ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-page-up", MOVE_PAGE_UP, N__("Move upwards by a page"), 
ACTION_REQUIRE_VIEW_STATE),
+ACTION_(MAIN, "move-half-page-up", MOVE_HALF_PAGE_UP, N__("Move upwards by 
half a page"), ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "open-link-in-new-tab", OPEN_LINK_IN_NEW_TAB, N__("Open the 
current link in a new tab"), ACTION_REQUIRE_VIEW_STATE | ACTION_JUMP_TO_LINK | 
ACTION_REQUIRE_LINK),
 ACTION_(MAIN, "open-link-in-new-tab-in-background", 
OPEN_LINK_IN_NEW_TAB_IN_BACKGROUND, N__("Open the current link in a new tab in 
the background"), ACTION_REQUIRE_VIEW_STATE | ACTION_JUMP_TO_LINK | 
ACTION_REQUIRE_LINK),
 ACTION_(MAIN, "open-link-in-new-window", OPEN_LINK_IN_NEW_WINDOW, N__("Open 
the current link in a new window"), ACTION_RESTRICT_ANONYMOUS | 
ACTION_REQUIRE_VIEW_STATE | ACTION_JUMP_TO_LINK | ACTION_REQUIRE_LINK),
diff --git a/src/viewer/action.c b/src/viewer/action.c
index 66e20bb..d22db6d 100644
--- a/src/viewer/action.c
+++ b/src/viewer/action.c
@@ -408,10 +408,18 @@ do_action(struct session *ses, enum main_action 
action_id, int verbose)
status = move_page_down(ses, doc_view);
break;
 
+   case ACT_MAIN_MOVE_HALF_PAGE_DOWN:
+   status = move_half_page_down(ses, doc_view);
+   break;
+
case ACT_MAIN_MOVE_PAGE_UP:
status = move_page_up(ses, doc_view);
break;
 
+   case ACT_MAIN_MOVE_HALF_PAGE_UP:
+   status = move_half_page_up(ses, doc_view);
+   break;
+
case ACT_MAIN_MOVE_DOCUMENT_START:
status = move_document_start(ses, doc_view);
break;
diff --git a/src/viewer/text/view.c b/src/viewer/text/view.c
index 3a031b3..e4a9648 100644
--- a/src/viewer/text/view.c
+++ b/src/viewer/text/view.c
@@ -85,7 +85,7 @@ detach_formatted(struct document_view *doc_view)
 /*! @a type == 0 -> PAGE_DOWN;
  * @a type == 1 -> DOWN */
 static void
-move_down(struct session *ses, struct document_view *doc_view, int type)
+move_down(struct session *ses, struct document_view *doc_view, int type, int 
overlap)
 {
int newpos;
 
@@ -94,7 +94,8 @@ move_down(struct session *ses, struct document_view 
*doc_view, int type)
 
assert(ses->navigate_mode == NAVIGATE_LINKWISE);/* XXX: drop it 
at some time. --Zas */
 
-   newpos = doc_view->vs->y + doc_view->box.height;
+   newpos = doc_view->vs->y + doc_view->box.height - overlap;
+
if (newpos < doc_view->document->height)
doc_view->vs->y = newpos;
 
@@ -109,23 +110,35 @@ move_down(struct session *ses, struct document_view 
*doc_view, int type)
return;
 }
 
-enum frame_event_status
-move_page_down(struct session *ses, struct document_view *doc_view)
+

Re: [elinks-dev] Scrolling by page, by half-page (v2)

2010-08-15 Thread Fabienne Ducroquet
On Sat, Aug 14, 2010 at 11:38:08PM +0200, أحمد المحمودي wrote:
> I think you forgot to attach/send the patches.

The e-mail with the first patch is awaiting moderator approval (The
message headers matched a filter rule, according to the automatic
message I received), the other one seems to have been sent to the list
since it's on gmane.

Regards,

Fabienne
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


[elinks-dev] [PATCH 2/2] Add document.browse.scrolling.vertical_overlap

2010-08-14 Thread Fabienne Ducroquet
Add an option to specify the number of overlapping lines when scrolling
page by page (0 by default because this is ELinks' current behaviour).

Signed-off-by: Fabienne Ducroquet 
---
 src/config/options.inc |5 +
 src/viewer/text/view.c |   14 ++
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/config/options.inc b/src/config/options.inc
index 0448f90..a267abf 100644
--- a/src/config/options.inc
+++ b/src/config/options.inc
@@ -397,6 +397,11 @@ static struct option_info config_options_info[] = {
N_("Number of lines to scroll when a key bound to scroll-up "
"or scroll-down is pressed and no prefix was given.")),
 
+   INIT_OPT_INT("document.browse.scrolling", N_("Vertical overlap"),
+   "vertical_overlap", 0, 0, 10, 0,
+   N_("Number of overlapping lines between the new page displayed "
+   "and the previous one when scrolling one page up or down.")),
+
 
INIT_OPT_TREE("document.browse", N_("Searching"),
"search", 0,
diff --git a/src/viewer/text/view.c b/src/viewer/text/view.c
index e4a9648..9bd9436 100644
--- a/src/viewer/text/view.c
+++ b/src/viewer/text/view.c
@@ -94,7 +94,10 @@ move_down(struct session *ses, struct document_view 
*doc_view, int type, int ove
 
assert(ses->navigate_mode == NAVIGATE_LINKWISE);/* XXX: drop it 
at some time. --Zas */
 
-   newpos = doc_view->vs->y + doc_view->box.height - overlap;
+   if (overlap < doc_view->box.height)
+   newpos = doc_view->vs->y + doc_view->box.height - overlap;
+   else
+   newpos = doc_view->vs->y + doc_view->box.height;
 
if (newpos < doc_view->document->height)
doc_view->vs->y = newpos;
@@ -126,7 +129,7 @@ move_part_page_down(struct session *ses, struct 
document_view *doc_view, int ove
 enum frame_event_status
 move_page_down(struct session *ses, struct document_view *doc_view)
 {
-   return move_part_page_down(ses, doc_view, 0);
+   return move_part_page_down(ses, doc_view, 
get_opt_int("document.browse.scrolling.vertical_overlap", ses));
 }
 
 enum frame_event_status
@@ -147,7 +150,10 @@ move_up(struct session *ses, struct document_view 
*doc_view, int type, int overl
 
if (doc_view->vs->y == 0) return;
 
-   doc_view->vs->y -= (doc_view->box.height - overlap);
+   if (overlap < doc_view->box.height)
+   doc_view->vs->y -= (doc_view->box.height - overlap);
+   else
+   doc_view->vs->y -= doc_view->box.height;
 
int_lower_bound(&doc_view->vs->y, 0);
 
@@ -178,7 +184,7 @@ move_part_page_up(struct session *ses, struct document_view 
*doc_view, int overl
 enum frame_event_status
 move_page_up(struct session *ses, struct document_view *doc_view)
 {
-   return move_part_page_up(ses, doc_view, 0);
+   return move_part_page_up(ses, doc_view, 
get_opt_int("document.browse.scrolling.vertical_overlap", ses));
 }
 
 enum frame_event_status
-- 
1.7.1

___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


[elinks-dev] Scrolling by page, by half-page (v2)

2010-08-14 Thread Fabienne Ducroquet
Hi,

Following are two patches I already sent in a different version in January, the
first one to implement scrolling by half a page, the second one to allow some
overlapping when browsing page by page. The differences with the patches I sent
previously are:
- the order of application of the patches is reversed;
- now the vertical overlap set by the user is ignored if it is greater than the
  window's height; you really need to be using a tiny window for that to happen
  but you never know.

Regards,

Fabienne

___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


[elinks-dev] [PATCH v2] Add half-page-down and half-page-up commands

2010-01-10 Thread Fabienne Ducroquet

Signed-off-by: Fabienne Ducroquet 
---
This is better than the patch I sent last week.

 src/config/actions-main.inc |2 +
 src/viewer/action.c |8 ++
 src/viewer/text/view.c  |   51 ---
 src/viewer/text/view.h  |2 +
 4 files changed, 50 insertions(+), 13 deletions(-)

diff --git a/src/config/actions-main.inc b/src/config/actions-main.inc
index 6620d3f..cb6c6bb 100644
--- a/src/config/actions-main.inc
+++ b/src/config/actions-main.inc
@@ -71,7 +71,9 @@ ACTION_(MAIN, "move-link-right-line", MOVE_LINK_RIGHT_LINE, 
N__("Move one link r
 ACTION_(MAIN, "move-link-up", MOVE_LINK_UP, N__("Move one link up"), 
ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-link-up-line", MOVE_LINK_UP_LINE, N__("Move to the 
previous line with a link"), ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-page-down", MOVE_PAGE_DOWN, N__("Move downwards by a 
page"), ACTION_REQUIRE_VIEW_STATE),
+ACTION_(MAIN, "move-half-page-down", MOVE_HALF_PAGE_DOWN, N__("Move downwards 
by half a page"), ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-page-up", MOVE_PAGE_UP, N__("Move upwards by a page"), 
ACTION_REQUIRE_VIEW_STATE),
+ACTION_(MAIN, "move-half-page-up", MOVE_HALF_PAGE_UP, N__("Move upwards by 
half a page"), ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "open-link-in-new-tab", OPEN_LINK_IN_NEW_TAB, N__("Open the 
current link in a new tab"), ACTION_REQUIRE_VIEW_STATE | ACTION_JUMP_TO_LINK | 
ACTION_REQUIRE_LINK),
 ACTION_(MAIN, "open-link-in-new-tab-in-background", 
OPEN_LINK_IN_NEW_TAB_IN_BACKGROUND, N__("Open the current link in a new tab in 
the background"), ACTION_REQUIRE_VIEW_STATE | ACTION_JUMP_TO_LINK | 
ACTION_REQUIRE_LINK),
 ACTION_(MAIN, "open-link-in-new-window", OPEN_LINK_IN_NEW_WINDOW, N__("Open 
the current link in a new window"), ACTION_RESTRICT_ANONYMOUS | 
ACTION_REQUIRE_VIEW_STATE | ACTION_JUMP_TO_LINK | ACTION_REQUIRE_LINK),
diff --git a/src/viewer/action.c b/src/viewer/action.c
index 66e20bb..d22db6d 100644
--- a/src/viewer/action.c
+++ b/src/viewer/action.c
@@ -408,10 +408,18 @@ do_action(struct session *ses, enum main_action 
action_id, int verbose)
status = move_page_down(ses, doc_view);
break;
 
+   case ACT_MAIN_MOVE_HALF_PAGE_DOWN:
+   status = move_half_page_down(ses, doc_view);
+   break;
+
case ACT_MAIN_MOVE_PAGE_UP:
status = move_page_up(ses, doc_view);
break;
 
+   case ACT_MAIN_MOVE_HALF_PAGE_UP:
+   status = move_half_page_up(ses, doc_view);
+   break;
+
case ACT_MAIN_MOVE_DOCUMENT_START:
status = move_document_start(ses, doc_view);
break;
diff --git a/src/viewer/text/view.c b/src/viewer/text/view.c
index 686daee..ecdb8a8 100644
--- a/src/viewer/text/view.c
+++ b/src/viewer/text/view.c
@@ -85,7 +85,7 @@ detach_formatted(struct document_view *doc_view)
 /*! @a type == 0 -> PAGE_DOWN;
  * @a type == 1 -> DOWN */
 static void
-move_down(struct session *ses, struct document_view *doc_view, int type)
+move_down(struct session *ses, struct document_view *doc_view, int type, int 
overlap)
 {
int newpos;
 
@@ -94,7 +94,8 @@ move_down(struct session *ses, struct document_view 
*doc_view, int type)
 
assert(ses->navigate_mode == NAVIGATE_LINKWISE);/* XXX: drop it 
at some time. --Zas */
 
-   newpos = doc_view->vs->y + doc_view->box.height - 
get_opt_int("document.browse.scrolling.vertical_overlap", ses);
+   newpos = doc_view->vs->y + doc_view->box.height - overlap;
+
if (newpos < doc_view->document->height)
doc_view->vs->y = newpos;
 
@@ -109,23 +110,35 @@ move_down(struct session *ses, struct document_view 
*doc_view, int type)
return;
 }
 
-enum frame_event_status
-move_page_down(struct session *ses, struct document_view *doc_view)
+static enum frame_event_status
+move_part_page_down(struct session *ses, struct document_view *doc_view, int 
overlap)
 {
int oldy = doc_view->vs->y;
int count = eat_kbd_repeat_count(ses);
 
ses->navigate_mode = NAVIGATE_LINKWISE;
 
-   do move_down(ses, doc_view, 0); while (--count > 0);
+   do move_down(ses, doc_view, 0, overlap); while (--count > 0);
 
return doc_view->vs->y == oldy ? FRAME_EVENT_OK : FRAME_EVENT_REFRESH;
 }
 
+enum frame_event_status
+move_page_down(struct session *ses, struct document_view *doc_view)
+{
+   return move_part_page_down(ses, doc_view, 
get_opt_int("document.browse.scrolling.vertical_overlap", ses));
+}
+
+enum frame

[elinks-dev] [PATCH 2/2] Add half-page-down and half-page-up commands

2010-01-03 Thread Fabienne Ducroquet

Signed-off-by: Fabienne Ducroquet 
---
 src/config/actions-main.inc |2 +
 src/viewer/action.c |8 +
 src/viewer/text/view.c  |   61 ++
 src/viewer/text/view.h  |2 +
 4 files changed, 61 insertions(+), 12 deletions(-)

diff --git a/src/config/actions-main.inc b/src/config/actions-main.inc
index 6620d3f..cb6c6bb 100644
--- a/src/config/actions-main.inc
+++ b/src/config/actions-main.inc
@@ -71,7 +71,9 @@ ACTION_(MAIN, "move-link-right-line", MOVE_LINK_RIGHT_LINE, 
N__("Move one link r
 ACTION_(MAIN, "move-link-up", MOVE_LINK_UP, N__("Move one link up"), 
ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-link-up-line", MOVE_LINK_UP_LINE, N__("Move to the 
previous line with a link"), ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-page-down", MOVE_PAGE_DOWN, N__("Move downwards by a 
page"), ACTION_REQUIRE_VIEW_STATE),
+ACTION_(MAIN, "move-half-page-down", MOVE_HALF_PAGE_DOWN, N__("Move downwards 
by half a page"), ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "move-page-up", MOVE_PAGE_UP, N__("Move upwards by a page"), 
ACTION_REQUIRE_VIEW_STATE),
+ACTION_(MAIN, "move-half-page-up", MOVE_HALF_PAGE_UP, N__("Move upwards by 
half a page"), ACTION_REQUIRE_VIEW_STATE),
 ACTION_(MAIN, "open-link-in-new-tab", OPEN_LINK_IN_NEW_TAB, N__("Open the 
current link in a new tab"), ACTION_REQUIRE_VIEW_STATE | ACTION_JUMP_TO_LINK | 
ACTION_REQUIRE_LINK),
 ACTION_(MAIN, "open-link-in-new-tab-in-background", 
OPEN_LINK_IN_NEW_TAB_IN_BACKGROUND, N__("Open the current link in a new tab in 
the background"), ACTION_REQUIRE_VIEW_STATE | ACTION_JUMP_TO_LINK | 
ACTION_REQUIRE_LINK),
 ACTION_(MAIN, "open-link-in-new-window", OPEN_LINK_IN_NEW_WINDOW, N__("Open 
the current link in a new window"), ACTION_RESTRICT_ANONYMOUS | 
ACTION_REQUIRE_VIEW_STATE | ACTION_JUMP_TO_LINK | ACTION_REQUIRE_LINK),
diff --git a/src/viewer/action.c b/src/viewer/action.c
index 66e20bb..d22db6d 100644
--- a/src/viewer/action.c
+++ b/src/viewer/action.c
@@ -408,10 +408,18 @@ do_action(struct session *ses, enum main_action 
action_id, int verbose)
status = move_page_down(ses, doc_view);
break;
 
+   case ACT_MAIN_MOVE_HALF_PAGE_DOWN:
+   status = move_half_page_down(ses, doc_view);
+   break;
+
case ACT_MAIN_MOVE_PAGE_UP:
status = move_page_up(ses, doc_view);
break;
 
+   case ACT_MAIN_MOVE_HALF_PAGE_UP:
+   status = move_half_page_up(ses, doc_view);
+   break;
+
case ACT_MAIN_MOVE_DOCUMENT_START:
status = move_document_start(ses, doc_view);
break;
diff --git a/src/viewer/text/view.c b/src/viewer/text/view.c
index 686daee..4adacf9 100644
--- a/src/viewer/text/view.c
+++ b/src/viewer/text/view.c
@@ -85,7 +85,7 @@ detach_formatted(struct document_view *doc_view)
 /*! @a type == 0 -> PAGE_DOWN;
  * @a type == 1 -> DOWN */
 static void
-move_down(struct session *ses, struct document_view *doc_view, int type)
+move_down(struct session *ses, struct document_view *doc_view, int type, int 
half)
 {
int newpos;
 
@@ -94,7 +94,11 @@ move_down(struct session *ses, struct document_view 
*doc_view, int type)
 
assert(ses->navigate_mode == NAVIGATE_LINKWISE);/* XXX: drop it 
at some time. --Zas */
 
-   newpos = doc_view->vs->y + doc_view->box.height - 
get_opt_int("document.browse.scrolling.vertical_overlap", ses);
+   if (half)
+   newpos = doc_view->vs->y + doc_view->box.height / 2;
+   else
+   newpos = doc_view->vs->y + doc_view->box.height - 
get_opt_int("document.browse.scrolling.vertical_overlap", ses);
+
if (newpos < doc_view->document->height)
doc_view->vs->y = newpos;
 
@@ -110,22 +114,37 @@ move_down(struct session *ses, struct document_view 
*doc_view, int type)
 }
 
 enum frame_event_status
-move_page_down(struct session *ses, struct document_view *doc_view)
+move_part_page_down(struct session *ses, struct document_view *doc_view, int 
half)
 {
int oldy = doc_view->vs->y;
int count = eat_kbd_repeat_count(ses);
 
ses->navigate_mode = NAVIGATE_LINKWISE;
 
-   do move_down(ses, doc_view, 0); while (--count > 0);
+   if (half)
+   do move_down(ses, doc_view, 0, 1); while (--count > 0);
+   else
+   do move_down(ses, doc_view, 0, 0); while (--count > 0);
 
return doc_view->vs->y == oldy ? FRAME_EVENT_OK : FRAME_EVENT_REFRESH;
 }
 
+enum frame_event_status
+move_page_down(struct session

[elinks-dev] [PATCH 0/2] Scrolling by page, by half-page

2010-01-03 Thread Fabienne Ducroquet
Hi,

Here are two patches against ELinks 0.13.GIT concerning scrolling.

I give permission to license my contributions under GPLv2 or later or the 
Simplified BSD License or the X11 License, and I allow the storing of the 
personal information submitted with the patches in public places consistent 
with 
this project.

Regards,
Fabienne

Fabienne Ducroquet (2):
  Add document.browse.scrolling.vertical_overlap
  Add half-page-down and half-page-up commands

 src/config/actions-main.inc |2 +
 src/config/options.inc  |5 +++
 src/viewer/action.c |8 +
 src/viewer/text/view.c  |   61 ++
 src/viewer/text/view.h  |2 +
 5 files changed, 66 insertions(+), 12 deletions(-)

___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


[elinks-dev] [PATCH 1/2] Add document.browse.scrolling.vertical_overlap

2010-01-03 Thread Fabienne Ducroquet
Add an option to specify the number of overlapping lines when scrolling
page by page (0 by default because this is ELinks' current behaviour).
I think that repeating the last line of the screen when scrolling makes reading 
long pages easier; this also is what slrn does, so with this patch I can make 
them behave in the same way when scrolling page by page.

Signed-off-by: Fabienne Ducroquet 
---
 src/config/options.inc |5 +
 src/viewer/text/view.c |4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/config/options.inc b/src/config/options.inc
index 9969e25..7f5fb6d 100644
--- a/src/config/options.inc
+++ b/src/config/options.inc
@@ -397,6 +397,11 @@ static struct option_info config_options_info[] = {
N_("Number of lines to scroll when a key bound to scroll-up "
"or scroll-down is pressed and no prefix was given.")),
 
+   INIT_OPT_INT("document.browse.scrolling", N_("Vertical overlap"),
+   "vertical_overlap", 0, 0, 10, 0,
+   N_("Number of overlapping lines between the new page displayed "
+   "and the previous one when scrolling one page up or down.")),
+
 
INIT_OPT_TREE("document.browse", N_("Searching"),
"search", 0,
diff --git a/src/viewer/text/view.c b/src/viewer/text/view.c
index 3a031b3..686daee 100644
--- a/src/viewer/text/view.c
+++ b/src/viewer/text/view.c
@@ -94,7 +94,7 @@ move_down(struct session *ses, struct document_view 
*doc_view, int type)
 
assert(ses->navigate_mode == NAVIGATE_LINKWISE);/* XXX: drop it 
at some time. --Zas */
 
-   newpos = doc_view->vs->y + doc_view->box.height;
+   newpos = doc_view->vs->y + doc_view->box.height - 
get_opt_int("document.browse.scrolling.vertical_overlap", ses);
if (newpos < doc_view->document->height)
doc_view->vs->y = newpos;
 
@@ -134,7 +134,7 @@ move_up(struct session *ses, struct document_view 
*doc_view, int type)
 
if (doc_view->vs->y == 0) return;
 
-   doc_view->vs->y -= doc_view->box.height;
+   doc_view->vs->y -= (doc_view->box.height - 
get_opt_int("document.browse.scrolling.vertical_overlap", ses));
int_lower_bound(&doc_view->vs->y, 0);
 
if (current_link_is_visible(doc_view))
-- 
1.6.5.7

___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] The Links/Links2/ELinks browsers are unusable on Debian GNU/Hurd

2008-10-30 Thread Fabienne Ducroquet
On Fri, Sep 26, 2008 at 10:37:04AM +0200, =?ISO-8859-1?Q?G=FCrkan_Seng=FCn_ 
wrote:
> links and links2 work perfectly on Debian GNU/Hurd, i just tried 
> links2 -g and it gave worked with http as well as https with no 
> problem

   It works in graphical mode but not in text mode.

> elinks is a different source than links and links2.

   ELinks has been forked from Links 0.96 and the core parts of Links2 
and ELinks still are very similar.  Compare e.g. kbd.c in Links with 
src/terminal/kbd.c in ELinks, select.c (Links) with src/main/select.c.  
Kalle's workaround[0] for this bug works for Links too, I put the diff 
for Links 2.2 at the end of this e-mail in case you want to include it 
in your package (if Kalle agrees).

Cheers,
Fabienne

[0]http://repo.or.cz/w/elinks.git?a=commit;h=a0d624cd615702d041387b29d00f5128c900e567

--- select.c.bak2008-10-30 18:10:47.0 +0100
+++ select.c2008-10-30 18:15:25.0 +0100
@@ -5,6 +5,9 @@
  */
 
 #include "links.h"
+#ifdef __GNU__ /* For GNU Hurd bug workaround in set_handlers() */
+#include  /* OS/2 needs this after sys/types.h */
+#endif
 
 /*
 #define DEBUG_CALLS
@@ -216,6 +219,21 @@
internal("set_handlers: handle %d >= FD_SETSIZE %d", fd, 
FD_SETSIZE);
return;
}
+   #ifdef __GNU__
+   /* GNU Hurd pflocal bug :
+* If ELinks does a select() where the initial exceptfds set
+* includes a pipe that is not listed in the other fd_sets,
+* then select() always reports an exception there.  That
+* makes Elinks think the pipe has failed and close it.
+* To work around this bug, do not monitor exceptions for
+* pipes on the Hurd.  */
+   if (error_func) {
+   struct stat st;
+
+   if (fstat(fd, &st) == 0 && S_ISFIFO(st.st_mode))
+   error_func = NULL;
+   }
+   #endif /* __GNU__ */
threads[fd].read_func = read_func;
threads[fd].write_func = write_func;
threads[fd].error_func = error_func;
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] The Links/Links2/ELinks browsers are unusable on Debian GNU/Hurd

2007-12-20 Thread Fabienne Ducroquet
Le Fri, 21 Dec 2007 03:04:06 +0200, Kalle Olavi Niemitalo <[EMAIL PROTECTED]> a
écrit :
> Probably it doesn't break anything else, but anyway I meant
> changing the callers of set_handlers, rather than the function
> itself.

OK, I remark that I've forgotten the tests on error_func further in
the function anyway, I will not have the possibility to look at that
before 2.5 weeks (at least) but I will try to do that and the other
things you suggest in your message at that moment (if nobody else
decides to do it in the meantime :-).

-- 
Fabienne

___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] The Links/Links2/ELinks browsers are unusable on Debian GNU/Hurd

2007-12-20 Thread Fabienne Ducroquet
On Thu, Dec 20, 2007 at 06:29:51AM +0200, Kalle Olavi Niemitalo wrote:
> > 114 if (!len) return;
> > (gdb) n
> > 116 if (!itrm->out.queue.len && can_write(itrm->out.sock)) {
> > (gdb) n
> > 119 register_bottom_half(free_itrm, itrm);
> > (gdb) n
> > 124 if (w < len) {
> 
> Recompile without optimization to see what really happens here.

(gdb) run -no-home
Starting program: /home/fabi/hurd/elinks/src/elinks -no-home

Breakpoint 1, itrm_queue_event (itrm=0x81a1f40, data=0x1020b18 "", len=320)
at kbd.c:112
112 int w = 0;
(gdb) n
114 if (!len) return;
(gdb) n
116 if (!itrm->out.queue.len && can_write(itrm->out.sock)) {
(gdb) n
124 if (w < len) {
(gdb) n
125 int left = len - w;
(gdb) n
126 unsigned char *c = mem_realloc(itrm->out.queue.data,
(gdb) n
129 if (!c) {
(gdb) n
134 itrm->out.queue.data = c;
(gdb) n
135 memcpy(itrm->out.queue.data + itrm->out.queue.len, data 
+ w, left);
(gdb) n
136 itrm->out.queue.len += left;
(gdb) n
137 set_handlers(itrm->out.sock,
(gdb) n
142 }
(gdb) n
handle_trm (std_in=0, std_out=1, sock_in=1, sock_out=7, ctl_in=0, 
init_string=0x81a1dd0, init_len=0, remote=0) at kbd.c:345
345 itrm_queue_event(itrm, (char *) init_string, init_len);

The test line 116 fails here and not on Linux.  I still don't
understand why gdb says that it goes to the line 119
(check_bottom_halves) with optimization?
With a breakpoint at can_read_or_write:

(gdb) run -no-home
Starting program: /home/fabi/hurd/elinks/src/elinks -no-home

Breakpoint 1, itrm_queue_event (itrm=0x81a1f40, data=0x1020b18 "", len=320)
at kbd.c:112
112 int w = 0;
(gdb) n
114 if (!len) return;
(gdb) n
116 if (!itrm->out.queue.len && can_write(itrm->out.sock)) {
(gdb) print *itrm
$1 = {in = {std = 0, sock = 1, ctl = 0, queue = {data = 0x81a1fd0 "", 
  len = 0}}, out = {std = 1, sock = 7, queue = {data = 0x0, len = 0}}, 
  timer = 0x0, t = {c_iflag = 10240, c_oflag = 3, c_cflag = 19201, 
c_lflag = 4194499, c_cc = "\004ÿÿ\177\027\025\022ÿ\003ÿÿÿ\001\000ÿÿ", 
__ispeed = 38400, __ospeed = 38400}, mouse_h = 0x0, orig_title = 0x0, 
  blocked = 0, altscreen = 1, touched_title = 0, remote = 0}
(gdb) n

Breakpoint 2, can_read_or_write (fd=7, write=1) at select.c:319
319 struct timeval tv = {0, 0};
(gdb) n
321 fd_set *rfds = NULL;
(gdb) n
322 fd_set *wfds = NULL;
(gdb) n
324 FD_ZERO(&fds);
(gdb) n
325 FD_SET(fd, &fds);
(gdb) n
327 if (write)
(gdb) n
328 wfds = &fds;
(gdb) n
332 return select(fd + 1, rfds, wfds, NULL, &tv);
(gdb) print wfds
$2 = (fd_set *) 0x1020a6c
(gdb) print rfds
$3 = (fd_set *) 0x0
(gdb) print &tv
$4 = (struct timeval *) 0x1020a8c
(gdb) print select(8,0x0,0x1020a6c,0x0,0x1020a8c)
$5 = 0
(gdb) n
333 }
(gdb) n
can_write (fd=7) at select.c:345
345 }
(gdb) n
itrm_queue_event (itrm=0x81a1f40, data=0x1020b18 "", len=320) at kbd.c:124
124 if (w < len) {
(gdb) n
125 int left = len - w;

> I mean, the compiler might merely have decided to load the
> address of free_itrm into a register at that point, or something
> like that.

But how could I see that?

> > As you can see, there is something wrong there,
> 
> I don't see that.

You are probably more experienced than me in that sort of thing, for
me that seems at least very weird. :-)

> So the patch doesn't reveal anything.

   It's true, I had not observed enough what it does.

> Instead, you should find out why the select function is reporting
> an exceptional state for the file descriptor.

   According to the gdb output above select in can_read_or_write(7,1)
returns 0 whereas on Linux it returns 1 in the same conditions, but why,
I don't know.

> I suggest you use rpctrace to find whether any io_select is
> returning the SELECT_URG flag in select_type, and from which
> server that reply comes. 

I tried rpctrace elinks but I don't know what to look for in the
output...  There are lines such as:

task2573->vm_deallocate (21331968 4096) = 0 
  88->io_select_request (2)task2573->mach_port_destroy (pn{ 25}) = 0 
reply(94:io_select_request)->io_select_reply (0 2);
  72->io_write_request ("^[[1;1H" -1) = 0 6
  52->io_select_request (5)task2573->mach_port_allocate (3) = 0 pn{ 29}
task2573->mach_port_move_member (pn{ 25} pn{ 29}) = 0 
  86->io_select_request (5)task2573->mach_port_move_member (pn{ 27} pn{ 29}) = 
0 
  88->io_select_request (6)task2573->mach_port_move_member (pn{ 28} pn{ 29}) = 
0 
reply(96:io_select_request)->io_select_reply (0 2);
task2573->mach_port_destroy (pn{ 25}) = 0 

What must I look here?  the numbers between parenthesis after
io_select_reply (in that case, they are always (0 1) or (0 2) or 

Re: [elinks-dev] The Links/Links2/ELinks browsers are unusable on Debian GNU/Hurd

2007-12-19 Thread Fabienne Ducroquet
On Thu, Dec 20, 2007 at 12:40:10AM +0200, Kalle Olavi Niemitalo wrote:
> free_itrm should be called only if an error or EOF occurs in
> terminal handling, or when ELinks is exiting.

Did you receive all my replies? I sent 3 successive replies through
gmane during my investigation but I see only one in elinks-dev web
archive.
I did not detail what I've done in these mails, I will do that here
(it's rather long with the output of gdb, sorry).
As threads[i].error_func is set by set_handlers, I've put a
breakpoint at set_handlers and compared what happens on Hurd and Linux
in the same conditions (run elinks -no-home about:blank on a terminal on
which I've done sleep 9 and which I don't touch during the test).
On Linux set_handlers is called only 2 times before ELinks displays the
blank page I've requested and waits for further input, the result with
backtraces at each break is:

(gdb) run -no-home about:blank
Starting program: /home/fabi/prog/bin/elinks-bin -no-home about:blank
[Thread debugging using libthread_db enabled]
[New Thread 0xb737c930 (LWP 21627)]
[Switching to Thread 0xb737c930 (LWP 21627)]

Breakpoint 2, set_handlers (fd=0, read_func=0x8106ae0 , write_func=0, 
error_func=0x8105970 , data=0x81c0d38) at select.c:144
144 assertm(fd >= 0 && fd < FD_SETSIZE,
(gdb) bt
#0  set_handlers (fd=0, read_func=0x8106ae0 , write_func=0, 
error_func=0x8105970 , data=0x81c0d38) at select.c:144
#1  0x0810565c in handle_itrm_stdin (itrm=) at kbd.c:1193
#2  0x08105e19 in handle_trm (std_in=0, std_out=1, sock_in=1, sock_out=7, 
ctl_in=0, init_string=0x82a69e8, init_len=12, remote=0) at kbd.c:330
#3  0x0810b59f in attach_terminal (in=0, out=1, ctl=0, info=0x82a69e8, len=12)
at terminal.c:371
#4  0x080cf578 in init () at main.c:239
#5  0x080d0071 in select_loop (init=0x80cef20 ) at select.c:204
#6  0x080cf6b8 in main (argc=3, argv=0xbf945444) at main.c:361
(gdb) c
Continuing.

Breakpoint 2, set_handlers (fd=6, read_func=0x8104890 , write_func=0, 
error_func=0x810ae90 , data=0x82f7e28) at select.c:144
144 assertm(fd >= 0 && fd < FD_SETSIZE,
(gdb) bt
#0  set_handlers (fd=6, read_func=0x8104890 , write_func=0, 
error_func=0x810ae90 , data=0x82f7e28) at select.c:144
#1  0x0810b452 in init_term (fdin=6, fdout=1) at terminal.c:101
#2  0x0810b5b3 in attach_terminal (in=0, out=1, ctl=0, info=0x82a69e8, len=12)
at terminal.c:373
#3  0x080cf578 in init () at main.c:239
#4  0x080d0071 in select_loop (init=0x80cef20 ) at select.c:204
#5  0x080cf6b8 in main (argc=3, argv=0xbf945444) at main.c:361
(gdb) c
Continuing.


 On Hurd there are 9 calls to set_handlers before ELinks displays
the about:blank (and I have to kill gdb after that because it does not
understand ^C).  The result is:

(gdb) run -no-home about:blank
Starting program: /home/fabi/hurd/bin/elinks -no-home about:blank

Breakpoint 2, set_handlers (fd=0, read_func=0x80c1a10 , write_func=0, 
error_func=0x80c0970 , data=0x8187f00) at select.c:144
144 assertm(fd >= 0 && fd < FD_SETSIZE,
(gdb) bt
#0  set_handlers (fd=0, read_func=0x80c1a10 , write_func=0, 
error_func=0x80c0970 , data=0x8187f00) at select.c:144
#1  0x080c06cb in handle_itrm_stdin (itrm=0x8187f00) at kbd.c:1193
#2  0x080c0d6a in handle_trm (std_in=0, std_out=1, sock_in=1, sock_out=7, 
ctl_in=0, init_string=0x8187dd0, init_len=12, remote=0) at kbd.c:330
#3  0x080c5aeb in attach_terminal (in=0, out=1, ctl=0, info=0x8187dd0, len=12)
at terminal.c:371
#4  0x0809de88 in init () at main.c:239
#5  0x0809e8f7 in select_loop (init=0x809d900 ) at select.c:204
#6  0x0809df98 in main (argc=) at main.c:361
(gdb) c
Continuing.

Breakpoint 2, set_handlers (fd=7, read_func=0, 
write_func=0x80c1090 , error_func=0x80c0970 , 
data=0x8187f00) at select.c:144
144 assertm(fd >= 0 && fd < FD_SETSIZE,
(gdb) bt
#0  set_handlers (fd=7, read_func=0, write_func=0x80c1090 , 
error_func=0x80c0970 , data=0x8187f00) at select.c:144
#1  0x080c0bd0 in itrm_queue_event (itrm=0x8187f00, data=0x1020b28 "", len=320)
at kbd.c:137
#2  0x080c0dff in handle_trm (std_in=0, std_out=1, sock_in=1, sock_out=7, 
ctl_in=0, init_string=0x8187dd0, init_len=12, remote=0) at kbd.c:344
#3  0x080c5aeb in attach_terminal (in=0, out=1, ctl=0, info=0x8187dd0, len=12)
at terminal.c:371
#4  0x0809de88 in init () at main.c:239
info = {magic = 7, source = 0x8187dd0 "about:blank", length = 
12}
#5  0x0809e8f7 in select_loop (init=0x809d900 ) at select.c:204
#6  0x0809df98 in main (argc=) at main.c:361
(gdb) c
Continuing.

Breakpoint 2, set_handlers (fd=7, read_func=0, 
write_func=0x80c1090 , error_func=0x80c0970 , 
data=0x8187f00) at select.c:144
144 assertm(fd >= 0 && fd < FD_SETSIZE,
(gdb) bt
#0  set_handlers (fd=7, read_func=0, write_func=0x80c1090 , 
error_func=0x80c0970 , data=0x8187f00) at select.c:144
#1  0x080c0bd0 in itrm_queue_event (itrm=0x8187f00, data=0x8187dd0 
"about:blank", 
len=12)

Re: [elinks-dev] The Links/Links2/ELinks browsers are unusable on Debian GNU/Hurd

2007-12-19 Thread Fabienne Ducroquet
Le Wed, 19 Dec 2007 00:44:46 +0100, Fabienne Ducroquet
<[EMAIL PROTECTED]> a écrit :
>  and more precisely, that seems to happen after
> set_handlers has been called with read_func = 0, write_func = 0 and
> error_func = &free_itrm (or &free_trm).  After that, all the calls to

I think that this is normal (that the error happens before that).
In ELinks, I've found something anormal during the execution of
itrm_queue_event on Hurd: it jumps from line 116
if (!itrm->out.queue.len && can_write(itrm->out.sock)) {
to line 119 (which is inside the if) without executing lines 117-118
w = safe_write(itrm->out.sock, data, len);
if (w <= 0 && HPUX_PIPE) {
Then it executes lines 124-141 as w is still 0 whereas it should
have been modified at line 117.

In Links 1.00pre20 there is something similar during the execution of
queue_event (in kbd.c): after the test line 69
if (!itrm->eqlen && can_write(itrm->sock_out) && (w =
write(itrm->sock_out, data, len)) <= 0) {
it jumps to line 72 (inside the if)
return;
without executing line 71, and then the execution of the function
continues line 74 to 80 as w is still 0.  I don't know whether the
command w = write(...) in the test is executed or not.

-- 
Fabienne

___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


[elinks-dev] The Links/Links2/ELinks browsers are unusable on Debian GNU/Hurd

2007-12-14 Thread Fabienne Ducroquet
[ E-Mail sent to [EMAIL PROTECTED], CC'ed to
elinks-dev@linuxfromscratch.org and [EMAIL PROTECTED] ]

Hi,

I have tried to use the text web browsers Links (1.00~pre20-0.1,
from the debian repository), Links2 (2.1pre31-1, from the debian
repository) and ELinks (git/master from the git repository at
http://elinks.cz, there is no binary package for ELinks in Debian
hurd-i386 because of its Build-Dep on smbclient which is not available
for hurd-i386) on Debian GNU/Hurd, but they are totally unusable in text
mode, only Links2 in graphical mode works.

In text mode they all three have the same behaviour: any key hit
is literally displayed on the screen, beginning at the position where
the cursor is (e.g. if I hit a letter it is displayed on the screen, if
I hit the right arrow ^[[C is printed on the screen ...), with a few
exceptions:
-  moves the cursor 1 line down instead of printing ^M or so,
- in the hurd console ^\ kills the program (shouldn't that produce a
  core dump too? I have limit CORE unlimited), but ^C does not work,
- inside gdb ^C interrupts the program (but not ^\).
On an X terminal, neither ^C nor ^\ work, I have to kill the program
with kill.
All the keys hit while the program was running are interpreted by the
shell after I killed the program.

In fact there have been 2 or 3 times where the first keys hit
have been correctly interpreted before the browser became unusable (with
ELinks, but I tried the other ones less), but I didn't manage to
reproduce that and I don't know what could influence that.

I firstly thought that this was just the hurd console which was not
fully supported, but then the "normal" keys such as the letters would
work, and the fact that it doesn't work with xterm or rxvt (i.e. all the
X terminal emulators I have tried) proves that the problem is elsewhere.
Do the other Hurd users have this issue or is there just something wrong
in my installation?

I've tried to find what is wrong by compiling the programs in debug
mode and running gdb elinks (resp. links), then run, ^C to interrupt the
program and then bt, here are the results:

ELinks (0.13.GIT):
Program received signal SIGINT, Interrupt.
0x014c916c in mach_msg_trap () from /lib/libc.so.0.3
(gdb) bt
#0  0x014c916c in mach_msg_trap () from /lib/libc.so.0.3
#1  0x014c98b3 in mach_msg () from /lib/libc.so.0.3
#2  0x014cfd43 in _hurd_select () from /lib/libc.so.0.3
#3  0x015a7c8e in select () from /lib/libc.so.0.3
#4  0x080bfc29 in select_loop (init=0x80beb10 ) at select.c:252
#5  0x080bf1b8 in main (argc=Cannot access memory at address 0x0
) at main.c:361

Links (1.0~pre20-0.1):
Program received signal SIGINT, Interrupt.
0x011c716c in mach_msg_trap () from /lib/libc.so.0.3
(gdb) bt
#0  0x011c716c in mach_msg_trap () from /lib/libc.so.0.3
#1  0x011c78b3 in mach_msg () from /lib/libc.so.0.3
#2  0x011cdd43 in _hurd_select () from /lib/libc.so.0.3
#3  0x012a5c8e in select () from /lib/libc.so.0.3
#4  0x08086072 in select_loop (init=0x807c180 ) at select.c:353
#5  0x0807ba59 in main (argc=Cannot access memory at address 0x0
) at main.c:337

   In text mode Links2's behaviour is the same as Links' and ELinks',
but in graphical mode it works ... unless I run it from gdb.  If I run
gdb links2, then run -g, I can only access to local files, if I try to
access to another host there is an error "Host not found" (that's not a
network error, I can access to the same hosts with another browser at
the same time).  Then if I hit ^Z to suspend the program and see the
backtrace I have the same error than in text mode:
(gdb) bt
#0  0x013bb16c in mach_msg_trap () from /lib/libc.so.0.3
#1  0x013bb8b3 in mach_msg () from /lib/libc.so.0.3
#2  0x013c1d43 in _hurd_select () from /lib/libc.so.0.3
#3  0x01499c8e in select () from /lib/libc.so.0.3
#4  0x080b5d56 in select_loop (init=0x80a59b0 ) at select.c:423
#5  0x080a51d9 in main (argc=Cannot access memory at address 0x0
) at main.c:438

If I continue the program after that, it does not work anymore:
nothing happens when I hit a key as the browser's window is focused, if
I hit a key as gdb's window is focused, it is just literally printed on
the screen like with *Links* in text mode (and interpreted by the shell
after gdb has been killed too), and I have to kill gdb as ^C and ^\
don't work anymore.  Outside of gdb there is none of these issues with
links2 -g, I can access to remote hosts or suspend it without causing
errors, and in gdb on Linux it works too.

Should not this error "Cannot access memory at address 0x0" produce
a segfault?  Do you think that this error is why the browsers don't work?
Does someone have an idea about what could cause that?

Thanks for your help.

PS: If you have the same problem than me, don't forget to verify that
the socket created in ~/.links or ~/.links2 or ~/.elinks has been
deleted after you have killed one of these programs, without that the
next time you launch it it will try to connect to a master instance
which does not exist