From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: HTML rendering and docview not Date: Mon, 15 May 2017 23:53:32 +0200 Message-ID: References: <87y3u5ohae.fsf@fliptop> <87r2zxnw8c.fsf@fliptop> <87mvagpqsb.fsf@fliptop> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1494885256 2001 195.159.176.226 (15 May 2017 21:54:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 15 May 2017 21:54:16 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon May 15 23:54:12 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dANwR-0000Ml-1t for geh-help-gnu-emacs@m.gmane.org; Mon, 15 May 2017 23:54:11 +0200 Original-Received: from localhost ([::1]:38986 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dANwW-0002HA-Lr for geh-help-gnu-emacs@m.gmane.org; Mon, 15 May 2017 17:54:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57009) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dANw7-0002Gt-21 for help-gnu-emacs@gnu.org; Mon, 15 May 2017 17:53:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dANw3-0000mD-UY for help-gnu-emacs@gnu.org; Mon, 15 May 2017 17:53:51 -0400 Original-Received: from [195.159.176.226] (port=43888 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dANw3-0000lp-NR for help-gnu-emacs@gnu.org; Mon, 15 May 2017 17:53:47 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dANvs-00084h-LQ for help-gnu-emacs@gnu.org; Mon, 15 May 2017 23:53:36 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 65 Original-X-Complaints-To: usenet@blaine.gmane.org Mail-Copies-To: never Cancel-Lock: sha1:dNYZyVPQK88nHBfwzfGo0WZwMQU= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:113031 Archived-At: > I didn't find it so easy. I figured out that > if I fiddle with the variable > mailcap-mime-data in the following way, > doc-view-mode will not be used by > notmuch-show-view-part. I use Gnus, however as for PDFs I never open them from Gnus, what I do is download the attachments with either `gnus-summary-save-parts' or just hitting the buttons; with URLs, I use w3m to either bookmark or download them. If you want to view them directly from the article buffer, and there isn't an option to do this (which would be ideal), what I would do is browse the source for how it isolates the file, and then run your own background process with that as the argument. As for DWIM from the Dired buffer on .doc files, if it is a matter of putting the buffer in a specific mode, it is better to not involve Dired, but do this all over. See `auto-mode-alist' below. You can also use `magic-mode-alist' as in the C++ example below - I suppose that is sort of the hash-bang solution in Emacs, however I think it is much better to not use that and instead use the file suffix. The poll example I also put there as a fun thing to do - I wouldn't use it. (setq magic-mode-alist '(("/\\* cpp \\*/" . c++-mode) ("/\\* poll-mode \\*/" . (lambda () (call-interactively #'poll-mode)) ))) (defun poll-mode (mode) (interactive "CMajor mode: ") (eval `(,mode)) ) (let ((modes (list '("\\.nqp\\'" . perl-mode) '("\\.tex\\'" . latex-mode) '("\\.php\\'" . html-mode) '("\\.bal\\'" . balance-mode) '("\\.gpi\\'" . gnuplot-mode) '("\\.\\(glsl\\|oil\\|ssc\\|dfy\\)\\'" . c-mode) '("\\.lu\\'" . lua-mode) '("keys\\'" . conf-mode) '("\\.\\(options\\|service\\|list\\|theme\\|mailrc\\|sed\\|inc\\)\\'" . conf-mode) '("\\.pic\\'" . nroff-mode) '("\\.xr\\'" . conf-xdefaults-mode) '("inputrc\\'" . conf-colon-mode) '("README\\'" . text-mode) '("BIRDS\\'" . emacs-lisp-mode) ))) (setf auto-mode-alist (nconc modes auto-mode-alist)) ) -- underground experts united http://user.it.uu.se/~embe8573