From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos 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 Message-ID: <87k3kz3ky6.fsf@gmail.com> References: <20130709120441.GD25098@stardiviner> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwYFc-0000YS-72 for emacs-orgmode@gnu.org; Tue, 09 Jul 2013 09:46:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UwYFb-00073a-11 for emacs-orgmode@gnu.org; Tue, 09 Jul 2013 09:46:40 -0400 Received: from plane.gmane.org ([80.91.229.3]:36172) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwYFa-00073L-QO for emacs-orgmode@gnu.org; Tue, 09 Jul 2013 09:46:38 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UwYFZ-0000Fc-ML for emacs-orgmode@gnu.org; Tue, 09 Jul 2013 15:46:37 +0200 Received: from pool-108-7-96-134.bstnma.fios.verizon.net ([108.7.96.134]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 09 Jul 2013 15:46:37 +0200 Received: from ndokos by pool-108-7-96-134.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 09 Jul 2013 15:46:37 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org chris 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