Tag Archives: qt emacs linux

Qt + Assistant + Emacs

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’s ok when you make this mistake one, two or even three times…but It was happening a lot.

I searched my entire KDE’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…hmmm…of course it was an Emacs key binding and not KDE’s one!

Ok, now I was able to remove the F11 key binding, but the fun just started: how about binding Qt’s Assistant instead of Devhelp as I’m working much more with Qt than with GTK ??? 😉

At first it looked pretty easy, just needing a few lines inside .emacs:

(defun assistant ()
"runs qt assistant"
(interactive)
(start-process-shell-command "assistant" nil "assistant")
)
(global-set-key [f11] 'assistant)

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 Assistant search for it. A few hours later I finished it and came along with the following patch on my “personal” Assistant:

0001-created-search-keyword-function.patch

And my final Emac’s function:

(defun assistant ()
"runs qt assistant"
(interactive)
(start-process-shell-command "assistant" nil "assistant" "-search" (current-word))
)
(global-set-key [f11] 'assistant)

Emacs + Assistant

So much fun with Qt =P