[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: HTML rendering and docview not
From: |
Emanuel Berg |
Subject: |
Re: HTML rendering and docview not |
Date: |
Mon, 15 May 2017 23:53:32 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
> 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