ついでに作ったoedit用のEmacs風関数のメモ

(define (buffer-substring row1 col1 row2 col2)
		(let ((row (editor-get-cur-row))
			  (col (editor-get-cur-col)))
		  (editor-set-select-area row1 col1 row2 col2)
		  (let ((str (editor-get-selected-string)))
			(editor-set-select-area row col row col)
			str)))

(define (char-after row col)
		(editor-set-select-area row col row (+ col 1))
		(let ((str (editor-get-selected-string)))
		  (editor-set-select-area row col row col)
		  str))
; 今のところ文字列でしか取得できないのでcharじゃないけどその辺は無視

せめてエディタから一文字取得があれば、eobpとかも出来るんだど改行が読み込めないと中々難しい。選択して取得だと改行が認識してないような気がする。eobpが出来ないとend-of-lineも難しい。と言うことでまともな感じのC-eは面倒になってやめてた。

良く知らないけど、SRFIとか言うのがライブラリの代わりならば、その中になんかあるのかもしれないが、あんまりリファレンス呼んでいないので不明。っていうかSchemeを全然知らないのでどうなってるのか知らないけど。

Karetta|Gaucheプログラミング(立読み版)|SRFI
http://karetta.jp/book-node/gauche-hacks/004724
Gauche リファレンスマニュアル: ライブラリモジュール - SRFI
http://gauche.sourceforge.jp/doc/gauche-refj_211.html

Gaucheを参考にしてるとか書いて在ったので、後で見ても良いかなぁと思ったメモ。