From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/30270 Path: main.gmane.org!not-for-mail From: Lloyd Zusman Newsgroups: gmane.emacs.gnus.general Subject: Logic error found in mailcap.el (was: Unable to change mailcap entry.) Date: 24 Apr 2000 01:37:26 -0400 Organization: Linux Hippopotamus Preserve Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035166830 7574 80.91.224.250 (21 Oct 2002 02:20:30 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 02:20:30 +0000 (UTC) Return-Path: Original-Received: from lisa.math.uh.edu (lisa.math.uh.edu [129.7.128.49]) by mailhost.sclp.com (Postfix) with ESMTP id 02424D051E for ; Mon, 24 Apr 2000 01:38:06 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by lisa.math.uh.edu (8.9.1/8.9.1) with ESMTP id AAB13718; Mon, 24 Apr 2000 00:38:04 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 24 Apr 2000 00:37:23 -0500 (CDT) Original-Received: from mailhost.sclp.com (postfix@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id AAA09942 for ; Mon, 24 Apr 2000 00:37:11 -0500 (CDT) Original-Received: from ljz.net (ljz.net [216.182.19.128]) by mailhost.sclp.com (Postfix) with ESMTP id C80FDD051E for ; Mon, 24 Apr 2000 01:37:28 -0400 (EDT) Original-Received: by ljz.net (Postfix, from userid 510) id 3929A3ECB0; Mon, 24 Apr 2000 01:37:27 -0400 (EDT) Original-To: ding@gnus.org X-Face: "!ga1s|?LNLE3MeeeEYs(%LIl9q[xV9!j4#xf4!**BFW_ihlOb;:Slb>)vy>CJM writes: > I'm using the latest (or near-latest) CVS gnus. > > For the first time in a couple weeks or so, I tried to view a MIME > image (image/jpeg) that was sent to me ... but now, gnus is trying to > use `ee' as the viewer. I don't have `ee' and have always used > `display' or `xv' for image viewing in the past. > > I'd like to handle this from within `.gnus.el', and so I put the > following into that file: > > (require 'mailcap) > > (mailcap-add-mailcap-entry "image" "jpeg" > '((viewer . "xv %s") > (type . "image/jpeg"))) > > ... but this has no effect. I've been fooling around, and now I understand the problem better. I have hacked a temporary solution so I can continue to use gnus the way I like. However, something needs to be changed, and I have an idea of what it is. First of all, this is my temporary hack for `.gnus.el' ... (require 'mailcap) (remassoc ".*" (assoc "image" mailcap-mime-data)) (mailcap-add-mailcap-entry "image" ".*" '((viewer . "xv %s") (type . "image/*"))) I'm not surprised that this works, given that it uses a rather healthy amount of brute force to remove the existing `ee' entry from `mailcap-mime-data' before adding my new entry ... along with all the other image-viewing possibilities. After digging around, I found out what is wrong: if there are multiple passing matches for a major/minor combination, the *last* valid match is always used; however, `mailcap-add-mailcap-entry' always puts the new entries *first*, thereby causing them to be ignored in the multiple-passing-matches case. My guess is that the solution should be either that ... ... one or more of the `(nreverse passed)' calls should be removed from within the `mailcap-mime-info' function in `mailcap.el' ... or that one or more of the `(car passed)' calls should be `(car (last passed))' in this `mailcap-mime-info' function ... or that the final line of the `mailcap-add-mailcap-entry' in this same file should be changed to read: (setcdr old-major (cons (cdr old-major) (cons minor info))))))))) ... or perhaps something else along these same lines which would cause newly added entries to not be skipped Thoughts? -- Lloyd Zusman ljz@asfast.com