;;; Index rendering
;;
+(defun elpher-decode (string)
+ "Return decoded STRING."
+ (let ((coding (detect-coding-string string t)))
+ (decode-coding-string string coding)))
+
(defun elpher-preprocess-text-response (string)
"Clear away CRs and terminating period from STRING."
(replace-regexp-in-string "\n\.\n$" "\n"
(replace-regexp-in-string "\r" ""
- string)))
+ (elpher-decode string))))
(defun elpher-insert-index (string)
"Insert the index corresponding to STRING into the current buffer."
(elpher-address-host address)
(elpher-address-port address)))))
+
(defun elpher-insert-index-record (display-string type selector host port)
"Function to insert an index record into the current buffer.
The contents of the record are dictated by TYPE, DISPLAY-STRING, SELECTOR, HOST
(make-network-process :name "elpher-process"
:host (elpher-address-host address)
:service (elpher-address-port address)
+ :coding 'no-conversion
+ :filter-multibyte nil
:filter (lambda (proc string)
(setq elpher-selector-string
(concat elpher-selector-string string)))
(lambda (proc event)
(unless (string-prefix-p "deleted" event)
(let ((image (create-image
- (encode-coding-string
- elpher-selector-string
- 'no-conversion)
+ elpher-selector-string
nil t)))
(elpher-with-clean-buffer
(insert-image image)