{"thread":{"id":"11844","subject":"[RFC] git-gui and spell checking","startedAt":"2008-02-02T18:07:29Z","lastAt":"2008-02-04T02:21:22Z","messageCount":2,"participants":["Adam Flott","Shawn O. Pearce"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"67150","messageId":"alpine.DEB.1.00.0802021142320.21831@an.sumeria","threadId":"11844","inReplyTo":null,"subject":"[RFC] git-gui and spell checking","fromName":"Adam Flott","fromEmail":"adam@npjh.com","sentAt":"2008-02-02T18:07:29Z","receivedAt":"2008-02-02T18:07:29Z","isPatch":false,"sender":{"key":"adam@npjh.com","avatar":"https://gravatar.com/avatar/b1499b03b4ec6de9607c0cc5c57de362b328a9cf646277f8f77b12f80c0e6228?d=mp&s=160"},"body":"Shawn,\n\nThe other day I committed something with a comment that had a rather\nembarrassing misspelling. I had some more commits on top of that and I\nwas about to dcommit it up to the companies SVN repository before I\ncaught it. I reset the commits to fix it and all was well.\n\nBut it had me thinking about avoiding the problem in the future and how\nI handle it in other applications. So far, I think Opera has the best\nGUI spell checking[1]. I then went and poked around the git-gui code to\nsee how hard it would be to learn some minimal Tk in order to implement\nsuch a thing.\n\n[1]: http://npjh.com/etc/opera-spell-check.png\n\nIf Tk comes really natural and you could crank this sort of thing out\nand have the time to do so, I would really appreciate it. Otherwise I\nmight take a stab at it. Reading the aspell documentation (what Opera)\nuses doesn't seem all that bad about operating with stdout/stdin. I\nbrowsed the web looking for \"recipes\" for making something very similar\nto the Opera spell checker, but I don't think I found any good resources\nwhich explain going from little Tcl/Tk to a workable simple GUI.\n\nIs this some functionality you and/or others would like to see?\n\n\nAdam\n"},{"id":"67311","messageId":"20080204022122.GJ24004@spearce.org","threadId":"11844","inReplyTo":"alpine.DEB.1.00.0802021142320.21831@an.sumeria","subject":"Re: [RFC] git-gui and spell checking","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-02-04T02:21:22Z","receivedAt":"2008-02-04T02:21:22Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Adam Flott <adam@npjh.com> wrote:\n> The other day I committed something with a comment that had a rather\n> embarrassing misspelling. I had some more commits on top of that and I\n> was about to dcommit it up to the companies SVN repository before I\n> caught it. I reset the commits to fix it and all was well.\n> \n> But it had me thinking about avoiding the problem in the future and how\n> I handle it in other applications. So far, I think Opera has the best\n> GUI spell checking[1]. I then went and poked around the git-gui code to\n> see how hard it would be to learn some minimal Tk in order to implement\n> such a thing.\n> \n> [1]: http://npjh.com/etc/opera-spell-check.png\n> \n> If Tk comes really natural and you could crank this sort of thing out\n> and have the time to do so, I would really appreciate it. Otherwise I\n> might take a stab at it. Reading the aspell documentation (what Opera)\n> uses doesn't seem all that bad about operating with stdout/stdin. I\n> browsed the web looking for \"recipes\" for making something very similar\n> to the Opera spell checker, but I don't think I found any good resources\n> which explain going from little Tcl/Tk to a workable simple GUI.\n> \n> Is this some functionality you and/or others would like to see?\n\nI've been thinking about adding some sort of spell checking to git-gui.\nOne of the things I liked about Mozilla's XUL implementation is that\nyou can perform spell checking on any input field \"for free\" by just\nasking for it.  Tk hasn't caught up to that level of functionality. :-\\\n\nI would personally prefer the more complex solution that a lot of\ntools do these days, which is to underline the misspelled words\nin red and let the user correct the word by right clicking on it.\nMozilla does this for textareas in HTML (based upon that XUL widget),\nOutlook does it on Windows, Microsoft Word does it, and a number\nof Mac OS X applications implement it.\n\nThe ispell/aspell pipe protocol should make this rather easy:\n\n  - Open a bidirectional pipe to aspell on startup;\n  - Set it into terse mode;\n  - Use a UTF-8 encoding.\n\n  - On idle if the commit message area is dirty we already save it\n    to a backup file (in case of random Tk crashes).\n  - Feed the text to aspell and remember the lines we sent.\n\n  - When we get the results back, if the line still matches what is\n    in the Tk widget add a 'mispelled' tag to the mispelled words.\n    Such lines haven't been edited by the user since we submitted\n    it to aspell.\n\n  - Setup a right-click binding on the 'mispelled' tag to show a\n    popup menu.  Populate the menu with the suggestions from aspell.\n    I'm thinking its easier to re-ask aspell for suggestions then\n    it would be to keep track of the suggestions we received when\n    we asked for the mispelling detection.\n\n-- \nShawn.\n"}]}