From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/60860 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: Imroving deleting/stripping MIME parts Date: Thu, 01 Sep 2005 14:29:07 +0900 Organization: Emacsen advocacy group Message-ID: References: <87r7cfxfma.fsf@uwo.ca> <87d5nw88p9.fsf@uwo.ca> <87fysr78gi.fsf@uwo.ca> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1125552869 22660 80.91.229.2 (1 Sep 2005 05:34:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 1 Sep 2005 05:34:29 +0000 (UTC) Original-X-From: ding-owner+m9392=ding+2daccount=gmane.org@lists.math.uh.edu Thu Sep 01 07:34:21 2005 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EAhhB-0002s9-H7 for ding-account@gmane.org; Thu, 01 Sep 2005 07:33:05 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1EAhhA-0001ji-01 for ding-account@gmane.org; Thu, 01 Sep 2005 00:33:04 -0500 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1EAhdT-0001jV-00 for ding@lists.math.uh.edu; Thu, 01 Sep 2005 00:29:15 -0500 Original-Received: from quimby.gnus.org ([80.91.224.244]) by util2.math.uh.edu with esmtp (Exim 4.30) id 1EAhdR-0002SE-94 for ding@lists.math.uh.edu; Thu, 01 Sep 2005 00:29:13 -0500 Original-Received: from washington.hostforweb.net ([66.225.201.13]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1EAhdQ-0008Ei-00 for ; Thu, 01 Sep 2005 07:29:12 +0200 Original-Received: from localhost ([127.0.0.1]) by washington.hostforweb.net with esmtpa (Exim 4.50) id 1EAhde-0006CW-Sa for ding@gnus.org; Thu, 01 Sep 2005 00:29:27 -0500 Original-To: ding@gnus.org X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:KWdPAVvyeXi9xQjAe6ExEwEh1KE= X-Hashcash: 1:20:050901:ding@gnus.org::Un11x9BrPiM8huL+:00000Yl0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - washington.hostforweb.net X-AntiAbuse: Original Domain - gnus.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: -4.8 (----) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:60860 Archived-At: --=-=-= >>>>> In Katsumi Yamaoka wrote: >>> I'd like to propose adding two features. The following >>> definition displays all the MIME buttons even if >>> `gnus-inhibit-mime-unbuttonizing' is nil (which is the default), >>> and specifies which part the user is going to manipulate. I revised the function I posted last. This does: issue the error if the article is not visible or the article doesn't display the right contents or there's no specified part. point the cursor and the arrow at the MIME button when the handler function (e.g., `2 K d', `2 K O', `2 K |', etc.) prompts the user for something. redisplay the article so that all the MIME buttons might be visible if the part which doesn't have the MIME button is selected. Could you test it? I added an article for testing in the gmane.test group as . --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline (defun gnus-article-part-wrapper (n function &optional no-handle) (let (window) ;; Check whether the article is displayed. (unless (and (gnus-buffer-live-p gnus-article-buffer) (setq window (get-buffer-window gnus-article-buffer t)) (frame-visible-p (window-frame window))) (error "No article is displayed")) (with-current-buffer gnus-article-buffer ;; Check whether the article displays the right contents. (unless (with-current-buffer gnus-summary-buffer (eq gnus-current-article (gnus-summary-article-number))) (error "You should select the right article first")) ;; Check whether the specified part exists. (when (> n (length gnus-article-mime-handle-alist)) (error "No such part"))) (unless ;; We point the cursor and the arrow at the MIME button ;; when the `function' prompt the user for something. (save-window-excursion ;; To select the window is needed so that the cursor ;; might be visible on the MIME button. (select-window window) (when (gnus-article-goto-part n) (let ((cursor-in-non-selected-windows t) ;; Display cursor. (overlay-arrow-string "=>") ;; Display arrow. (overlay-arrow-position (point-marker))) (unwind-protect (if no-handle (funcall function) (funcall function (cdr (assq n gnus-article-mime-handle-alist)))) (set-marker overlay-arrow-position nil))) t)) (if gnus-inhibit-mime-unbuttonizing ;; This is the default though the program shouldn't reach here. (error "No such part") ;; The part which doesn't have the MIME button is selected. ;; So, we display all the buttons and redo it. (let ((gnus-inhibit-mime-unbuttonizing t)) (gnus-summary-show-article) (gnus-article-part-wrapper n function no-handle)))))) --=-=-=--