{"thread":{"id":"5691","subject":"[PATCH] gitk: Fix nextfile() and more","startedAt":"2006-09-25T13:46:52Z","lastAt":"2006-09-27T03:32:19Z","messageCount":7,"participants":["OGAWA Hirofumi","Junio C Hamano","Paul Mackerras"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"27621","messageId":"873bag12k3.fsf@duaron.myhome.or.jp","threadId":"5691","inReplyTo":null,"subject":"[PATCH] gitk: Fix nextfile() and more","fromName":"OGAWA Hirofumi","fromEmail":"hirofumi@mail.parknet.co.jp","sentAt":"2006-09-25T13:46:52Z","receivedAt":"2006-09-25T13:46:52Z","isPatch":true,"sender":{"key":"hirofumi@mail.parknet.co.jp","avatar":null},"body":"Hi,\n\nThe current nextfile() jumps to last hunk, but I think this is not\nintention, probably, it's forgetting to add \"break;\". Right?  And this\npatch also adds prevfile(), it jumps to previous hunk.\n\nThe following part is just my favorite the key-binds, it doesn't matter.\n\n+    bind . <Control-p> \"$ctext yview scroll -1 units\"\n+    bind . <Control-n> \"$ctext yview scroll 1 units\"\n+    bind . <Alt-v> \"$ctext yview scroll -1 pages\"\n+    bind . <Control-v> \"$ctext yview scroll 1 pages\"\n+    bindkey P prevfile\n+    bindkey N nextfile\n\nWhat do you think of this?\n\nThanks.\n-- \nOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>\n\n\nSigned-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>\n---\n\n gitk |   20 ++++++++++++++++++++\n 1 file changed, 20 insertions(+)\n\ndiff -puN gitk~gitk-key-emacs gitk\n--- git/gitk~gitk-key-emacs\t2006-09-25 22:31:51.000000000 +0900\n+++ git-hirofumi/gitk\t2006-09-25 22:31:51.000000000 +0900\n@@ -672,6 +672,10 @@ proc makewindow {} {\n     bind . <Control-Key-Down> \"allcanvs yview scroll 1 units\"\n     bind . <Control-Key-Prior> \"allcanvs yview scroll -1 pages\"\n     bind . <Control-Key-Next> \"allcanvs yview scroll 1 pages\"\n+    bind . <Control-p> \"$ctext yview scroll -1 units\"\n+    bind . <Control-n> \"$ctext yview scroll 1 units\"\n+    bind . <Alt-v> \"$ctext yview scroll -1 pages\"\n+    bind . <Control-v> \"$ctext yview scroll 1 pages\"\n     bindkey <Key-Delete> \"$ctext yview scroll -1 pages\"\n     bindkey <Key-BackSpace> \"$ctext yview scroll -1 pages\"\n     bindkey <Key-space> \"$ctext yview scroll 1 pages\"\n@@ -690,6 +694,8 @@ proc makewindow {} {\n     bindkey <Key-Return> {findnext 0}\n     bindkey ? findprev\n     bindkey f nextfile\n+    bindkey P prevfile\n+    bindkey N nextfile\n     bind . <Control-q> doquit\n     bind . <Control-f> dofind\n     bind . <Control-g> {findnext 0}\n@@ -4440,12 +4446,26 @@ proc getblobdiffline {bdf ids} {\n     }\n }\n \n+proc prevfile {} {\n+    global difffilestart ctext\n+    set prev [lindex $difffilestart 0]\n+    set here [$ctext index @0,0]\n+    foreach loc $difffilestart {\n+\tif {[$ctext compare $loc >= $here]} {\n+\t    $ctext yview $prev\n+\t    break\n+\t}\n+\tset prev $loc\n+    }\n+}\n+\n proc nextfile {} {\n     global difffilestart ctext\n     set here [$ctext index @0,0]\n     foreach loc $difffilestart {\n \tif {[$ctext compare $loc > $here]} {\n \t    $ctext yview $loc\n+\t    break\n \t}\n     }\n }\n_\n"},{"id":"27659","messageId":"7vpsdjryj2.fsf@assigned-by-dhcp.cox.net","threadId":"5691","inReplyTo":"873bag12k3.fsf@duaron.myhome.or.jp","subject":"Re: [PATCH] gitk: Fix nextfile() and more","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-09-26T05:24:01Z","receivedAt":"2006-09-26T05:24:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> writes:\n\n> The current nextfile() jumps to last hunk, but I think this is not\n> intention, probably, it's forgetting to add \"break;\". Right?  And this\n> patch also adds prevfile(), it jumps to previous hunk.\n>\n> The following part is just my favorite the key-binds, it doesn't matter.\n>\n> +    bind . <Control-p> \"$ctext yview scroll -1 units\"\n> +    bind . <Control-n> \"$ctext yview scroll 1 units\"\n> +    bind . <Alt-v> \"$ctext yview scroll -1 pages\"\n> +    bind . <Control-v> \"$ctext yview scroll 1 pages\"\n> +    bindkey P prevfile\n> +    bindkey N nextfile\n>\n> What do you think of this?\n\n. As a patch e-mail, the initial Hi and trailing Thanks add\n  additional work for the person who applies patch.\n\n. ACK on missing \"break\" and addition of prevfile for symmetry.\n\n. I do not have preference on the extra bindings.  I do not\n  speak for Paul, but I suspect he would have liked them in a\n  separate patch.\n"},{"id":"27680","messageId":"877izq3bbf.fsf@duaron.myhome.or.jp","threadId":"5691","inReplyTo":"7vpsdjryj2.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] gitk: Fix nextfile() and more","fromName":"OGAWA Hirofumi","fromEmail":"hirofumi@mail.parknet.co.jp","sentAt":"2006-09-26T15:19:16Z","receivedAt":"2006-09-26T15:19:16Z","isPatch":true,"sender":{"key":"hirofumi@mail.parknet.co.jp","avatar":null},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n> OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> writes:\n>\n>> The current nextfile() jumps to last hunk, but I think this is not\n>> intention, probably, it's forgetting to add \"break;\". Right?  And this\n>> patch also adds prevfile(), it jumps to previous hunk.\n>>\n>> The following part is just my favorite the key-binds, it doesn't matter.\n>>\n>> +    bind . <Control-p> \"$ctext yview scroll -1 units\"\n>> +    bind . <Control-n> \"$ctext yview scroll 1 units\"\n>> +    bind . <Alt-v> \"$ctext yview scroll -1 pages\"\n>> +    bind . <Control-v> \"$ctext yview scroll 1 pages\"\n>> +    bindkey P prevfile\n>> +    bindkey N nextfile\n>>\n>> What do you think of this?\n>\n> . As a patch e-mail, the initial Hi and trailing Thanks add\n>   additional work for the person who applies patch.\n\nOk.\n\n> . I do not have preference on the extra bindings.  I do not\n>   speak for Paul, but I suspect he would have liked them in a\n>   separate patch.\n\nOk. I'll send patches.\n-- \nOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>\n"},{"id":"27681","messageId":"873bae3b5x.fsf_-_@duaron.myhome.or.jp","threadId":"5691","inReplyTo":"7vpsdjryj2.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] gitk: Fix nextfile() and add prevfile()","fromName":"OGAWA Hirofumi","fromEmail":"hirofumi@mail.parknet.co.jp","sentAt":"2006-09-26T15:22:34Z","receivedAt":"2006-09-26T15:22:34Z","isPatch":true,"sender":{"key":"hirofumi@mail.parknet.co.jp","avatar":null},"body":"The current nextfile() jumps to last hunk, but I think this is not\nintention, probably, it's forgetting to add \"break;\". And this\npatch also adds prevfile(), it jumps to previous hunk.\n\nSigned-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>\n---\n\n gitk |   14 ++++++++++++++\n 1 file changed, 14 insertions(+)\n\ndiff -puN gitk~gitk-nextfile-fix gitk\n--- git/gitk~gitk-nextfile-fix\t2006-09-27 00:16:11.000000000 +0900\n+++ git-hirofumi/gitk\t2006-09-27 00:16:48.000000000 +0900\n@@ -4440,12 +4440,26 @@ proc getblobdiffline {bdf ids} {\n     }\n }\n \n+proc prevfile {} {\n+    global difffilestart ctext\n+    set prev [lindex $difffilestart 0]\n+    set here [$ctext index @0,0]\n+    foreach loc $difffilestart {\n+\tif {[$ctext compare $loc >= $here]} {\n+\t    $ctext yview $prev\n+\t    break\n+\t}\n+\tset prev $loc\n+    }\n+}\n+\n proc nextfile {} {\n     global difffilestart ctext\n     set here [$ctext index @0,0]\n     foreach loc $difffilestart {\n \tif {[$ctext compare $loc > $here]} {\n \t    $ctext yview $loc\n+\t    break\n \t}\n     }\n }\n_\n"},{"id":"27683","messageId":"87y7s61wdx.fsf_-_@duaron.myhome.or.jp","threadId":"5691","inReplyTo":"873bae3b5x.fsf_-_@duaron.myhome.or.jp","subject":"[PATCH] gitk: add some key-bind","fromName":"OGAWA Hirofumi","fromEmail":"hirofumi@mail.parknet.co.jp","sentAt":"2006-09-26T15:27:06Z","receivedAt":"2006-09-26T15:27:06Z","isPatch":true,"sender":{"key":"hirofumi@mail.parknet.co.jp","avatar":null},"body":"This add initial user of prevfile(), and additional some key-binds for\nemacs users.\n\nSigned-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>\n---\n\n gitk |    6 ++++++\n 1 file changed, 6 insertions(+)\n\ndiff -puN gitk~gitk-key-emacs gitk\n--- git/gitk~gitk-key-emacs\t2006-09-27 00:17:31.000000000 +0900\n+++ git-hirofumi/gitk\t2006-09-27 00:17:31.000000000 +0900\n@@ -672,6 +672,10 @@ proc makewindow {} {\n     bind . <Control-Key-Down> \"allcanvs yview scroll 1 units\"\n     bind . <Control-Key-Prior> \"allcanvs yview scroll -1 pages\"\n     bind . <Control-Key-Next> \"allcanvs yview scroll 1 pages\"\n+    bind . <Control-p> \"$ctext yview scroll -1 units\"\n+    bind . <Control-n> \"$ctext yview scroll 1 units\"\n+    bind . <Alt-v> \"$ctext yview scroll -1 pages\"\n+    bind . <Control-v> \"$ctext yview scroll 1 pages\"\n     bindkey <Key-Delete> \"$ctext yview scroll -1 pages\"\n     bindkey <Key-BackSpace> \"$ctext yview scroll -1 pages\"\n     bindkey <Key-space> \"$ctext yview scroll 1 pages\"\n@@ -690,6 +694,8 @@ proc makewindow {} {\n     bindkey <Key-Return> {findnext 0}\n     bindkey ? findprev\n     bindkey f nextfile\n+    bindkey P prevfile\n+    bindkey N nextfile\n     bind . <Control-q> doquit\n     bind . <Control-f> dofind\n     bind . <Control-g> {findnext 0}\n_\n"},{"id":"27724","messageId":"17689.49841.913304.878599@cargo.ozlabs.ibm.com","threadId":"5691","inReplyTo":"873bae3b5x.fsf_-_@duaron.myhome.or.jp","subject":"Re: [PATCH] gitk: Fix nextfile() and add prevfile()","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2006-09-27T00:15:45Z","receivedAt":"2006-09-27T00:15:45Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"OGAWA Hirofumi writes:\n\n> The current nextfile() jumps to last hunk, but I think this is not\n> intention, probably, it's forgetting to add \"break;\". And this\n> patch also adds prevfile(), it jumps to previous hunk.\n\nI think your prevfile isn't quite right - I don't think it will do the\nright thing if $loc is past the last entry in $difffilestart.  Don't\nyou want the \"$ctext yview $prev\" after the loop?\n\nPaul.\n"},{"id":"27750","messageId":"87fyeernlo.fsf@duaron.myhome.or.jp","threadId":"5691","inReplyTo":"17689.49841.913304.878599@cargo.ozlabs.ibm.com","subject":"Re: [PATCH] gitk: Fix nextfile() and add prevfile()","fromName":"OGAWA Hirofumi","fromEmail":"hirofumi@mail.parknet.co.jp","sentAt":"2006-09-27T03:32:19Z","receivedAt":"2006-09-27T03:32:19Z","isPatch":true,"sender":{"key":"hirofumi@mail.parknet.co.jp","avatar":null},"body":"Paul Mackerras <paulus@samba.org> writes:\n\n> OGAWA Hirofumi writes:\n>\n>> The current nextfile() jumps to last hunk, but I think this is not\n>> intention, probably, it's forgetting to add \"break;\". And this\n>> patch also adds prevfile(), it jumps to previous hunk.\n>\n> I think your prevfile isn't quite right - I don't think it will do the\n> right thing if $loc is past the last entry in $difffilestart.  Don't\n> you want the \"$ctext yview $prev\" after the loop?\n>\n> Paul.\n\nSure, it's obviously useful in the case of big hunk. Thanks.\n-- \nOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>\n\n\nThe current nextfile() jumps to last hunk, but I think this is not\nintention, probably, it's forgetting to add \"break;\". And this\npatch also adds prevfile(), it jumps to previous hunk.\n\nSigned-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>\n---\n\n gitk |   15 +++++++++++++++\n 1 file changed, 15 insertions(+)\n\ndiff -puN gitk~gitk-nextfile-fix gitk\n--- git/gitk~gitk-nextfile-fix\t2006-09-27 12:14:07.000000000 +0900\n+++ git-hirofumi/gitk\t2006-09-27 12:16:23.000000000 +0900\n@@ -4440,12 +4440,27 @@ proc getblobdiffline {bdf ids} {\n     }\n }\n \n+proc prevfile {} {\n+    global difffilestart ctext\n+    set prev [lindex $difffilestart 0]\n+    set here [$ctext index @0,0]\n+    foreach loc $difffilestart {\n+\tif {[$ctext compare $loc >= $here]} {\n+\t    $ctext yview $prev\n+\t    return\n+\t}\n+\tset prev $loc\n+    }\n+    $ctext yview $prev\n+}\n+\n proc nextfile {} {\n     global difffilestart ctext\n     set here [$ctext index @0,0]\n     foreach loc $difffilestart {\n \tif {[$ctext compare $loc > $here]} {\n \t    $ctext yview $loc\n+\t    return\n \t}\n     }\n }\n_\n"}]}