fix(emacs/lean-server): respect order of messages in check-buffer-and-partition

This commit is contained in:
Soonho Kong 2014-09-10 12:46:08 -07:00
parent 7c4debd1d1
commit b51e8dd1b9

View file

@ -124,12 +124,16 @@
(defun lean-server-check-buffer-and-partition (buf-str)
"Return the status of buffer."
(let (result)
(when buf-str
(let (matches partition-result)
(setq matches
(cl-loop for (type beg-regex end-regex) in lean-server-syntax-pattern
do (setq partition-result (lean-server-split-buffer buf-str beg-regex end-regex))
if partition-result
return `(,type ,partition-result)))))
collect `(,type ,partition-result)))
(when matches
(-min-by (-on '< (lambda (type-partition-result) (length (car (cdr type-partition-result)))))
matches)))))
(defun lean-server-process-received-message (buf str)
"Process received message from lean-server"