[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Couple of useful (?) patches
- To: wl-en@lists.airs.net
- Subject: Couple of useful (?) patches
- From: Vitaly Mayatskikh <v.mayatskih@gmail.com>
- Date: Tue, 05 Apr 2011 22:20:50 -0400
- Cc: emacs-mime-ja@m17n.org
- Delivered-to: wl-en@lists.airs.net
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:message-id:from:to:cc:subject:user-agent :mime-version:content-type:content-transfer-encoding; bh=7Q/ASmc5xTBCo9Xb1VYLuvrUTBhiW4AMcVHBWu2I5yU=; b=Wg4GYSy5qYLdUsSiJNmUN2RPwjZ71iY/X8WAECClcDkE29BJSuxJgEYp8d6JfASjJw lhHHGTom+W+fUVmDtb1sP+At7IadLpEl+MBOKaQbNrKwgc2rIy4s2ZzHc+6rwaCzfNpi eb66/CLZwksSCt7J/RC81lFj/ZOuFXUmUzYxU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:message-id:from:to:cc:subject:user-agent:mime-version :content-type:content-transfer-encoding; b=dWwPfMCSk1U4HgEGgXmuCk9cCbWdq1UGAlziAmNShx0BidxEY6NkHjOEr5qwTKz5nC Dfdf8upFuvi1rJiP7WnJe/Zw/V5NtPMUsi1Mdm3DNMp7O4sgOfusGd9w1oyKXVZHWovD K1vj6HJp7dLKx9ELIZRBGHoCgAhnC28uVsTSA=
- List-help: <mailto:wl-en-ctl@lists.airs.net?body=help>
- List-id: wl-en.lists.airs.net
- List-owner: <mailto:wl-en-admin@lists.airs.net>
- List-post: <mailto:wl-en@lists.airs.net>
- List-software: fml [fml stable 20011102.2100]
- List-unsubscribe: <mailto:wl-en-ctl@lists.airs.net?body=unsubscribe>
- Reply-to: wl-en@lists.airs.net
- User-agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/23.3 Mule/6.0 (HANACHIRUSATO)
Hi!
This is follow up to recent issues claimed by Dave Abrahams on wl-en
list. Indeed, I agree with him, here're fixes:
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? ;)
Index: wl-summary.el
===================================================================
RCS file: /cvs/root/wanderlust/wl/wl-summary.el,v
retrieving revision 1.450
diff -p -u -w -r1.450 wl-summary.el
--- wl-summary.el 18 Oct 2010 07:43:32 -0000 1.450
+++ wl-summary.el 6 Apr 2011 02:06:43 -0000
@@ -4031,6 +4031,9 @@ Return t if message exists."
(defun wl-summary-reply-with-citation (&optional arg)
(interactive "P")
+ (let (mime-view-buttons-visible)
+ (wl-message-buffer-cache-clean-up)
+ (wl-summary-redisplay))
(when (wl-summary-reply arg t)
(goto-char (point-max))
(wl-draft-yank-original)
Next patch is for SEMI. The reason why mime-view-buttons-visible
defcustom has appeared is that people don't want to see MIME buttons
for multipart messages. The only need for them is to see
attachments. So last time I added defcustom and some code around to
toggle visibility of buttons, and now it's a time to finish it
logically. This patch allows to display buttons only for parts in
which we are interested.
Now it is part of type "application", but it can be extended. I've
seen, of course, function mime-view-entity-button-visible-p, which is
commented out, but I was afraid to reanimate this 10-years old code,
because I don't understand it. My approach is less smart may be, but
it works ;)
Please, test these patches. If you'll not find any problems, I'm about
to commit them.
Index: mime-view.el
===================================================================
RCS file: /cvs/root/semi/mime-view.el,v
retrieving revision 1.151.2.28
diff -p -u -w -r1.151.2.28 mime-view.el
--- mime-view.el 24 Oct 2010 10:39:22 -0000 1.151.2.28
+++ mime-view.el 6 Apr 2011 01:49:42 -0000
@@ -82,6 +82,11 @@ buttom. Nil means don't scroll at all."
:group 'mime-view
:type 'boolean)
+(defcustom mime-view-content-types-to-show '(application)
+ "Content types which have MIME buttons rendered."
+ :group 'mime-view
+ :type '(repeat sexp))
+
;;; @ in raw-buffer (representation space)
;;;
@@ -1095,11 +1100,14 @@ MEDIA-TYPE must be (TYPE . SUBTYPE), TYP
(or situation
(setq situation
(mime-find-entity-preview-situation entity default-situation)))
- (let ((button-is-invisible
- (or (not mime-view-buttons-visible)
- (eq (cdr (or (assq '*entity-button situation)
- (assq 'entity-button situation)))
- 'invisible)))
+ (let* ((entity-button (cdr (or (assq '*entity-button situation)
+ (assq 'entity-button situation))))
+ (button-is-visible
+ (and mime-view-buttons-visible
+ (or (and entity-button
+ (not (eq entity-button 'invisible)))
+ (member (cdr (assq 'type (mime-entity-content-type entity)))
+ mime-view-content-types-to-show))))
(header-is-visible
(eq (cdr (or (assq '*header situation)
(assq 'header situation)))
@@ -1112,11 +1120,8 @@ MEDIA-TYPE must be (TYPE . SUBTYPE), TYP
(set-buffer preview-buffer)
(setq nb (point))
(narrow-to-region nb nb)
- (or button-is-invisible
- ;; (if (mime-view-entity-button-visible-p entity)
- (mime-view-insert-entity-button entity)
- ;; )
- )
+ (when button-is-visible
+ (mime-view-insert-entity-button entity))
(if header-is-visible
(let ((header-presentation-method
(or (cdr (assq 'header-presentation-method situation))
--
wbr, Vitaly