From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/86242 Path: news.gmane.org!not-for-mail From: Michael Sperber Newsgroups: gmane.emacs.gnus.general Subject: PATCH: Unbreak `mailcap-mailcap-entry-passes-test' Date: Tue, 20 Oct 2015 11:10:55 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1445332555 10979 80.91.229.3 (20 Oct 2015 09:15:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 20 Oct 2015 09:15:55 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M34476@lists.math.uh.edu Tue Oct 20 11:15:43 2015 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from lists1.math.uh.edu ([129.7.128.208]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZoT0v-0007C1-By for ding-account@gmane.org; Tue, 20 Oct 2015 11:15:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.85) (envelope-from ) id 1ZoT0n-0006xd-MY; Tue, 20 Oct 2015 04:15:17 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by lists1.math.uh.edu with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.85) (envelope-from ) id 1ZoT0l-0006xC-RB for ding@lists.math.uh.edu; Tue, 20 Oct 2015 04:15:15 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.85) (envelope-from ) id 1ZoT0k-0006vy-KE for ding@lists.math.uh.edu; Tue, 20 Oct 2015 04:15:15 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1ZoT0j-0005CQ-9C for ding@gnus.org; Tue, 20 Oct 2015 11:15:13 +0200 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZoT0e-0006sK-9M for ding@gnus.org; Tue, 20 Oct 2015 11:15:08 +0200 Original-Received: from 195.52.203.132 ([195.52.203.132]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 20 Oct 2015 11:15:03 +0200 Original-Received: from sperber by 195.52.203.132 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 20 Oct 2015 11:15:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 97 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 195.52.203.132 User-Agent: Gnus/5.130014 (Ma Gnus v0.14) XEmacs/21.5-b34 (darwin) Cancel-Lock: sha1:lKJHgCfi9g72uYPTAvcMR0ML/xA= X-Spam-Score: -1.7 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:86242 Archived-At: --=-=-= Content-Type: text/plain I had to apply to attached patch to make mailcap work on XEmacs. I'm puzzled by this, as I think it should break mailcap for just about everyone. On the other hand, I don't see how the code (without) the patch could work as advertised. So if somebody could review (and maybe apply) it, that - again - would be much appreciated. -- Regards, Mike --=-=-= Content-Type: text/plain Content-Disposition: inline commit 44ac8cc38c99a6f88fc1ea9d065c8971ac39e36b Author: Mike Sperber Date: Tue Oct 20 11:06:49 2015 +0200 * mailcap.el (mailcap-mailcap-entry-passes-test): Actually return non-nil if no test clause is present, as documented. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3e2f0e1..56618b6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,10 @@ 2015-10-20 Michael Sperber + * mailcap.el (mailcap-mailcap-entry-passes-test): Actually return + non-nil if no test clause is present, as documented. + +2015-10-20 Michael Sperber + * mailcap.el (mailcap-mime-data): Conditonalize `doc-view-mode', which does not exist on XEmacs. diff --git a/lisp/mailcap.el b/lisp/mailcap.el index a3348c6..cdd20d1 100644 --- a/lisp/mailcap.el +++ b/lisp/mailcap.el @@ -560,26 +560,28 @@ MAILCAPS if set; otherwise (on Unix) use the path from RFC 1524, plus Also return non-nil if no test clause is present." (let ((test (assq 'test info)) ; The test clause status) - (setq status (and test (split-string (cdr test) " "))) - (if (and (or (assoc "needsterm" info) - (assoc "needsterminal" info) - (assoc "needsx11" info)) - (not (getenv "DISPLAY"))) - (setq status nil) - (cond - ((and (equal (nth 0 status) "test") - (equal (nth 1 status) "-n") - (or (equal (nth 2 status) "$DISPLAY") - (equal (nth 2 status) "\"$DISPLAY\""))) - (setq status (if (getenv "DISPLAY") t nil))) - ((and (equal (nth 0 status) "test") - (equal (nth 1 status) "-z") - (or (equal (nth 2 status) "$DISPLAY") - (equal (nth 2 status) "\"$DISPLAY\""))) - (setq status (if (getenv "DISPLAY") nil t))) - (test nil) - (t nil))) - (and test (listp test) (setcdr test status)))) + (or (not test) + (progn + (setq status (and test (split-string (cdr test) " "))) + (if (and (or (assoc "needsterm" info) + (assoc "needsterminal" info) + (assoc "needsx11" info)) + (not (getenv "DISPLAY"))) + (setq status nil) + (cond + ((and (equal (nth 0 status) "test") + (equal (nth 1 status) "-n") + (or (equal (nth 2 status) "$DISPLAY") + (equal (nth 2 status) "\"$DISPLAY\""))) + (setq status (if (getenv "DISPLAY") t nil))) + ((and (equal (nth 0 status) "test") + (equal (nth 1 status) "-z") + (or (equal (nth 2 status) "$DISPLAY") + (equal (nth 2 status) "\"$DISPLAY\""))) + (setq status (if (getenv "DISPLAY") nil t))) + (test nil) + (t nil))) + (and test (listp test) (setcdr test status)))))) ;;; ;;; The action routines. --=-=-=--