Commit 2b538300 authored by David Kågedal's avatar David Kågedal
Browse files

No commit message

No commit message
parent 7479f02e
No preview for this file type
...@@ -55,9 +55,9 @@ See lyskom-mode for details." ...@@ -55,9 +55,9 @@ See lyskom-mode for details."
(run-hooks 'lyskom-init-hook) (run-hooks 'lyskom-init-hook)
(setq username (setq username
(if username username (getenv "KOMNAME"))) (or username (getenv "KOMNAME")))
(setq password (setq password
(if password password (getenv "KOMPASSWORD"))) (or password (getenv "KOMPASSWORD")))
(if (zerop (length host)) (if (zerop (length host))
(setq host (or (getenv "KOMSERVER") (setq host (or (getenv "KOMSERVER")
lyskom-default-server))) lyskom-default-server)))
...@@ -72,10 +72,12 @@ See lyskom-mode for details." ...@@ -72,10 +72,12 @@ See lyskom-mode for details."
(t (t
(setq host (substring host 0 (match-beginning 0))))))) (setq host (substring host 0 (match-beginning 0)))))))
(unwind-protect
(let* ((buffer (generate-new-buffer host)) (let* ((buffer (generate-new-buffer host))
(name (buffer-name buffer)) (name (buffer-name buffer))
(proc (open-network-stream name buffer host port))) (proc nil))
(unwind-protect
(progn
(setq proc (open-network-stream name buffer host port))
(switch-to-buffer buffer) (switch-to-buffer buffer)
(lyskom-mode) ;Clearing lyskom-default... (lyskom-mode) ;Clearing lyskom-default...
(setq kom-buffer buffer) (setq kom-buffer buffer)
...@@ -93,8 +95,7 @@ See lyskom-mode for details." ...@@ -93,8 +95,7 @@ See lyskom-mode for details."
"%" (system-name))))) "%" (system-name)))))
(while (eq 'lyskom-connect-filter (process-filter proc)) (while (eq 'lyskom-connect-filter (process-filter proc))
(accept-process-output proc)) (accept-process-output proc))
; Now we have gotten the correct response. ;; Now we have got the correct response.
(set-process-sentinel proc 'lyskom-sentinel) (set-process-sentinel proc 'lyskom-sentinel)
(save-excursion (save-excursion
...@@ -117,7 +118,8 @@ See lyskom-mode for details." ...@@ -117,7 +118,8 @@ See lyskom-mode for details."
(lyskom-insert (lyskom-insert
(text->text-mass (text->text-mass
(blocking-do 'get-text (blocking-do 'get-text
(server-info->motd-of-lyskom lyskom-server-info))))) (server-info->motd-of-lyskom
lyskom-server-info)))))
;; Can't use lyskom-end-of-command here. ;; Can't use lyskom-end-of-command here.
(setq lyskom-executing-command nil) (setq lyskom-executing-command nil)
;;; B|rja ;;; B|rja
...@@ -126,8 +128,8 @@ See lyskom-mode for details." ...@@ -126,8 +128,8 @@ See lyskom-mode for details."
;; Something went wrong. Lets cleanup everything. :-> ;; Something went wrong. Lets cleanup everything. :->
(if init-done (if init-done
nil nil
(delete-process (get-buffer-process (current-buffer))) (if proc (delete-process proc))
(kill-buffer (current-buffer)))))) (kill-buffer buffer))))))
(defun lyskom-connect-filter (proc output) (defun lyskom-connect-filter (proc output)
...@@ -201,6 +203,7 @@ See lyskom-mode for details." ...@@ -201,6 +203,7 @@ See lyskom-mode for details."
(lyskom-refetch) (lyskom-refetch)
;; (cache-initiate-who-info-buffer (blocking-do 'who-is-on)) ;; (cache-initiate-who-info-buffer (blocking-do 'who-is-on))
(cache-set-marked-texts (blocking-do 'get-marks)) (cache-set-marked-texts (blocking-do 'get-marks))
;; What is this variable? It is never used. It is ust to fill the cache?
(setq lyskom-who-am-i (blocking-do 'who-am-i)) (setq lyskom-who-am-i (blocking-do 'who-am-i))
(lyskom-end-of-command)) (lyskom-end-of-command))
......
...@@ -329,7 +329,7 @@ Args: TEXT-STAT TEXT MARK-AS-READ TEXT-NO." ...@@ -329,7 +329,7 @@ Args: TEXT-STAT TEXT MARK-AS-READ TEXT-NO."
(setq t2 (point-max))) (setq t2 (point-max)))
(t ;No \n found. Don't print header. (t ;No \n found. Don't print header.
(setq s1 (point-max)) (setq s1 (point-max))
(lyskom-format-insert "%#1t" body) (lyskom-format-insert "%#1t" str)
(setq s2 (point-max)) (setq s2 (point-max))
(setq t1 (point-max) (setq t1 (point-max)
t2 (point-max)) t2 (point-max))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment