Multiple undo/redo in Scrolled widged - perl

I know that I can implement multiple undo using the TextUndo widget. But that doesn't do the redo function.
How can I implement both multiple undo and multiple redo?

The text widget supports a full undo/redo functionality. You just have to turn it on; since not all uses of text want that sort of thing, it's off by default. To turn it on, you just need to set the boolean -undo widget option to true. It's as simple as that (though the way you write it might be a little different in languages other than Tcl, e.g., it's undo in Tkinter).
However, PerlTk seems to make a confused mess of it all. For some reason, the Tk::Text widget doesn't support undo/redo (Why? The machinery is in there, poking through.) and the Tk::TextUndo widget doesn't have the redo capability exposed (Why on earth would that be omitted?) These are all limitations in PerlTk, not Tk itself. In that case, your best bet might be the Tk::Text::SuperText class, though to me that's very odd as it's just doing what I consider to be core Tk functionality.
Or maybe it's just the CPAN documentation that's out of date.

Problem is that the '' binding is assigned twice, for the virtual event '<>' (to implement emacs-like pasting) and to the virtual event '<>'. A normal Tk::Text does not have the undo functionality, so having the C-y binding here makes sense. Unfortunately this binding clashes when using a Tk::TextUndo.
You have the following possibilities:
use the other bindings for Redo (e.g. the F12 binding, see Tk::MainWindow source code for a complete list, or the "Redo" entry in the popup menu)
remove the C-y binding for <<Paste>> globally, e.g. by using:
$mw->eventDelete('<<Paste>>', '<Control-Key-y>');
I am not sure how this can be resolved best in the Perl/Tk source itself. Simplest would be to remove the emacs key binding for '<>' here, but then emacs users could be unhappy. I am open to suggestions...

Related

Disabling shortcuts in insertion mode with vim bindings

I am quite new to vscode, and am trying to figure out how to solve the following issue:
I use vim bindings (via vscodevim), and am happy with it
I have custom bindings for the main language I develop in (Coq) that I am adamant about keeping and that are of the form ", n", ", u" and so on. These shortcuts are not used to edit code, but rather to interact with the prover.
This setup currently entails that I globally cannot type a comma anymore, which is quite annoying :) I hence would like to disable these shortcuts when in insertion mode.
I have tried to add the condition !vim.insertModeKeyBindings to all When fields of these custom bindings, but it does not seem to be sufficient: pressing , still triggers a Waiting for second key of chord... even in insertion mode.
Would anyone know how to solve this issue by any chance?
Best,
Yannick

Eclipse shortcut to switch between editor groups

I can use Ctrl-F6 or Ctrl-Shift-PgUp/Down to switch between files in the editor.
This works well if there is only one editor visible.
But when i have arranged the editor in two halfs, some files are left, some files are right. This is called "split window", like this example https://codeyarns.com/2010/01/04/how-to-split-window-in-eclipse/
I do not mean the split editor, where the same file is shown in two halfs.
How can I toggle between the left/right side (or however they are arranged), always to the already visible file?
This is one of the benefits of the Emacs+ Eclipse plugin. When this is installed, the "other-window" function will be available, which does exactly what you're looking for.
Note that using the Emacs+ plugin does not require you to know anything about Emacs or Elisp. It simply provides a large catalog of functions that are similar in spirit to what Emacs provides.
You could use the "Emacs+" keyboard scheme, which is consistent with typical Emacs bindings, but I don't use it, as I prefer to integrate Emacs+ with Eclipse, not the other way around. I like to choose a "prefix sequence" that I use to group many functions that I like to use. For instance, I use "Ctrl+;" (ctrl-semicolon) as that prefix. I bound "other-window to "ctrl+; o". You can use whatever scheme you like. Despite my goal to use my own bindings, there are some functions that are awkward if you don't use the binding from the Emacs+ scheme, like binding "ctrl+s" to the incremental regexp search function.

Modify stylus behavior in any tablet

I just read this post about there being no way to fully use the stylus buttons, nor movements:
http://www.autohotkey.com/board/topic/91828-stylus-middle-mouse-button-emulation/
And I think that there should be some available workaround for this by now.
To clearly state my question: Is there a way to use AutoHotkey (or other program) to modify the stylus buttons (including the on screen actions like click and hold) in a similar fashion as the keyboard?
An example of what I am looking for in AutoHotkey is to be able to press pen against screen and at the same time click any button as a hotkey using e.g. GetKeyState.
One suboptimal workaround that I know for this is to use something like these: http://alternativeto.net/software/strokesplus/
And have them send some keyboard combination as output, which AutoHotkey can act on. This would probably work, but would require another program, and essentially make AutoHotkey redundant for the most basic things. Once you add GetKeyState etc functionality from AutoHotkey the two together should make for a vast amount of possible combinations not possible by either alone though.

Vim style Omnicomplete for emacs?

I've found several code completion elisp packages for emacs that do code completion, but most bind to a key such as M-/ to toggle completion. Is there something similar to Vim's omnicomplete where you can set it to automatically pop up a list of autocompletion options where you can either navigate through them, or just keep typing.
See screenshot for example:
I think company mode would best fit your description. Have a look at it.
There are a number, all a little different:
predictivemode
pabbrev
completionui
autocomplete
They all have their drawbacks and advantages.
The emacs wiki has a page for all the completion packages.
Can you? Sure. Reset a timer on post-command-hook. If it goes off (because you are sitting at your screen not typing), pop-up the thing.
It seems easier to tell your computer what to do (by pressing keys) rather than having it wait for your to stop typing for a while, however. Bind completion to something like the "menu key", and you won't even have to chord.

Better control over Emacs windows

I spend a lot of my time in emacs, and for the most part it's wonderful. But one thing really drives me nuts when I'm deep in it, and that's control over which window various new buffers are opened in. When I do find-file, it always opens in the current window, and this is what I like. But tons of other modes like to split my windows for me, change the layout, and do various other things that annoy me. For example running M-x manual-entry seems to have no rhyme or reason about where it opens the manpage, and various org-mode commands do the same thing, closing windows I want to keep open, etc. I don't like having to redo my layout everytime I want to look at my org agenda or open a manpage.
In short, is there anyway to globally control which windows are used for modes that want to open in a window other than the current one? Can I direct them more easily? Or will I have to hack each mode to act the way I want it to?
Try Winner mode:
http://www.emacswiki.org/emacs/WinnerMode
It provides an undo/redo for changes to the window configuration.
This question has always bugged me too. I found this:
http://www.gnu.org/software/emacs/elisp/html_node/Choosing-Window.html
It looks like you can use (setf pop-up-frames t) to make stuff show up in a new frame.
Also, it looks like you can use display-buffer-function to override the display function (how buffers are chosen.) Of course, you'd have to be good at elisp.