Created
July 28, 2019 12:35
-
-
Save tsuchm/fc300cd5d2fc4a8e39af3f0fef85b51a to your computer and use it in GitHub Desktop.
Use neither doc-view-mode or gimp to display application/pdf part
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (eval-after-load "mailcap" | |
| '(setq mailcap-mime-data | |
| (mapcar | |
| (lambda (data) | |
| (cons (car data) | |
| (delq nil | |
| (mapcar | |
| (lambda (pair) | |
| (let ((viewer (cdr (assq 'viewer (cdr pair))))) | |
| (cond | |
| ;; MIME part を表示するときに doc-view-mode を利用しないための設定 | |
| ;; doc-view-mode を使うようになっていると,applicate/pdf な MIME part | |
| ;; を表示できずに,単にファイルを保存してしまう. | |
| ((memq viewer '(pdf-view-mode doc-view-mode)) | |
| nil) | |
| ;; application/pdf または application/postscript を表示する時に gimp を利用しないための設定 | |
| ((and (string-match "\\`\\(pdf\\|postscript\\)\\'" (car pair)) | |
| (string-match "\\`gimp" viewer)) | |
| nil) | |
| (t pair)))) | |
| (cdr data))))) | |
| mailcap-mime-data))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment