Opening files with default Windows application from within emacs

前端 未结 8 1596
难免孤独
难免孤独 2021-02-07 21:06

I\'m trying to tweak the dired-find-file function in emacs on Windows XP so that when I open (say) a pdf file from dired it fires up a copy of Acrobat Reader and op

相关标签:
8条回答
  • 2021-02-07 21:58

    Tom Smith's answer is nice, but you can also just run the program "start" with the filename as an argument.

    (shell-command (concat "start " (shell-quote-argument filename)))
    
    0 讨论(0)
  • 2021-02-07 21:59

    To extend on the 'org-open-file' proposal:

    (defun my-dired-find-file (&optional prefix)
        (interactive "P")
        (if prefix
            (org-open-file (dired-get-file-for-visit) 'system)
          (dired-find-file)))
    
    (define-key dired-mode-map "\r" 'my-dired-find-file)
    

    Will let you open a file externally with `C-u RET'.

    found at http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-11/msg01069.html

    0 讨论(0)
提交回复
热议问题