1/** 2 * Emulate GNU Emacs's "kill-ring-save" capability (normally bound to Meta-W), 3 * which copies the text between the caret and the mark to the kill ring. This 4 * version is slightly different than the Emacs version: If there's any 5 * selected text, it copies that text. Otherwise, it selects the text between 6 * the caret and the mark, and copies that. 7 * 8 * Does NOT use jEdit markers. 9 */ 10source (MiscUtilities.constructPath(dirname(scriptPath), "EmacsUtil.bsh")); 11 12void emacsKillRingSave() 13{ 14 selection = getKillRegion(); 15 if (selection == null) 16 beep(); 17 else 18 addToClipboardAndHistory (selection); 19} 20 21emacsKillRingSave(); 22 23