
ktexteditor - emacsextensions
Source (link to git-repo or to original if based on someone elses unmodified work):
* kill-ring (yank (Ctrl-Y), yank-pop (Alt-Y), kill-ring-save (Alt-W), kill-region (Ctrl-W)
* mark-ring (Ctrl-Space, Ctrl-X,X, Ctrl-U,Space)
* kill-line (Ctrl-K)
* next-line (Ctrl-N), previous-line (Ctrl-P)
* forward-char (Ctrl-F), backward-char (Ctrl-B) for Kate pre 3.4.
Some of these actions are only activated in older KTextEditor versions that don't support them by themselves yet.
Since it is a pure KTextEditor plugin, it is available for a all KDE applications that use the libkatepart for editing, among these are KDevelop, Kile, Kate, Quanta Plus and many more.
It's a great plugin to enhance your KDE texteditors as long as there is no Kemacs.
Comments and suggestions for more features are welcome.
Felix Berger
0.1.7-3
* Uploaded a new Debian package to reflect the library renaming for the KDE 3.4.3 packages.
0.1.7-2
* Uploaded a new Debian package to reflect the ABI transition of the KDE 3.4 packages.
0.1.7
* Added delete-next-char action.
0.1.6
* Debianized package.
* No code changes.
0.1.5
* yank-pop appears as an atomic command in the undo history.
* Remove the following line-break character when kill-line is called at the end of the line.
* Don't use removeLine() in implementation of kill-line for empty lines.
0.1.4
* Use hardcoded Emacs default max-sizes for mark- and kill-ring.
* Implemented correct kill-ring position after last yank-pop.
* Added sub menu in the KTextEditor's popup context menu.
Ratings & Comments
19 Comments
I did "make" and it says: *** Creating configure.files cd . && aclocal-1.7 /bin/bash: aclocal-1.7: command not found make: *** [aclocal.m4] Error 127 Any ideas?
That means that you are missing aclocal. Try installing it first. In my SuSe it's fixed installing the package «automake».
kscope is supposed to be a ktexteditor-based app but I am unable to see any of the emacs extensions from inside kscope. Anyone else have the two programs working nicely together?
It works for me. I installed the emacsextensions plugin, selected it under "Configure Editor"->"Plugins", and got all the entries in KScope's "Edit" menu.
thanks for adding deleting-next-char! repeated calls to emacs kill-line seem to clear the cut buffer, rather than append to it, so that a paste will only paste the last cut line. This is very different from emacs' behavior - does that happen on your end too?
Yes, it does. As of now I just ignored concatenating coalescent kill-regions in the kill-buffer. But now that someone caught me ;-), I'll have a look how difficult it would be to mimic Emacs' behavior with respect to this.
For this to work I would have to find out what the last executed command was. Unfortunately I couldn't find a way to do it. I tried using the undo count, but this is too fine grained and seems to also change when you move the cursor between two kill-region commands. :-(
Could you add a "delete next character" shortcut to the list of shortcuts? I miss that one...
Done :-) The action will only be available in libkatepart versions < 3.4 since the katepart supports it in 3.4 itself.
Maybe you can even add some NEdit niceties like 'strip wite space' or 'interprete selected text as file name and open' or wyswyg moving of a text selection?
> Maybe you can even add some NEdit > niceties like 'strip wite space' or > 'interprete selected text as file > name and open' or wyswyg moving of a > text selection? Thanks for interest. If you could point me to some exact specification of these features and I find them useful I might add them. Please keep in mind, that the plugin should only depend on the KTextEditor::... interfaces documented at: http://developer.kde.org/documentation/library/cvs-api/interfaces/html/namespaceKTextEditor.html This confines most features to non-GUI functionality.
hmm... do you think it would be possible to put an emacs-editor submenu on the right-mouse-button? this might be useful so you don't have to go all the way up to the menu bar Edit. of course I have the key shortcuts memorized so it doesn't really matter much to me.
Done. I don't use it myself, but if it advertises the actions and their shortcuts better, it won't harm. Felix
I've been looking for something to make kate more emacs-like. Thank You. To make Ctrl-K kill from the point to the end of the line I needed to change the default Delete Line shortcut which is also Ctrl-K. Was that the correct solution?
Thanks for the feedback! Yes, that was the correct solution. I was going to write some documentation about that, but haven't come around to doing it yet. The Emacs kill-line deletes from the current point to the end of the line and also puts the deleted content into the clipboard and kill-ring as opposed to Kate's implementation. I haven't used the plugin in long editing sessions yet, so more subtle discrepancies from Emacs' implementation might have gone unnoticed. If you notice minor annoyances like the the wrong text being yanked, or yank-popped, let me know. Regards, Felix
Those extra shortcuts are great, thanks for doing this! I was wondering though - the ctrl-Y should yank whatever was cut with ctrl-k, but it appears to be an alias for ctrl-V (paste) and pastes whatever was in the cut buffer. Which would be fine if ctrl-K put its "cut content" into the paste buffer.
whoops! Turns out my ctrl-k was simultaneously bound to "delete line" in the other shortcut menu, which I didn't notice. I removed that binding and now your cut works great.
I'm glad you worked it out. Ctrl-K is not fully compatible to Emacs's kill-line yet when you call it at the end of a line. The new line character should be removed then. This will be fixed in the next release. Regards, Felix