tag:blogger.com,1999:blog-175523322024-03-07T05:27:11.715+01:00dhaumannNews around KDE and Kate.dhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.comBlogger80125tag:blogger.com,1999:blog-17552332.post-69544882088625219602010-07-09T13:58:00.002+02:002010-07-15T08:50:25.708+02:00Moving my BlogSince we have a new <a href="http://www.kate-editor.org/">Kate Homepage</a>, I''ve moved all my content over. Now the kate homepage at least has lots of Kate related content :)dhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.com0tag:blogger.com,1999:blog-17552332.post-24990661697151633912010-07-09T11:04:00.005+02:002010-07-09T11:27:50.092+02:00Kate: Scripted ActionsFinally, I came around to implement scripted actions for Kate in KDE SC 4.6. Let's take a look at how this works. When Kate starts, it searches for $KDEDIRS/share/apps/katepart/script/ for *.js files. As example, let's take a look at utils.js there:<br /><blockquote><pre>/* kate-script<br />* author: Dominik Haumann<br />* license: LGPL<br />* revision: 3<br />* kate-version: 3.4<br />* type: commands<br />* functions: moveLinesDown<br />*/<br /><br />function moveLinesDown()<br />{<br /> var fromLine = -1;<br /> var toLine = -1;<br /><br /> var selectionRange = view.selection();<br /> if (selectionRange.isValid() && selectionRange.end.line < document.lines() - 1) {<br /> toLine = selectionRange.start.line;<br /> fromLine = selectionRange.end.line + 1;<br /> } else if (view.cursorPosition().line < document.lines() - 1) {<br /> toLine = view.cursorPosition().line;<br /> fromLine = toLine + 1;<br /> }<br /><br /> if (fromLine != -1 && toLine != -1) {<br /> var text = document.line(fromLine);<br /><br /> document.editBegin();<br /> document.removeLine(fromLine);<br /> document.insertLine(toLine, text);<br /> document.editEnd();<br /> }<br />}<br /><br />function action(cmd)<br />{<br /> var a = new Array();<br /> if (cmd == "moveLinesDown") {<br /> a['text'] = i18n("Move Lines Down");<br /> a['icon'] = "";<br /> a['category'] = "";<br /> a['interactive'] = false;<br /> a['shortcut'] = "";<br /> }<br /><br /> return a;<br />}<br /><br />function help(cmd)<br />{<br /> if (cmd == "moveLinesDown") {<br /> return i18n("Move selected lines down.");<br /> }<br />}<br /></pre></blockquote>What happens is the following:<br /><ol><li>the header tells kate that there is an exported function "moveLinesDown"</li><li>so when Kate Part is loaded, it calls "action(moveLinesDown)" to check whether this function should be exposed in the GUI. Here, we return the action info that includes the displayed text, an icon, a category, whether the script needs user input (interactive) and a default shortcut. Of course, you can change the shortcuts, and also configure the toolbars to show the actions.<br /></li></ol>With this, every user is able to script arbitrary editing functions for Kate Part. We don't have to implement all those helpers in C++ anymore. The result looks like this:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcYB5-eLVWJJYpbQCVmU9LtzsfE8wW8T5ajGKzXHDwJKl-506id1bFjZhywpm8kEhqac1cqElStPJG0cOlKnPW0BC21oKL-lpiTEqUynrAZTOAhd6sk5sejSpnuaGQnPqXiMmt/s1600/scriptaction.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 298px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcYB5-eLVWJJYpbQCVmU9LtzsfE8wW8T5ajGKzXHDwJKl-506id1bFjZhywpm8kEhqac1cqElStPJG0cOlKnPW0BC21oKL-lpiTEqUynrAZTOAhd6sk5sejSpnuaGQnPqXiMmt/s400/scriptaction.png" alt="" id="BLOGGER_PHOTO_ID_5491834784971426050" border="0" /></a>You can have this already now, you just have to use the <a href="http://gitorious.org/kate/pages/Building%20Kate">development version</a> of Kate :)dhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.com2tag:blogger.com,1999:blog-17552332.post-81384015916404451402010-07-07T00:11:00.008+02:002010-07-07T00:32:45.011+02:00Enjoying TampereAs always, the KDE conference has its funny sides, as you can see on the photo: 4 Kate developers shaping the future of the (as you all know) most awesome application: Kate :-)<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEin5mtS4Ho_ymkPBMOii9qzOjgMrocnyzCu0bkBiRbu1WdqZ9KD1dUtja4d4H3BmPB_O8lVsNYqlvH5MprXPLjNcLwkgu7JTLDPimHx251shveuGXb2Rd0U_Xd1PjSVhmsAcnr9/s1600/prettywoman-small.jpeg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEin5mtS4Ho_ymkPBMOii9qzOjgMrocnyzCu0bkBiRbu1WdqZ9KD1dUtja4d4H3BmPB_O8lVsNYqlvH5MprXPLjNcLwkgu7JTLDPimHx251shveuGXb2Rd0U_Xd1PjSVhmsAcnr9/s400/prettywoman-small.jpeg" alt="" id="BLOGGER_PHOTO_ID_5490919516796073730" border="0" /></a>dhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.comtag:blogger.com,1999:blog-17552332.post-71506228217814360482010-06-24T22:32:00.003+02:002010-06-24T22:56:33.326+02:00A Flashback of Kate in GitoriousBack in February, I blogged about <a href="http://dhaumann.blogspot.com/2010/02/kate-partly-moving-to-gitorious.html">Kate's move to gitorious</a>. The main reason for this move was to make building Kate as easy as possible. If you want to build Kate as part of KDE, (as of now) you have to compile kdesupport, phonon, dbusmenu-qt, kdelibs, kdepimlibs, kdebase for kwrite and kdesdk for the kate application. Getting all this done is a huge effort, especially if you are new to KDE development (I very well remember my own times spending weeks to get everything going. Be aware of new contributors might now close to nothing about KDE and all the dependencies!).<br />As <span style="font-style: italic;">getting new contributors is essential for keeping a project alive</span>, the barrier to get involved should be as low as possible. And exactly this was achieved by moving all pieces to one place (this was gitorious for us). <a href="http://gitorious.org/kate/pages/Building%20Kate">Building Kate is so simple right</a> now that we can even make bug reporters build Kate out of the box. This helps a lot, and even results in patches from time to time. We also got quite some merge requests.<br />There were several voices at that time that considered moving "away from KDE" was very bad. However, this is not the case, as Christoph is synchronizing all the changes in KDE's subversion and gitorious almost every day. This is certainly not optimal, but looking back at the last months, we can say it was worth it.<br />KDE is moving to <a href="http://cgit.kde.org/">git.kde.org</a> in the near future. This also raises the discussion about how KDE's source code will be organized. Speaking for Kate, we certainly want to have all of Kate's code in one place, just as it is now with gitorious, no matter what :) I hope we can find a solution the KDE community can live with. To be discussed, maybe <a href="http://akademy2010.kde.org/">in Tampere in two weeks</a>? :)dhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.com2tag:blogger.com,1999:blog-17552332.post-76203255988282548682010-06-19T11:48:00.004+02:002010-06-19T12:41:53.111+02:00Kate: Debugging with Qt-CreatorLet's have a quick look at how to debug Kate and KWrite with Qt-Creator. First, make sure you meet the requirements:<br /><ol><li><a href="http://gitorious.org/kate/pages/Building%20Kate">build Kate according to this tutorial</a></li><li><a href="http://get.qt.nokia.com/qtcreator/">install Qt-Creator</a> (in my case this is version 2.0.0rc1)</li></ol>Setup the Kate project Qt-Creator once like this<br /><ol><li>start Qt-Creator: <span style="font-family:courier new;">~/kde/run.sh /path/to/qtcreator/bin/qtcreator</span><br /></li><li>invoke <span style="font-family:courier new;">File > Open File or Project</span> and choose <span style="font-family:courier new;">~/kde/kate/CMakeLists.txt</span></li><li>Build Location: choose <span style="font-family:courier new;">~/kde/build</span></li><li>Run CMake arguments: choose <span style="font-family:courier new;">../kate -DCMAKE_BUILD_TYPE=debugfull -DCMAKE_INSTALL_PREFIX=~/kde/usr</span></li><li>click the button "Run CMake" and then "Finish"</li></ol>Start debugging like this<br /><ol><li>click the "hammer" icon button on the very bottom left to compile Kate</li><li>click the "computer" icon button (3 icons above the hammer icon) and choose "kate" (or "kwrite") in the Run combo box</li><li>choose the "Debug" icon in the left pane</li><li>invoke "Debug > Start Debugging (F5)", now Kate starts<br /></li><li> open part/document/katedocument.cpp in the file tree view on the left</li><li>go to the line "<span style="font-family:courier new;">KateDocument::insertText</span>" and click "Debug > Toggle Breakpoint (F9)"</li><li>now if you type a character in Kate, Qt-Crator will halt in <span style="font-family:courier new;">KateDocument::insertText</span></li><li>chose "Debug > Step Opver (F10)" (and "Debug > Stip Into (F11)") to step through the code</li><li>click on "Locals and Watchers" in the debugging pane on the bottom and you see the values of local variables</li></ol>Happy debugging :)dhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.com4tag:blogger.com,1999:blog-17552332.post-24738044931969518812010-06-10T22:55:00.003+02:002010-06-20T23:58:22.871+02:00Kate: Code Folding CrashWe still have a <a href="http://bugs.kde.org/show_bug.cgi?id=213964">crash in Kate's code folding code</a>; no one was able to find a proper fix, yet. So if you want to get your hands dirty, <a href="http://gitorious.org/kate/pages/Building%20Kate">just build Kate</a>, find a fix and be the hero of all Kate developers :)<br /><br /><span style="font-weight: bold;">Update: </span>Fixed by Stefan Schenk <a href="http://gitorious.org/kate/kate/commit/8db89fcffbb18a9001eedbc4d33256026fd5ae85">in this commit for KDE 4.5</a>. Awesome! :)dhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.com3tag:blogger.com,1999:blog-17552332.post-7083852619167504222010-04-28T17:53:00.002+02:002010-04-29T00:10:48.263+02:00Kate Internals: Smart Cursors and Smart Ranges<span style="font-size:180%;">SmartCursors and SmartRanges in KDE 4.0 - KDE 4.4</span><br /><br />Since KDE 4.0 the KTextEditor interfaces have so called <a href="http://api.kde.org/4.4-api/kdelibs-apidocs/interfaces/ktexteditor/html/classKTextEditor_1_1SmartCursor.html">SmartCursors</a> and <a href="http://api.kde.org/4.4-api/kdelibs-apidocs/interfaces/ktexteditor/html/classKTextEditor_1_1SmartRange.html">SmartRanges</a>. A SmartCursor is a text cursor (i.e. a line/column tuple) , which is bound to a text document. When editing the text document, the cursor is automatically moved such that it maintains its position. You need this for the displayed text cursor in a view for instance. If you type text, the cursor automatically moves.<br />A SmartRange consists of two SmartCursors: start and end. We use that for instance for the text selection or the inline spell checking, or KDevelop uses it to add arbitrary highlighting to parsed C/C++ code. Again, if you modify text in the document, the text range automatically moves, expands or shrinks.<br /><br />The concept of SmartCursors and SmartRanges is doubtless very useful. However, for KDE 4.5 the Kate developers came up with an alternative implementation that will even deprecate the SmartCursors and SmartRanges in KDE 4.6. The reason for this is that the current implementation has several problems, which we will discuss in the following.<br /><br /><span style="font-size:180%;">API Usage</span><br /><br />The <a href="http://api.kde.org/4.4-api/kdelibs-apidocs/interfaces/ktexteditor/html/classKTextEditor_1_1SmartRange.html">SmartRanges</a> API can be used in very wrong ways. For instance, the <a href="http://api.kde.org/4.4-api/kdelibs-apidocs/interfaces/ktexteditor/html/classKTextEditor_1_1SmartInterface.html">SmartInterface</a> has the two functions deleteCursors() and deleteRanges(). Besides that, a document reload also deletes all SmartCursors and SmartRanges. Both cases lead to a dangling pointer if you use SmartCursors or SmartRanges. Hence, whenever you use them, you always need a so-called <a href="http://api.kde.org/4.4-api/kdelibs-apidocs/interfaces/ktexteditor/html/classKTextEditor_1_1SmartCursorWatcher.html">SmartCursorWatcher</a> /<a href="http://api.kde.org/4.4-api/kdelibs-apidocs/interfaces/ktexteditor/html/classKTextEditor_1_1SmartCursorNotifier.html"> SmartCursorNotifier</a> and <a href="http://api.kde.org/4.4-api/kdelibs-apidocs/interfaces/ktexteditor/html/classKTextEditor_1_1SmartRangeWatcher.html">SmartRangeWatcher</a> / <a href="http://api.kde.org/4.4-api/kdelibs-apidocs/interfaces/ktexteditor/html/classKTextEditor_1_1SmartRangeNotifier.html">SmartRangeNotifier</a>, which tell you that your SmartCursor or SmartRange is about to be deleted. Watcher and Notifier basically do the same thing. Besides deletion notification, they also tell you more e.g. that the SmartCursor position changed. If you use a notifier, those notifications are sent via signals. If you use a watcher, you have to overwrite virtuals. That is, we have two different concepts that basically do the same thing. If you use thousands of SmartRanges e.g. for arbitrary highlighting, we have possibly thousands of those emits, which does not really scale.<br /><br />The API also allows to have parent/child relations, i.e. a SmartRange can have children and a parent. It is possible to traverse this hierarchy, and again since you get the pointers you can delete arbitrary SmartRanges or SmartCursors. Another reason why you always need a notifier or watcher. And if you have a notifier/watcher, you always have the signals emitted when e.g. a cursor changes, as explained above.<br /><br />Further, we have lots of places where we use reference object KTextEditor::Cursor& as parameter. This const reference-object signals that it does not change. But due to SmartRange deriving from KTextEditor::Cursor, this object might also be a SmartCursor. So despite of being declared as a const object, it may change its position behind your back. This may lead to unexpected behaviours in e.g. loops where the line or column of the cursor is assumed to be constant. This is a problem in almost all functions in KatePart, so passing SmartCursors as Cursors is a very bad idea, but of course allowed.<br /><br /><span style="font-size:180%;">Scaleability Problems</span><br /><br />As mentioned above, you always need a Notifier or Watcher for all SmartCursors and SmartRanges. This will emit lots of signals you probably rarely need. Still, there is no way around it. This is a huge overhead, it simply does not scale.<br /><br /><span style="font-size:180%;">Implementation</span><br /><br />The implementation is really complex and rather undocumented in most areas. Unfortunately, only very few (or maybe even no one) really understand the code. Besides that, it is very fragile. If you change something, you might break the code. Hence, we often heard similar comments like "don't touch the code, otherwise it will break". Such comments alone already indicate that the current implementation is not maintainable. Unmaintainable code is bad, especially in open source projects (this is not a good way to gain new developers at all). There are other downsides of the current implementation: SmartCursors need a lot of memory for each instance; there are lots of features like animations for SmartRanges, which make the code even more complex; redundancy of watchers and notifiers bloat the code and influence the runtime behavior.<br /><br /><span style="font-size:180%;">Threading</span><br /><br />It seems there was the idea of making the KTextEditor interfaces thread safe. The SmartRanges interact with the content of the document, e.g. querying lines count and line length of lines in the text buffer. As this is done by other threads we need correct locking in all places: in document content changes, in smart cursors, in smart ranges, in the painting routines, etc. The current state in KatePart is that not all functions do the right locking. That's why we have lots of asserts/crashs. KatePart already has more than 150 lockings at the moment, but they still do not voer problems. And very few developers (or no one?) really know when to lock and when not to. This is especially complex since we want to ensure that the locks are not hold while emitting signals or calling functions provided from the outside as callbacks, this is still not done completely right, too.<br /><br />If you think about Qt, the GUI widgets are also not thread-safe, they all live in the main thread. And if you need data in other threads, you always use queued signals. This is pretty much what we experience in KatePart now. Not enough locking? Too much locking? In other words: It's far too complex to make the KTextEditor interfaces thread-safe...<br /><br /><span style="font-size:180%;">Threading and Revisions</span><br /><br />Now to another issue in the implementation. KDevelop uses KTextEditor::Ranges in the parsing thread. Think of the following use case: KDevelop gets all the document text in the current revision (or version, if you prefer). Now it takes some time until the parsing is finished. When it's finished, KDevelop uses the Ranges (which initially belong to the old revision of the document), and then translates those ranges to the current version of the text document (this is simple: Just track all edits inside KatePart (delete, insert, wrap, unwrap) and apply those transformations to the ranges). Now we transformed ranges from an old text revision to the current text revision. This means KDevelop does not have to parse everything again, as it knows exactly which parts changed. Awesome indeed :) However, now comes the problem: To transform Cursors and Ranges between revisions, you have to tell the SmartInterface about the revision you are working with. This is done via SmartInterface::useRevision(int). The API documentation says: <span style="font-style: italic;">Tell the smart interface to work against the given </span><em style="font-style: italic;">revision</em><span style="font-style: italic;"> when creating cursors and ranges.</span> That is, if you call useRevision() once, all succeeding calls like newSmartRange() etc are working in the past (at that revision). Also kind of cool, since useRevision() works locally in each thread. That is different threads don't influence each other. But there is huge problem with this: Think of a KTextEditor user (KDevelop, Kile, ...) uses useRevision() in the main thread. Then all succeding calls of e.g. newSmartRange() use an old revision instead of the current one. Hence, KatePart itself is completely broken in that case. (This case is now catched via a qFatal() in KatePart). But again this shows that multi-threading simply complicates the matter a lot. It would have been much easier to say transformRange(int fromRevision, int toRevision) instead of just one translateFromRevision() that translates the given range against the revision specified through useRevision(). Hence, the current API is unfortunately pretty much broken by design.<br /><br /><span style="font-size:180%;">A necessary Step?</span><br /><br />Often it's hard to get things done right in the first try. So maybe the issues above are a necessary step to a much better implementation. And that is exactly what happened in the last two months: We have new interfaces called <a href="http://api.kde.org/4.x-api/kdelibs-apidocs/interfaces/ktexteditor/html/classKTextEditor_1_1MovingInterface.html">MovingInterface</a>, <a href="http://api.kde.org/4.x-api/kdelibs-apidocs/interfaces/ktexteditor/html/classKTextEditor_1_1MovingCursor.html">MovingCursor</a> and <a href="http://api.kde.org/4.x-api/kdelibs-apidocs/interfaces/ktexteditor/html/classKTextEditor_1_1MovingRange.html">MovingRange</a>. For feedback there is <a href="http://api.kde.org/4.x-api/kdelibs-apidocs/interfaces/ktexteditor/html/classKTextEditor_1_1MovingRangeFeedback.html">MovingRangeFeedback</a>, which uses callbacks for notification (no signals by intention). All those classes have unit tests. KatePart in KDE 4.6 will not implement any Smart* interface anymore. Hence, KatePart will be completely single threaded again. We already started to remove several thousands of lines Smart* code that was never used/finished. Much more will follow immediately after the KDE 4.5 release. This means all developers using Smart* from the KTextEditor interfaces should migrate to the Moving* pendents for KDE 4.5 already, if possible.<br /><br />I'll provide very detailed information about the Moving* implementation in further blogs during the next month.dhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.com17tag:blogger.com,1999:blog-17552332.post-78088054275614061332010-04-27T21:45:00.005+02:002010-04-27T21:55:11.719+02:00Kate XML Completion PluginA while ago I've blogged about the Kate's most powerful plugins: the <a href="http://dhaumann.blogspot.com/2010/01/kate-xml-completion-plugin-help-wanted.html">XML completion plugin</a>. Thanks to Tomáš Trnka this plugin is back alive with all its features since today and compiled by default in trunk: It will be included in KDE 4.5. Yay! :) And if you need it already now for KDE 4.4, you can <a href="http://dhaumann.blogspot.com/2010/04/quick-compiling-kate-in-stable-kde.html">build Kate yourself very easily according to this howto</a>, without touching your global KDE installation (probably interesting for KDE documentation writers!). Have fun!dhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.com0tag:blogger.com,1999:blog-17552332.post-1709184683750719902010-04-17T14:10:00.006+02:002010-05-01T15:50:35.452+02:00Quick Compiling Kate in a stable KDE EnvironmentSince all of the <a href="http://gitorious.org/kate">Kate code is now co-hosted on gitorious</a>, it became very easy to build Kate in your stable KDE >= 4.4 environment. This means you can run the newest version of Kate with very few effort. Just give it a try and do the following steps:<br /><ol><li>make sure you have the following packages installed: git, cmake and kdelibs development package (on openSUSE this is <span style="font-family:courier new;">git</span>, <span style="font-family:courier new;">cmake</span> and <span style="font-family:courier new;">libkde4-devel</span>)<br /></li><li>create and change into a KDE development directory:<br /><span style="font-family:courier new;">mkdir ~/kde; cd ~/kde</span></li><li>get a copy of the Kate code:<br /><span style="font-family:courier new;">git clone git://gitorious.org/kate/kate.git</span></li><li>create and change into a build directory for compilation:<br /><span style="font-family:courier new;">mkdir build; cd build</span><br /></li><li>run the configure process with cmake:<br /><span style="font-family:courier new;">cmake ../kate -DCMAKE_BUILD_TYPE=fulldebug \<br />-DCMAKE_INSTALL_PREFIX=~/kde/usr</span></li><li>compile Kate:<br /><span style="font-family:courier new;">make</span></li><li>finally install Kate:<br /><span style="font-family:courier new;">make install</span><br /></li></ol>That's all! This installs Kate locally into the separate directory <span style="font-family:courier new;">~/kde/usr</span>, so that your global KDE installation will not be touched at all.<br /><br />Now on to starting the newly compiled Kate. Create a file ~/kde/run.sh with the following content:<br /><pre><blockquote><span style="font-family:courier new;">#!/bin/bash<br />export KATE_DIR=~/kde/usr</span><br /><span style="font-family:courier new;">export PATH=$KATE_DIR/bin:$PATH</span><br /><span style="font-family:courier new;">export LD_LIBRARY_PATH=$KATE_DIR/lib:$LD_LIBRARY_PATH</span><br /><span style="font-family:courier new;">export KDEDIR=$KATE_DIR</span><br /><span style="font-family:courier new;">export KDEDIRS=$KDEDIR<br />export XDG_DATA_DIRS=$XDG_DATA_DIRS:$KATE_DIR/share<br /># update KDE's system configuration cache<br />kbuildsycoca4<br /># start app<br />$@</span></blockquote></pre>Now you can run the compiled Kate version with <span style="font-weight: bold;font-family:courier new;" >~/kde/run.sh kate</span>. Just calling <span style="font-weight: bold;font-family:courier new;" >kate</span> directly will start the system version of Kate.<br /><br />Your copy of Kate contains <a href="http://gitorious.org/kate/kate/trees/master">all of the Kate code</a>, i.e.: the KTextEditor interfaces, Kate Part, KWrite and the Kate Application. Feel free to send patches to our mailing list <a href="mailto:kwrite-devel@kde.org">kwrite-devel@kde.org</a>. And join <a href="irc://irc.kde.org/kate">#kate on irc.kde.org</a> :-)<br /><br />Note for KDE developers: All the changes in git are merged back to KDE's subversion repository in a timely manner. So don't worry about Kate moving away from KDE; this is not the case.<br /><br /><span style="font-style: italic;">(Updated on 2010-04-17: Allow installation into local directory.</span>)dhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.com16tag:blogger.com,1999:blog-17552332.post-54791367981116835072010-03-02T23:17:00.004+01:002010-03-02T23:34:29.519+01:00Kate Internals: Text Buffer<p>Right now, in Kate's gitorious repository we, or rather mainly Christoph, is rewriting the heart of Kate: The text buffer. In this blog I'll explain how the text buffer works in detail. After reading, you'll be able to understand the code. And be warned: Probably you will be desperately amazed about its awesomeness! So this is a must read :^) The following content is based on the <a href="http://gitorious.org/kate/pages/Design%20Idea%20for%20KateTextBuffer">notes for design ideas for the new text buffer</a>.<a href="http://gitorious.org/kate/pages/Design%20Idea%20for%20KateTextBuffer"><span style="font-weight: bold;font-size:130%;" ></span></a></p><br /><p><span style="font-weight: bold;">Storage</span>. Kate Part internally stores the content of a text document as a QVector of text lines. Each text line holds the text in a QString object as well as additional data like color attributes for highlighting. Inserting and removing text lines implies inserting or removing items in the QVector of the text lines. This is can get slow when there are thousands of text lines in a document, because QVector has to move the memory every time. Thus, to keep text operations fast, Kate splits all text lines into several text blocks: Each text block contains a certain amount of lines (e.g. 256). The expense of memory movement is then always limited. When a text block grows too much, it is automatically split. When the amount of lines in a text block shrinks, it is merged with the previous text block. In other words, Kate's text buffer automatically balances the text blocks. The basic idea of Kate's text buffer, the text blocks and text lines looks like this:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqIRCTiJELDchM8CZ8HHNvK5CFmc5z2Jf-Fig2KOnVHQHfeOPnT2vXGauAzJBOS2gaGdeLiqKcIBgo8qcL5rnZuWBVzP7gf0OgOt0XQrT-eTlQ3IWM8XqjQ-oq3ZLpS6ZiItrq/s1600-h/katetextbuffer.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqIRCTiJELDchM8CZ8HHNvK5CFmc5z2Jf-Fig2KOnVHQHfeOPnT2vXGauAzJBOS2gaGdeLiqKcIBgo8qcL5rnZuWBVzP7gf0OgOt0XQrT-eTlQ3IWM8XqjQ-oq3ZLpS6ZiItrq/s400/katetextbuffer.png" alt="" id="BLOGGER_PHOTO_ID_5443808860445540210" border="0" /></a></p><br /><p><span style="font-weight: bold;">Text Cursors and Ranges.</span> Text manipulation always takes place at certain positions in a text. Such a position is called a text cursor. Each text cursor is defined by a line and a column. Further, to specify e.g. text selections, we need text ranges. A text range has a start cursor and an end cursor. For instance, if you have two views of the same document, you want the cursor in the 2nd view to keep its correct position in the text if you insert text in the 1st view. Thus, text cursors have to be kind of intelligent. Whenever text changes, each text cursor needs to be moved. As a text range just consists of two text cursors, we will focus only on text cursors for now. The question is how to implement this efficiently? If we store all text cursors in a list in the text buffer, we have to iterate over all text cursors on every editing operation. This obviously does not scale for thousands of text cursors (KDevelop for instance uses thousands of text cursors for the highlighting). The solution is the same as with the text content itself: Let's just put a list of all text cursors in a text block to the text block itself. During text editing, we only have to adapt all text cursors of a single text block instead of all text cursors in a document. This looks as follows:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghX5ic__yatUbj7LelmYvDjXhwB7-ZpJJlyMYD3E3nbrW_eyZz4VvKnJ9PYAFWclyUo_tC_Ai1PcWv-7_Nc9yOMUhrqT84w7v6ow4M5cgQQLvMZqM2_eOGoOw3jaQ6zJ6rOw_A/s1600-h/katetextcursor.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghX5ic__yatUbj7LelmYvDjXhwB7-ZpJJlyMYD3E3nbrW_eyZz4VvKnJ9PYAFWclyUo_tC_Ai1PcWv-7_Nc9yOMUhrqT84w7v6ow4M5cgQQLvMZqM2_eOGoOw3jaQ6zJ6rOw_A/s400/katetextcursor.png" alt="" id="BLOGGER_PHOTO_ID_5443814894321952418" border="0" /></a></p><br /><p><span style="font-weight: bold;">Editing Operations</span>. When editing text, you usually have only four different types of text manipulation:<br /><ol><li>insert text at a text cursor inside one line<br /></li><li>remove text at a text cursor inside one line<br /></li><li>wrap line at a text cursor (e.g. by hitting <return/enter>)</li><li>unwrap line (e.g. by hitting <backspace> at the beginning of a line)</li></ol>Those editing primitives are implemented in the Kate::TextBuffer and Kate::TextBlock and take care of balancing the text blocks. For each one the set of text cursors in a text block has to be adapted. Of course, corner cases need to be taken into account: For instance, unwrapping the first line in a text block means that cursors in the first line need to be moved to the previous text block. All editing primitives emit a signal, such that additional layers later can track what happens. For instance, the undo/redo system needs to know all editing operations. Or on top of that we could implement vim like swap file support, i.e., track all changes from the beginning, and if Kate crashes, replay all the editing primitives on the original files.</p><br /><p><span style="font-weight: bold;">Transactions</span>. A transaction consists of several of the four editing operations. For instance, if you select text and then move it to another location in the document with drag & drop you want this to be grouped together to a single text operation on undo/redo. (The text operations in this case are unwrap lines and remove text, then insert text and wrap line). To be able to specify which parts of text operations belong together, the text buffer provides two functions: startEditing() starts a transaction and finishEditing() closes it. Those functions use reference counting, so you can call startEditing() multiple times and only the last finishEditing() completes a transaction. Again, signals are emitted e.g. in finishEditing() such that other layers (undo/redo system) are notified about this.</p><br /><p><span style="font-weight: bold;">Revisions</span>. As an easy way to check whether a document changed you can get the current revision of the text buffer. The revision is simply an int64 starting with 0 after loading a document. The revision is incremented in every of the 4 editing primitives. This way you don't have to listen to multiple signals like textInserted() and textRemoved(). This could be useful for e.g. KDevelop's background parser: Parse a file. When done, check whether the revision is the same. If yes, parsing was successful. If not, parse again. This is how QtCreator does it. Easy and straight forward.</p><br /><p><span style="font-weight: bold;">Unit Tests</span>. The text buffer, text block, text line, text cursors are all designed such that unit tests can be written. Hence, each of the above implementation details will be covered by unit tests.</p><br /><p><span style="font-weight: bold;">Further ideas</span>. As mentioned previously, the design of the text buffer leaves room for further features. For now, let's face two ideas:<br /><ul><li>Vim like swap files: If Kate or the application using Kate Part crashes, the unsaved data in the text document is lost. Vim has a backup mechanism called 'swap files' to recover from crashes to avoid data loss since years, and it works as follows: Each of the 4 editing primitives explained above are streamed into a separate file. When you save a file successfully, the swap file is cleared. If a crash happens, vim loads the original text document and then replays all editing operations in the swap file. This way the current unsaved editing state is recovered; no data is lost. Since the text buffer emits all necessary signals, implementing this feature is kind of trivial. Any takers?<br /></li><li>Right now, the highlighting works in an extra class, accessing the text buffer's text lines and setting the text attributes such as the color. As idea, we could also derive a class Kate::HighlightingBuffer from Kate::TextBuffer and do the additional modifications in the derived class instead of an extra class. We'll have to see whether that makes sense.</li></ul></p><br /><p><span style="font-weight: bold;">Please Contribute</span>.<br /><ul><li>join <a href="irc://irc.kde.org/kate">#kate on irc://irc.kde.org</a></li><li><a href="http://gitorious.org/kate">checkout the code base</a>, clone it, create branches, and merge back!</li><li>other kate internals: <a href="http://dhaumann.blogspot.com/2008/11/kate-internals-undoredo-system.html">undo/redo system</a> (little bit outdated, but all in all still valid)<br /></li></ul></p>dhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.com5tag:blogger.com,1999:blog-17552332.post-6619286412992586412010-02-27T16:55:00.004+01:002010-02-27T17:17:33.174+01:00Kate Partly Moving to GitoriousWe are about to move the applications Kate and KWrite as well as the libraries KTextEditor and Kate Part to <a href="http://gitorious.org/kate">gitorious</a>. Christoph is working on the migration right now in order to keep the development history. Things look good so far, so the migration is soon finished.<br />We have discussed a bit about the migration to gitorious on the Kate Developer Meeting and Christoph came up with this mainly because building only KTextEditor, Kate Part, KWrite and Kate is much <span style="font-style: italic;">faster and easier</span> compared to building the KDE modules kdesupport, kdelibs, kdepimlibs, kdebase, kdesdk.<br />I myself remember the time where I started KDE development, and it took more than two weeks to have a first successful build of KDE. You have to learn so many things at once, like revision control, lots of so far unknown software, and what not. Talking to other developers verifies this. In other words: Getting into KDE development is not easy and straight forward.<br />Moving to gitorious removes this barrier for Kate development: You just checkout the Kate repository and that's all you need. It would be nice if you join Kate development and contribute patches :)<br /><span style="font-weight: bold;">What does that mean for Kate in KDE? <span style="font-style: italic;">Nothing changes.</span> We will merge the changes in Gitorious back to the main KDE development line and vice versa.</span>dhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.com11tag:blogger.com,1999:blog-17552332.post-18017961131848802322010-02-17T14:15:00.004+01:002010-02-17T16:06:43.827+01:00The Power of Developer MeetingsSince several years, we have lots of small <a href="http://ev.kde.org/activities/devmeetings/">developer meetings in the KDE project</a>, gratefully supported by the KDE e.V. There, developers of a certain project (e.g. KMail/kdepim, Plasma, you name it) meet to discuss further plans and to push the project further. From experience we can tell that those meetings are really beneficial in several ways:<br /><ul><li>Social aspect: You get to know the other developers involved in the project in real life, which is a great motivation factor. This also happens at KDE's annual conference <a href="http://akademy.kde.org/">Akademy</a>, although there are <span style="font-style: italic;">a lot</span> more people.<br /></li><li>Productivity: Since you are sitting next to each other discussions about <span style="font-style: italic;">how</span> to do <span style="font-style: italic;">what</span> are very focused. It's amazing how quickly a project can evolve this way. (I haven't seen such focused work in companies, yet. I guess the variance in the knowledge of people involved is higher. And the motivation is usually very different).<br /></li><li>Knowledge Transfer: Since participants are experts in different areas, discussions lead to knowledge transfer. This is essential, as sometimes developers have very few free time to contributes to a project. Spreading the knowledge helps a lot to keep the project alive.<br /></li><li>Steady Contributions: We are always open for new contributors. Just send a patch, <a href="http://techbase.kde.org/Contribute/Get_a_SVN_Account">get commit access</a> and join development. Experience shows that participants of a developer meeting usually contribute for years to come.</li></ul>Enough said, here is what happened the last three days in Kate:<br /><ul><li><a href="http://websvn.kde.org/?view=revision&revision=1091712">memory optimization:</a> <a href="http://websvn.kde.org/?view=revision&revision=1091718">remove unused</a> <a href="http://websvn.kde.org/?view=revision&revision=1091735">edit history items</a><br /></li><li><a href="https://bugs.kde.org/show_bug.cgi?id=227293">fix crash in doHighlight due to wrong initialization</a><br /></li><li><a href="https://bugs.kde.org/show_bug.cgi?id=190853">don't squeeze captions in the window title</a><br /></li><li><a href="https://bugs.kde.org/show_bug.cgi?id=225746">fix crash when using katepart in e.g. konqueror</a><br /></li><li><a href="http://websvn.kde.org/?view=revision&revision=1091115">kate vi mode improvements</a><br /></li><li><a href="https://bugs.kde.org/show_bug.cgi?id=223624">fix: invalid js commands lead to a crash</a><br /></li><li><a href="http://websvn.kde.org/?view=revision&revision=1091074">share code snippets between kate and kdevelop</a><br /></li><li><a href="https://bugs.kde.org/show_bug.cgi?id=196516">more syntax highlighting files for asm dialects</a><br /></li><li><a href="http://websvn.kde.org/?view=revision&revision=1091041">replace: show number of replacements in a passive popup</a><br /></li><li><a href="https://bugs.kde.org/show_bug.cgi?id=125104">new command line command: unwrap</a><br /></li><li><a href="https://bugs.kde.org/show_bug.cgi?id=227008">fix crash when switching sessions with multiple main windows</a><br /></li><li><a href="https://bugs.kde.org/show_bug.cgi?id=129494">fix incorrect global replace %s///g</a><br /></li><li><a href="https://bugs.kde.org/show_bug.cgi?id=226409">fix crash in smart range group handling</a><br /></li><li><a href="http://websvn.kde.org/?view=revision&revision=1090637">turn search option "highlight all" into the action "find all"</a><br /></li><li><a href="http://websvn.kde.org/?view=revision&revision=1090635">replace old text snippet plugin with new one</a><br /></li><li><a href="http://websvn.kde.org/?view=revision&revision=1090601">optimize away nops for text editing</a><br /></li><li><a href="http://websvn.kde.org/?view=revision&revision=1090598">fixes in the template handler code</a><br /></li><li><a href="http://websvn.kde.org/?view=revision&revision=1090593">remove pythong browser plugin, since the symbol viewer plugin can do the same and much more</a><br /></li><li><a href="http://websvn.kde.org/?view=revision&revision=1090592">remove unmaintained html tools plugin, since it was never ported</a><br /></li><li><a href="http://websvn.kde.org/?view=revision&revision=1090558">optimization for bracket matching</a><br /></li><li><a href="http://websvn.kde.org/?view=revision&revision=1090515">new text snippet plugin: context aware snippet completion</a><br /></li><li><a href="https://bugs.kde.org/show_bug.cgi?id=226529">fix filtering in the file browser plugin</a><br /></li><li><a href="http://websvn.kde.org/?view=revision&revision=1090382">always start search&replace from cursor</a><br /></li><li><a href="http://websvn.kde.org/?view=revision&revision=1090377">developer doumentation</a> <a href="http://websvn.kde.org/?view=revision&revision=1090380">for smart range usage</a><br /></li><li><a href="https://bugs.kde.org/show_bug.cgi?id=169415">cstyle indenter: fix indentation of multi-line comments</a><br /></li><li><a href="http://websvn.kde.org/?view=revision&revision=1090241">update of syntax highlighting for MySQL</a><br /></li><li><a href="http://websvn.kde.org/?view=revision&revision=1090237">performance optimization</a> <a href="http://websvn.kde.org/?view=revision&revision=1090238">in the highlighting system:</a> <a href="https://bugs.kde.org/show_bug.cgi?id=225228">bug</a>, <a href="https://bugs.kde.org/show_bug.cgi?id=145686">bug</a><br /></li><li><a href="https://bugs.kde.org/show_bug.cgi?id=152203">fix crash in removeTrailingSpaces, if undo/redo is active</a><br /></li><li><a href="http://websvn.kde.org/?view=revision&revision=1090122">new interface for getting the mode at a given cursor</a><br /></li><li>search & replace: <a href="http://websvn.kde.org/?view=revision&revision=1090106">lots of</a> <a href="http://websvn.kde.org/?view=revision&revision=1090100">code</a> <a href="http://websvn.kde.org/?view=revision&revision=1090103">cleanups</a><br /></li><li><a href="http://websvn.kde.org/?view=revision&revision=1090101">basic regression tests for search</a>, <a href="http://websvn.kde.org/?view=revision&revision=1090102">scripting</a>, <a href="http://websvn.kde.org/?view=revision&revision=1090164">and more</a>...<br /></li><li><a href="http://websvn.kde.org/?view=revision&revision=1090086">scripting: add support for quoting in command line scripts</a><br /></li><li><a href="https://bugs.kde.org/show_bug.cgi?id=226724">Kate crashes because of spell checking</a><br /></li><li><a href="https://bugs.kde.org/show_bug.cgi?id=222181">fix regression: with auto brackets + selection</a><br /></li><li><a href="https://bugs.kde.org/show_bug.cgi?id=213096">find-in-files: set filter correctly when opening the search</a><br /></li><li><a href="http://websvn.kde.org/?view=revision&revision=1089691">fix: make reload-scripts work with new functions</a><br /></li><li><a href="http://websvn.kde.org/?view=revision&revision=1089690">share a KCompletion object between all KateCmdLineEdits</a><br /></li></ul>There are even more changes I left out. Most of those changes will be in KDE 4.4.1. If you want to help, join #kate in irc.kde.org!dhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.com0tag:blogger.com,1999:blog-17552332.post-75354810336297649462010-02-17T13:57:00.006+01:002010-02-17T14:56:36.337+01:00Developer Meeting: More on scripting KateWe are 10 people here at the developer meeting in Berlin. Kate, KDevelop as well as Okteta see a lot of commits. I'll mainly talk about what's happening in the holy Kate land, though :-)<br />Yesterday I closed a bug requesting an "unwrap" feature in Kate that works like "Tools > Join Lines" but maintains paragraph separation, i.e., empty lines are not removed. This feature is implemented now in javascript. Further infos:<br /><ul><li><a href="https://bugs.kde.org/show_bug.cgi?id=125104">the bug report</a></li><li><a href="http://websvn.kde.org/trunk/KDE/kdelibs/kate/script/data/utils.js?r1=1091040&r2=1091039&pathrev=1091040">the javascript implementation</a></li></ul>To run the script simply switch to the command line (F7) and write "unwrap". If you have further ideas about useful scripts, don't hesitate to start hacking right away, see also<br /><ul><li><a href="http://docs.kde.org/stable/en/kdesdk/kate/advanced-editing-tools-scripting.html">how to extend Kate with scripting</a></li></ul>Fixes with regard to the scripting support in the last days are<br /><ul><li><a href="http://websvn.kde.org/?revision=1089691&view=revision">make reload-scripts work properly</a></li><li><a href="http://websvn.kde.org/?revision=1089690&view=revision">fix command line completion for new scripts without restarting kate</a><br /></li><li><a href="http://websvn.kde.org/?revision=1090086&view=revision">support quoting in arguments for scripts</a></li><li><a href="http://websvn.kde.org/?revision=1091093&view=revision">fix crash for invalid commands in scripts</a></li></ul>Those fixes will be in KDE 4.4.1. More to come in other blog entries :-)dhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.com6tag:blogger.com,1999:blog-17552332.post-40393529045601906892010-01-17T12:58:00.003+01:002010-01-17T13:28:47.854+01:00Kate XML Completion Plugin: Help WantedIn KDE3 Kate had a plugin called "XML Completion Plugin". It was able to list XML elements, attributes and attribute values and entities in a completion popup menu depending on the currently active DTD. For instance, it was able to complete all your KDE/docbook tags and, thus, was one of the best tools for writing KDE documentation.<br /><br />Unfortunately, <a href="https://bugs.kde.org/show_bug.cgi?id=222859">this plugin has not been ported to KDE4</a>, yet. So this is a request for developers: Please someone pick it up and make it available for Kate in KDE4.<br /><br />The location in svn is: <a href="http://websvn.kde.org/trunk/KDE/kdesdk/kate/plugins/xmltools">trunk/KDE/kdesdk/kate/plugins/xmltools</a><br />Just enable this folder in the kate/plugins/CMakeLists.txt file and start porting it. The code completion interface changed quite a lot, but there are other plugins and good api documentation (<a href="http://api.kde.org/4.x-api/kdelibs-apidocs/interfaces/ktexteditor/html/index.html">KTextEditor interfaces</a>, <a href="http://api.kde.org/4.x-api/kdesdk-apidocs/kate/interfaces/kate/html/index.html">Kate Application interfaces</a>) where you can have a look at how things work.<br /><br />Having a working XML Completion plugin for KDE4.5 would be awesome.dhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.com4tag:blogger.com,1999:blog-17552332.post-38800470175424318732009-11-01T15:04:00.004+01:002009-11-01T22:19:11.614+01:00Scripting KateIn my <a href="http://dhaumann.blogspot.com/2009/10/extending-kate-with-scripts.html">last blog</a> I explained Kate's scripting features in KDE 4.4. To better understand how scripting can be used let's look at some use cases.<br /><ul><br /><li><a href="https://bugs.kde.org/show_bug.cgi?id=125104">join lines</a>: This feature request wants the action "join lines" to not join different paragraphs, i.e. not remove empty lines. We have not implemented this wish, as there are probably users who prefer the current behaviour. This request can be fixed by writing a small script that joins the lines according to the user's wishes.</li><br /><li><a href="https://bugs.kde.org/show_bug.cgi?id=93398">reformat paragraph</a>: An intelligent reformatter for paragraphs. Should be rather straight forward to implement.</li><br /><li>XML tools: In KDE3, Kate once had a xmltools plugin. Unfortunately noone ported it to KDE4. The plugin provided lots of very useful features for xml editing. For example, you could select text and then wrap it with xml elements, e.g. "text" would become "<para>text</para>". This is a perfect example for a command line script as well. Any volunteers? :)</li><br /></ul><br />Scripting also brings us closer to fixing the following reports:<br /><ul><br /><li><a href="https://bugs.kde.org/show_bug.cgi?id=44908">macro system</a>: Kate still does not have a macro system. A macro can be interpreted as a group of scripts, executed in a sequence (more or less). The vi input mode already supports pretty complex commands, and the code for scripting is all there. It's just a matter of putting this together so it's usable for users.</li><br /><li><a href="http://bugs.kde.org/show_bug.cgi?id=65740">word count</a>: maybe the word count features can be implemented by a script (too slow?). Problem is, that a script cannot show dialogs etc.</li><br /></ul><br />To make scripting an even better experience, we still need to implement binding shortcuts to scripts. Again: any volunteers? :)dhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.com3tag:blogger.com,1999:blog-17552332.post-83110038685065039932009-10-29T18:41:00.007+01:002009-10-29T19:11:14.241+01:00Extending Kate with ScriptsAs mentioned in one of my <a href="http://dhaumann.blogspot.com/2009_09_01_archive.html">last blogs</a>, there has been quite some work for JavaScript scripting support in trunk recently. So what will Kate 3.4 (KDE 4.4) will bring? This is explained in detail in the sections:<br /><ul><li>Indentation Scripting<br /></li><li>Command Line Scripting</li><li>Some Remarks<br /></li></ul>The scripting allows to extend Kate with lots of little helper functions. All users can add scripts as they wish. The documentation here is copied from the <a href="http://docs.kde.org/development/en/kdesdk/kate/advanced-editing-tools-scripting.html">official Kate handbook</a>. So instead of using this blog as reference, please use the handbook later for an up-to-date version. To script something useful, you'll need to know the scripting API. All the available functions are documented in the section <a href="http://docs.kde.org/development/en/kdesdk/kate/advanced-editing-tools-scripting.html#advanced-editing-tools-scripting-api">Scripting API in the handbook</a> as well. Enough said, here we go:<br /><div class="titlepage"><div><div><h2 class="title" style="clear: both;"><a name="advanced-editing-tools-scripting"></a></h2></div></div></div><div class="titlepage"><div><div><h2 class="title" style="clear: both;"><a name="advanced-editing-tools-scripting"></a>Extending <span class="application">Kate</span> with Scripts</h2></div></div></div><p> Since <span class="application">Kate</span> 3.4 in KDE 4.4 the <span class="application">Kate</span> editor component is easily extensible by writing scripts. The scripting language is ECMAScript (widely known as JavaScript). <span class="application">Kate</span> supports two kinds of scripts: indentation and command line scripts. </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="advanced-editing-tools-scripting-indentation"></a>Indentation Scripts</h3></div></div></div><p> Indentation scripts - also referred as indenters - automatically indent the source code while typing text. As example, after hitting the return-key code the indentation level often increases. </p><p> The following sections describe step by step how to create the skeleton for a simple indenter. As first step, create a new <code class="filename">*.js</code> file called e.g. <code class="filename">javascript.js</code> in the local home folder <code class="filename">$KDEHOME/share/apps/katepart/script</code>. </p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="advanced-editing-tools-scripting-indentation-header"></a>The Indentation Script Header</h4></div></div></div><p> The header of the file <code class="filename">javascript.js</code> is embedded in a comment and is of the following form </p><pre class="programlisting">/* kate-script<br />* name: JavaScript<br />* author: Example Name <example.name@some.address.org><br />* license: BSD<br />* revision: 1<br />* kate-version: 3.4<br />* type: indentation<br />* required-syntax-style: javascript<br />* indent-languages: javascript<br />* priority: 0<br />*<br />* A line without colon ':' stops header parsing. That is, you can add optional<br />* text here such as a detailed license.<br />*/<br /></example.name@some.address.org></pre><p> Each entry is explained in detail now: </p><div class="itemizedlist"><ul type="disc"><li><code class="literal">kate-script</code> [required]: This text string has to appear in the first line of the <code class="filename">*.js</code> file, otherwise <span class="application">Kate</span> skips the script. </li><li><code class="literal">name</code> [required]: This is the indenter name that appears in the menu <span doc="http://nwalsh.com/xsl/documentation/1.0" class="guiitem"><span class="guimenu">Tools</span></span>-><span doc="http://nwalsh.com/xsl/documentation/1.0" class="guiitem"><span class="guimenuitem">Indentation</span></span> and in the configuration dialog. </li><li><code class="literal">author</code> [optional]: The author's name and contact information. </li><li><code class="literal">license</code> [optional]: Short form of the license, such as BSD or LGPLv3. </li><li><code class="literal">revision</code> [required]: The revision of the script. This number should be increased whenever the script is modified. </li><li><code class="literal">kate-version</code> [required]: Minimal required <span class="application">Kate</span> version. </li><li><code class="literal">type</code> [required]: The type must be “<span class="quote"><code class="literal">indentation</code></span>”, otherwise <span class="application">Kate</span> skips this script. </li><li><code class="literal">required-syntax-style</code> [optional]: Comma separated list of required syntax highlighting styles. This is important for indenters that rely on specific highlight information in the document. If a required syntax style is specified, the indenter is available only when the appropriate highlighter is active. This prevents “<span class="quote">undefined behavior</span>” caused by using the indenter without the expected highlighting schema. For instance, the Ruby indenter makes use of this in the files <code class="filename">ruby.js</code> and <code class="filename">ruby.xml</code>. </li><li><code class="literal">indent-languages</code> [optional]: Comma separated list of syntax styles the indenter can indent correctly, e.g.: c++, java. </li><li><code class="literal">priority</code> [optional]: If several indenters are suited for a certain highlighted file, the priority decides which indenter is chosen as default indenter. </li></ul></div><p> </p><p> <span class="application">Kate</span> reads all pairs of the form “<span class="quote"><span doc="http://nwalsh.com/xsl/documentation/1.0" class="replaceable"><em class="replaceable"><code>key</code></em></span>:<span doc="http://nwalsh.com/xsl/documentation/1.0" class="replaceable"><em class="replaceable"><code>value</code></em></span></span>” until it cannot fine a colon anymore. This implies that the header can contain arbitrary text such as a license as shown in the example. </p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="advanced-editing-tools-scripting-indentation-body"></a>The Indenter Source Code</h4></div></div></div><p> Having specified the header this section explains how the indentation scripting itself works. The basic skeleton of the body looks like this: </p><pre class="programlisting">triggerCharacters = "{}/:;";<br />function indent(line, indentWidth, ch)<br />{<br /> // called for each newline (ch == '\n') and all characters specified in<br /> // the global variable triggerCharacters. When calling <span doc="http://nwalsh.com/xsl/documentation/1.0" class="guiitem"><span class="guimenu">Tools</span></span>-><span doc="http://nwalsh.com/xsl/documentation/1.0" class="guiitem"><span class="guimenuitem">Align</span></span><br /> // the variable ch is empty, i.e. ch == ''.<br /> //<br /> // see also: Scripting API<br /> return -2;<br />}<br /></pre><p> The function <code class="function">indent()</code> has three parameters: </p><div class="itemizedlist"><ul type="disc"><li><code class="literal">line</code>: the line that has to be indented</li><li><code class="literal">indentWidth</code>: the indentation width in amount of spaces</li><li><code class="literal">ch</code>: either a newline character (<code class="literal">ch == '\n'</code>), the trigger character specified in <code class="literal">triggerCharacters</code> or empty if the user invoked the action <span doc="http://nwalsh.com/xsl/documentation/1.0" class="guiitem"><span class="guimenu">Tools</span></span>-><span doc="http://nwalsh.com/xsl/documentation/1.0" class="guiitem"><span class="guimenuitem">Align</span></span>.</li></ul></div><p> The return value of the <code class="function">indent()</code> function specifies how the line will be indented. If the return value is a simple integer number, it is interpreted as follows: </p><div class="itemizedlist"><ul type="disc"><li>return value <code class="literal">-2</code>: do nothing</li><li>return value <code class="literal">-1</code>: keep indentation (searches for previous non-blank line)</li><li>return value <code class="literal"> 0</code>: numbers >= 0 specify the indentation depth in spaces</li></ul></div><p> Alternatively, an array of two elements can be returned: </p><div class="itemizedlist"><ul type="disc"><li><code class="literal">return [ indent, align ];</code></li></ul></div><p> In this case, the first element is the indentation depth like above with the same meaning of the special values. However, the second element is an absolute value representing a column for “<span class="quote">alignment</span>”. If this value is higher than the indent value, the difference represents a number of spaces to be added after the indentation of the first parameter. Otherwise, the second number is ignored. Using tabs and spaces for indentation is often referred to as “<span class="quote">mixed mode</span>”. </p><p> Consider the following example: Assume using tabs to indent, and tab width is set to 4. Here, <tab> represents a tab and '.' a space: </p><pre class="programlisting">1: <tab><tab>foobar("hello",<br />2: <tab><tab>......."world");<br /></pre><p> When indenting line 2, the <code class="function">indent()</code> function returns [8, 15]. As result, two tabs are inserted to indent to column 8, and 7 spaces are added to align the second parameter under the first, so that it stays aligned if the file is viewed with a different tab width. </p><p> A default KDE installation ships <span class="application">Kate</span> with several indenters. The corresponding JavaScript source code can be found in <code class="filename">$KDRDIR/share/apps/katepart/script</code>. </p><p> Developing an indenter requires to reload the scripts to see whether the changes behave appropriately. Instead of restarting the application, simply switch to the command line and invoke the command <span doc="http://nwalsh.com/xsl/documentation/1.0" class="command"><span><strong class="command">reload-scripts</strong></span></span>. </p><p> If you develop useful scripts please consider contributing to the <span class="application">Kate</span> Project by <a href="mailto:kwrite-devel@kde.org" target="_top">contacting the mailing list</a>. </p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="advanced-editing-tools-scripting-command-line"></a>Command Line Scripts</h3></div></div></div><p> As it is hard to satisfy everyone's needs, <span class="application">Kate</span> supports little helper tools for quick text manipulation through the <a href="http://docs.kde.org/development/en/kdesdk/kate/advanced-editing-tools-commandline.html" title="The Editor Component Command Line">built-in command line</a>. For instance, the command <span doc="http://nwalsh.com/xsl/documentation/1.0" class="command"><span><strong class="command">sort</strong></span></span> is implemented as script. This section explains how to create <code class="filename">*.js</code> files to extend <span class="application">Kate</span> with arbitrary helper scripts. </p><p> Command line scripts are located in the save folder as indentation scripts. So as first step, create a new <code class="filename">*.js</code> file called <code class="filename">myutils.js</code> in the local home folder <code class="filename">$KDEHOME/share/apps/katepart/script</code>. </p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="advanced-editing-tools-scripting-command-line-header"></a>The Command Line Script Header</h4></div></div></div><p> The header of each command line script is embedded in a comment and is of the following form </p><pre class="programlisting">/* kate-script<br />* author: Example Name <example.name@some.address.org><br />* license: BSD<br />* revision: 1<br />* kate-version: 3.4<br />* type: commands<br />* functions: sort, format-paragraph<br />*<br />* A line without colon ':' stops header parsing. That is, you can add optional<br />* text here such as a detailed license.<br />*/<br /></example.name@some.address.org></pre><p> Each entry is explained in detail now: </p><div class="itemizedlist"><ul type="disc"><li><code class="literal">kate-script</code> [required]: This text string has to appear in the first line of the <code class="filename">*.js</code> file, otherwise <span class="application">Kate</span> skips the script.</li><li><code class="literal">author</code> [optional]: The author's name and contact information.</li><li><code class="literal">license</code> [optional]: Short form of the license, such as BSD or LGPLv3.</li><li><code class="literal">revision</code> [required]: The revision of the script. This number should be increased whenever the script is modified.</li><li><code class="literal">kate-version</code> [required]: Minimal required <span class="application">Kate</span> version.</li><li><code class="literal">type</code> [required]: The type must be 'commands', otherwise <span class="application">Kate</span> skips this script.</li><li><code class="literal">functions</code> [required]: Comma separated list of commands in the script.</li></ul></div><p> </p><p> <span class="application">Kate</span> reads all pairs of the form “<span class="quote"><span doc="http://nwalsh.com/xsl/documentation/1.0" class="replaceable"><em class="replaceable"><code>key</code></em></span>:<span doc="http://nwalsh.com/xsl/documentation/1.0" class="replaceable"><em class="replaceable"><code>value</code></em></span></span>” until it cannot fine a colon anymore. This implies that the header can contain arbitrary text such as a license as shown in the example. The value of the key functions is a comma separated list of command line commands. This means a single script contains an arbitrary amount of command line commands. Each function is available through <span class="application">Kate</span>'s <a href="http://docs.kde.org/development/en/kdesdk/kate/advanced-editing-tools-commandline.html" title="The Editor Component Command Line">built-in command line</a>. </p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="advanced-editing-tools-scripting-command-line-body"></a>The Script Source Code</h4></div></div></div><p> All functions specified in the header have to be implemented in the script. For instance, the script file from the example above needs to implement the two functions <span doc="http://nwalsh.com/xsl/documentation/1.0" class="command"><span><strong class="command">sort</strong></span></span> and <span doc="http://nwalsh.com/xsl/documentation/1.0" class="command"><span><strong class="command">format-paragraph</strong></span></span>. All functions have the following syntax: </p><pre class="programlisting">function <name>(arg1, arg2, ...)<br />{<br /> // ... implementation, see also: Scripting API<br />}<br /></name></pre><p> </p><p> Arguments in the command line are passed to the function as <span doc="http://nwalsh.com/xsl/documentation/1.0" class="parameter"><em class="parameter"><code>arg1</code></em></span>, <span doc="http://nwalsh.com/xsl/documentation/1.0" class="parameter"><em class="parameter"><code>arg2</code></em></span>, etc. In order to provide documentation for each command, simply implement the '<code class="function">help</code>' function as follows: </p><pre class="programlisting">function help(cmd)<br />{<br /> if (cmd == "sort") {<br /> return "Sort the selected text.";<br /> } else if (cmd == "...") {<br /> // ...<br /> }<br />}<br /></pre><p> Executing <span doc="http://nwalsh.com/xsl/documentation/1.0" class="command"><span><strong class="command">help sort</strong></span></span> in the command line then calls this help function with the argument <span doc="http://nwalsh.com/xsl/documentation/1.0" class="parameter"><em class="parameter"><code>cmd</code></em></span> set to the given command, i.e. <span doc="http://nwalsh.com/xsl/documentation/1.0" class="parameter"><em class="parameter"><code>cmd == "sort"</code></em></span>. <span class="application">Kate</span> then presents the returned text as documentation to the user. </p><p> Developing a command line script requires to reload the scripts to see whether the changes behave appropriately. Instead of restarting the application, simply switch to the command line and invoke the command <span doc="http://nwalsh.com/xsl/documentation/1.0" class="command"><span><strong class="command">reload-scripts</strong></span></span>. </p><p> If you develop useful scripts please consider contributing to the <span class="application">Kate</span> Project by <a href="mailto:kwrite-devel@kde.org" target="_top">contacting the mailing list</a>.<br /></p><h2 class="title" style="clear: both;">Final Remarks<br /></h2>Right now, it's not possible to assign shortcuts to command line commands. Thus, there is no way of executing scripted commands with shortcuts. Volunteers wanted!<br /><br />The command line scripting can be accessed for all KTextEditor users through the <a href="http://api.kde.org/4.x-api/kdelibs-apidocs/interfaces/ktexteditor/html/classKTextEditor_1_1CommandInterface.html">KTextEditor::CommandInterface</a>. That is, you can query a specific command and <a href="http://api.kde.org/4.x-api/kdelibs-apidocs/interfaces/ktexteditor/html/classKTextEditor_1_1Command.html#afcf59107ca87d860fc7a17e507df02d2">execute it</a> with arbitrary parameters (The parameter cmd contains the command itself including all arguments. Example: cmd = "goto 65").<br /><br />Kate's command line itself is actually a quite powerful tool. It's a little bit sad that it's rather unknown. If you want to know more, just invoke "View -> Swith to command line" (shortcut: F7) and start typing text. More details are in the <a href="http://docs.kde.org/development/en/kdesdk/kate/advanced-editing-tools-commandline.html">Kate handbook</a> as well.<br /><br />The Kate scripting API can be found <a href="http://docs.kde.org/development/en/kdesdk/kate/advanced-editing-tools-scripting.html#advanced-editing-tools-scripting-api">here</a>.<br /><br /></div></div>dhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.com9tag:blogger.com,1999:blog-17552332.post-58713170704643660772009-10-05T22:26:00.003+02:002009-10-05T22:30:37.550+02:00Help on TechBase, KDE Community ForumsFrom time to time techbase readers ask questions in the associated talk pages, e.g. with regard to bugs in the tutorials. Usually, they get no reply. This is mainly because noone gets even noticed about this. I've added a <a href="http://forum.kde.org/viewforum.php?f=108">link to the KDE Community Forum</a> now on top of each techbase page (<a href="http://techbase.kde.org/MediaWiki:Sitenotice">MediaWiki:sidenotice</a>). Maybe this helps that developers new to KDE get more help. A little...dhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.com0tag:blogger.com,1999:blog-17552332.post-67920088347496870752009-09-18T00:36:00.004+02:002009-09-18T00:45:57.932+02:00News from the Holy Kate LandSince we now all know that Kate is holy (thanks to rms. By accident, he obviously confused Kate with emacs, though) let's have a look at what's going on. In the last months Kate development is quite active, so here is a quick update:<br /><ul><li>new: <a href="http://dhaumann.blogspot.com/2009/07/followup-on-kates-on-fly-spellchecking.html">on-the-fly spell checking</a> thanks to Michel Ludwig. Highlights include e.g. spell checking in comments of source code or latex parts. Also, constructs like sch\"on work in latex.</li><li>extended scripting support in the command line, more on that later</li><li>more and more mature vi input mode</li><li><a href="https://bugs.kde.org/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=&product=kate&long_desc_type=substring&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&keywords_type=allwords&keywords=&bug_status=RESOLVED&bug_status=CLOSED&resolution=FIXED&resolution=WORKSFORME&emailassigned_to1=1&emailtype1=substring&email1=&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=2009-06-25&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0=">lots of bug fixing</a>. quite impressive bug squashing by Pascal Létourneau for more than 4 months now</li><li>lots of refactoring and code cleanups thanks to Bernhard!</li><li>"Find in Files" appears by default again in the tool view,</li><li>"File Browser" uses UrlNavigator, huge code cleanup</li><li>convenience updates of syntax highlighting</li><li>delayed highlighting of code folding ranges to prevent flickering on mouse move</li><li>new command line commands: 'toggle-header' in the Open Header plugin. 'grep' and 'find-in-files'</li><li>haskell and lilypond indenter</li><li>much, much more, see commits for details.<br /></li></ul>Thanks to all contributors involved in Kate development. Keep it up :)dhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.com6tag:blogger.com,1999:blog-17552332.post-6403044092908992002009-07-08T12:09:00.003+02:002009-07-08T12:47:01.919+02:00Followup on Kate's on-the-fly spellcheckingAs there was a lot of feedback in the <a href="http://dhaumann.blogspot.com/2009/07/on-fly-spellchecking-in-kate.html">last blog</a>, I'll answer some of the questions here.<br /><br />> <span style="font-style: italic;">Where can I get this patch?</span><br />The relevant subversion revisions are r992778, r992779, r992780, r992784.<br /><br />> <span style="font-style: italic;">Will it be available in 4.3, or only in 4.4?</span><br />As KDE 4.3 will be released end of the month, this feature will be available in KDE 4.4 and not earlier.<br /><br />> <span style="font-style: italic;">Please, please tell me that it's powered by Sonnet, one of the most awaited KDE4 pillar by me...</span><br />Yes, it uses Sonnet :)<br />The old spellcheck dialog however still uses the old spellchecking code without Sonnet. Any volunteers to port this? Also, the on-the-fly spellchecking needs to be more configurable in Kate's config dialog, e.g. selecting the correct language.<br /><br />> <span style="font-style: italic;">Thanks so much, this was the feature I was mostly longing for in kate.</span><br />Yes, it is one of the <a href="http://bugs.kde.org/show_bug.cgi?id=33857">oldest reports</a> with <span style="font-weight: bold;">1245 votes</span>!<br /><br />> What languages are supported support?<br /><s>On-the-fly spellchecking works if the specific itemDatas are marked with spellChecking="true" or "1" in the xml highlighting definition files.</s> UPDATE: On-the-fly spellchecking is enabled for all itemDatas by default in the xml highlighting defintion files. To disable it, you have to add <span style="font-weight: bold;">spellChecking="false"</span> or "0" to an itemData, e.g. at the end of the <a href="http://websvn.kde.org/trunk/KDE/kdelibs/kate/syntax/data/cpp.xml?view=markup">cpp.xml</a> file:<br /><pre><blockquote><br /><itemDatas><br /><itemData name="Normal Text" <span style="font-weight: bold;">spellChecking="0"</span> /><br />...<br /><itemData name="String"<span style="font-weight: bold;"></span> /><br /><itemData name="String Char" <span style="font-weight: bold;">spellChecking="0"</span> /><br /><itemData name="Comment" /><br /><itemData name="Symbol" <span style="font-weight: bold;">spellChecking="0"</span> /><br />...<br /></itemData><br /></blockquote></pre><br />So we have to go through all .xml files and change the relevant parts in the itemDatas section. And that's where we need your help, as we don't know all the languages :) ...and if you want to test this feature, you first have to enable it in Tools > On-the-fly spellchecking.<br />PS: Is there a better name? Maybe Inline spellchecking? Any linguistic experts around? :)dhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.com12tag:blogger.com,1999:blog-17552332.post-30601773772719417812009-07-07T20:51:00.003+02:002009-07-07T20:57:30.741+02:00On-the-fly spellchecking in KateChristoph just added an awesome and long awaited feature: on-the-fly spellchecking. 'Kate's xml highlighting files now have an additional attribute in the itemData section: spellChecking="true/false". C++ comments and strings can be spellchecked now :) Same for all other languages such as Latex. Really big thanks to Michel Ludwig for the patch, good work! Screenshot for latex highlighting:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMJxI5wurfmVV6q5T4J90PsbqpjJmvaUYJKjK49klezA6umOBper0gcGGML6I5_0Mb6YA7iHw8lE_2O8enRMLHn9v7EaZdfO1ayXoGLV04NBzcQQkHczroz7Fkf7DGErgP-jVq/s1600-h/snapshot1.png"><img style="cursor: pointer; width: 400px; height: 326px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMJxI5wurfmVV6q5T4J90PsbqpjJmvaUYJKjK49klezA6umOBper0gcGGML6I5_0Mb6YA7iHw8lE_2O8enRMLHn9v7EaZdfO1ayXoGLV04NBzcQQkHczroz7Fkf7DGErgP-jVq/s400/snapshot1.png" alt="" id="BLOGGER_PHOTO_ID_5355793400578405490" border="0" /></a>dhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.com12tag:blogger.com,1999:blog-17552332.post-37743444586956966802009-06-07T13:55:00.004+02:002010-02-18T18:33:08.472+01:00Kate Test Regression SuiteThis blog is mainly about documenting the process how to run Kate Part's test regression suite and probably not much use for other developers.<br /><br />Step I: Setup the environment<br /><ol><li> create the file ~/.testkateregression. The content of this file is a single line pointing to the folder of the checkout of the test regression suite data. For me this is<br />/home/dh/kde/tests/katetests/regression/ </li><li>Create the folder where you checkout the suite<br />mkdir /home/dh/kde/tests</li><li>Change to this folder</li><li>Checkout the data:<br />svn co svn://anonsvn.kde.org/home/kde/trunk/tests/katetests<br /></li></ol>Now all the data is there for testing.<br /><br />Step II: Run the test suite<br /><ol><li>go to your build directory of kate (e.g. kdelibs/build/kate/tests/</li><li>run the complete suite:<br />./testkateregression.shell</li><li>run specific tests, e.g. for the c indenter:<br />./testkateregression.shell -t indent/csmart</li></ol>That's it.dhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.com0tag:blogger.com,1999:blog-17552332.post-47506845973907255172009-03-17T20:53:00.002+01:002009-03-17T20:59:01.384+01:00Again System Load ViewerIt's in <a href="http://websvn.kde.org/trunk/KDE/kdeplasma-addons/applets/systemloadviewer/">kdeplasma-addons</a> now will be part of KDE 4.3. For those who can't wait we have released <a href="http://www.kde-look.org/content/show.php/System+Status?content=74891">version 0.6 for KDE 4.2</a>. I encourage developers to get their hands dirty and make it look even better. Another idea is to automatically use the plasma colors so it visually integrates better into the desktop. It's more than good enough though, as it has all the features of KDE3's System Monitor and some more (like support for showing all CPUs' usage). Have fun :)dhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.com4tag:blogger.com,1999:blog-17552332.post-37572259058228796212009-02-27T12:14:00.004+01:002009-02-27T12:33:13.501+01:00Creating a Plugin SystemOn techbase we have a tutorial about <a href="http://techbase.kde.org/Development/Tutorials/Services/Plugins">extending your application with a plugin system</a>. However, it's unfinished and some people need it as you can see on the talk page. So if you feel like passing your knowledge on, please fill in the missing sections to complete this tutorial. Just make sure to keep it as simple as possible, of course you can also change what's already there. Btw, we once had such a <a href="http://developer.kde.org/documentation/tutorials/developing-a-plugin-structure/index.html">tutorial for KDE3</a>, maybe you can copy some text from there. It would be awesome to have it for KDE4 as well :)dhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.com2tag:blogger.com,1999:blog-17552332.post-21501403959369904522009-01-27T13:23:00.002+01:002009-01-27T13:27:18.300+01:00Feature Plans for KDE 4.2 / 4.3Hi KDE developers: As KDE 4.2 is about to be released you should move all your <a href="http://techbase.kde.org/Schedules/KDE4/4.2_Feature_Plan">features that did not make it into the KDE 4.2 release</a> to the <a href="http://techbase.kde.org/Schedules/KDE4/4.3_Feature_Plan">KDE 4.3 feature plan</a>. Thanks! :)dhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.com0tag:blogger.com,1999:blog-17552332.post-71762621665386748572009-01-09T19:50:00.003+01:002009-01-09T20:01:33.148+01:00Compile TimeRecompiling kdelibs, kdepimlibs, kdebase, kdesdk, kdeplasma-addons, playground/base/plasma all in all takes about <span style="font-weight: bold;">2h 13min</span> on my t41p (1.7GHz, 1.5GB ram). It's still quite fast imo, but I imagine with today's hardware it's maybe 30 minutes? See below for detailed infos. I'm using mpyne's <a href="http://kdesvn-build.kde.org/">excellent kdesvn-build scripts</a> to build KDE from trunk. I even believe this should be the default way for building trunk instead of the <a href="http://techbase.kde.org/Getting_Started/Build/KDE4">rough road we propose on techbase</a> right now. Are there any reasons not to use kdesvn-build?<br /><pre><br /><blockquote>Building kdelibs (1/6)<br /> Preparing build system for kdelibs.<br /> Running cmake...<br /> Compiling, attempt 1...<br /> Build succeeded after 44 minutes, and 56 seconds.<br /> Installing kdelibs.<br /> Overall time for kdelibs was <span style="font-weight: bold;">48 minutes, and 49 seconds</span>.<br /><br />Building kdepimlibs (2/6)<br /> Preparing build system for kdepimlibs.<br /> Running cmake...<br /> Compiling, attempt 1...<br /> Build succeeded after 7 minutes, and 53 seconds.<br /> Installing kdepimlibs.<br /> Overall time for kdepimlibs was <span style="font-weight: bold;">8 minutes, and 14 seconds</span>.<br /><br />Building kdebase (3/6)<br /> Preparing build system for kdebase.<br /> Running cmake...<br /> Compiling, attempt 1...<br /> Build succeeded after 52 minutes, and 35 seconds.<br /> Installing kdebase.<br /> Overall time for kdebase was <span style="font-weight: bold;">57 minutes, and 44 seconds</span>.<br /><br />Building kdesdk (4/6) <span style="font-weight: bold;"># note: several subdirs commented out</span><br /> Preparing build system for kdesdk.<br /> Running cmake...<br /> Compiling, attempt 1...<br /> Build succeeded after 8 minutes, and 26 seconds.<br /> Installing kdesdk.<br /> Overall time for kdesdk was <span style="font-weight: bold;">8 minutes, and 45 seconds</span>.<br /><br />Building kdeplasma-addons (5/6)<br /> Preparing build system for kdeplasma-addons.<br /> Running cmake...<br /> Compiling, attempt 1...<br /> Build succeeded after 6 minutes, and 15 seconds.<br /> Installing kdeplasma-addons.<br /> Overall time for kdeplasma-addons was <span style="font-weight: bold;">6 minutes, and 24 seconds</span>.<br /><br />Building plasma (6/6) # this is: playground/base/plasma<br /> Preparing build system for plasma.<br /> Running cmake...<br /> Compiling, attempt 1...<br /> Build succeeded after 3 minutes, and 25 seconds.<br /> Installing plasma.<br /> Overall time for plasma was <span style="font-weight: bold;">3 minutes, and 35 seconds</span>.</blockquote><br /></pre>dhaumannhttp://www.blogger.com/profile/06242913572752671774noreply@blogger.com6