- 612 名前:名無しさん@お腹いっぱい。 mailto:sage [2009/12/10(木) 01:04:48 ID:WGO4TcAu0]
- 矩形選択がうまく選べないバグがあったので、一応修正版
;;; 左ドラッグで選択した領域の文字数(改行を除く)を ;;; ステータスのところに表示するスクリプト。 (defun selection-char-count () (interactive) (let ((start nil) (end nil) (res 0) (seltype (get-selection-type))) (unless seltype (return-from selection-char-count nil)) (setf start (selection-mark) end (selection-point)) (if (= seltype 2) (progn (setf res (length (remove #\LFD (buffer-substring start end)))) (message "文字数: ~A" res))) (start-selection seltype t start); 関数呼び出しでセレクションが解除されてしまうため、設定しなおす (goto-char end))) (global-set-key #\LBtnUp 'selection-char-count)
|

|