From: Peng Li Date: Fri, 29 Sep 2017 01:20:21 +0000 (+0800) Subject: Emacs - dired open file X-Git-Url: http://47.100.26.94:8080/?a=commitdiff_plain;h=0959aa16ba6280d213421f22190ea5e26e050e2f;hp=91d6442af37c49a429d2da637b06a44f522cbcae;p=dotfiles.git Emacs - dired open file --- diff --git a/emacs.d/config.org b/emacs.d/config.org index 7ebbe01..0854ef8 100644 --- a/emacs.d/config.org +++ b/emacs.d/config.org @@ -2028,7 +2028,7 @@ here on Mac, just use "open" commands to pen =.pdf=, =.html= and image files ("\\.csv\\'" "libreoffice") ("\\.tex\\'" "pdflatex" "latex") ("\\.\\(?:mp4\\|mkv\\|avi\\|rmvb\\|flv\\|ogv\\)\\(?:\\.part\\)?\\'" "mplayer") - ("\\.\\(?:mp3\\|flac\\)\\'" "rhythmbox") + ("\\.\\(?:mp3\\|flac\\|wav\\)\\'" "mplayer") ("\\.html?\\'" "open") ("\\.dmg\\'" "open") ("\\.cue?\\'" "audacious"))) @@ -2036,30 +2036,27 @@ here on Mac, just use "open" commands to pen =.pdf=, =.html= and image files (defun sd/dired-start-process (cmd &optional file-list) (interactive - (let ((files (dired-get-marked-files - t current-prefix-arg))) + (let ((files (dired-get-marked-files t current-prefix-arg))) (list - (unless (eq system-type 'windows-nt) - (dired-read-shell-command "& on %s: " - current-prefix-arg files)) + (dired-read-shell-command "& on %s: " current-prefix-arg files) files))) - (if (eq system-type 'windows-nt) - (dolist (file file-list) - (w32-shell-execute "open" (expand-file-name file))) - (let (list-switch) - (start-process - cmd nil shell-file-name - shell-command-switch - (format - "nohup 1>/dev/null 2>/dev/null %s \"%s\"" - cmd - ;; (if (and (> (length file-list) 1) - ;; (setq list-switch - ;; (cadr (assoc cmd ora-dired-filelist-cmd)))) - ;; (format "%s %s" cmd list-switch) - ;; cmd) - (mapconcat #'expand-file-name file-list "\" \"")))))) + ;; (let (list-switch)) + (start-process + cmd nil shell-file-name + shell-command-switch + (format + "nohup 1>/dev/null 2>/dev/null %s \"%s\"" + cmd + ;; (if (and (> (length file-list) 1) + ;; (setq list-switch + ;; (cadr (assoc cmd ora-dired-filelist-cmd)))) + ;; (format "%s %s" cmd list-switch) + ;; cmd) + (mapconcat #'expand-file-name file-list "\" \"")))) + + + #+END_SRC ** dired-hacks