リンクを作成して、たとえば、テキスト ファイルを Firefox に送信したり、Gedit に送信したりしたいと考えています。
Firefox にファイルを開くように指示するリンクを作成するにはどうすればよいですか。
.jpg を Firefox に送信したり、別のプログラムを使用したりすることがあるので、システムは多用途でなければなりませんが、ハイパーリンクとしてリンクする必要があります。
ファイル openwith.el はどうですか?
これはどう:
(setq reverse-org-file-apps
'(("firefox %s" . "\\.\\(?:xhtml\\|html\\|txt\\|jpg\\|png\\)")
("gedit %s" . "\\(?:txt\\|cc\\)")
("evince \"%s\"" . "\\.pdf\\'")
("okular \"%s\"" . "\\.pdf\\'")))
(defun new-org-open-at-point (program)
(interactive
(list
(completing-read "Open with: "
reverse-org-file-apps
nil t)))
(let* ((chosen-program (assoc program reverse-org-file-apps))
(org-file-apps (list (cons (cdr chosen-program)
(car chosen-program)))))
(org-open-at-point)))
(global-set-key (kbd "C-z") 'new-org-open-at-point)
を呼び出すたびにnew-org-open-at-point
、可能なアプリケーションを含む補完ミニバッファーが提供されます。好きなように伸ばすことができreverse-org-file-apps
ます。