diff --git a/toys/mm/mm-hdrs.el b/toys/mm/mm-hdrs.el index 80c909bb..b2c7ef53 100644 --- a/toys/mm/mm-hdrs.el +++ b/toys/mm/mm-hdrs.el @@ -182,8 +182,11 @@ after the end of the search results." (insert (propertize (case count (0 "No matching messages found") - (1 "Found 1 message") - (otherwise (format "Found %d messages" count))) + ;; note, don't show the number so we don't have to update it + ;; when we delete messsages... + (otherwise "End of search results")) + ;; (1 "Found 1 message") + ;; (otherwise (format "Found %d messages" count))) 'face 'mm/system-face 'intangible t)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/toys/mm/mm-proc.el b/toys/mm/mm-proc.el index 266b94b9..848ea838 100644 --- a/toys/mm/mm-proc.el +++ b/toys/mm/mm-proc.el @@ -133,7 +133,7 @@ process." ;; register a function for (:info ...) sexps (setq mm/proc-info-func 'mm/proc-info-handler) (when mm/mu-proc - (set-process-coding-system mm/mu-proc 'utf-8-unix 'utf-8-unix) + (set-process-coding-system mm/mu-proc 'binary 'utf-8-unix) (set-process-filter mm/mu-proc 'mm/proc-filter) (set-process-sentinel mm/mu-proc 'mm/proc-sentinel)))) @@ -163,11 +163,16 @@ updated as well, with all processed sexp data removed." (let* ((b (string-match "\376\\([0-9]+\\)\376" mm/buf)) (sexp-len (when b (string-to-number (match-string 1 mm/buf))))) + ;; does mm/buf contain the full sexp? (when (and b (>= (length mm/buf) (+ sexp-len (match-end 0)))) ;; clear-up start (setq mm/buf (substring mm/buf (match-end 0))) - (let ((objcons (read-from-string mm/buf))) + ;; note: we read the input in binary mode -- here, we take the part that + ;; is the sexp, and convert that to utf-8, before we interpret it. + (let ((objcons + (read-from-string + (decode-coding-string (substring mm/buf 0 sexp-len) 'utf-8)))) (setq mm/buf (substring mm/buf sexp-len)) (car objcons)))))) diff --git a/toys/mm/mm-view.el b/toys/mm/mm-view.el index 35bbefb7..523cd1e3 100644 --- a/toys/mm/mm-view.el +++ b/toys/mm/mm-view.el @@ -319,8 +319,8 @@ removing '^M' etc." (save-excursion ;; remove the stupid CRs (goto-char (point-min)) - (while (re-search-forward "[  ]" nil t) - (replace-match "" nil t)) + (while (re-search-forward "[\r\240]" nil t) + (replace-match " " nil t)) ;; give the footer a different color... (goto-char (point-min)) (let ((p (search-forward "\n-- \n" nil t))) @@ -328,7 +328,7 @@ removing '^M' etc." (add-text-properties p (point-max) '(face mm/view-footer-face)))) ;; this is fairly simplistic... (goto-char (point-min)) - (while (re-search-forward "\\(https?://.*\\)\\>" nil t) + (while (re-search-forward "\\(https?://[-a-zA-Z0-9?_.$%/=+&#@!]*\\)\\>" nil t) (let ((subst (propertize (match-string-no-properties 0) 'face 'mm/view-link-face))) (incf num)