emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <ndokos@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: 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	[thread overview]
Message-ID: <87k3kz3ky6.fsf@gmail.com> (raw)
In-Reply-To: 20130709120441.GD25098@stardiviner

chris <numbchild@gmail.com> 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	other threads:[~2013-07-09 13:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-09 12:04 I can not change the behavior of open the link which is a CHM file [[file+sys://kk.chm]] chris
2013-07-09 13:46 ` Nick Dokos [this message]
2013-07-09 14:08   ` Jambunathan K
2013-07-09 15:50     ` Nick Dokos
2013-07-09 16:38       ` Jambunathan K
2013-07-10  1:19     ` chris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k3kz3ky6.fsf@gmail.com \
    --to=ndokos@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).