Change mode

This commit is contained in:
Denis Zheleztsov 2018-08-10 11:41:30 +03:00
parent 7344cc325f
commit 004b3396ca
Signed by: Difrex
GPG Key ID: B047A0E62A285621

View File

@ -268,10 +268,10 @@ optionaly return cursor to CHECKPOINT."
(princ "]\n")) (princ "]\n"))
(message (concat "IDEC: FUUUUUU <" echo ">"))) (message (concat "IDEC: FUUUUUU <" echo ">")))
)) ))
(add-text-properties (point-min) (point-max) 'read-only)) (add-text-properties (beginning-of-buffer) (end-of-buffer) 'read-only))
(if checkpoint (if checkpoint
(goto-char checkpoint)) (goto-char checkpoint))
(idec-mode)) (idec))
(defun idec-browse-local-echo (&optional echo) (defun idec-browse-local-echo (&optional echo)
"Get messages from local ECHO." "Get messages from local ECHO."
@ -282,28 +282,26 @@ optionaly return cursor to CHECKPOINT."
(setq longest (+ 1 (longest-local-echo-subj echo))) (setq longest (+ 1 (longest-local-echo-subj echo)))
(with-output-to-temp-buffer (get-buffer-create (concat "*IDEC: INBOX->(" echo ")") ) (with-output-to-temp-buffer (get-buffer-create (concat "*IDEC: INBOX->(" echo ")") )
(switch-to-buffer (concat "*IDEC: INBOX->(" echo ")")) (switch-to-buffer (concat "*IDEC: INBOX->(" echo ")"))
(let (start) (dolist (msg (get-echo-messages echo))
(setq start (point)) (setq subj-length (length (gethash "subj" msg)))
(dolist (msg (get-echo-messages echo)) (insert-button (gethash "subj" msg)
(setq subj-length (length (gethash "subj" msg))) 'action (lambda (x) (display-message-hash (button-get x 'msg-hash)))
(insert-button (gethash "subj" msg) 'subj (gethash "subj" msg)
'action (lambda (x) (display-message-hash (button-get x 'msg-hash))) 'help-echo (concat "Read message *" (gethash "subj" msg) "*")
'subj (gethash "subj" msg) 'msg-hash msg)
'help-echo (concat "Read message *" (gethash "subj" msg) "*")
'msg-hash msg)
;; Mark by asterisk unread message ;; Mark by asterisk unread message
(if (= 1 (gethash "unread" msg)) (if (= 1 (gethash "unread" msg))
(and (and
(princ "*") (princ "*")
(if (> longest subj-length) (if (> longest subj-length)
(setq subj-length (+ subj-length 1))))) (setq subj-length (+ subj-length 1)))))
(princ (make-string (- longest subj-length) ? )) (princ (make-string (- longest subj-length) ? ))
(princ (concat " " (gethash "time" msg))) (princ (concat " " (gethash "time" msg)))
(princ (concat "\t" (gethash "author" msg) "\n"))) (princ (concat "\t" (gethash "author" msg) "\n")))
(add-text-properties start (point) 'read-only) (add-text-properties (beginning-of-buffer) (end-of-buffer) 'read-only)))
(idec-mode))))) (idec))
;; NAVIGATION FUNCTIONS ;; NAVIGATION FUNCTIONS