[comp.emacs] Send Binary Code to Terminal?

schi@hpcupt1.HP.COM (Shan Chi) (09/01/89)

Is there a way to send binary code to the terminal from Emacs Lisp?

I'm using an HP terminal and would like to configure the function key
set, which requires some control code to be sent to the terminal.
I tried various output functions such as (princ ...) but everything is
intercepted by emacs and gets converted to displaying characters.  For
example, ESC will be displayed as ^[.  Is there a way to send ESC to the
terminal?

msikes@hpcupt1.HP.COM (Mark Sikes) (09/01/89)

Try this...

;
; set up the pf key functions
;

(defun update-pf-keys ()
  "Display the updated pf key labels."
  (interactive)
  (send-string-to-terminal "\e&jB"))

(defun set-pf (key-num label def)
  "Define a pf key."
  (interactive)
  (send-string-to-terminal
   (concat "\e&f0a" key-num "k"
	   (length label) "d"
	   (length def) "L"
	   label def)))

(defun clear-pf (key-num)
  "Clear a pf key."
  (interactive)
  (send-string-to-terminal (concat "\e&f0a" key-num "k1d-1L ")))

Mark Sikes, Hewlett-Packard  (hpda!msikes)