From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/26113 Path: main.gmane.org!not-for-mail From: Shenghuo ZHU Newsgroups: gmane.emacs.gnus.general Subject: Re: mailcap-viewer-lessp is just plain wrong Date: 01 Nov 1999 16:24:25 -0500 Organization: U of Rochester Sender: owner-ding@hpc.uh.edu Message-ID: <5bpuxtoqgm.fsf@giga.cs.rochester.edu> References: <87aeoyvw1b.fsf@pazuzu.eudaemonia.org> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035163381 17650 80.91.224.250 (21 Oct 2002 01:23:01 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 01:23:01 +0000 (UTC) Return-Path: Original-Received: from lisa.math.uh.edu (lisa.math.uh.edu [129.7.128.49]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id QAA02208 for ; Mon, 1 Nov 1999 16:26:04 -0500 (EST) 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 PAB13535; Mon, 1 Nov 1999 15:25:44 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 01 Nov 1999 15:25:22 -0600 (CST) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id PAA24124 for ; Mon, 1 Nov 1999 15:25:10 -0600 (CST) Original-Received: from cayuga.cs.rochester.edu (cayuga.cs.rochester.edu [192.5.53.209]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id QAA02192 for ; Mon, 1 Nov 1999 16:24:27 -0500 (EST) Original-Received: from giga.cs.rochester.edu (giga.cs.rochester.edu [192.5.53.186]) by cayuga.cs.rochester.edu (8.9.3/Q) with ESMTP id QAA12959 for ; Mon, 1 Nov 1999 16:24:26 -0500 (EST) Original-Received: (from zsh@localhost) by giga.cs.rochester.edu (8.9.1b+Sun/Q++) id QAA09064; Mon, 1 Nov 1999 16:24:25 -0500 (EST) Original-To: ding@gnus.org X-Attribution: ZSH X-Face: 'IF:e51ib'Qbl^(}l^&4-J`'P!@[4~O|&k#:@Gld#b/]oMq&`&FVY._3+b`mzp~Jeve~/#/ ERD!OTe<86UhyN=l`mrPY)M7_}`Ktt\K+58Z!hu7>qU,i.N7TotU[FYE(f1;}`g2xj!u*l`^&=Q!g{ *q|ddto|nkt"$r,K$[)"|6,elPH= GJ6Q In-Reply-To: Mark Buda's message of "01 Nov 1999 14:42:08 -0500" Original-Lines: 44 User-Agent: Gnus/5.07009701 (Pterodactyl Gnus v0.97.1) Emacs/20.4 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:26113 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:26113 >>>>> "Mark" == Mark Buda writes: Mark> In pgnus-0.97/lisp/mailcap.el, this seems to be just wrong: Mark> (defun mailcap-viewer-lessp (x y) Mark> ;; Return t iff viewer X is more desirable than viewer Y Mark> (let ((x-wild (string-match "[*?]" (or (cdr-safe (assq 'type x)) ""))) Mark> (y-wild (string-match "[*?]" (or (cdr-safe (assq 'type y)) ""))) Mark> (x-lisp (not (stringp (or (cdr-safe (assq 'viewer x)) "")))) Mark> (y-lisp (not (stringp (or (cdr-safe (assq 'viewer y)) ""))))) Mark> (cond Mark> ((and x-lisp (not y-lisp)) Mark> t) Mark> ((and (not y-lisp) x-wild (not y-wild)) Mark> t) Mark> ((and (not x-wild) y-wild) Mark> t) Mark> (t nil)))) Mark> Shouldn't it be more like: Mark> ; blah blah blah Mark> (cond Mark> ((and x-lisp (not y-wild)) Mark> t) Mark> ((and y-wild (not x-wild)) Mark> t) Mark> ((and y-wild (not y-lisp)) Mark> t) Mark> (t nil)))) Mark> ? Mark> Even if mine isn't right, the existing function is just wrong. How can Mark> X be better if only one is wild, regardless of which one is wild? Your argument is right, but I don't think yours function is right. In the case that both X and Y are lisp, X is wild, while Y is not wild, your function returns 't. How can X be better than Y? Another problem is, in the case that X is wild and list, Y is neither wild nor list, both evaluations of (mailcap-viewer-lessp x y) and (mailcap-viewer-lessp y x) return 't for both the functions. -- Shenghuo ZHU