[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Couple of useful (?) patches



At Tue, 05 Apr 2011 22:20:50 -0400,
Vitaly Mayatskikh wrote:
>
> Hi!
>
> First issue is weird MIME buttons appear in quoted reply. I see no
> reason to keep text representation of buttons in reply, do you? To
> work that around I propose to turn on visibility of buttons using
> relatively recent mime-view-buttons-visible patch (was it a year ago?
> or two?) just before reply is going to be rendered. Solution is pretty
> dumb: the whole pre-rendered cache is ripping out now, but... It
> works, and who cares about cache? ;)

Not sure, but couldn't we use the mime button's textproperties to
identify and kill them before insert the draft?

Just cobbled together this one

(defun foo ()
  (interactive)
  (while (not (eobp))
    (let ((plist (text-properties-at (point)))
	  (next-change
	   (or (next-single-char-property-change (point) 'mime-button-callback) (point-max))))
      (unless (get-text-property next-change 'mime-button-callback)
	(kill-region (point) next-change))
      (goto-char next-change))))

And it removes mime buttons in a copy of a message body.

Best,
  -- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

Attachment: pgpuDnKLWms1b.pgp
Description: PGP signature