[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 fabi...@gmail.com
---
 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


[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 fabi...@gmail.com
---
 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/viewer/text/view.h
+++ b/src/viewer/text/view.h
@@ -14,10 +14,10 @@ struct terminal;
  * But doesn't free() the @a doc_view. */
 void detach_formatted(struct document_view *doc_view);
 
-enum frame_event_status move_page_down(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_page_up(struct session *ses

[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 fabi...@gmail.com
---
 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 \fBnum\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 \fBnum\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 \fBnum\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


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 fabi...@gmail.com
---

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;
-
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 d560bb5..7c11260 100644
--- a/src/viewer/text/view.h
+++ b/src/viewer/text/view.h
@@ -15,10 +15,10 @@ struct terminal;
 void detach_formatted(struct document_view *doc_view);
 
 enum frame_event_status move_current_top(struct session *ses, struct

[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 fabi...@gmail.com
---
 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] Add half-page-up and half-page-down commands

2010-08-19 Thread Fabienne Ducroquet

Signed-off-by: Fabienne Ducroquet fabi...@gmail.com
---

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)
+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

[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


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 (0 0))?
something completely different?

 Also try putting the NULLs in ELinks
 

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 in_kbd, write_func=0, 
error_func=0x8105970 free_itrm, data=0x81c0d38) at select.c:144
144 assertm(fd = 0  fd  FD_SETSIZE,
(gdb) bt
#0  set_handlers (fd=0, read_func=0x8106ae0 in_kbd, write_func=0, 
error_func=0x8105970 free_itrm, data=0x81c0d38) at select.c:144
#1  0x0810565c in handle_itrm_stdin (itrm=value optimized out) 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 init) 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 in_term, write_func=0, 
error_func=0x810ae90 destroy_terminal, data=0x82f7e28) at select.c:144
144 assertm(fd = 0  fd  FD_SETSIZE,
(gdb) bt
#0  set_handlers (fd=6, read_func=0x8104890 in_term, write_func=0, 
error_func=0x810ae90 destroy_terminal, 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 init) 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 in_kbd, write_func=0, 
error_func=0x80c0970 free_itrm, data=0x8187f00) at select.c:144
144 assertm(fd = 0  fd  FD_SETSIZE,
(gdb) bt
#0  set_handlers (fd=0, read_func=0x80c1a10 in_kbd, write_func=0, 
error_func=0x80c0970 free_itrm, 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 init) 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 itrm_queue_write, error_func=0x80c0970 free_itrm, 
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 itrm_queue_write, 
error_func=0x80c0970 free_itrm, 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 init) 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 itrm_queue_write, error_func=0x80c0970 free_itrm, 
data=0x8187f00) at select.c:144
144 assertm(fd = 0  fd  FD_SETSIZE,
(gdb) bt
#0  set_handlers (fd=7,