comparison shared/mail-extras.el @ 3:0a81352bd7d0

catch up
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Sat, 17 Sep 2022 11:01:40 +0100
parents 107d592c5f4a
children
comparison
equal deleted inserted replaced
2:dd557432d846 3:0a81352bd7d0
448 (kill-buffer "*Preview-RMAIL*") 448 (kill-buffer "*Preview-RMAIL*")
449 ) 449 )
450 450
451 ;; see message-citation-line-function in message.el 451 ;; see message-citation-line-function in message.el
452 (defun safe-citation () 452 (defun safe-citation ()
453 (use-text-not-html)
453 (when message-reply-headers 454 (when message-reply-headers
454 (let ((from (mail-header-from message-reply-headers))) 455 (let ((from (mail-header-from message-reply-headers)))
455 (cond ((string-match "^\"?\\([^\"]*\\)\"? <.*>$" from) 456 (cond ((string-match "^\"?\\([^\"]*\\)\"? <.*>$" from)
456 (insert (match-string 1 from) " writes:\n\n")) 457 (insert (match-string 1 from) " writes:\n\n"))
457 ((string-match "^\\([^<@]*\\)@" from) 458 ((string-match "^\\([^<@]*\\)@" from)
458 (insert (match-string 1 from) " writes:\n\n")) 459 (insert (match-string 1 from) " writes:\n\n"))
459 (t 460 (t
460 (insert "[anon] writes:\n\n")))))) 461 (insert "[anon] writes:\n\n"))))))
461 462
463 (defun use-text-not-html (&optional clear)
464 (when (and (if clear (looking-at "<html")
465 (looking-at "> <html"))
466 (bufferp (get-buffer "*Shell Command Output*")))
467 ;; replace HTML only with result of my HTML filter
468 (delete-region (point)(mark t))
469 (insert-buffer "*Shell Command Output*")
470 (when (looking-at "piping")
471 (kill-entire-line)
472 (indent-rigidly (point) (mark t) -3)
473 (if (not clear)
474 (submerge-region (point) (mark t)))))
475 )
462 476
463 (setq message-citation-line-function (function safe-citation)) 477 (setq message-citation-line-function (function safe-citation))
464 478
465 ;(load-library "mailcrypt") ; provides "mc-setversion" 479 ;(load-library "mailcrypt") ; provides "mc-setversion"
466 ;(mc-setversion "gpg") ; for PGP 2.6 (default); also "5.0" and "gpg" 480 ;(mc-setversion "gpg") ; for PGP 2.6 (default); also "5.0" and "gpg"