| 1 4 package gnu.jemacs.buffer; 5 import gnu.math.IntNum; 6 import gnu.mapping.*; 7 8 public class SelfInsertCommand extends Procedure0or1 9 { 10 public Object getProperty (Object key, Object defaultValue) 11 { 12 if (key == "emacs-interactive") 13 return "*p"; 14 return super.getProperty(key, defaultValue); 15 } 16 17 public Object apply0 () 18 { 19 apply1 (IntNum.one()); 20 return Values.empty; 21 } 22 23 24 public Object apply1 (Object arg1) 25 { 26 int count = ((Number ) arg1).intValue(); 27 EWindow window = EWindow.getSelected(); 28 Buffer buffer = window.buffer; 29 30 char ch = (char) window.pendingKeys[window.pendingLength]; 31 buffer.insert(ch, count); 32 return Values.empty; 33 } 34 } 35 | Popular Tags |