{"thread":{"id":"62619","subject":"[PATCH 0/2] gitk: text wrapping in ctext (commit headers, subject, and body)","startedAt":"2024-12-09T18:09:00Z","lastAt":"2024-12-12T18:58:33Z","messageCount":5,"participants":["Christoph Sommer via GitGitGadget","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"508881","messageId":"pull.1835.git.1733767737.gitgitgadget@gmail.com","threadId":"62619","inReplyTo":null,"subject":"[PATCH 0/2] gitk: text wrapping in ctext (commit headers, subject, and body)","fromName":"Christoph Sommer via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2024-12-09T18:08:55Z","receivedAt":"2024-12-09T18:09:00Z","isPatch":true,"sender":{"key":"name:Christoph Sommer","avatar":null},"body":"Using gitk to view diffs of source code without hard linebreaks is a bit\npainful without dynamic word wrapping, for which I could not find a\npreference. The only related one I found was for wrapping the commit subject\n(called a comment in the source code, I guess), and that did not seem to be\nreconfigurable in a running gitk.\n\nOn the off chance that such features might also be useful to somebody else I\nam sharing them publicly, as two semi-related changes:\n\n\ngitk: add text wrapping preferences\n===================================\n\nAdd a new preference \"wrapdefault\" which allows enabling char/word wrap.\nImpacts all text in the ctext widget for which no other preference exists.\n\nAlso make the (existing) preference \"wrapcomment\" configurable graphically.\nIts setting impacts only the \"comment\" part of the ctext widget.\n\n\ngitk: make headings of preferences bold\n=======================================\n\nMake preference groups like \"Diff display options\" stand out more.\n\nChristoph Sommer (2):\n  gitk: make headings of preferences bold\n  gitk: add text wrapping preferences\n\n gitk-git/gitk | 45 ++++++++++++++++++++++++++++++++-------------\n 1 file changed, 32 insertions(+), 13 deletions(-)\n\n\nbase-commit: e66fd72e972df760a53c3d6da023c17adfc426d6\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-1835%2Fsommer%2Fmaster-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1835/sommer/master-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/1835\n-- \ngitgitgadget\n"},{"id":"508882","messageId":"d58ce9d609d8a5da3edd1e1061d84919af12b02d.1733767737.git.gitgitgadget@gmail.com","threadId":"62619","inReplyTo":"pull.1835.git.1733767737.gitgitgadget@gmail.com","subject":"[PATCH 1/2] gitk: make headings of preferences bold","fromName":"Christoph Sommer via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2024-12-09T18:08:56Z","receivedAt":"2024-12-09T18:09:01Z","isPatch":true,"sender":{"key":"name:Christoph Sommer","avatar":null},"body":"From: Christoph Sommer <sommer@cms-labs.org>\n\nMake preference groups like \"Diff display options\" stand out more.\n\nSigned-off-by: Christoph Sommer <sommer@cms-labs.org>\n---\n gitk-git/gitk | 10 +++++-----\n 1 file changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex 7a087f123d7..d024e58d016 100755\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -11581,7 +11581,7 @@ proc prefspage_general {notebook} {\n \n     set page [create_prefs_page $notebook.general]\n \n-    ${NS}::label $page.ldisp -text [mc \"Commit list display options\"]\n+    ${NS}::label $page.ldisp -text [mc \"Commit list display options\"] -font mainfontbold\n     grid $page.ldisp - -sticky w -pady 10\n     ${NS}::label $page.spacer -text \" \"\n     ${NS}::label $page.maxwidthl -text [mc \"Maximum graph width (lines)\"]\n@@ -11602,7 +11602,7 @@ proc prefspage_general {notebook} {\n         -variable hideremotes\n     grid x $page.hideremotes -sticky w\n \n-    ${NS}::label $page.ddisp -text [mc \"Diff display options\"]\n+    ${NS}::label $page.ddisp -text [mc \"Diff display options\"] -font mainfontbold\n     grid $page.ddisp - -sticky w -pady 10\n     ${NS}::label $page.tabstopl -text [mc \"Tab spacing\"]\n     spinbox $page.tabstop -from 1 -to 20 -width 4 -textvariable tabstop\n@@ -11635,7 +11635,7 @@ proc prefspage_general {notebook} {\n     pack configure $page.webbrowserf.l -padx 10\n     grid x $page.webbrowserf $page.webbrowser -sticky ew\n \n-    ${NS}::label $page.lgen -text [mc \"General options\"]\n+    ${NS}::label $page.lgen -text [mc \"General options\"] -font mainfontbold\n     grid $page.lgen - -sticky w -pady 10\n     ${NS}::checkbutton $page.want_ttk -variable want_ttk \\\n         -text [mc \"Use themed widgets\"]\n@@ -11654,7 +11654,7 @@ proc prefspage_colors {notebook} {\n \n     set page [create_prefs_page $notebook.colors]\n \n-    ${NS}::label $page.cdisp -text [mc \"Colors: press to choose\"]\n+    ${NS}::label $page.cdisp -text [mc \"Colors: press to choose\"] -font mainfontbold\n     grid $page.cdisp - -sticky w -pady 10\n     label $page.ui -padx 40 -relief sunk -background $uicolor\n     ${NS}::button $page.uibut -text [mc \"Interface\"] \\\n@@ -11712,7 +11712,7 @@ proc prefspage_colors {notebook} {\n proc prefspage_fonts {notebook} {\n     global NS\n     set page [create_prefs_page $notebook.fonts]\n-    ${NS}::label $page.cfont -text [mc \"Fonts: press to choose\"]\n+    ${NS}::label $page.cfont -text [mc \"Fonts: press to choose\"] -font mainfontbold\n     grid $page.cfont - -sticky w -pady 10\n     mkfontdisp mainfont $page [mc \"Main font\"]\n     mkfontdisp textfont $page [mc \"Diff display font\"]\n-- \ngitgitgadget\n\n"},{"id":"508883","messageId":"e116685568e4f1db3bc71985945f0ff4e40e12fc.1733767737.git.gitgitgadget@gmail.com","threadId":"62619","inReplyTo":"pull.1835.git.1733767737.gitgitgadget@gmail.com","subject":"[PATCH 2/2] gitk: add text wrapping preferences","fromName":"Christoph Sommer via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2024-12-09T18:08:57Z","receivedAt":"2024-12-09T18:09:02Z","isPatch":true,"sender":{"key":"name:Christoph Sommer","avatar":null},"body":"From: Christoph Sommer <sommer@cms-labs.org>\n\nAdd a new preference \"wrapdefault\" which allows enabling char/word wrap.\nImpacts all text in the ctext widget for which no other preference exists.\n\nAlso make the (existing) preference \"wrapcomment\" configurable graphically.\nIts setting impacts only the \"comment\" part of the ctext widget.\n\nSigned-off-by: Christoph Sommer <sommer@cms-labs.org>\n---\n gitk-git/gitk | 35 +++++++++++++++++++++++++++--------\n 1 file changed, 27 insertions(+), 8 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex d024e58d016..3bf9bc2edea 100755\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -2089,7 +2089,7 @@ proc makewindow {} {\n     global diffcontextstring diffcontext\n     global ignorespace\n     global maincursor textcursor curtextcursor\n-    global rowctxmenu fakerowmenu mergemax wrapcomment\n+    global rowctxmenu fakerowmenu mergemax wrapcomment wrapdefault\n     global highlight_files gdttype\n     global searchstring sstring\n     global bgcolor fgcolor bglist fglist diffcolors diffbgcolors selectbgcolor\n@@ -2431,7 +2431,7 @@ proc makewindow {} {\n     set ctext .bleft.bottom.ctext\n     text $ctext -background $bgcolor -foreground $fgcolor \\\n         -state disabled -undo 0 -font textfont \\\n-        -yscrollcommand scrolltext -wrap none \\\n+        -yscrollcommand scrolltext -wrap $wrapdefault \\\n         -xscrollcommand \".bleft.bottom.sbhorizontal set\"\n     if {$have_tk85} {\n         $ctext conf -tabstyle wordprocessor\n@@ -11576,7 +11576,7 @@ proc create_prefs_page {w} {\n \n proc prefspage_general {notebook} {\n     global NS maxwidth maxgraphpct showneartags showlocalchanges\n-    global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs\n+    global tabstop wrapcomment wrapdefault limitdiffs autoselect autosellen extdifftool perfile_attrs\n     global hideremotes want_ttk have_ttk maxrefs web_browser\n \n     set page [create_prefs_page $notebook.general]\n@@ -11607,6 +11607,17 @@ proc prefspage_general {notebook} {\n     ${NS}::label $page.tabstopl -text [mc \"Tab spacing\"]\n     spinbox $page.tabstop -from 1 -to 20 -width 4 -textvariable tabstop\n     grid x $page.tabstopl $page.tabstop -sticky w\n+\n+    ${NS}::label $page.wrapcommentl -text [mc \"Wrap comment text\"]\n+    ${NS}::combobox $page.wrapcomment -values {none char word} -state readonly \\\n+        -textvariable wrapcomment\n+    grid x $page.wrapcommentl $page.wrapcomment -sticky w\n+\n+    ${NS}::label $page.wrapdefaultl -text [mc \"Wrap other text\"]\n+    ${NS}::combobox $page.wrapdefault -values {none char word} -state readonly \\\n+        -textvariable wrapdefault\n+    grid x $page.wrapdefaultl $page.wrapdefault -sticky w\n+\n     ${NS}::checkbutton $page.ntag -text [mc \"Display nearby tags/heads\"] \\\n         -variable showneartags\n     grid x $page.ntag -sticky w\n@@ -11725,7 +11736,7 @@ proc doprefs {} {\n     global oldprefs prefstop showneartags showlocalchanges\n     global uicolor bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor\n     global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs\n-    global hideremotes want_ttk have_ttk\n+    global hideremotes want_ttk have_ttk wrapcomment wrapdefault\n \n     set top .gitkprefs\n     set prefstop $top\n@@ -11734,7 +11745,7 @@ proc doprefs {} {\n         return\n     }\n     foreach v {maxwidth maxgraphpct showneartags showlocalchanges \\\n-                   limitdiffs tabstop perfile_attrs hideremotes want_ttk} {\n+                   limitdiffs tabstop perfile_attrs hideremotes want_ttk wrapcomment wrapdefault} {\n         set oldprefs($v) [set $v]\n     }\n     ttk_toplevel $top\n@@ -11860,7 +11871,7 @@ proc prefscan {} {\n     global oldprefs prefstop\n \n     foreach v {maxwidth maxgraphpct showneartags showlocalchanges \\\n-                   limitdiffs tabstop perfile_attrs hideremotes want_ttk} {\n+                   limitdiffs tabstop perfile_attrs hideremotes want_ttk wrapcomment wrapdefault} {\n         global $v\n         set $v $oldprefs($v)\n     }\n@@ -11874,7 +11885,8 @@ proc prefsok {} {\n     global oldprefs prefstop showneartags showlocalchanges\n     global fontpref mainfont textfont uifont\n     global limitdiffs treediffs perfile_attrs\n-    global hideremotes\n+    global hideremotes wrapcomment wrapdefault\n+    global ctext\n \n     catch {destroy $prefstop}\n     unset prefstop\n@@ -11923,6 +11935,12 @@ proc prefsok {} {\n     if {$hideremotes != $oldprefs(hideremotes)} {\n         rereadrefs\n     }\n+    if {$wrapcomment != $oldprefs(wrapcomment)} {\n+        $ctext tag conf comment -wrap $wrapcomment\n+    }\n+    if {$wrapdefault != $oldprefs(wrapdefault)} {\n+        $ctext configure -wrap $wrapdefault\n+    }\n }\n \n proc formatdate {d} {\n@@ -12392,6 +12410,7 @@ set downarrowlen 5\n set mingaplen 100\n set cmitmode \"patch\"\n set wrapcomment \"none\"\n+set wrapdefault \"none\"\n set showneartags 1\n set hideremotes 0\n set maxrefs 20\n@@ -12497,7 +12516,7 @@ config_check_tmp_exists 50\n \n set config_variables {\n     mainfont textfont uifont tabstop findmergefiles maxgraphpct maxwidth\n-    cmitmode wrapcomment autoselect autosellen showneartags maxrefs visiblerefs\n+    cmitmode wrapcomment wrapdefault autoselect autosellen showneartags maxrefs visiblerefs\n     hideremotes showlocalchanges datetimeformat limitdiffs uicolor want_ttk\n     bgcolor fgcolor uifgcolor uifgdisabledcolor colors diffcolors mergecolors\n     markbgcolor diffcontext selectbgcolor foundbgcolor currentsearchhitbgcolor\n-- \ngitgitgadget\n"},{"id":"509035","messageId":"9dd297db-1c87-455b-bb95-fbc174b8a6ca@kdbg.org","threadId":"62619","inReplyTo":"d58ce9d609d8a5da3edd1e1061d84919af12b02d.1733767737.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 1/2] gitk: make headings of preferences bold","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2024-12-12T18:43:36Z","receivedAt":"2024-12-12T18:44:09Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 09.12.24 um 19:08 schrieb Christoph Sommer via GitGitGadget:\n> From: Christoph Sommer <sommer@cms-labs.org>\n> \n> Make preference groups like \"Diff display options\" stand out more.\n\nThis is a nice and obvious improvement.\n\n-- Hannes\n\n"},{"id":"509036","messageId":"c6cc8704-6043-4e6d-bc4a-d9801a372710@kdbg.org","threadId":"62619","inReplyTo":"e116685568e4f1db3bc71985945f0ff4e40e12fc.1733767737.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 2/2] gitk: add text wrapping preferences","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2024-12-12T18:58:07Z","receivedAt":"2024-12-12T18:58:33Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 09.12.24 um 19:08 schrieb Christoph Sommer via GitGitGadget:\n> From: Christoph Sommer <sommer@cms-labs.org>\n> \n> Add a new preference \"wrapdefault\" which allows enabling char/word wrap.\n> Impacts all text in the ctext widget for which no other preference exists.\n> \n> Also make the (existing) preference \"wrapcomment\" configurable graphically.\n> Its setting impacts only the \"comment\" part of the ctext widget.\n\nNice! I agree that it makes sense to wrap the comment differently than\nthe patch text section. I notice, though, that the patch text wrapping\nis also applied to the commit header section. Personally, I don't mind\nit. If someone needs a third option, they can take this patch as a\nblueprint.\n\n-- Hannes\n\n"}]}