| 1406 | | (if (file-directory-p (dired-get-filename)) |
|---|
| 1407 | | (or (and (cdr dired-subdir-alist) |
|---|
| 1408 | | (dired-goto-subdir (dired-get-filename))) |
|---|
| 1409 | | (dired (dired-get-filename))) |
|---|
| 1410 | | (view-file (dired-get-filename)))) |
|---|
| | 1406 | (let ((file (dired-get-file-for-visit))) |
|---|
| | 1407 | (if (file-directory-p file) |
|---|
| | 1408 | (or (and (cdr dired-subdir-alist) |
|---|
| | 1409 | (dired-goto-subdir file)) |
|---|
| | 1410 | (dired file)) |
|---|
| | 1411 | (let (cmd) |
|---|
| | 1412 | ;; Look for some other way to view a certain file. |
|---|
| | 1413 | (dolist (elt dired-view-command-alist) |
|---|
| | 1414 | (if (string-match (car elt) file) |
|---|
| | 1415 | (setq cmd (cdr elt)))) |
|---|
| | 1416 | (if cmd |
|---|
| | 1417 | (call-process shell-file-name nil 0 nil |
|---|
| | 1418 | "-c" |
|---|
| | 1419 | (concat (format cmd (shell-quote-argument file)) |
|---|
| | 1420 | " &")) |
|---|
| | 1421 | (view-file file)))))) |
|---|