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.