[Date Prev] [Date Index] [Date Next]
[Thread Prev] [Thread Index] [Thread Next]

[xyzzy:06579] Re: Filer: network $B5!G=(B



$B$3$s$P$s$o!#$^$8$^$G$9!#(J
(B
$B<+8J%U%)%m!<(J
(B
(B> $B550f$5$s!'(J
(B>> $B$=$&$$$&$b$s$G$9$,!"@_Dj$r(J "bash -i" $B$K$9$l$P=P$^$9!#(J
(B> 
(B> $B$*$)!"$[$s$H$@=P$^$7$?!#(J
(B> $B$G$b!"$d$C$Q$j(JTAB$B$G%3%^%s%I%3%s%W%j!<%H$7$J$$$G$9$J$!!#(J
(B> $B$H$j$"$($:4*$G%W%m%;%9$K(J \t $B$rAw$C$F$_$?$N$G$9$,$@$a$G$d$s$7$?!#(J
(B
$B$H$$$&$+!"$5$i$K4*$GAw$C$F$_$?$i%3%s%W%j!<%H$7$^$7$?!#(J
$B$7$^$7$?$,!"JQ$JJ8;z$,I=<($5$l$^$9(J
(B^G
$B$HI=<($5$l$k!#$J$s$+%(%9%1!<%W%3!<%I!)(J
$B$G!"B-$j$J$$G>$G9M$($k$H!"(Jbash $B$+$i$NI8=`=PNO$r$=$N$^$^(J
$B$D$J$,$:$K!"$R$H$D$+$^$;$F$+$iI=<($7$F$d$i$($($s$H$A$c$&$+!)(J
$B$8$c$!!"$+$^$;$k$b$N$O2?!)$H!"$3$3$GC

Attachment: bash.l
Description: application/applefile

;;; -*- Mode: Lisp; Package: EDITOR -*-
(B;;;
(B;;; This file is part of xyzzy.
(B;;;
(B
(B(provide "bash")
(B
(B(in-package "editor")
(B
(B(export '(*bash-mode-hook* *bash-mode-map* bash
(B					bash-send-interrupt))
(B
(B(defvar *ebash* "bash -i")
(B
(B(defvar *bash-mode-hook* nil)
(B(defvar *bash-mode-map* nil)
(B(unless *bash-mode-map*
(B	(setq *bash-mode-map* (make-keymap))
(B	(do ((n #x20 (+ n 1)))
(B			((> n #x7f))
(B		(define-key *bash-mode-map* (code-char n) 'bash-send-self-command))
(B	(define-key *bash-mode-map* '(#\C-c #\C-c) 'bash-send-interrupt))
(B
(B(setf (symbol-function 'bash-send-interrupt) #'kill-subprocess)
(B
(B(defun bash-mode ()
(B  (setq mode-name "Bash")
(B  (setq buffer-mode 'bash-mode)
(B  (use-keymap *bash-mode-map*)
(B	(setq need-not-save t)
(B	(setq auto-save nil)
(B	(setq kept-undo-information nil)
(B	(run-hooks '*bash-mode-hook*))
(B
(B(defun bash ()
(B	(interactive)
(B	(set-buffer (create-new-buffer "*Bash*"))
(B	(let ((proc (buffer-process (selected-buffer))))
(B		(and proc
(B				 (eq (process-status proc) ':run)
(B				 (return-from bash t)))
(B	(goto-char (point-max)) ;; いちばんけつまでいく
(B	(bash-mode)
(B  (make-process *ebash* :output (selected-buffer)))
(B
(B
(B(defun bash-send-self-command ()
(B	(interactive)
(B	(process-send-string (buffer-process (selected-buffer))
(B											 (string *last-command-char*)))
(B
(B;;;;;;;;;;;;;;;;;;
(B(define-key *bash-mode-map* #\C-p
(B						#'(lambda ()
(B								(interactive)
(B								(process-send-string (buffer-process (selected-buffer))
(B																		 "")))
(B
(B(define-key *bash-mode-map* #\C-n
(B						#'(lambda ()
(B								(interactive)
(B								(process-send-string (buffer-process (selected-buffer))
(B																		 "")))
(B
(B(define-key *bash-mode-map* #\C-f
(B						#'(lambda ()
(B								(interactive)
(B								(process-send-string (buffer-process (selected-buffer))
(B																		 "")))
(B
(B(define-key *bash-mode-map* #\C-b
(B						#'(lambda ()
(B								(interactive)
(B								(process-send-string (buffer-process (selected-buffer))
(B																		 "")))
(B
(B(define-key *bash-mode-map* #\RET
(B						#'(lambda ()
(B								(interactive)
(B								(process-send-string (buffer-process (selected-buffer))
(B																		 "\n")))
(B
(B(define-key *bash-mode-map* #\TAB
(B						#'(lambda ()
(B								(interactive)
(B								(process-send-string (buffer-process (selected-buffer))
(B																		 "\t")))
(B
(B(define-key *bash-mode-map* #\F21
(B						#'(lambda ()
(B								(interactive)
(B								(process-send-string (buffer-process (selected-buffer))
(B																		 "\b")))
(B(set-extended-key-translate-table exkey-backspace #\F21)

Index Home