
(byte-code "ÀÁÂ\"ˆÃÁÄÅ#ˆÆÇ!ˆÀÈÉ\"ˆÃÈÊÅ#ˆÆÇ!ˆÈ‡" [setplist ibtypes::hwww:link-follow (variable-documentation "When in a www buffer, returns a link follow or history recall command." at-p (let* ((www (get-buffer-process (current-buffer))) (www-proc-nm (and www (process-name www))) (act (quote (lambda (&optional prefix) (setq selection (buffer-substring (match-beginning 1) (match-end 1))) (ibut:label-set selection (match-beginning 1) (match-end 1)) (hact (quote hwww:link-follow) (concat prefix selection))))) selection) (if (and www-proc-nm (equal (string-match "www" www-proc-nm) 0)) (cond ((save-excursion (skip-chars-backward "^ 	
") (looking-at "[^][ 	
]*\\[\\([0-9]+\\)\\]")) (funcall act)) ((save-excursion (beginning-of-line) (looking-at "[ 	]*\\([0-9]+\\))[ 	]+[^ 	
]")) (funcall act "recall ")) ((save-excursion (beginning-of-line) (looking-at "[ 	]*\\[\\([0-9]+\\)\\][ 	]+[^ 	
]")) (funcall act))))) to-p nil style nil) symset:add ibtypes types run-hooks htype:create-hook actypes::hwww:link-follow (variable-documentation "Follows a link given by LINK-NUM-STR or displays a www history list." action (lambda (link-num-str) (interactive "sNumber of WWW link to follow: ") (or (stringp link-num-str) (error "(hwww:link-follow): Link number must be given as a string.")) (let ((www (get-buffer-process (current-buffer)))) (if www (progn (setq buffer-read-only nil) (erase-buffer) (process-send-string www (concat link-num-str "
"))) (error "(hwww:link-follow): No current WWW process.  Use 'hwww:start'."))))) actypes] 8)

(defun hwww:link-follow:help (&optional but) "\
Displays history list of www nodes previously visited." (interactive) (actype:act (quote hwww:link-follow) "recall"))

(byte-code "ÀÁÂ\"ˆÃÁÄÅ#ˆÆÇ!ˆÁ‡" [setplist actypes::hwww:start (variable-documentation "Starts a www process and displays optional FILE.
Without FILE (an empty string), displays default initial www file." action (lambda (&optional file) (interactive "FWWW file to start with: ") (or (stringp file) (error "(hwww:start): FILE argument is not a string.")) (let ((www-buf (get-buffer-create "WWW")) (www-proc (get-process "www"))) (save-excursion (set-buffer www-buf) (setq buffer-read-only nil) (erase-buffer)) (if www-proc (pop-to-buffer www-buf) (if (setq www-proc (if (or (equal file "") (equal file "\"\"")) (start-process "www" www-buf "www" "-p") (start-process "www" www-buf "www" "-p" file))) (progn (set-process-sentinel www-proc (quote hwww:sentinel)) (set-process-filter www-proc (quote hwww:filter)) (process-kill-without-query www-proc) (pop-to-buffer www-buf) (shell-mode) (make-local-variable (quote explicit-shell-file-name)) (setq explicit-shell-file-name "www") (use-local-map hwww:mode-map) (if hwww:mode-map nil (setq hwww:mode-map (copy-keymap shell-mode-map)) (define-key hwww:mode-map "" (quote hwww:send-input)) (define-key hwww:mode-map " " (quote hwww:scroll-up)) (define-key hwww:mode-map "" (quote hwww:scroll-down))) (goto-char (point-min)))))))) symset:add actypes types run-hooks htype:create-hook] 5)

(defun hwww:filter (process str) (byte-code "GÁV… ÂÃÄÅO\"ƒ! cˆebˆÆÇÈÉQÊ\"‚# c‡" [str 3 equal "==> " -4 nil ep:but-create "\\([^ 	
]*\\[[0-9]+\\]\\|" "^[ 	]*\\[\\([0-9]+\\)\\][ 	]+[^ 	
]+\\|" "^[ ]+[0-9]+).*\\)" regexp] 5))

(defun hwww:scroll-up (&optional arg) "\
If on last line of buffer, insert space, else scroll up a page." (interactive "P") (byte-code "Á ƒ
 Âc‚ Ã!‡" [arg last-line-p " " scroll-up] 3))

(defun hwww:scroll-down (&optional arg) "\
If on last line of buffer, delete char backwards, else scroll down a page." (interactive "P") (byte-code "Á ƒ Â† Ã!‚ Ä!‡" [arg last-line-p backward-delete-char-untabify 1 scroll-down] 4))

(defun hwww:send-input nil (interactive) (byte-code "mƒ7 Äp!ƒ0 Å ˆÆ	ŠÇ ˆ`)Â#ˆÈ`ÉÊ!ˆ`\"ËPÌ ˆÍ\")‚3 ÎÏ!)‚C Ð ƒA Ñ ‚C Ò ‡" [www shell-prompt-pattern t cmd get-buffer-process beginning-of-line re-search-forward end-of-line buffer-substring forward-line 1 "
" erase-buffer process-send-string error "(hwww:link-follow): No current WWW process.  Use 'hwww:start'." ibut:at-p hui:hbut-act end-of-buffer] 13))

(defun hwww:sentinel (process signal) (byte-code "ÂÃÄ	#!ˆÅÆ	\"† ÇÈ!!‡" [process signal princ format "Process: %s received the msg: %s" string-match "killed" pop-to-buffer process-buffer] 6))

(defvar hwww:mode-map nil)

(provide (quote hsys-www))
