diff options
Diffstat (limited to 'modules/system-utils.el')
| -rw-r--r-- | modules/system-utils.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/system-utils.el b/modules/system-utils.el index 1bd7f015..29076f6d 100644 --- a/modules/system-utils.el +++ b/modules/system-utils.el @@ -106,7 +106,11 @@ Signals an error if the host is unsupported." "Open FILENAME (or the file at point) with the OS default handler. Logs output and exit code to buffer *external-open.log*." (interactive) - (let* ((file (expand-file-name (or filename (dired-file-name-at-point)))) + (let* ((file (expand-file-name + (or filename + buffer-file-name + (and (derived-mode-p 'dired-mode) (dired-file-name-at-point)) + (user-error "No file associated with this buffer")))) (cmd (cj/identify-external-open-command)) (logbuf (get-buffer-create "*external-open.log*"))) (with-current-buffer logbuf |
