Skip to content

Instantly share code, notes, and snippets.

@idontgetoutmuch
Forked from dotemacs/rdcp.el
Created December 10, 2013 21:26
Show Gist options
  • Save idontgetoutmuch/7900505 to your computer and use it in GitHub Desktop.
Save idontgetoutmuch/7900505 to your computer and use it in GitHub Desktop.
;; 10.112.148.185 8080
;; (defun dired-vlc-test ()
;; (interactive)
;; (let* ((buf (process-buffer dired-vlc-telnet-proc))
;; (old-max (with-current-buffer buf
;; (point-max))))
;; (telnet-simple-send dired-vlc-telnet-proc "get_time")
;; (accept-process-output dired-vlc-telnet-proc 5)
;; (message (buffer-substring-no-properties old-max (with-current-buffer buf
;; (point-max))))))
(defun conn ()
(interactive)
(telnet "10.112.148.185 8080"))
;; (progn
;; (conn)
;; (sleep-for 200)
;; (insert "Elisp")
;; (telnet-send-input)
;; (sleep-for 2000)
;; (read-last-line)
;; ;; (telnet-send-input)
;; (read-last-line)
;; (read-last-line)
;; )
(defun ourtelnet ()
(interactive)
(let ((proc (telnet "10.112.148.185 8080"))
(buf (process-buffer proc)))
(when (accept-process-output proc 5)
(message "yes")
(message "no"))))
;;(make-comint NAME PROGRAM &optional STARTFILE &rest SWITCHES)
(make-comint "Telnet" telnet )
(require 'comint)
(progn
(apply 'make-comint "our-telnet" "/usr/bin/telnet" nil '())
(switch-to-buffer-other-window "*our-telnet*")
(other-window -1))
(progn
(apply 'make-comint "our-telnet" "/usr/bin/telnet" nil '())
(switch-to-buffer-other-window "*our-telnet*"))
(comint-send-string (get-buffer-process "*our-telnet*") "open 10.112.148.185 8080\n")
(comint-send-string (get-buffer-process "*our-telnet*") "Elisp\n")
(comint-send-string (get-buffer-process "*our-telnet*") "E\n")
(defun read-last-line ()
(interactive)
(progn
(end-of-buffer)
(move-beginning-of-line 0)
(kill-line)
(yank)
(car kill-ring-yank-pointer)))
(defun parse-opts ()
(interactive)
(message "NORTH: %s" (substring (read-last-line) 1 2)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment