{"id":57,"date":"2008-07-01T18:19:52","date_gmt":"2008-07-01T21:19:52","guid":{"rendered":"http:\/\/labs.morpheuz.eng.br\/blog\/?p=57"},"modified":"2008-07-01T18:19:52","modified_gmt":"2008-07-01T21:19:52","slug":"qt-assistant-emacs","status":"publish","type":"post","link":"https:\/\/blog.morpheuz.cc\/?p=57","title":{"rendered":"Qt + Assistant + Emacs"},"content":{"rendered":"<p style=\"text-align: left;\">Everytime I wanted to get a console I typed F12, willing to make <a title=\"yakuake\" href=\"http:\/\/yakuake.uv.ro\/\" target=\"_blank\" rel=\"noopener noreferrer\">Yakuake<\/a> come down. But sometimes I pressed F11 and then <a title=\"Devhelp\" href=\"http:\/\/developer.imendio.com\/projects\/devhelp\" target=\"_blank\" rel=\"noopener noreferrer\">Devhelp<\/a> was loaded. It&#8217;s ok when you make this mistake one, two or even three times&#8230;but It was happening a lot.<\/p>\n<p style=\"text-align: left;\">I searched my entire KDE&#8217;s shortcuts trying to find where the hell was that key binding but I had no luck. After a while, I discovered that it only happened when I was inside Emacs&#8230;hmmm&#8230;of course it was an Emacs key binding and not KDE&#8217;s one!<\/p>\n<p style=\"text-align: left;\">Ok, now I was able to remove the F11 key binding, but the fun just started: how about binding <a title=\"Qt Assistant\" href=\"http:\/\/doc.trolltech.com\/4.0\/assistant-manual.html\" target=\"_blank\" rel=\"noopener noreferrer\">Qt&#8217;s Assistant<\/a> instead of <a title=\"Devhelp\" href=\"http:\/\/developer.imendio.com\/projects\/devhelp\" target=\"_blank\" rel=\"noopener noreferrer\">Devhelp<\/a> as I&#8217;m working much more with Qt than with GTK ??? \ud83d\ude09<\/p>\n<p style=\"text-align: left;\">At first it looked pretty easy, just needing a few lines inside .emacs:<br \/>\n<code><br \/>\n(defun assistant ()<br \/>\n\"runs qt assistant\"<br \/>\n(interactive)<br \/>\n(start-process-shell-command \"assistant\" nil \"assistant\")<br \/>\n)<br \/>\n(global-set-key [f11] 'assistant)<br \/>\n<\/code>\n<\/p>\n<p style=\"text-align: left;\">But now I really need Assistant to automatically search for a keyword when I open it. It would be much easier to just put the cursor in the keyword I want and make <a title=\"Qt Assistant\" href=\"http:\/\/doc.trolltech.com\/4.0\/assistant-manual.html\" target=\"_blank\" rel=\"noopener noreferrer\">Assistant<\/a> search for it. A few hours later I finished it and came along with the following patch on my &#8220;personal&#8221; Assistant:<\/p>\n<p style=\"text-align: left;\"><a href=\"http:\/\/labs.morpheuz.eng.br\/blog\/wp-content\/uploads\/2008\/07\/0001-created-search-keyword-function.patch\">0001-created-search-keyword-function.patch<\/a><\/p>\n<p style=\"text-align: left;\">And my final Emac&#8217;s function:<br \/>\n<code><br \/>\n(defun assistant ()<br \/>\n<\/code><code> \"runs qt assistant\"<\/code><br \/>\n<code> (interactive)<br \/>\n(start-process-shell-command \"assistant\" nil \"assistant\" \"-search\" (current-word))<br \/>\n)<br \/>\n(global-set-key [f11] 'assistant)<\/code>\n<\/p>\n<p style=\"text-align: left;\">\n<p style=\"text-align: center;\"><a href=\"http:\/\/blog.morpheuz.cc\/wp-content\/uploads\/2008\/07\/post1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-59 aligncenter\" title=\"post\" src=\"http:\/\/labs.morpheuz.eng.br\/blog\/wp-content\/uploads\/2008\/07\/post-300x279.jpg\" alt=\"Emacs + Assistant\" width=\"300\" height=\"279\" \/><\/a><\/p>\n<p style=\"text-align: left;\">So much fun with Qt =P<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Everytime I wanted to get a console I typed F12, willing to make Yakuake come down. But sometimes I pressed F11 and then Devhelp was loaded. It&#8217;s ok when you make this mistake one, two or even three times&#8230;but It was happening a lot. I searched my entire KDE&#8217;s shortcuts trying to find where the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,3,4],"tags":[42],"class_list":["post-57","post","type-post","status-publish","format-standard","hentry","category-general","category-kde","category-maemo","tag-qt-emacs-linux"],"_links":{"self":[{"href":"https:\/\/blog.morpheuz.cc\/index.php?rest_route=\/wp\/v2\/posts\/57","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.morpheuz.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.morpheuz.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.morpheuz.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.morpheuz.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=57"}],"version-history":[{"count":0,"href":"https:\/\/blog.morpheuz.cc\/index.php?rest_route=\/wp\/v2\/posts\/57\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.morpheuz.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=57"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.morpheuz.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=57"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.morpheuz.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=57"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}