From kon at iki.fi Sat Aug 4 13:14:03 2007 From: kon at iki.fi (Kalle Olavi Niemitalo) Date: Sat, 04 Aug 2007 22:14:03 +0300 Subject: [elinks-dev] [PATCH] download.txt: No more Cogito. Describe branches. Message-ID: <87y7gr15ac.fsf@Astalo.kon.iki.fi> I am not entirely satisfied with the result. Can someone with good English or Git skills check this? download.txt: No more Cogito. Describe branches. --- commit 71b71d34283fe4f10dc70c15a8a31dfe0878a6d6 tree 0caddb5b0f4ff370c9b02b6d2a5258f72acf920a parent 6317e6c9e49cd5a9b2650949331b05ec0f6d6a20 author Kalle Olavi Niemitalo Sat, 04 Aug 2007 22:07:36 +0300 committer Kalle Olavi Niemitalo Sat, 04 Aug 2007 22:08:17 +0300 download.html | 121 +++++++++++++++++++++++++++++++++++++++++------------- download.txt | 127 ++++++++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 191 insertions(+), 57 deletions(-) diff --git a/download.html b/download.html index 30b1541..d87a489 100644 --- a/download.html +++ b/download.html @@ -146,47 +146,110 @@ is given in the following section.

ELinks via GIT

-

To get access to ELinks via GIT you will need to have the following tools -installed on your system:

+

To get access to ELinks via GIT you will need to have GIT installed on +your system. Please see the GIT website for pointers +to source and binary packages and documentation. Pick the most recent +version. (We no longer recommend +Cogito.)

+

First, get yourself a copy of the ELinks repository by doing:

+
% git clone http://repo.or.cz/r/elinks.git
+% cd elinks
+

(If the operation hangs or fails, try also cloning from +git://repo.or.cz/elinks.git or http://elinks.cz/elinks.git. +However, your firewall may block the GIT protocol, and cloning +from elinks.cz takes much longer. You can add more sources with +git remote add after you have the clone.)

+

You now have a working copy of the local “master” branch, which is +tracking the remote “origin/master” branch, where the unstable +version of ELinks is kept. If you want to use some other remote +branch, e.g. “origin/elinks-0.12”, create a corresponding local +branch with this command:

+
% git checkout --track -b elinks-0.12 origin/elinks-0.12
+

You can get a list of remote branches with git branch -r, +git remote show origin, or git ls-remote —heads origin. +The following branches are known to exist:

-The GIT core +master +
+
+ The unstable version. As of August 2007, this is ELinks + 0.13.GIT, but few commits are made directly here; instead, + they are made in “elinks-0.12” and later merged here. +
+
+elinks-0.12 +
+
+ The ELinks 0.12 series. Forked from “master” on 2007-04-22. + Bug fixes only, until ELinks 0.12.0 has been released. +
+
+elinks-0.11 +
+
+ The ELinks 0.11 series. Mainly bug fixes are made here. +
+
+REL_0_10
- This is a set of lowlevel tools able of accessing and modifying - a GIT tree. Pick the most recent version. + The ELinks 0.10 series. Unmaintained since 2007-03-17.
-The Cogito tools +utf8
- Which is a set of bash scripts layered on top of the GIT core with the - aim of making interacting with GIT trees more pleasent. - Pick the most recent version. + UTF-8 terminal support for ELinks 0.12.GIT. Forked from + “master” on 2006-01-14. Was merged back to “master” + on 2006-07-21 and is no longer developed separately. +
+
+witekfl +
+
+ Changes to be reviewed and then applied to “master” or + “elinks-0.12”. +
+
+HEAD +
+
+ An alias for the default branch, currently “master”.
-

In the following we will only focus on getting the most recent version of the -stable and unstable trees. See -the Cogito introduction -or the Cogito manpages. -for information on doing more advanced things with Cogito.

-

You can get the latest unstable development version by doing:

-
% cg clone http://elinks.cz/elinks.git
-% cd elinks
-

You can also get the latest stable development version via GIT. Note that -development in the stable branch is more slow and mostly involves backporting -of bug fixes. Just do this:

-
% cg clone http://elinks.cz/elinks.git#{stable-branch} {stable-branch}
-% cd {stable-branch}
-

There may also be some other branches for separate development of some larger -experimental features etc. The old CVS history is available in a separate -archive that can be grafted onto either the stable or unstable tree by simply -running the following command in the cloned ELinks repository:

-
% sh contrib/grafthistory.sh
-

Note, it requires wget(1) and will download about 80M.

+

After you have checked out the right branch, generate the files +that we do not keep in GIT:

+
% ./autogen.sh
+

And then you can compile ELinks as described on +the installation page +or in the INSTALL file.

+

Keeping up to date

You can browse the GIT tree online. You can also browse the old CVS tree.

+

As new commits are made, your clone of the ELinks repository will +become out of date. Instead of making a new clone from scratch, +you can quickly update the old one with:

+
% git pull
+

This command both updates the remote branches (e.g. “origin/elinks-0.12”) +and merges the changes to your local branch (e.g. “elinks-0.12”). +You can then compile the new version. It is usually not necessary +to run ./autogen.sh first.

+

Adding more data to the repository gradually leaves more and more +small files in the .git/objects/?? directories. To compress these +files into a pack so that they take up less disk space, run this:

+
% git gc
+

To see commits almost in real time, you can join the +#ELinks IRC channel, where the +CIA.vc bot announces them. +However, it takes a while before the new commit is available +at elinks.cz, and then some more before it is at repo.or.cz.

+

The old CVS history is available in a separate archive that can be +grafted onto either the stable or unstable tree by simply running the +following command in the cloned ELinks repository:

+
% sh contrib/grafthistory.sh
+

Note, it requires wget(1) and will download about 80M.

Getting ELinks up and running

@@ -205,7 +268,7 @@ You can also browse

- Last Modified: 10-Jul-2007 17:24:33 EEST. + Last Modified: 04-Aug-2007 22:07:58 EEST. Validate: CSS XHTML. diff --git a/download.txt b/download.txt index 88e0451..1495553 100644 --- a/download.txt +++ b/download.txt @@ -102,49 +102,120 @@ is given in the following section. ELinks via GIT -------------- -To get access to ELinks via GIT you will need to have the following tools -installed on your system: +To get access to ELinks via GIT you will need to have GIT installed on +your system. Please see the http://git.or.cz/[GIT website] for pointers +to source and binary packages and documentation. Pick the most recent +version. (We no longer recommend +http://article.gmane.org/gmane.comp.version-control.git/45014[Cogito].) -http://kernel.org/pub/software/scm/git/[The GIT core]:: - This is a set of lowlevel tools able of accessing and modifying - a GIT tree. Pick the most recent version. +First, get yourself a copy of the ELinks repository by doing: -http://kernel.org/pub/software/scm/cogito/[The Cogito tools]:: - Which is a set of bash scripts layered on top of the GIT core with the - aim of making interacting with GIT trees more pleasent. - Pick the most recent version. + % git clone http://repo.or.cz/r/elinks.git + % cd elinks -In the following we will only focus on getting the most recent version of the -stable and unstable trees. See -http://kernel.org/pub/software/scm/cogito/docs/introduction.html[the Cogito introduction] -or http://kernel.org/pub/software/scm/cogito/docs/[the Cogito manpages]. -for information on doing more advanced things with Cogito. +(If the operation hangs or fails, try also cloning from +`git://repo.or.cz/elinks.git` or `http://elinks.cz/elinks.git`. +However, your firewall may block the GIT protocol, and cloning +from elinks.cz takes much longer. You can add more sources with +`git remote add` after you have the clone.) -You can get the latest *unstable* development version by doing: +////////////////////////////////////////////////////////////////////// + real user sys +http://repo.or.cz/r/elinks.git 5m35.358s 0m21.649s 0m6.060s +http://repo.or.cz/r/elinks.git 7m53.854s 0m21.201s 0m6.164s +git://repo.or.cz/elinks.git 7m17.302s 0m14.073s 0m1.872s +git://repo.or.cz/elinks.git 8m3.286s 0m14.029s 0m1.836s +http://elinks.cz/elinks.git 15m28.878s 0m24.250s 0m14.489s +http://elinks.cz/elinks.git 15m39.615s 0m24.738s 0m14.589s +////////////////////////////////////////////////////////////////////// - % cg clone http://elinks.cz/elinks.git - % cd elinks +You now have a working copy of the local ``master'' branch, which is +tracking the remote ``origin/master'' branch, where the unstable +version of ELinks is kept. If you want to use some other remote +branch, e.g. ``origin/elinks-0.12'', create a corresponding local +branch with this command: -You can also get the latest *stable* development version via GIT. Note that -development in the stable branch is more slow and mostly involves backporting -of bug fixes. Just do this: + % git checkout --track -b elinks-0.12 origin/elinks-0.12 - % cg clone http://elinks.cz/elinks.git#{stable-branch} {stable-branch} - % cd {stable-branch} +You can get a list of remote branches with `git branch -r`, +`git remote show origin`, or `git ls-remote --heads origin`. +The following branches are known to exist: -There may also be some other branches for separate development of some larger -experimental features etc. The old CVS history is available in a separate -archive that can be grafted onto either the stable or unstable tree by simply -running the following command in the cloned ELinks repository: +master:: + The unstable version. As of August 2007, this is ELinks + 0.13.GIT, but few commits are made directly here; instead, + they are made in ``elinks-0.12'' and later merged here. - % sh contrib/grafthistory.sh +elinks-0.12:: + The ELinks 0.12 series. Forked from ``master'' on 2007-04-22. + Bug fixes only, until ELinks 0.12.0 has been released. + +elinks-0.11:: + The ELinks 0.11 series. Mainly bug fixes are made here. + +REL_0_10:: + The ELinks 0.10 series. Unmaintained since 2007-03-17. + +utf8:: + UTF-8 terminal support for ELinks 0.12.GIT. Forked from + ``master'' on 2006-01-14. Was merged back to ``master'' + on 2006-07-21 and is no longer developed separately. + +witekfl:: + Changes to be reviewed and then applied to ``master'' or + ``elinks-0.12''. + +HEAD:: + An alias for the default branch, currently ``master''. + +After you have checked out the right branch, generate the files +that we do not keep in GIT: + + % ./autogen.sh + +And then you can compile ELinks as described on +link:documentation/installation.html[the installation page] +or in the INSTALL file. -Note, it requires `wget(1)` and will download about 80M. + +Keeping up to date +~~~~~~~~~~~~~~~~~~ You can browse http://repo.or.cz/w/elinks.git[the GIT tree] online. You can also browse http://cvsweb.elinks.cz/cvsweb.cgi/elinks/[the old CVS tree]. +As new commits are made, your clone of the ELinks repository will +become out of date. Instead of making a new clone from scratch, +you can quickly update the old one with: + + % git pull + +This command both updates the remote branches (e.g. ``origin/elinks-0.12'') +and merges the changes to your local branch (e.g. ``elinks-0.12''). +You can then compile the new version. It is usually not necessary +to run `./autogen.sh` first. + +Adding more data to the repository gradually leaves more and more +small files in the `.git/objects/??` directories. To compress these +files into a pack so that they take up less disk space, run this: + + % git gc + +To see commits almost in real time, you can join the +link:community.html#irc[#ELinks IRC channel], where the +http://cia.vc/stats/project/ELinks[CIA.vc] bot announces them. +However, it takes a while before the new commit is available +at elinks.cz, and then some more before it is at repo.or.cz. + +The old CVS history is available in a separate archive that can be +grafted onto either the stable or unstable tree by simply running the +following command in the cloned ELinks repository: + + % sh contrib/grafthistory.sh + +Note, it requires `wget(1)` and will download about 80M. + Getting ELinks up and running ----------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available Url : http://linuxfromscratch.org/pipermail/elinks-dev/attachments/20070804/616e8b07/attachment.bin From thomas.adam22 at gmail.com Sat Aug 4 13:31:28 2007 From: thomas.adam22 at gmail.com (Thomas Adam) Date: Sat, 4 Aug 2007 20:31:28 +0100 Subject: [elinks-dev] [PATCH] download.txt: No more Cogito. Describe branches. In-Reply-To: <87y7gr15ac.fsf@Astalo.kon.iki.fi> References: <87y7gr15ac.fsf@Astalo.kon.iki.fi> Message-ID: <18071eea0708041231y16fd7766gba9d304f23732b6c@mail.gmail.com> On 04/08/07, Kalle Olavi Niemitalo wrote: > I am not entirely satisfied with the result. > Can someone with good English or Git skills check this? I discussed this with you on IRC, I remember, but got side-tracked because no one was able to clone the repository properly. This is what you get for using dumb protocols such as HTTP to do the damn transfer. > -You can also get the latest *stable* development version via GIT. Note that > -development in the stable branch is more slow and mostly involves backporting > -of bug fixes. Just do this: > + % git checkout --track -b elinks-0.12 origin/elinks-0.12 Yes, although generally speaking: git-config --global autosetupmerge true before you track a remote branch means that the "--track" option is redundant. -- Thomas Adam From myself at ligesh.com Thu Aug 9 21:15:39 2007 From: myself at ligesh.com (Ligesh) Date: Fri, 10 Aug 2007 08:45:39 +0530 Subject: [elinks-dev] Sponsor development of the key motion. Message-ID: <20070810031539.GA16137@lxlabs.com> Hi, I had requested a specific 2 dimensional keyboard motion some time back. It was like this: the up/down arrows will move straight up and down, and will stop on a line that contains a link anywhere on that line. The up/down arrows will not move right/left at all. They will just stop on a line which contains the link anywhere, even if the exact location of the cursor does not have a link. The right-left would of course move along the links on a single line. The right-left would also wrap-around, so that after the farthest right link, the right button will wrap to the left most link on the left line. But up/down moves only straight. I would like to know if I can sponsor this feature. Also I want to know if I can disable the need to press key while copy/pasting from/to elinks. Thanks a lot in advance. From kon at iki.fi Thu Aug 9 22:30:26 2007 From: kon at iki.fi (Kalle Olavi Niemitalo) Date: Fri, 10 Aug 2007 07:30:26 +0300 Subject: [elinks-dev] disable mouse (was: Sponsor development of the key motion.) In-Reply-To: <20070810031539.GA16137@lxlabs.com> References: <20070810031539.GA16137@lxlabs.com> Message-ID: <874pj82eql.fsf@Astalo.kon.iki.fi> A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available Url : http://linuxfromscratch.org/pipermail/elinks-dev/attachments/20070810/2b6c8675/attachment.bin From myself at ligesh.com Fri Aug 10 00:55:57 2007 From: myself at ligesh.com (myself at ligesh.com) Date: Fri, 10 Aug 2007 12:25:57 +0530 Subject: [elinks-dev] disable mouse (was: Sponsor development of the key motion.) In-Reply-To: <874pj82eql.fsf@Astalo.kon.iki.fi> References: <20070810031539.GA16137@lxlabs.com> <874pj82eql.fsf@Astalo.kon.iki.fi> Message-ID: <20070810065557.GA20889@lxlabs.com> On Fri, Aug 10, 2007 at 07:30:26AM +0300, Kalle Olavi Niemitalo wrote: > Ligesh writes: > > > Also I want to know if I can disable the need to press > > key while copy/pasting from/to elinks. > > It appears the "toggle-mouse" action (not bound to a key by > default) would stop ELinks from requesting mouse events. > However, this works on the master terminal only (the interlink > protocol does not support such a request), the setting cannot > be saved in elinks.conf (but some scripting modules may allow a > startup script to execute the action), and I can't test it now. > > What type of terminal are you using? I am using screen running inside an xterm. Thanks. From fonseca at diku.dk Fri Aug 10 02:11:14 2007 From: fonseca at diku.dk (Jonas Fonseca) Date: Fri, 10 Aug 2007 10:11:14 +0200 Subject: [elinks-dev] disable mouse (was: Sponsor development of the key motion.) In-Reply-To: <874pj82eql.fsf@Astalo.kon.iki.fi> References: <20070810031539.GA16137@lxlabs.com> <874pj82eql.fsf@Astalo.kon.iki.fi> Message-ID: <20070810081114.GA28943@diku.dk> Kalle Olavi Niemitalo wrote Fri, Aug 10, 2007: > Ligesh writes: > > > Also I want to know if I can disable the need to press > > key while copy/pasting from/to elinks. > > It appears the "toggle-mouse" action (not bound to a key by > default) would stop ELinks from requesting mouse events. Or configure ELinks not to support mouse input with --disable-mouse. -- Jonas Fonseca From fonseca at diku.dk Fri Aug 10 05:38:53 2007 From: fonseca at diku.dk (Jonas Fonseca) Date: Fri, 10 Aug 2007 13:38:53 +0200 Subject: [elinks-dev] Sponsor development of the key motion. In-Reply-To: <20070810031539.GA16137@lxlabs.com> References: <20070810031539.GA16137@lxlabs.com> Message-ID: <20070810113853.GB28943@diku.dk> Ligesh wrote Fri, Aug 10, 2007: > > Hi, > > I had requested a specific 2 dimensional keyboard motion some time back. It was like this: the up/down arrows will move straight up and down, and will stop on a line that contains a link anywhere on that line. The up/down arrows will not move right/left at all. They will just stop on a line which contains the link anywhere, even if the exact location of the cursor does not have a link. This should be something like the move-cursor-* actions, right? Try putting this in your elinks.conf and test: bind "main" "up" = "move-cursor-up" bind "main" "down" = "move-cursor-down" > The right-left would of course move along the links on a single line. The right-left would also wrap-around, so that after the farthest right link, the right button will wrap to the left most link on the left line. But up/down moves only straight. bind "main" "right" = "move-link-right" bind "main" "left" = "move-link-left" Almost does what, I think, you want. Unfortunately, it jumps to a random link sometimes. I've never used this feature and the code is a bit "hairy". > I would like to know if I can sponsor this feature. Maybe you could test the patch below, which makes the horizontal navigation "kind-of" work when browsing local directories and could serve as a start. diff --git a/src/viewer/text/link.c b/src/viewer/text/link.c index 175a0ff..715e690 100644 --- a/src/viewer/text/link.c +++ b/src/viewer/text/link.c @@ -615,14 +615,17 @@ next_link_in_dir(struct document_view *doc_view, int dir_x, int dir_y) vs = doc_view->vs; link = get_current_link(doc_view); - if (!link) return 0; + if (link) { + /* Find the link's "bounding box" coordinates. */ - /* Find the link's "bounding box" coordinates. */ + get_link_x_bounds(link, -1, &min_x, &max_x); - get_link_x_bounds(link, -1, &min_x, &max_x); - - min_y = link->points[0].y; - max_y = link->points[link->npoints - 1].y; + min_y = link->points[0].y; + max_y = link->points[link->npoints - 1].y; + } else { + min_x = max_x = doc_view->session->tab->x - doc_view->box.x; + min_y = max_y = doc_view->session->tab->y - doc_view->box.y; + } /* Now go from the bounding box edge in the appropriate * direction and find the nearest link. */ -- Jonas Fonseca From myself at ligesh.com Fri Aug 10 07:04:29 2007 From: myself at ligesh.com (myself at ligesh.com) Date: Fri, 10 Aug 2007 18:34:29 +0530 Subject: [elinks-dev] Sponsor development of the key motion. In-Reply-To: <20070810113853.GB28943@diku.dk> References: <20070810031539.GA16137@lxlabs.com> <20070810113853.GB28943@diku.dk> Message-ID: <20070810130429.GA25470@lxlabs.com> On Fri, Aug 10, 2007 at 01:38:53PM +0200, Jonas Fonseca wrote: > Ligesh wrote Fri, Aug 10, 2007: > > > > Hi, > > > > I had requested a specific 2 dimensional keyboard motion some time back. It was like this: the up/down arrows will move straight up and down, and will stop on a line that contains a link anywhere on that line. The up/down arrows will not move right/left at all. They will just stop on a line which contains the link anywhere, even if the exact location of the cursor does not have a link. > > This should be something like the move-cursor-* actions, right? > > Try putting this in your elinks.conf and test: > > bind "main" "up" = "move-cursor-up" > bind "main" "down" = "move-cursor-down" That won't work at all. It has to skip all the lines that do not contain a link. Otherwise, it is a horrendous chore to move through all the unnecessary lines that do not contain a link. Please note, I have read through elinks extensively. I used use emacs-w3m, which I was able rewrite to get the feature I wanted. I need that exact feature please. I have gone through every available option, and even checked the code, so I don't think you will be able to help me out in any other way other than implement it in code. > > > The right-left would of course move along the links on a single line. The right-left would also wrap-around, so that after the farthest right link, the right button will wrap to the left most link on the left line. But up/down moves only straight. > > bind "main" "right" = "move-link-right" > bind "main" "left" = "move-link-left" > > Almost does what, I think, you want. Unfortunately, it jumps to > a random link sometimes. I've never used this feature and the > code is a bit "hairy". I am using the above now. The only problem is that move-link-right doesn't wrap around to the next line. > I had written >>>> the right button will wrap to the left most link on the left line. There was a small typo in my ealier post. What I meant was "wrap to the left most link on the NEXT line ". Thanks. From witekfl at poczta.onet.pl Fri Aug 10 11:53:41 2007 From: witekfl at poczta.onet.pl (Witold Filipczyk) Date: Fri, 10 Aug 2007 19:53:41 +0200 Subject: [elinks-dev] Sponsor development of the key motion. In-Reply-To: <20070810130429.GA25470@lxlabs.com> References: <20070810031539.GA16137@lxlabs.com> <20070810113853.GB28943@diku.dk> <20070810130429.GA25470@lxlabs.com> Message-ID: <20070810175341.GA17668@pldmachine> Use this patch: diff --git a/src/document/renderer.c b/src/document/renderer.c index 90fcc80..8b80d73 100644 --- a/src/document/renderer.c +++ b/src/document/renderer.c @@ -499,6 +499,7 @@ render_document_frames(struct session *ses, int no_cache) } } +#if 0 static int comp_links(struct link *l1, struct link *l2) { @@ -506,6 +507,20 @@ comp_links(struct link *l1, struct link *l2) if_assert_failed return 0; return (l1->number - l2->number); } +#endif + +static int +comp_links(struct link *l1, struct link *l2) +{ + int res; + + assert(l1 && l2 && l1->points && l2->points); + if_assert_failed return 0; + res = l1->points[0].y - l2->points[0].y; + if (res) + return res; + return l1->points[0].x - l2->points[0].x; +} void sort_links(struct document *document) and these keybindings: bind "main" "up" = "move-link-up" bind "main" "down" = "move-link-down" bind "main" "left" = "move-link-prev" bind "main" "right" = "move-link-next" You pay 5$ :) From myself at ligesh.com Fri Aug 10 13:22:20 2007 From: myself at ligesh.com (myself at ligesh.com) Date: Sat, 11 Aug 2007 00:52:20 +0530 Subject: [elinks-dev] Sponsor development of the key motion. In-Reply-To: <20070810175341.GA17668@pldmachine> References: <20070810031539.GA16137@lxlabs.com> <20070810113853.GB28943@diku.dk> <20070810130429.GA25470@lxlabs.com> <20070810175341.GA17668@pldmachine> Message-ID: <20070810192220.GA641@lxlabs.com> Applied and compiled. didn't work. I can contribute at least $150 for a proper implementation of this feature. It should work exactly like have explained. up/down arrows go up/down and will not move right/left. They will skip all the lines that do not contain a link. And they will stop on a line that contains a link, even if the actual location that the cursor is in doesn't have a link. THanks. On Fri, Aug 10, 2007 at 07:53:41PM +0200, Witold Filipczyk wrote: > Use this patch: > diff --git a/src/document/renderer.c b/src/document/renderer.c > index 90fcc80..8b80d73 100644 > --- a/src/document/renderer.c > +++ b/src/document/renderer.c > @@ -499,6 +499,7 @@ render_document_frames(struct session *ses, int no_cache) > } > } > > +#if 0 > static int > comp_links(struct link *l1, struct link *l2) > { > @@ -506,6 +507,20 @@ comp_links(struct link *l1, struct link *l2) > if_assert_failed return 0; > return (l1->number - l2->number); > } > +#endif > + > +static int > +comp_links(struct link *l1, struct link *l2) > +{ > + int res; > + > + assert(l1 && l2 && l1->points && l2->points); > + if_assert_failed return 0; > + res = l1->points[0].y - l2->points[0].y; > + if (res) > + return res; > + return l1->points[0].x - l2->points[0].x; > +} > > void > sort_links(struct document *document) > > > and these keybindings: > > bind "main" "up" = "move-link-up" > bind "main" "down" = "move-link-down" > bind "main" "left" = "move-link-prev" > bind "main" "right" = "move-link-next" > > You pay 5$ :) > _______________________________________________ > elinks-dev mailing list > elinks-dev at linuxfromscratch.org > http://linuxfromscratch.org/mailman/listinfo/elinks-dev From witekfl at poczta.onet.pl Sat Aug 11 15:10:52 2007 From: witekfl at poczta.onet.pl (Witold Filipczyk) Date: Sat, 11 Aug 2007 23:10:52 +0200 Subject: [elinks-dev] Sponsor development of the key motion. In-Reply-To: <20070810192220.GA641@lxlabs.com> References: <20070810031539.GA16137@lxlabs.com> <20070810113853.GB28943@diku.dk> <20070810130429.GA25470@lxlabs.com> <20070810175341.GA17668@pldmachine> <20070810192220.GA641@lxlabs.com> Message-ID: <20070811211052.GA14978@pldmachine> Use the patch from the attachment for ELinks-0.12.GIT. I hope it works as expected. I have no write permission to the main branch, so you must ask someone to commit it. -- Witek -------------- next part -------------- viewer: Added new four actions requested by Ligesh. move-link-down-line moves the cursor down to the line with a link. move-link-up-line moves the cursor up to the line with a link. move-link-prev-line moves to the previous link horizontally. move-link-next-line moves to the next link horizontally. --- commit 7882384bce49ab8d09e4c6d7a4b7b0eb0c945797 tree a8b3e69e402f3f5fe74f4676e196d5af83f9d536 parent ee83dca303963e26f5811fab895283e2e70cd2b9 author Witold Filipczyk Sat, 11 Aug 2007 23:06:10 +0200 committer Witold Filipczyk Sat, 11 Aug 2007 23:06:10 +0200 src/config/actions-main.inc | 4 + src/viewer/action.c | 16 ++++++ src/viewer/text/link.c | 2 - src/viewer/text/link.h | 3 + src/viewer/text/view.c | 120 +++++++++++++++++++++++++++++++++++++++++++ src/viewer/text/view.h | 7 +++ 6 files changed, 150 insertions(+), 2 deletions(-) diff --git a/src/config/actions-main.inc b/src/config/actions-main.inc index 939943d..a62adcd 100644 --- a/src/config/actions-main.inc +++ b/src/config/actions-main.inc @@ -59,11 +59,15 @@ ACTION_(MAIN, "move-cursor-up", MOVE_CURSOR_UP, N__("Move cursor up"), ACTION_RE 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-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), +ACTION_(MAIN, "move-link-left-line", MOVE_LINK_LEFT_LINE, N__("Move one link left or to the previous link"), ACTION_REQUIRE_VIEW_STATE), ACTION_(MAIN, "move-link-next", MOVE_LINK_NEXT, N__("Move to the next link"), ACTION_REQUIRE_VIEW_STATE), ACTION_(MAIN, "move-link-prev", MOVE_LINK_PREV, N__("Move to the previous link"), ACTION_REQUIRE_VIEW_STATE), ACTION_(MAIN, "move-link-right", MOVE_LINK_RIGHT, N__("Move one link right"), ACTION_REQUIRE_VIEW_STATE), +ACTION_(MAIN, "move-link-right-line", MOVE_LINK_RIGHT_LINE, N__("Move one link right or to the next link"), ACTION_REQUIRE_VIEW_STATE), 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-page-up", MOVE_PAGE_UP, N__("Move upwards by 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), diff --git a/src/viewer/action.c b/src/viewer/action.c index 662dd50..4ebc99b 100644 --- a/src/viewer/action.c +++ b/src/viewer/action.c @@ -361,10 +361,18 @@ do_action(struct session *ses, enum main_action action_id, int verbose) status = move_link_down(ses, doc_view); break; + case ACT_MAIN_MOVE_LINK_DOWN_LINE: + status = move_link_down_line(ses, doc_view); + break; + case ACT_MAIN_MOVE_LINK_LEFT: status = move_link_left(ses, doc_view); break; + case ACT_MAIN_MOVE_LINK_LEFT_LINE: + status = move_link_prev_line(ses, doc_view); + break; + case ACT_MAIN_MOVE_LINK_NEXT: status = move_link_next(ses, doc_view); break; @@ -377,10 +385,18 @@ do_action(struct session *ses, enum main_action action_id, int verbose) status = move_link_right(ses, doc_view); break; + case ACT_MAIN_MOVE_LINK_RIGHT_LINE: + status = move_link_next_line(ses, doc_view); + break; + case ACT_MAIN_MOVE_LINK_UP: status = move_link_up(ses, doc_view); break; + case ACT_MAIN_MOVE_LINK_UP_LINE: + status = move_link_up_line(ses, doc_view); + break; + case ACT_MAIN_MOVE_PAGE_DOWN: status = move_page_down(ses, doc_view); break; diff --git a/src/viewer/text/link.c b/src/viewer/text/link.c index 48adf91..30e1734 100644 --- a/src/viewer/text/link.c +++ b/src/viewer/text/link.c @@ -552,7 +552,7 @@ next_link_in_view_y(struct document_view *doc_view, int current, int direction) /** Get the bounding columns of @a link at line @a y (or all lines if * @a y == -1). */ -static void +void get_link_x_bounds(struct link *link, int y, int *min_x, int *max_x) { int point; diff --git a/src/viewer/text/link.h b/src/viewer/text/link.h index 1e20434..a3ffe2e 100644 --- a/src/viewer/text/link.h +++ b/src/viewer/text/link.h @@ -45,11 +45,14 @@ int current_link_is_visible(struct document_view *doc_view); int next_link_in_view(struct document_view *doc_view, int current, int direction); int next_link_in_view_y(struct document_view *doc_view, int current, int direction); int next_link_in_dir(struct document_view *doc_view, int dir_x, int dir_y); +int next_link_vertical(struct session *ses, struct document_view *doc_view, int dir_y); void jump_to_link_number(struct session *ses, struct document_view *doc_view, int); struct link *goto_current_link(struct session *ses, struct document_view *, int); void goto_link_number(struct session *ses, unsigned char *num); +void get_link_x_bounds(struct link *link, int y, int *min_x, int *max_x); + /* Bruteforce compilation fixes */ enum frame_event_status enter(struct session *ses, struct document_view *doc_view, int do_reload); diff --git a/src/viewer/text/view.c b/src/viewer/text/view.c index 238ca2e..c985c5d 100644 --- a/src/viewer/text/view.c +++ b/src/viewer/text/view.c @@ -61,6 +61,7 @@ #include "viewer/text/vs.h" +static enum frame_event_status move_cursor_rel(struct session *ses, struct document_view *view, int rx, int ry); void detach_formatted(struct document_view *doc_view) @@ -164,6 +165,91 @@ move_page_up(struct session *ses, struct document_view *doc_view) } enum frame_event_status +move_link_prev_line(struct session *ses, struct document_view *doc_view) +{ + struct view_state *vs; + struct document *document; + struct link *link, *last = NULL; + int y1, y, min_x, max_x, x1; + + assert(ses && doc_view && doc_view->vs && doc_view->document); + if_assert_failed return FRAME_EVENT_OK; + + vs = doc_view->vs; + document = doc_view->document; + if (!document->lines1) return FRAME_EVENT_OK; + + y = y1 = vs->y + ses->tab->y - ses->status.show_title_bar + - (ses->status.show_tabs_bar && ses->status.show_tabs_bar_at_top); + x1 = vs->x + ses->tab->x; + + link = get_current_link(doc_view); + if (link) { + get_link_x_bounds(link, y1, &min_x, &max_x); + } else { + min_x = max_x = x1; + int_upper_bound(&y, document->height - 1); + } + + for (; y >= 0; y--, min_x = INT_MAX) { + link = document->lines1[y]; + if (!link) continue; + for (; link <= document->lines2[y]; link++) { + if (link->points[0].y != y) continue; + if (link->points[0].x >= min_x) continue; + if (!last) last = link; + else if (link->points[0].x > last->points[0].x) last = link; + } + if (last) + return move_cursor_rel(ses, doc_view, last->points[0].x - x1, last->points[0].y - y1); + } + return FRAME_EVENT_OK; +} + + +enum frame_event_status +move_link_next_line(struct session *ses, struct document_view *doc_view) +{ + struct view_state *vs; + struct document *document; + struct link *link, *last = NULL; + int y1, y, min_x, max_x, x1; + + assert(ses && doc_view && doc_view->vs && doc_view->document); + if_assert_failed return FRAME_EVENT_OK; + + vs = doc_view->vs; + document = doc_view->document; + if (!document->lines1) return FRAME_EVENT_OK; + + y = y1 = vs->y + ses->tab->y - ses->status.show_title_bar + - (ses->status.show_tabs_bar && ses->status.show_tabs_bar_at_top); + x1 = vs->x + ses->tab->x; + + link = get_current_link(doc_view); + if (link) { + get_link_x_bounds(link, y1, &min_x, &max_x); + } else { + min_x = max_x = x1; + int_upper_bound(&y, document->height - 1); + } + + for (; y < document->height; y++, min_x = -1) { + link = document->lines1[y]; + if (!link) continue; + for (; link <= document->lines2[y]; link++) { + if (link->points[0].y != y) continue; + if (link->points[0].x <= min_x) continue; + if (!last) last = link; + else if (link->points[0].x < last->points[0].x) last = link; + } + if (last) + return move_cursor_rel(ses, doc_view, last->points[0].x - x1, last->points[0].y - y1); + } + return FRAME_EVENT_OK; +} + +enum frame_event_status move_link(struct session *ses, struct document_view *doc_view, int direction, int wraparound_bound, int wraparound_link) { @@ -555,7 +641,7 @@ move_cursor(struct session *ses, struct document_view *doc_view, int x, int y) return status; } -enum frame_event_status +static enum frame_event_status move_cursor_rel(struct session *ses, struct document_view *view, int rx, int ry) { @@ -593,6 +679,38 @@ move_cursor_down(struct session *ses, struct document_view *view) return move_cursor_rel(ses, view, 0, 1); } +enum frame_event_status +move_link_vertical(struct session *ses, struct document_view *doc_view, int dir_y) +{ + struct document *document; + struct view_state *vs; + int y, y1; + + assert(ses && doc_view && doc_view->vs && doc_view->document); + if_assert_failed return FRAME_EVENT_OK; + vs = doc_view->vs; + document = doc_view->document; + if (!document->lines1) return FRAME_EVENT_OK; + + y1 = vs->y + ses->tab->y - ses->status.show_status_bar + - (ses->status.show_tabs_bar && ses->status.show_tabs_bar_at_top); + y = y1 + dir_y; + if (dir_y < 0) + int_upper_bound(&y, document->height - 1); + else + int_lower_bound(&y, 0); + for (; dir_y > 0 ? y < document->height : y >= 0; y += dir_y) { + struct link *link = document->lines1[y]; + + if (!link) continue; + for (; link <= document->lines2[y]; link++) { + if (link->points[0].y == y) { + return move_cursor_rel(ses, doc_view, 0, y - y1); + } + } + } + return FRAME_EVENT_OK; +} enum frame_event_status copy_current_link_to_clipboard(struct session *ses, diff --git a/src/viewer/text/view.h b/src/viewer/text/view.h index e87fae6..ad9049b 100644 --- a/src/viewer/text/view.h +++ b/src/viewer/text/view.h @@ -30,6 +30,13 @@ enum frame_event_status move_link_dir(struct session *ses, struct document_view #define move_link_left(ses, doc_view) move_link_dir(ses, doc_view, -1, 0) #define move_link_right(ses, doc_view) move_link_dir(ses, doc_view, 1, 0) +enum frame_event_status move_link_prev_line(struct session *ses, struct document_view *doc_view); +enum frame_event_status move_link_next_line(struct session *ses, struct document_view *doc_view); +enum frame_event_status move_link_vertical(struct session *ses, struct document_view *doc_view, int dir_y); + +#define move_link_up_line(ses, doc_view) move_link_vertical(ses, doc_view, -1) +#define move_link_down_line(ses, doc_view) move_link_vertical(ses, doc_view, 1) + enum frame_event_status scroll_up(struct session *ses, struct document_view *doc_view); enum frame_event_status scroll_down(struct session *ses, struct document_view *doc_view); enum frame_event_status scroll_left(struct session *ses, struct document_view *doc_view); From myself at ligesh.com Sat Aug 11 20:05:37 2007 From: myself at ligesh.com (Ligesh) Date: Sun, 12 Aug 2007 07:35:37 +0530 Subject: [elinks-dev] Sponsor development of the key motion. In-Reply-To: <20070811211052.GA14978@pldmachine> References: <20070810031539.GA16137@lxlabs.com> <20070810113853.GB28943@diku.dk> <20070810130429.GA25470@lxlabs.com> <20070810175341.GA17668@pldmachine> <20070810192220.GA641@lxlabs.com> <20070811211052.GA14978@pldmachine> Message-ID: <20070812020537.GA26292@lxlabs.com> Thanks for the patch. Works great. I have a new problem though. I updated my elinks from the git and now the alt-keys does not work. If I run my old elinks, all the alt-key commands work fine, but not with the new one. Also, please send me your paypal billing at myself at ligesh.com. Can you also implement a key to take the cursor to the start of line. Like you have in VIM with '0'. Press 0 and the cursor moves to the start of line. DOes this already exist in Elinks? Thanks. On Sat, Aug 11, 2007 at 11:10:52PM +0200, Witold Filipczyk wrote: > Use the patch from the attachment for ELinks-0.12.GIT. I hope it works as expected. > I have no write permission to the main branch, so you must ask someone to commit it. > -- > Witek > viewer: Added new four actions requested by Ligesh. > > move-link-down-line moves the cursor down to the line with a link. > move-link-up-line moves the cursor up to the line with a link. > move-link-prev-line moves to the previous link horizontally. > move-link-next-line moves to the next link horizontally. > > --- > commit 7882384bce49ab8d09e4c6d7a4b7b0eb0c945797 > tree a8b3e69e402f3f5fe74f4676e196d5af83f9d536 > parent ee83dca303963e26f5811fab895283e2e70cd2b9 > author Witold Filipczyk Sat, 11 Aug 2007 23:06:10 +0200 > committer Witold Filipczyk Sat, 11 Aug 2007 23:06:10 +0200 > > src/config/actions-main.inc | 4 + > src/viewer/action.c | 16 ++++++ > src/viewer/text/link.c | 2 - > src/viewer/text/link.h | 3 + > src/viewer/text/view.c | 120 +++++++++++++++++++++++++++++++++++++++++++ > src/viewer/text/view.h | 7 +++ > 6 files changed, 150 insertions(+), 2 deletions(-) > > diff --git a/src/config/actions-main.inc b/src/config/actions-main.inc > index 939943d..a62adcd 100644 > --- a/src/config/actions-main.inc > +++ b/src/config/actions-main.inc > @@ -59,11 +59,15 @@ ACTION_(MAIN, "move-cursor-up", MOVE_CURSOR_UP, N__("Move cursor up"), ACTION_RE > 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-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), > +ACTION_(MAIN, "move-link-left-line", MOVE_LINK_LEFT_LINE, N__("Move one link left or to the previous link"), ACTION_REQUIRE_VIEW_STATE), > ACTION_(MAIN, "move-link-next", MOVE_LINK_NEXT, N__("Move to the next link"), ACTION_REQUIRE_VIEW_STATE), > ACTION_(MAIN, "move-link-prev", MOVE_LINK_PREV, N__("Move to the previous link"), ACTION_REQUIRE_VIEW_STATE), > ACTION_(MAIN, "move-link-right", MOVE_LINK_RIGHT, N__("Move one link right"), ACTION_REQUIRE_VIEW_STATE), > +ACTION_(MAIN, "move-link-right-line", MOVE_LINK_RIGHT_LINE, N__("Move one link right or to the next link"), ACTION_REQUIRE_VIEW_STATE), > 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-page-up", MOVE_PAGE_UP, N__("Move upwards by 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), > diff --git a/src/viewer/action.c b/src/viewer/action.c > index 662dd50..4ebc99b 100644 > --- a/src/viewer/action.c > +++ b/src/viewer/action.c > @@ -361,10 +361,18 @@ do_action(struct session *ses, enum main_action action_id, int verbose) > status = move_link_down(ses, doc_view); > break; > > + case ACT_MAIN_MOVE_LINK_DOWN_LINE: > + status = move_link_down_line(ses, doc_view); > + break; > + > case ACT_MAIN_MOVE_LINK_LEFT: > status = move_link_left(ses, doc_view); > break; > > + case ACT_MAIN_MOVE_LINK_LEFT_LINE: > + status = move_link_prev_line(ses, doc_view); > + break; > + > case ACT_MAIN_MOVE_LINK_NEXT: > status = move_link_next(ses, doc_view); > break; > @@ -377,10 +385,18 @@ do_action(struct session *ses, enum main_action action_id, int verbose) > status = move_link_right(ses, doc_view); > break; > > + case ACT_MAIN_MOVE_LINK_RIGHT_LINE: > + status = move_link_next_line(ses, doc_view); > + break; > + > case ACT_MAIN_MOVE_LINK_UP: > status = move_link_up(ses, doc_view); > break; > > + case ACT_MAIN_MOVE_LINK_UP_LINE: > + status = move_link_up_line(ses, doc_view); > + break; > + > case ACT_MAIN_MOVE_PAGE_DOWN: > status = move_page_down(ses, doc_view); > break; > diff --git a/src/viewer/text/link.c b/src/viewer/text/link.c > index 48adf91..30e1734 100644 > --- a/src/viewer/text/link.c > +++ b/src/viewer/text/link.c > @@ -552,7 +552,7 @@ next_link_in_view_y(struct document_view *doc_view, int current, int direction) > > /** Get the bounding columns of @a link at line @a y (or all lines if > * @a y == -1). */ > -static void > +void > get_link_x_bounds(struct link *link, int y, int *min_x, int *max_x) > { > int point; > diff --git a/src/viewer/text/link.h b/src/viewer/text/link.h > index 1e20434..a3ffe2e 100644 > --- a/src/viewer/text/link.h > +++ b/src/viewer/text/link.h > @@ -45,11 +45,14 @@ int current_link_is_visible(struct document_view *doc_view); > int next_link_in_view(struct document_view *doc_view, int current, int direction); > int next_link_in_view_y(struct document_view *doc_view, int current, int direction); > int next_link_in_dir(struct document_view *doc_view, int dir_x, int dir_y); > +int next_link_vertical(struct session *ses, struct document_view *doc_view, int dir_y); > > void jump_to_link_number(struct session *ses, struct document_view *doc_view, int); > > struct link *goto_current_link(struct session *ses, struct document_view *, int); > void goto_link_number(struct session *ses, unsigned char *num); > +void get_link_x_bounds(struct link *link, int y, int *min_x, int *max_x); > + > > /* Bruteforce compilation fixes */ > enum frame_event_status enter(struct session *ses, struct document_view *doc_view, int do_reload); > diff --git a/src/viewer/text/view.c b/src/viewer/text/view.c > index 238ca2e..c985c5d 100644 > --- a/src/viewer/text/view.c > +++ b/src/viewer/text/view.c > @@ -61,6 +61,7 @@ > #include "viewer/text/vs.h" > > > +static enum frame_event_status move_cursor_rel(struct session *ses, struct document_view *view, int rx, int ry); > > void > detach_formatted(struct document_view *doc_view) > @@ -164,6 +165,91 @@ move_page_up(struct session *ses, struct document_view *doc_view) > } > > enum frame_event_status > +move_link_prev_line(struct session *ses, struct document_view *doc_view) > +{ > + struct view_state *vs; > + struct document *document; > + struct link *link, *last = NULL; > + int y1, y, min_x, max_x, x1; > + > + assert(ses && doc_view && doc_view->vs && doc_view->document); > + if_assert_failed return FRAME_EVENT_OK; > + > + vs = doc_view->vs; > + document = doc_view->document; > + if (!document->lines1) return FRAME_EVENT_OK; > + > + y = y1 = vs->y + ses->tab->y - ses->status.show_title_bar > + - (ses->status.show_tabs_bar && ses->status.show_tabs_bar_at_top); > + x1 = vs->x + ses->tab->x; > + > + link = get_current_link(doc_view); > + if (link) { > + get_link_x_bounds(link, y1, &min_x, &max_x); > + } else { > + min_x = max_x = x1; > + int_upper_bound(&y, document->height - 1); > + } > + > + for (; y >= 0; y--, min_x = INT_MAX) { > + link = document->lines1[y]; > + if (!link) continue; > + for (; link <= document->lines2[y]; link++) { > + if (link->points[0].y != y) continue; > + if (link->points[0].x >= min_x) continue; > + if (!last) last = link; > + else if (link->points[0].x > last->points[0].x) last = link; > + } > + if (last) > + return move_cursor_rel(ses, doc_view, last->points[0].x - x1, last->points[0].y - y1); > + } > + return FRAME_EVENT_OK; > +} > + > + > +enum frame_event_status > +move_link_next_line(struct session *ses, struct document_view *doc_view) > +{ > + struct view_state *vs; > + struct document *document; > + struct link *link, *last = NULL; > + int y1, y, min_x, max_x, x1; > + > + assert(ses && doc_view && doc_view->vs && doc_view->document); > + if_assert_failed return FRAME_EVENT_OK; > + > + vs = doc_view->vs; > + document = doc_view->document; > + if (!document->lines1) return FRAME_EVENT_OK; > + > + y = y1 = vs->y + ses->tab->y - ses->status.show_title_bar > + - (ses->status.show_tabs_bar && ses->status.show_tabs_bar_at_top); > + x1 = vs->x + ses->tab->x; > + > + link = get_current_link(doc_view); > + if (link) { > + get_link_x_bounds(link, y1, &min_x, &max_x); > + } else { > + min_x = max_x = x1; > + int_upper_bound(&y, document->height - 1); > + } > + > + for (; y < document->height; y++, min_x = -1) { > + link = document->lines1[y]; > + if (!link) continue; > + for (; link <= document->lines2[y]; link++) { > + if (link->points[0].y != y) continue; > + if (link->points[0].x <= min_x) continue; > + if (!last) last = link; > + else if (link->points[0].x < last->points[0].x) last = link; > + } > + if (last) > + return move_cursor_rel(ses, doc_view, last->points[0].x - x1, last->points[0].y - y1); > + } > + return FRAME_EVENT_OK; > +} > + > +enum frame_event_status > move_link(struct session *ses, struct document_view *doc_view, int direction, > int wraparound_bound, int wraparound_link) > { > @@ -555,7 +641,7 @@ move_cursor(struct session *ses, struct document_view *doc_view, int x, int y) > return status; > } > > -enum frame_event_status > +static enum frame_event_status > move_cursor_rel(struct session *ses, struct document_view *view, > int rx, int ry) > { > @@ -593,6 +679,38 @@ move_cursor_down(struct session *ses, struct document_view *view) > return move_cursor_rel(ses, view, 0, 1); > } > > +enum frame_event_status > +move_link_vertical(struct session *ses, struct document_view *doc_view, int dir_y) > +{ > + struct document *document; > + struct view_state *vs; > + int y, y1; > + > + assert(ses && doc_view && doc_view->vs && doc_view->document); > + if_assert_failed return FRAME_EVENT_OK; > + vs = doc_view->vs; > + document = doc_view->document; > + if (!document->lines1) return FRAME_EVENT_OK; > + > + y1 = vs->y + ses->tab->y - ses->status.show_status_bar > + - (ses->status.show_tabs_bar && ses->status.show_tabs_bar_at_top); > + y = y1 + dir_y; > + if (dir_y < 0) > + int_upper_bound(&y, document->height - 1); > + else > + int_lower_bound(&y, 0); > + for (; dir_y > 0 ? y < document->height : y >= 0; y += dir_y) { > + struct link *link = document->lines1[y]; > + > + if (!link) continue; > + for (; link <= document->lines2[y]; link++) { > + if (link->points[0].y == y) { > + return move_cursor_rel(ses, doc_view, 0, y - y1); > + } > + } > + } > + return FRAME_EVENT_OK; > +} > > enum frame_event_status > copy_current_link_to_clipboard(struct session *ses, > diff --git a/src/viewer/text/view.h b/src/viewer/text/view.h > index e87fae6..ad9049b 100644 > --- a/src/viewer/text/view.h > +++ b/src/viewer/text/view.h > @@ -30,6 +30,13 @@ enum frame_event_status move_link_dir(struct session *ses, struct document_view > #define move_link_left(ses, doc_view) move_link_dir(ses, doc_view, -1, 0) > #define move_link_right(ses, doc_view) move_link_dir(ses, doc_view, 1, 0) > > +enum frame_event_status move_link_prev_line(struct session *ses, struct document_view *doc_view); > +enum frame_event_status move_link_next_line(struct session *ses, struct document_view *doc_view); > +enum frame_event_status move_link_vertical(struct session *ses, struct document_view *doc_view, int dir_y); > + > +#define move_link_up_line(ses, doc_view) move_link_vertical(ses, doc_view, -1) > +#define move_link_down_line(ses, doc_view) move_link_vertical(ses, doc_view, 1) > + > enum frame_event_status scroll_up(struct session *ses, struct document_view *doc_view); > enum frame_event_status scroll_down(struct session *ses, struct document_view *doc_view); > enum frame_event_status scroll_left(struct session *ses, struct document_view *doc_view); > _______________________________________________ > elinks-dev mailing list > elinks-dev at linuxfromscratch.org > http://linuxfromscratch.org/mailman/listinfo/elinks-dev From myself at ligesh.com Sat Aug 11 22:31:43 2007 From: myself at ligesh.com (Ligesh) Date: Sun, 12 Aug 2007 10:01:43 +0530 Subject: [elinks-dev] Sponsor development of the key motion. In-Reply-To: <20070812020537.GA26292@lxlabs.com> References: <20070810031539.GA16137@lxlabs.com> <20070810113853.GB28943@diku.dk> <20070810130429.GA25470@lxlabs.com> <20070810175341.GA17668@pldmachine> <20070810192220.GA641@lxlabs.com> <20070811211052.GA14978@pldmachine> <20070812020537.GA26292@lxlabs.com> Message-ID: <20070812043143.GA30961@lxlabs.com> OK. It seems the problem was with charset. I changed the charset from System to iso-8859, and the meta characters also works fine. There is one issue left. If I move from one page to another, the cursor position doest change at all, and it feels kind of a like a zombie. The cursor should get positioned at the top or the actual position where I left it on the page right? instead, if I move from one page to another, the cursor stays exactly at the same geometrical location. It could be owing to the newly added feature. Also, everyone please check out this key motion. You will never need anything else. It will never get stuck at anything either. This is the most efficient and also the one with absolutely no limitations. Thanks. On Sun, Aug 12, 2007 at 07:35:37AM +0530, Ligesh wrote: > Thanks for the patch. Works great. I have a new problem though. I updated my elinks from the git and now the alt-keys does not work. If I run my old elinks, all the alt-key commands work fine, but not with the new one. Also, please send me your paypal billing at myself at ligesh.com. > > Can you also implement a key to take the cursor to the start of line. Like you have in VIM with '0'. Press 0 and the cursor moves to the start of line. DOes this already exist in Elinks? > > Thanks. > > On Sat, Aug 11, 2007 at 11:10:52PM +0200, Witold Filipczyk wrote: > > Use the patch from the attachment for ELinks-0.12.GIT. I hope it works as expected. > > I have no write permission to the main branch, so you must ask someone to commit it. > > -- > > Witek > > > viewer: Added new four actions requested by Ligesh. > > > > move-link-down-line moves the cursor down to the line with a link. > > move-link-up-line moves the cursor up to the line with a link. > > move-link-prev-line moves to the previous link horizontally. > > move-link-next-line moves to the next link horizontally. > > > > --- > > commit 7882384bce49ab8d09e4c6d7a4b7b0eb0c945797 > > tree a8b3e69e402f3f5fe74f4676e196d5af83f9d536 > > parent ee83dca303963e26f5811fab895283e2e70cd2b9 > > author Witold Filipczyk Sat, 11 Aug 2007 23:06:10 +0200 > > committer Witold Filipczyk Sat, 11 Aug 2007 23:06:10 +0200 > > > > src/config/actions-main.inc | 4 + > > src/viewer/action.c | 16 ++++++ > > src/viewer/text/link.c | 2 - > > src/viewer/text/link.h | 3 + > > src/viewer/text/view.c | 120 +++++++++++++++++++++++++++++++++++++++++++ > > src/viewer/text/view.h | 7 +++ > > 6 files changed, 150 insertions(+), 2 deletions(-) > > > > diff --git a/src/config/actions-main.inc b/src/config/actions-main.inc > > index 939943d..a62adcd 100644 > > --- a/src/config/actions-main.inc > > +++ b/src/config/actions-main.inc > > @@ -59,11 +59,15 @@ ACTION_(MAIN, "move-cursor-up", MOVE_CURSOR_UP, N__("Move cursor up"), ACTION_RE > > 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-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), > > +ACTION_(MAIN, "move-link-left-line", MOVE_LINK_LEFT_LINE, N__("Move one link left or to the previous link"), ACTION_REQUIRE_VIEW_STATE), > > ACTION_(MAIN, "move-link-next", MOVE_LINK_NEXT, N__("Move to the next link"), ACTION_REQUIRE_VIEW_STATE), > > ACTION_(MAIN, "move-link-prev", MOVE_LINK_PREV, N__("Move to the previous link"), ACTION_REQUIRE_VIEW_STATE), > > ACTION_(MAIN, "move-link-right", MOVE_LINK_RIGHT, N__("Move one link right"), ACTION_REQUIRE_VIEW_STATE), > > +ACTION_(MAIN, "move-link-right-line", MOVE_LINK_RIGHT_LINE, N__("Move one link right or to the next link"), ACTION_REQUIRE_VIEW_STATE), > > 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-page-up", MOVE_PAGE_UP, N__("Move upwards by 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), > > diff --git a/src/viewer/action.c b/src/viewer/action.c > > index 662dd50..4ebc99b 100644 > > --- a/src/viewer/action.c > > +++ b/src/viewer/action.c > > @@ -361,10 +361,18 @@ do_action(struct session *ses, enum main_action action_id, int verbose) > > status = move_link_down(ses, doc_view); > > break; > > > > + case ACT_MAIN_MOVE_LINK_DOWN_LINE: > > + status = move_link_down_line(ses, doc_view); > > + break; > > + > > case ACT_MAIN_MOVE_LINK_LEFT: > > status = move_link_left(ses, doc_view); > > break; > > > > + case ACT_MAIN_MOVE_LINK_LEFT_LINE: > > + status = move_link_prev_line(ses, doc_view); > > + break; > > + > > case ACT_MAIN_MOVE_LINK_NEXT: > > status = move_link_next(ses, doc_view); > > break; > > @@ -377,10 +385,18 @@ do_action(struct session *ses, enum main_action action_id, int verbose) > > status = move_link_right(ses, doc_view); > > break; > > > > + case ACT_MAIN_MOVE_LINK_RIGHT_LINE: > > + status = move_link_next_line(ses, doc_view); > > + break; > > + > > case ACT_MAIN_MOVE_LINK_UP: > > status = move_link_up(ses, doc_view); > > break; > > > > + case ACT_MAIN_MOVE_LINK_UP_LINE: > > + status = move_link_up_line(ses, doc_view); > > + break; > > + > > case ACT_MAIN_MOVE_PAGE_DOWN: > > status = move_page_down(ses, doc_view); > > break; > > diff --git a/src/viewer/text/link.c b/src/viewer/text/link.c > > index 48adf91..30e1734 100644 > > --- a/src/viewer/text/link.c > > +++ b/src/viewer/text/link.c > > @@ -552,7 +552,7 @@ next_link_in_view_y(struct document_view *doc_view, int current, int direction) > > > > /** Get the bounding columns of @a link at line @a y (or all lines if > > * @a y == -1). */ > > -static void > > +void > > get_link_x_bounds(struct link *link, int y, int *min_x, int *max_x) > > { > > int point; > > diff --git a/src/viewer/text/link.h b/src/viewer/text/link.h > > index 1e20434..a3ffe2e 100644 > > --- a/src/viewer/text/link.h > > +++ b/src/viewer/text/link.h > > @@ -45,11 +45,14 @@ int current_link_is_visible(struct document_view *doc_view); > > int next_link_in_view(struct document_view *doc_view, int current, int direction); > > int next_link_in_view_y(struct document_view *doc_view, int current, int direction); > > int next_link_in_dir(struct document_view *doc_view, int dir_x, int dir_y); > > +int next_link_vertical(struct session *ses, struct document_view *doc_view, int dir_y); > > > > void jump_to_link_number(struct session *ses, struct document_view *doc_view, int); > > > > struct link *goto_current_link(struct session *ses, struct document_view *, int); > > void goto_link_number(struct session *ses, unsigned char *num); > > +void get_link_x_bounds(struct link *link, int y, int *min_x, int *max_x); > > + > > > > /* Bruteforce compilation fixes */ > > enum frame_event_status enter(struct session *ses, struct document_view *doc_view, int do_reload); > > diff --git a/src/viewer/text/view.c b/src/viewer/text/view.c > > index 238ca2e..c985c5d 100644 > > --- a/src/viewer/text/view.c > > +++ b/src/viewer/text/view.c > > @@ -61,6 +61,7 @@ > > #include "viewer/text/vs.h" > > > > > > +static enum frame_event_status move_cursor_rel(struct session *ses, struct document_view *view, int rx, int ry); > > > > void > > detach_formatted(struct document_view *doc_view) > > @@ -164,6 +165,91 @@ move_page_up(struct session *ses, struct document_view *doc_view) > > } > > > > enum frame_event_status > > +move_link_prev_line(struct session *ses, struct document_view *doc_view) > > +{ > > + struct view_state *vs; > > + struct document *document; > > + struct link *link, *last = NULL; > > + int y1, y, min_x, max_x, x1; > > + > > + assert(ses && doc_view && doc_view->vs && doc_view->document); > > + if_assert_failed return FRAME_EVENT_OK; > > + > > + vs = doc_view->vs; > > + document = doc_view->document; > > + if (!document->lines1) return FRAME_EVENT_OK; > > + > > + y = y1 = vs->y + ses->tab->y - ses->status.show_title_bar > > + - (ses->status.show_tabs_bar && ses->status.show_tabs_bar_at_top); > > + x1 = vs->x + ses->tab->x; > > + > > + link = get_current_link(doc_view); > > + if (link) { > > + get_link_x_bounds(link, y1, &min_x, &max_x); > > + } else { > > + min_x = max_x = x1; > > + int_upper_bound(&y, document->height - 1); > > + } > > + > > + for (; y >= 0; y--, min_x = INT_MAX) { > > + link = document->lines1[y]; > > + if (!link) continue; > > + for (; link <= document->lines2[y]; link++) { > > + if (link->points[0].y != y) continue; > > + if (link->points[0].x >= min_x) continue; > > + if (!last) last = link; > > + else if (link->points[0].x > last->points[0].x) last = link; > > + } > > + if (last) > > + return move_cursor_rel(ses, doc_view, last->points[0].x - x1, last->points[0].y - y1); > > + } > > + return FRAME_EVENT_OK; > > +} > > + > > + > > +enum frame_event_status > > +move_link_next_line(struct session *ses, struct document_view *doc_view) > > +{ > > + struct view_state *vs; > > + struct document *document; > > + struct link *link, *last = NULL; > > + int y1, y, min_x, max_x, x1; > > + > > + assert(ses && doc_view && doc_view->vs && doc_view->document); > > + if_assert_failed return FRAME_EVENT_OK; > > + > > + vs = doc_view->vs; > > + document = doc_view->document; > > + if (!document->lines1) return FRAME_EVENT_OK; > > + > > + y = y1 = vs->y + ses->tab->y - ses->status.show_title_bar > > + - (ses->status.show_tabs_bar && ses->status.show_tabs_bar_at_top); > > + x1 = vs->x + ses->tab->x; > > + > > + link = get_current_link(doc_view); > > + if (link) { > > + get_link_x_bounds(link, y1, &min_x, &max_x); > > + } else { > > + min_x = max_x = x1; > > + int_upper_bound(&y, document->height - 1); > > + } > > + > > + for (; y < document->height; y++, min_x = -1) { > > + link = document->lines1[y]; > > + if (!link) continue; > > + for (; link <= document->lines2[y]; link++) { > > + if (link->points[0].y != y) continue; > > + if (link->points[0].x <= min_x) continue; > > + if (!last) last = link; > > + else if (link->points[0].x < last->points[0].x) last = link; > > + } > > + if (last) > > + return move_cursor_rel(ses, doc_view, last->points[0].x - x1, last->points[0].y - y1); > > + } > > + return FRAME_EVENT_OK; > > +} > > + > > +enum frame_event_status > > move_link(struct session *ses, struct document_view *doc_view, int direction, > > int wraparound_bound, int wraparound_link) > > { > > @@ -555,7 +641,7 @@ move_cursor(struct session *ses, struct document_view *doc_view, int x, int y) > > return status; > > } > > > > -enum frame_event_status > > +static enum frame_event_status > > move_cursor_rel(struct session *ses, struct document_view *view, > > int rx, int ry) > > { > > @@ -593,6 +679,38 @@ move_cursor_down(struct session *ses, struct document_view *view) > > return move_cursor_rel(ses, view, 0, 1); > > } > > > > +enum frame_event_status > > +move_link_vertical(struct session *ses, struct document_view *doc_view, int dir_y) > > +{ > > + struct document *document; > > + struct view_state *vs; > > + int y, y1; > > + > > + assert(ses && doc_view && doc_view->vs && doc_view->document); > > + if_assert_failed return FRAME_EVENT_OK; > > + vs = doc_view->vs; > > + document = doc_view->document; > > + if (!document->lines1) return FRAME_EVENT_OK; > > + > > + y1 = vs->y + ses->tab->y - ses->status.show_status_bar > > + - (ses->status.show_tabs_bar && ses->status.show_tabs_bar_at_top); > > + y = y1 + dir_y; > > + if (dir_y < 0) > > + int_upper_bound(&y, document->height - 1); > > + else > > + int_lower_bound(&y, 0); > > + for (; dir_y > 0 ? y < document->height : y >= 0; y += dir_y) { > > + struct link *link = document->lines1[y]; > > + > > + if (!link) continue; > > + for (; link <= document->lines2[y]; link++) { > > + if (link->points[0].y == y) { > > + return move_cursor_rel(ses, doc_view, 0, y - y1); > > + } > > + } > > + } > > + return FRAME_EVENT_OK; > > +} > > > > enum frame_event_status > > copy_current_link_to_clipboard(struct session *ses, > > diff --git a/src/viewer/text/view.h b/src/viewer/text/view.h > > index e87fae6..ad9049b 100644 > > --- a/src/viewer/text/view.h > > +++ b/src/viewer/text/view.h > > @@ -30,6 +30,13 @@ enum frame_event_status move_link_dir(struct session *ses, struct document_view > > #define move_link_left(ses, doc_view) move_link_dir(ses, doc_view, -1, 0) > > #define move_link_right(ses, doc_view) move_link_dir(ses, doc_view, 1, 0) > > > > +enum frame_event_status move_link_prev_line(struct session *ses, struct document_view *doc_view); > > +enum frame_event_status move_link_next_line(struct session *ses, struct document_view *doc_view); > > +enum frame_event_status move_link_vertical(struct session *ses, struct document_view *doc_view, int dir_y); > > + > > +#define move_link_up_line(ses, doc_view) move_link_vertical(ses, doc_view, -1) > > +#define move_link_down_line(ses, doc_view) move_link_vertical(ses, doc_view, 1) > > + > > enum frame_event_status scroll_up(struct session *ses, struct document_view *doc_view); > > enum frame_event_status scroll_down(struct session *ses, struct document_view *doc_view); > > enum frame_event_status scroll_left(struct session *ses, struct document_view *doc_view); > > > _______________________________________________ > > elinks-dev mailing list > > elinks-dev at linuxfromscratch.org > > http://linuxfromscratch.org/mailman/listinfo/elinks-dev > > _______________________________________________ > elinks-dev mailing list > elinks-dev at linuxfromscratch.org > http://linuxfromscratch.org/mailman/listinfo/elinks-dev From witekfl at poczta.onet.pl Sun Aug 12 00:49:39 2007 From: witekfl at poczta.onet.pl (Witold Filipczyk) Date: Sun, 12 Aug 2007 08:49:39 +0200 Subject: [elinks-dev] Sponsor development of the key motion. In-Reply-To: <20070812020537.GA26292@lxlabs.com> References: <20070810031539.GA16137@lxlabs.com> <20070810113853.GB28943@diku.dk> <20070810130429.GA25470@lxlabs.com> <20070810175341.GA17668@pldmachine> <20070810192220.GA641@lxlabs.com> <20070811211052.GA14978@pldmachine> <20070812020537.GA26292@lxlabs.com> Message-ID: <20070812064939.GA12205@pldmachine> On Sun, Aug 12, 2007 at 07:35:37AM +0530, Ligesh wrote: > Thanks for the patch. Works great. I have a new problem though. I updated my elinks from the git and now the alt-keys does not work. If I run my old elinks, all the alt-key commands work fine, but not with the new one. Also, please send me your paypal billing at myself at ligesh.com. > > Can you also implement a key to take the cursor to the start of line. Like you have in VIM with '0'. Press 0 and the cursor moves to the start of line. DOes this already exist in Elinks? It doesn't work well with frames. From witekfl at poczta.onet.pl Sun Aug 12 02:36:22 2007 From: witekfl at poczta.onet.pl (Witold Filipczyk) Date: Sun, 12 Aug 2007 10:36:22 +0200 Subject: [elinks-dev] Sponsor development of the key motion. In-Reply-To: <20070812020537.GA26292@lxlabs.com> References: <20070810031539.GA16137@lxlabs.com> <20070810113853.GB28943@diku.dk> <20070810130429.GA25470@lxlabs.com> <20070810175341.GA17668@pldmachine> <20070810192220.GA641@lxlabs.com> <20070811211052.GA14978@pldmachine> <20070812020537.GA26292@lxlabs.com> Message-ID: <20070812083622.GA6738@pldmachine> Here is second patch, which fixes moving in frames. -- Witek -------------- next part -------------- actions: Fixed moving in frames. --- commit a68c563198afd22cf293b0c754ef1e5b73e8e9cc tree 52fd6c553ae0c355829131b32059d80784892170 parent 7882384bce49ab8d09e4c6d7a4b7b0eb0c945797 author Witold Filipczyk Sun, 12 Aug 2007 10:34:00 +0200 committer Witold Filipczyk Sun, 12 Aug 2007 10:34:00 +0200 src/viewer/text/view.c | 19 +++++++++++-------- 1 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/viewer/text/view.c b/src/viewer/text/view.c index c985c5d..887f301 100644 --- a/src/viewer/text/view.c +++ b/src/viewer/text/view.c @@ -169,6 +169,7 @@ move_link_prev_line(struct session *ses, struct document_view *doc_view) { struct view_state *vs; struct document *document; + struct box *box; struct link *link, *last = NULL; int y1, y, min_x, max_x, x1; @@ -178,10 +179,10 @@ move_link_prev_line(struct session *ses, struct document_view *doc_view) vs = doc_view->vs; document = doc_view->document; if (!document->lines1) return FRAME_EVENT_OK; + box = &doc_view->box; - y = y1 = vs->y + ses->tab->y - ses->status.show_title_bar - - (ses->status.show_tabs_bar && ses->status.show_tabs_bar_at_top); - x1 = vs->x + ses->tab->x; + y = y1 = vs->y + ses->tab->y - box->y; + x1 = vs->x + ses->tab->x - box->x; link = get_current_link(doc_view); if (link) { @@ -212,6 +213,7 @@ move_link_next_line(struct session *ses, struct document_view *doc_view) { struct view_state *vs; struct document *document; + struct box *box; struct link *link, *last = NULL; int y1, y, min_x, max_x, x1; @@ -221,10 +223,10 @@ move_link_next_line(struct session *ses, struct document_view *doc_view) vs = doc_view->vs; document = doc_view->document; if (!document->lines1) return FRAME_EVENT_OK; + box = &doc_view->box; - y = y1 = vs->y + ses->tab->y - ses->status.show_title_bar - - (ses->status.show_tabs_bar && ses->status.show_tabs_bar_at_top); - x1 = vs->x + ses->tab->x; + y = y1 = vs->y + ses->tab->y - box->y; + x1 = vs->x + ses->tab->x - box->x; link = get_current_link(doc_view); if (link) { @@ -684,6 +686,7 @@ move_link_vertical(struct session *ses, struct document_view *doc_view, int dir_ { struct document *document; struct view_state *vs; + struct box *box; int y, y1; assert(ses && doc_view && doc_view->vs && doc_view->document); @@ -692,8 +695,8 @@ move_link_vertical(struct session *ses, struct document_view *doc_view, int dir_ document = doc_view->document; if (!document->lines1) return FRAME_EVENT_OK; - y1 = vs->y + ses->tab->y - ses->status.show_status_bar - - (ses->status.show_tabs_bar && ses->status.show_tabs_bar_at_top); + box = &doc_view->box; + y1 = vs->y + ses->tab->y - box->y; y = y1 + dir_y; if (dir_y < 0) int_upper_bound(&y, document->height - 1); From myself at ligesh.com Sun Aug 12 06:29:05 2007 From: myself at ligesh.com (Ligesh) Date: Sun, 12 Aug 2007 17:59:05 +0530 Subject: [elinks-dev] Sponsor development of the key motion. In-Reply-To: <20070812083622.GA6738@pldmachine> References: <20070810031539.GA16137@lxlabs.com> <20070810113853.GB28943@diku.dk> <20070810130429.GA25470@lxlabs.com> <20070810175341.GA17668@pldmachine> <20070810192220.GA641@lxlabs.com> <20070811211052.GA14978@pldmachine> <20070812020537.GA26292@lxlabs.com> <20070812083622.GA6738@pldmachine> Message-ID: <20070812122905.GA5151@lxlabs.com> There is one problem left, and it is that the cursor doesn't change position when you move from one page to another. The cursor should ideally be at the top or it should be in the location where you left it, but with the new patch, the cursor just stays at the geometrical position. Btw, I would like to know how I can contribute to the elinks project. Witold has agreed that I can split my donation into $75-$75, with the latter going towards elinks dev. Thanks. From witekfl at poczta.onet.pl Sun Aug 12 12:03:04 2007 From: witekfl at poczta.onet.pl (Witold Filipczyk) Date: Sun, 12 Aug 2007 20:03:04 +0200 Subject: [elinks-dev] Sponsor development of the key motion. In-Reply-To: <20070812122905.GA5151@lxlabs.com> References: <20070810031539.GA16137@lxlabs.com> <20070810113853.GB28943@diku.dk> <20070810130429.GA25470@lxlabs.com> <20070810175341.GA17668@pldmachine> <20070810192220.GA641@lxlabs.com> <20070811211052.GA14978@pldmachine> <20070812020537.GA26292@lxlabs.com> <20070812083622.GA6738@pldmachine> <20070812122905.GA5151@lxlabs.com> Message-ID: <20070812180304.GA4588@pldmachine> diff --git a/src/viewer/text/draw.c b/src/viewer/text/draw.c index 6093315..8719156 100644 --- a/src/viewer/text/draw.c +++ b/src/viewer/text/draw.c @@ -220,7 +220,8 @@ draw_doc(struct session *ses, struct document_view *doc_view, int active) /* When redrawing the document after things like link menu we * have to reset the cursor routing state. */ if (ses->navigate_mode == NAVIGATE_CURSOR_ROUTING) { - set_cursor(term, ses->tab->x, ses->tab->y, 0); + if (doc_view->last_x == -1) move_document_start(ses, doc_view); + else set_cursor(term, ses->tab->x, ses->tab->y, 0); } else { set_cursor(term, box->x + box->width - 1, box->y + box->height - 1, 1); set_window_ptr(ses->tab, box->x, box->y); With that patch the cursor is placed at the top of the new document, but when one go back the cursor position is unchanged. It's not so easy. From myself at ligesh.com Sun Aug 12 13:00:12 2007 From: myself at ligesh.com (Ligesh) Date: Mon, 13 Aug 2007 00:30:12 +0530 Subject: [elinks-dev] Sponsor development of the key motion. In-Reply-To: <20070812180304.GA4588@pldmachine> References: <20070810031539.GA16137@lxlabs.com> <20070810113853.GB28943@diku.dk> <20070810130429.GA25470@lxlabs.com> <20070810175341.GA17668@pldmachine> <20070810192220.GA641@lxlabs.com> <20070811211052.GA14978@pldmachine> <20070812020537.GA26292@lxlabs.com> <20070812083622.GA6738@pldmachine> <20070812122905.GA5151@lxlabs.com> <20070812180304.GA4588@pldmachine> Message-ID: <20070812190012.GA4741@lxlabs.com> This is not needed I would think. The old elinks correctly remembers its position in every page. The old behaviour can be regained without patching to forcibly take it to the top of the page. This is worse than the cursor staying in the same geometric position. My question, how could a change of motion have affected the cursor being positioned so hard. Or is there some configuration that changed in elinks? Thanks a lot. On Sun, Aug 12, 2007 at 08:03:04PM +0200, Witold Filipczyk wrote: > diff --git a/src/viewer/text/draw.c b/src/viewer/text/draw.c > index 6093315..8719156 100644 > --- a/src/viewer/text/draw.c > +++ b/src/viewer/text/draw.c > @@ -220,7 +220,8 @@ draw_doc(struct session *ses, struct document_view *doc_view, int active) > /* When redrawing the document after things like link menu we > * have to reset the cursor routing state. */ > if (ses->navigate_mode == NAVIGATE_CURSOR_ROUTING) { > - set_cursor(term, ses->tab->x, ses->tab->y, 0); > + if (doc_view->last_x == -1) move_document_start(ses, doc_view); > + else set_cursor(term, ses->tab->x, ses->tab->y, 0); > } else { > set_cursor(term, box->x + box->width - 1, box->y + box->height - 1, 1); > set_window_ptr(ses->tab, box->x, box->y); > > > > With that patch the cursor is placed at the top of the new document, > but when one go back the cursor position is unchanged. It's not so easy. > _______________________________________________ > elinks-dev mailing list > elinks-dev at linuxfromscratch.org > http://linuxfromscratch.org/mailman/listinfo/elinks-dev From myself at ligesh.com Sun Aug 12 13:02:25 2007 From: myself at ligesh.com (Ligesh) Date: Mon, 13 Aug 2007 00:32:25 +0530 Subject: [elinks-dev] Sponsor development of the key motion. In-Reply-To: <20070812190012.GA4741@lxlabs.com> References: <20070810113853.GB28943@diku.dk> <20070810130429.GA25470@lxlabs.com> <20070810175341.GA17668@pldmachine> <20070810192220.GA641@lxlabs.com> <20070811211052.GA14978@pldmachine> <20070812020537.GA26292@lxlabs.com> <20070812083622.GA6738@pldmachine> <20070812122905.GA5151@lxlabs.com> <20070812180304.GA4588@pldmachine> <20070812190012.GA4741@lxlabs.com> Message-ID: <20070812190225.GA4849@lxlabs.com> Also, I lead developer, can you please open an account with paypal, so that if in the future, someone like me feels generous, he can donate. You can use to pay for hosting or whatever. I think it is a standard practice in open source. Please create a paypal account and send me a request. Thanks. From myself at ligesh.com Mon Aug 13 12:56:13 2007 From: myself at ligesh.com (Ligesh) Date: Tue, 14 Aug 2007 00:26:13 +0530 Subject: [elinks-dev] disable mouse (was: Sponsor development of the key motion.) In-Reply-To: <20070810081114.GA28943@diku.dk> References: <20070810031539.GA16137@lxlabs.com> <874pj82eql.fsf@Astalo.kon.iki.fi> <20070810081114.GA28943@diku.dk> Message-ID: <20070813185613.GA30549@lxlabs.com> On Fri, Aug 10, 2007 at 10:11:14AM +0200, Jonas Fonseca wrote: > Kalle Olavi Niemitalo wrote Fri, Aug 10, 2007: > > Ligesh writes: > > > > > Also I want to know if I can disable the need to press > > > key while copy/pasting from/to elinks. > > > > It appears the "toggle-mouse" action (not bound to a key by > > default) would stop ELinks from requesting mouse events. > > Or configure ELinks not to support mouse input with --disable-mouse. > Yes! This is what I really wanted. I do not use mouse, other than for copy pasting in xterm. I didn't actually know that Elinks had real mouse support. Thanks. From myself at ligesh.com Mon Aug 13 14:12:52 2007 From: myself at ligesh.com (Ligesh) Date: Tue, 14 Aug 2007 01:42:52 +0530 Subject: [elinks-dev] Sponsor development of the key motion. In-Reply-To: <20070812180304.GA4588@pldmachine> References: <20070810031539.GA16137@lxlabs.com> <20070810113853.GB28943@diku.dk> <20070810130429.GA25470@lxlabs.com> <20070810175341.GA17668@pldmachine> <20070810192220.GA641@lxlabs.com> <20070811211052.GA14978@pldmachine> <20070812020537.GA26292@lxlabs.com> <20070812083622.GA6738@pldmachine> <20070812122905.GA5151@lxlabs.com> <20070812180304.GA4588@pldmachine> Message-ID: <20070813201252.GA1892@lxlabs.com> I reverted your patch, and then elinks does remember positions in all the pages. SO it must be very trivial issue introduced by your code. Would it be possible to fix it? It seems, the cursor is staying at a specific geometrical on all actions--including when I scroll the page, or move from one page to another. Thanks a lot. From yan at seiner.com Tue Aug 14 09:41:29 2007 From: yan at seiner.com (Yan Seiner) Date: Tue, 14 Aug 2007 08:41:29 -0700 Subject: [elinks-dev] form.onLoad - where are forms loaded? Message-ID: <46C1CD29.8060203@seiner.com> I'm using elinks as a frontend to an embedded app. I've added a whole bunch of code to viewer/text/form.c to handle our special fields and to calculate the values in the form. All of that is working fine, except that there are several fields that need to be recalculated when the form loads. I can't find the place in the code where the forms are actually loaded and displayed for the first time. Could someone please clue me in on where the form is initially displayed? Thanks, --Yan From witekfl at poczta.onet.pl Tue Aug 14 11:59:14 2007 From: witekfl at poczta.onet.pl (Witold Filipczyk) Date: Tue, 14 Aug 2007 19:59:14 +0200 Subject: [elinks-dev] Sponsor development of the key motion. In-Reply-To: <20070813201252.GA1892@lxlabs.com> References: <20070810113853.GB28943@diku.dk> <20070810130429.GA25470@lxlabs.com> <20070810175341.GA17668@pldmachine> <20070810192220.GA641@lxlabs.com> <20070811211052.GA14978@pldmachine> <20070812020537.GA26292@lxlabs.com> <20070812083622.GA6738@pldmachine> <20070812122905.GA5151@lxlabs.com> <20070812180304.GA4588@pldmachine> <20070813201252.GA1892@lxlabs.com> Message-ID: <20070814175914.GA16311@pldmachine> Here is the patch. Kalle, Jonas, could apply them (key motion patches) to the mainstream ELinks? -------------- next part -------------- move-link-down-line, move-link-prev-line, etc.: Change mode to NAVIGATE_LINKWISE to preserve the link position when going back. --- commit 14b37d0362f9963cb2803d08d2c3e6e84574cdbe tree 062545598ae45bf519f7e825b0302542061bbf34 parent 2045574edca170a47b1e9f1e05cd210bdae8a49a author Witold Filipczyk Tue, 14 Aug 2007 19:56:02 +0200 committer Witold Filipczyk Tue, 14 Aug 2007 19:56:02 +0200 src/viewer/text/view.c | 25 ++++++++++++++++++++----- 1 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/viewer/text/view.c b/src/viewer/text/view.c index 887f301..a0ebefa 100644 --- a/src/viewer/text/view.c +++ b/src/viewer/text/view.c @@ -201,8 +201,13 @@ move_link_prev_line(struct session *ses, struct document_view *doc_view) if (!last) last = link; else if (link->points[0].x > last->points[0].x) last = link; } - if (last) - return move_cursor_rel(ses, doc_view, last->points[0].x - x1, last->points[0].y - y1); + if (last) { + enum frame_event_status status = move_cursor_rel(ses, doc_view, + last->points[0].x - x1, last->points[0].y - y1); + + ses->navigate_mode = NAVIGATE_LINKWISE; + return status; + } } return FRAME_EVENT_OK; } @@ -245,8 +250,13 @@ move_link_next_line(struct session *ses, struct document_view *doc_view) if (!last) last = link; else if (link->points[0].x < last->points[0].x) last = link; } - if (last) - return move_cursor_rel(ses, doc_view, last->points[0].x - x1, last->points[0].y - y1); + if (last) { + enum frame_event_status status = move_cursor_rel(ses, doc_view, + last->points[0].x - x1, last->points[0].y - y1); + + ses->navigate_mode = NAVIGATE_LINKWISE; + return status; + } } return FRAME_EVENT_OK; } @@ -708,7 +718,12 @@ move_link_vertical(struct session *ses, struct document_view *doc_view, int dir_ if (!link) continue; for (; link <= document->lines2[y]; link++) { if (link->points[0].y == y) { - return move_cursor_rel(ses, doc_view, 0, y - y1); + enum frame_event_status status = move_cursor_rel(ses, + doc_view, 0, y - y1); + + if (vs->current_link != -1) + ses->navigate_mode = NAVIGATE_LINKWISE; + return status; } } } From myself at ligesh.com Tue Aug 14 12:18:42 2007 From: myself at ligesh.com (Ligesh) Date: Tue, 14 Aug 2007 23:48:42 +0530 Subject: [elinks-dev] Sponsor development of the key motion. In-Reply-To: <20070814175914.GA16311@pldmachine> References: <20070810130429.GA25470@lxlabs.com> <20070810175341.GA17668@pldmachine> <20070810192220.GA641@lxlabs.com> <20070811211052.GA14978@pldmachine> <20070812020537.GA26292@lxlabs.com> <20070812083622.GA6738@pldmachine> <20070812122905.GA5151@lxlabs.com> <20070812180304.GA4588@pldmachine> <20070813201252.GA1892@lxlabs.com> <20070814175914.GA16311@pldmachine> Message-ID: <20070814181842.GA28358@lxlabs.com> This bug has to be fixed properly, otherwise, this is really interfering with the default elinks behaviour. If we can fix this cursor geometry issue, I will surely ask them to include it in the mainstream. Thanks a lot. On Tue, Aug 14, 2007 at 07:59:14PM +0200, Witold Filipczyk wrote: > Here is the patch. > Kalle, Jonas, could apply them (key motion patches) to the mainstream ELinks? > move-link-down-line, move-link-prev-line, etc.: > Change mode to NAVIGATE_LINKWISE to preserve the link position when > going back. > > --- > commit 14b37d0362f9963cb2803d08d2c3e6e84574cdbe > tree 062545598ae45bf519f7e825b0302542061bbf34 > parent 2045574edca170a47b1e9f1e05cd210bdae8a49a > author Witold Filipczyk Tue, 14 Aug 2007 19:56:02 +0200 > committer Witold Filipczyk Tue, 14 Aug 2007 19:56:02 +0200 > > src/viewer/text/view.c | 25 ++++++++++++++++++++----- > 1 files changed, 20 insertions(+), 5 deletions(-) > > diff --git a/src/viewer/text/view.c b/src/viewer/text/view.c > index 887f301..a0ebefa 100644 > --- a/src/viewer/text/view.c > +++ b/src/viewer/text/view.c > @@ -201,8 +201,13 @@ move_link_prev_line(struct session *ses, struct document_view *doc_view) > if (!last) last = link; > else if (link->points[0].x > last->points[0].x) last = link; > } > - if (last) > - return move_cursor_rel(ses, doc_view, last->points[0].x - x1, last->points[0].y - y1); > + if (last) { > + enum frame_event_status status = move_cursor_rel(ses, doc_view, > + last->points[0].x - x1, last->points[0].y - y1); > + > + ses->navigate_mode = NAVIGATE_LINKWISE; > + return status; > + } > } > return FRAME_EVENT_OK; > } > @@ -245,8 +250,13 @@ move_link_next_line(struct session *ses, struct document_view *doc_view) > if (!last) last = link; > else if (link->points[0].x < last->points[0].x) last = link; > } > - if (last) > - return move_cursor_rel(ses, doc_view, last->points[0].x - x1, last->points[0].y - y1); > + if (last) { > + enum frame_event_status status = move_cursor_rel(ses, doc_view, > + last->points[0].x - x1, last->points[0].y - y1); > + > + ses->navigate_mode = NAVIGATE_LINKWISE; > + return status; > + } > } > return FRAME_EVENT_OK; > } > @@ -708,7 +718,12 @@ move_link_vertical(struct session *ses, struct document_view *doc_view, int dir_ > if (!link) continue; > for (; link <= document->lines2[y]; link++) { > if (link->points[0].y == y) { > - return move_cursor_rel(ses, doc_view, 0, y - y1); > + enum frame_event_status status = move_cursor_rel(ses, > + doc_view, 0, y - y1); > + > + if (vs->current_link != -1) > + ses->navigate_mode = NAVIGATE_LINKWISE; > + return status; > } > } > } From myself at ligesh.com Tue Aug 14 12:28:21 2007 From: myself at ligesh.com (Ligesh) Date: Tue, 14 Aug 2007 23:58:21 +0530 Subject: [elinks-dev] Sponsor development of the key motion. In-Reply-To: <20070814181842.GA28358@lxlabs.com> References: <20070810175341.GA17668@pldmachine> <20070810192220.GA641@lxlabs.com> <20070811211052.GA14978@pldmachine> <20070812020537.GA26292@lxlabs.com> <20070812083622.GA6738@pldmachine> <20070812122905.GA5151@lxlabs.com> <20070812180304.GA4588@pldmachine> <20070813201252.GA1892@lxlabs.com> <20070814175914.GA16311@pldmachine> <20070814181842.GA28358@lxlabs.com> Message-ID: <20070814182820.GB28358@lxlabs.com> Woohoo. it works properly now. You can post this into the elinks list and I will ask them to include it. Thanks again. On Tue, Aug 14, 2007 at 11:48:42PM +0530, Ligesh wrote: > This bug has to be fixed properly, otherwise, this is really interfering with the default elinks behaviour. If we can fix this cursor geometry issue, I will surely ask them to include it in the mainstream. > > Thanks a lot. > > > On Tue, Aug 14, 2007 at 07:59:14PM +0200, Witold Filipczyk wrote: > > Here is the patch. > > Kalle, Jonas, could apply them (key motion patches) to the mainstream ELinks? > > > move-link-down-line, move-link-prev-line, etc.: > > Change mode to NAVIGATE_LINKWISE to preserve the link position when > > going back. > > > > --- > > commit 14b37d0362f9963cb2803d08d2c3e6e84574cdbe > > tree 062545598ae45bf519f7e825b0302542061bbf34 > > parent 2045574edca170a47b1e9f1e05cd210bdae8a49a > > author Witold Filipczyk Tue, 14 Aug 2007 19:56:02 +0200 > > committer Witold Filipczyk Tue, 14 Aug 2007 19:56:02 +0200 > > > > src/viewer/text/view.c | 25 ++++++++++++++++++++----- > > 1 files changed, 20 insertions(+), 5 deletions(-) > > > > diff --git a/src/viewer/text/view.c b/src/viewer/text/view.c > > index 887f301..a0ebefa 100644 > > --- a/src/viewer/text/view.c > > +++ b/src/viewer/text/view.c > > @@ -201,8 +201,13 @@ move_link_prev_line(struct session *ses, struct document_view *doc_view) > > if (!last) last = link; > > else if (link->points[0].x > last->points[0].x) last = link; > > } > > - if (last) > > - return move_cursor_rel(ses, doc_view, last->points[0].x - x1, last->points[0].y - y1); > > + if (last) { > > + enum frame_event_status status = move_cursor_rel(ses, doc_view, > > + last->points[0].x - x1, last->points[0].y - y1); > > + > > + ses->navigate_mode = NAVIGATE_LINKWISE; > > + return status; > > + } > > } > > return FRAME_EVENT_OK; > > } > > @@ -245,8 +250,13 @@ move_link_next_line(struct session *ses, struct document_view *doc_view) > > if (!last) last = link; > > else if (link->points[0].x < last->points[0].x) last = link; > > } > > - if (last) > > - return move_cursor_rel(ses, doc_view, last->points[0].x - x1, last->points[0].y - y1); > > + if (last) { > > + enum frame_event_status status = move_cursor_rel(ses, doc_view, > > + last->points[0].x - x1, last->points[0].y - y1); > > + > > + ses->navigate_mode = NAVIGATE_LINKWISE; > > + return status; > > + } > > } > > return FRAME_EVENT_OK; > > } > > @@ -708,7 +718,12 @@ move_link_vertical(struct session *ses, struct document_view *doc_view, int dir_ > > if (!link) continue; > > for (; link <= document->lines2[y]; link++) { > > if (link->points[0].y == y) { > > - return move_cursor_rel(ses, doc_view, 0, y - y1); > > + enum frame_event_status status = move_cursor_rel(ses, > > + doc_view, 0, y - y1); > > + > > + if (vs->current_link != -1) > > + ses->navigate_mode = NAVIGATE_LINKWISE; > > + return status; > > } > > } > > } > > _______________________________________________ > elinks-dev mailing list > elinks-dev at linuxfromscratch.org > http://linuxfromscratch.org/mailman/listinfo/elinks-dev From myself at ligesh.com Tue Aug 14 12:30:41 2007 From: myself at ligesh.com (Ligesh) Date: Wed, 15 Aug 2007 00:00:41 +0530 Subject: [elinks-dev] Sponsor development of the key motion. In-Reply-To: <20070814182820.GB28358@lxlabs.com> References: <20070810192220.GA641@lxlabs.com> <20070811211052.GA14978@pldmachine> <20070812020537.GA26292@lxlabs.com> <20070812083622.GA6738@pldmachine> <20070812122905.GA5151@lxlabs.com> <20070812180304.GA4588@pldmachine> <20070813201252.GA1892@lxlabs.com> <20070814175914.GA16311@pldmachine> <20070814181842.GA28358@lxlabs.com> <20070814182820.GB28358@lxlabs.com> Message-ID: <20070814183041.GA29153@lxlabs.com> Sorry, I didn't realize that we were in the elinks mailing list. Anyway, it seems, the patch now works fine, and it doesn't modify elinks' earlier behaviour either, making the new key motion a really non-intrusive feature. I would like to know if the maintainers can comment on this. Also, it would be nice if you have a paypal account, to which someone can donate if they want to. Thanks a lot for the great software. On Tue, Aug 14, 2007 at 11:58:20PM +0530, Ligesh wrote: > Woohoo. it works properly now. You can post this into the elinks list and I will ask them to include it. > > Thanks again. > > From witekfl at poczta.onet.pl Tue Aug 14 12:47:47 2007 From: witekfl at poczta.onet.pl (Witold Filipczyk) Date: Tue, 14 Aug 2007 20:47:47 +0200 Subject: [elinks-dev] Sponsor development of the key motion. In-Reply-To: <20070814175914.GA16311@pldmachine> References: <20070810130429.GA25470@lxlabs.com> <20070810175341.GA17668@pldmachine> <20070810192220.GA641@lxlabs.com> <20070811211052.GA14978@pldmachine> <20070812020537.GA26292@lxlabs.com> <20070812083622.GA6738@pldmachine> <20070812122905.GA5151@lxlabs.com> <20070812180304.GA4588@pldmachine> <20070813201252.GA1892@lxlabs.com> <20070814175914.GA16311@pldmachine> Message-ID: <20070814184747.GA11697@pldmachine> Once again me. Here is the patch which avoids a possible segmentation fault. -------------- next part -------------- Avoid segfault. Go to the page with a few lines. Follow a link to a page with more lines. Move cursor down, do not stay on a link. Go back and do move-link-prev-line. This caused a segmentation fault. --- commit 888ba8751674471768d846ff3443aa7bb71ecf82 tree f8a0a629f1aa0455f4532ad259224ab62fbef497 parent 14b37d0362f9963cb2803d08d2c3e6e84574cdbe author Witold Filipczyk Tue, 14 Aug 2007 20:43:22 +0200 committer Witold Filipczyk Tue, 14 Aug 2007 20:43:22 +0200 src/viewer/text/view.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/viewer/text/view.c b/src/viewer/text/view.c index a0ebefa..8724603 100644 --- a/src/viewer/text/view.c +++ b/src/viewer/text/view.c @@ -189,8 +189,8 @@ move_link_prev_line(struct session *ses, struct document_view *doc_view) get_link_x_bounds(link, y1, &min_x, &max_x); } else { min_x = max_x = x1; - int_upper_bound(&y, document->height - 1); } + int_upper_bound(&y, document->height - 1); for (; y >= 0; y--, min_x = INT_MAX) { link = document->lines1[y]; @@ -238,8 +238,8 @@ move_link_next_line(struct session *ses, struct document_view *doc_view) get_link_x_bounds(link, y1, &min_x, &max_x); } else { min_x = max_x = x1; - int_upper_bound(&y, document->height - 1); } + int_upper_bound(&y, document->height - 1); for (; y < document->height; y++, min_x = -1) { link = document->lines1[y]; From myself at ligesh.com Thu Aug 16 19:14:51 2007 From: myself at ligesh.com (Ligesh) Date: Fri, 17 Aug 2007 06:44:51 +0530 Subject: [elinks-dev] Sponsor development of the key motion. In-Reply-To: <20070814183041.GA29153@lxlabs.com> References: <20070811211052.GA14978@pldmachine> <20070812020537.GA26292@lxlabs.com> <20070812083622.GA6738@pldmachine> <20070812122905.GA5151@lxlabs.com> <20070812180304.GA4588@pldmachine> <20070813201252.GA1892@lxlabs.com> <20070814175914.GA16311@pldmachine> <20070814181842.GA28358@lxlabs.com> <20070814182820.GB28358@lxlabs.com> <20070814183041.GA29153@lxlabs.com> Message-ID: <20070817011451.GA18648@lxlabs.com> Some minor issues with the current setup. The earlier 'next-link' function would completely switch to the next page, when it reaches the bottom of the page. the current one seems to only scroll a couple of lines. Also, the earlier motion would always switch to the next page, even if there were no visible links there. The current one just halts, if there are no more links present. If it would be possible to fix the above, it would be great. There is a small bug too. IF there is a link that straddles two lines, and the there is another link parallel to it on the second line, then you cannot move down at all. If the cursor is on the 'long link1 spilled to second line', then you cannot move down. Thanks. From jnareb at gmail.com Sat Aug 18 17:28:41 2007 From: jnareb at gmail.com (Jakub Narebski) Date: Sun, 19 Aug 2007 01:28:41 +0200 Subject: [elinks-dev] Git User's Survey 2007 Message-ID: <200708190128.43515.jnareb@gmail.com> Hi all, We would like to ask you a few questions about your use of the GIT version control system. This survey is mainly to understand who is using GIT, how and why. The results will be discussed on the git mailing list and published to the GIT wiki at http://git.or.cz/gitwiki/GitSurvey2007 We'll close the survey in three weeks starting from 20 August 2007, on 10 September 2007. Please devote a few minutes of your time to fill this simple questionnaire, it will help a lot the git community to understand your needs, what you like of GIT, and of course what you don't like of it. The survey can be found here: http://www.survey.net.nz/survey.php?94e135ff41e871a1ea5bcda3ee1856d9 http://tinyurl.com/26774s -- Jakub Narebski From kon at iki.fi Tue Aug 28 01:07:14 2007 From: kon at iki.fi (Kalle Olavi Niemitalo) Date: Tue, 28 Aug 2007 10:07:14 +0300 Subject: [elinks-dev] exit(!!NULL) in die() Message-ID: <87tzqkxhlp.fsf@Astalo.kon.iki.fi> A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available Url : http://linuxfromscratch.org/pipermail/elinks-dev/attachments/20070828/615567ff/attachment.bin From fonseca at diku.dk Tue Aug 28 08:10:09 2007 From: fonseca at diku.dk (Jonas Fonseca) Date: Tue, 28 Aug 2007 16:10:09 +0200 Subject: [elinks-dev] exit(!!NULL) in die() In-Reply-To: <87tzqkxhlp.fsf@Astalo.kon.iki.fi> References: <87tzqkxhlp.fsf@Astalo.kon.iki.fi> Message-ID: <20070828141009.GA3530@diku.dk> Kalle Olavi Niemitalo wrote Tue, Aug 28, 2007: > In elinks-0.12/src/protocol/test/stub.c, we now have: > > static void > die(const char *msg, ...) > { > va_list args; > > if (msg) { > va_start(args, msg); > vfprintf(stderr, msg, args); > fputs("\n", stderr); > va_end(args); > } > > exit(!!NULL); > } > > !!NULL is 0. Wouldn't it make more sense to exit(1) or > exit(EXIT_FAILURE), as an error has occurred? Yes, sorry, I just copy/pasted it from the DOM test code. elinks > git grep 'exit(!!' src/dom/test/dom-select.c: exit(!!NULL); src/dom/test/sgml-parser.c: exit(!!NULL); src/protocol/ftp/ftp-parser.c: exit(!!NULL); src/protocol/test/stub.c: exit(!!NULL); Maybe a unified version should even go to a src/util/test.{h,inc} file. -- Jonas Fonseca From fonseca at diku.dk Wed Aug 29 10:39:37 2007 From: fonseca at diku.dk (Jonas Fonseca) Date: Wed, 29 Aug 2007 18:39:37 +0200 Subject: [elinks-dev] exit(!!NULL) in die() In-Reply-To: <20070828141009.GA3530@diku.dk> References: <87tzqkxhlp.fsf@Astalo.kon.iki.fi> <20070828141009.GA3530@diku.dk> Message-ID: <20070829163937.GA18607@diku.dk> Jonas Fonseca wrote Tue, Aug 28, 2007: > Kalle Olavi Niemitalo wrote Tue, Aug 28, 2007: > > In elinks-0.12/src/protocol/test/stub.c, we now have: > > > > static void > > die(const char *msg, ...) > > { > > va_list args; > > > > if (msg) { > > va_start(args, msg); > > vfprintf(stderr, msg, args); > > fputs("\n", stderr); > > va_end(args); > > } > > > > exit(!!NULL); > > } > > > > !!NULL is 0. Wouldn't it make more sense to exit(1) or > > exit(EXIT_FAILURE), as an error has occurred? > > Maybe a unified version should even go to a src/util/test.{h,inc} file. This has now been reworked in elinks-0.12. -- Jonas Fonseca From witekfl at poczta.onet.pl Wed Aug 29 13:48:08 2007 From: witekfl at poczta.onet.pl (Witold Filipczyk) Date: Wed, 29 Aug 2007 21:48:08 +0200 Subject: [elinks-dev] Bug 744: More tests and fix failures. Message-ID: <20070829194808.GA7265@pldmachine> Hi! While browsing diveintopython-5.4 I found a bug in recent ELinks-0.12.GIT. $ cd /usr/share/doc/diveintopython-5.4/html/toc $ elinks index.html Follow the link: "1. Installing Python" and you'll get the "No such file or directory" error. The link starts with "../". After the short investigation emerged: a2f3ec1ef75520e8044af65047217432aade8380 is first bad commit commit a2f3ec1ef75520e8044af65047217432aade8380 Author: Kalle Olavi Niemitalo Date: Thu Jul 19 14:28:20 2007 +0300 Bug 744: More tests and fix failures. :040000 040000 11eafb2a5713db3e7d22593c7b396989feaf5b6f 4618f8b1774eb47a2fd934021a5db8a55c51e3e6 M src -- Witek From myself at ligesh.com Wed Aug 29 23:00:55 2007 From: myself at ligesh.com (Ligesh) Date: Thu, 30 Aug 2007 10:30:55 +0530 Subject: [elinks-dev] Textarea doesn't get refreshed when the page is refreshed. Message-ID: <20070830050055.GA27359@lxlabs.com> Hi, Elinks behaviour when I am trying to edit a page can cause some real headaches. It happens when you are trying to edit an already edited page. Even if you refresh, the text area will contain the older contents and if you edit the second time, the changes you made during the first edit are lost, and it gets horribly confusing too. I would like to know if this can be fixed. Reproduce it like this: a) Go to a an editable page, and click on edit. b) Make some changes and save. You will be redirected to the display page again. c) Come back to the edit page and refresh. e) Expected result: The refreshed page should contain the new text. f) Actual result: The text area contains the older contents--the one before you made the edit. You can workaround this by, simply going back, and coming to the page again after you have refreshed the page. But that's not an ideal solution. Thanks a lot. From witekfl at poczta.onet.pl Thu Aug 30 11:40:01 2007 From: witekfl at poczta.onet.pl (Witold Filipczyk) Date: Thu, 30 Aug 2007 19:40:01 +0200 Subject: [elinks-dev] Textarea doesn't get refreshed when the page is refreshed. In-Reply-To: <20070830050055.GA27359@lxlabs.com> References: <20070830050055.GA27359@lxlabs.com> Message-ID: <20070830174001.GA6592@pldmachine> On Thu, Aug 30, 2007 at 10:30:55AM +0530, Ligesh wrote: > > Hi, > > Elinks behaviour when I am trying to edit a page can cause some real headaches. It happens when you are trying to edit an already edited page. Even if you refresh, the text area will contain the older contents and if you edit the second time, the changes you made during the first edit are lost, and it gets horribly confusing too. > > I would like to know if this can be fixed. Reproduce it like this: > > a) Go to a an editable page, and click on edit. > > b) Make some changes and save. You will be redirected to the display page again. > > c) Come back to the edit page and refresh. > > e) Expected result: The refreshed page should contain the new text. > > f) Actual result: The text area contains the older contents--the one before you made the edit. > > You can workaround this by, simply going back, and coming to the page again after you have refreshed the page. But that's not an ideal solution. > > Thanks a lot. Try this patch. -------------- next part -------------- Forget forms when reloading (bug 620 ?). --- commit 2d69e2e625bb4e673e95bc7eb7b1d8744c4f9a87 tree 9438cfe5923b1ffca02a814356c6c1045b72b2f0 parent 940196b131f13537b84e807b14481280bf5b72f1 author Witold Filipczyk Thu, 30 Aug 2007 19:36:48 +0200 committer Witold Filipczyk Thu, 30 Aug 2007 19:36:48 +0200 src/session/session.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/src/session/session.c b/src/session/session.c index e82141c..ae9f350 100644 --- a/src/session/session.c +++ b/src/session/session.c @@ -1198,11 +1198,17 @@ reload(struct session *ses, enum cache_mode cache_mode) if (have_location(ses)) { struct location *loc = cur_loc(ses); struct file_to_load *ftl; + int i; #ifdef CONFIG_ECMASCRIPT loc->vs.ecmascript_fragile = 1; #endif - + /* Forget forms. */ + for (i = 0; i < loc->vs.form_info_len; i++) + mem_free_if(loc->vs.form_info[i].value); + mem_free_set(&loc->vs.form_info, NULL); + loc->vs.form_info_len = 0; + free_list(loc->vs.forms); /* FIXME: When reloading use loading_callback and set up a * session task so that the reloading will work even when the * reloaded document contains redirects. This is needed atleast