> Is it possible to open a file clicking on a link in emacs-wiki
> mode with approppriate applications?
> Say one want to open a PDF file but with evince, or file.sch with
> gschem application. Can one open these files with evince and gschem
> Any advices will be appreciated!
Here is what I use:
; Opening other kinds of files
; http://www.emacswiki.org/cgi-bin/wiki/TrivialMode ; by Cyprian Laskowski
; Modified to make buffer read only and to suppress output of command
(defun define-trivial-mode(mode-prefix file-regexp &optional command)
(or command (setq command mode-prefix))
(let ((mode-command (intern (concat mode-prefix "-mode"))))
(start-process ,mode-prefix nil
(add-to-list 'auto-mode-alist (cons file-regexp mode-command)))
;; This is how you would do it by hand
;; (defun view-pdf ()
;; "Use evince to view PDFs."
;; (toggle-read-only t)
;; (start-process "pdf" nil
;; "evince" (buffer-file-name)))
;; (add-to-list 'auto-mode-alist '("\\.pdf\\'" . view-pdf))