emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] I can not change the behavior of open the link which is a CHM fi


From: Nick Dokos
Subject: Re: [O] I can not change the behavior of open the link which is a CHM file [[file+sys://kk.chm]]
Date: Tue, 09 Jul 2013 09:46:25 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

chris <address@hidden> writes:

> I set variable "org-file-apps" like this:
>
>
> (setq org-file-apps
>       '(;; default
>         (auto-mode . emacs)
>         ("\\.mm\\'" . default)
>         ;; ("\\.x?html?\\'" . default)
>         ("\.x?html\'" . "firefox %s")
>         ("\\.pdf\\'" . default)
>         ("\\.pdf::\\([[:digit:]]+\\)\\'" . "okular -p %1 %s")
>         ;; extras
>         ("\\.chm\\'" . "kchmviewer %s") ;; TODO open CHM file with external 
> program.
>         ))
>
> But when I open a CHM file, Emacs does not open it with "kchmviewer", just 
> open
> CHM in Emacs.
>
> What's wrong ?

Nothing is wrong. org-file-apps applies only to links that org-mode
knows about (e.g. when you follow a link to a CHM file from an org file
- that should work). In order to affect emacs as a whole, you need to
modify one of your mailcap files - read the manual page mailca[(5) for
the details. It's probably best to put it in your personal mailcap file,
~/.mailcap, but if your machine is used by other people who might also
want the association, you might want to put it into /etc/mailcap. I have
no idea how Windows does these things, so if you are running on Windows
you might need additional help.

mailcap maps content type (e.g. chemical/x-chemdraw) to processor:

chemical/x-chemdraw; kchmviewer %s

You might also need to provide an association between a filename suffix
and a content type. That is done in /etc/mime.types or ~/.mime.types:

chemical/x-chemdraw                     chm

My /etc/mime.types already contained this association.

This is the general mechanism and *all* programs that claim to deal
with MIME content use it, including emacs. org-file-apps should be
used only to impose *exceptions* to this rule (e.g. you might want to
treat some content types differently if they are found as targets of
links from org files).

-- 
Nick




reply via email to

[Prev in Thread] Current Thread [Next in Thread]