3 ; This file is placed under the protection of the GNU General Public Licence.
5 ; Patch to make "F" in dired-mode replace the current (dired) buffer with
6 ; a buffer visiting the file the cursor is on.
8 ; Also new dired-run-file function.
10 (defun dired-find-alternate-file ()
11 "Like dired-find-file and find-alternate-file put together"
13 (find-alternate-file (dired-get-filename)))
15 (defun dired-run-file ()
16 "Runs the file pointed to in dired - output if any is put in the *Shell Command Output* buffer"
18 (let ((file (dired-get-filename))
19 (shelco (get-buffer-create "*Shell Command Output*"))
20 (oldbuf (current-buffer)))
21 (message "Running %s..." file)
24 (set-buffer-modified-p nil)
25 (call-process file nil shelco nil)
26 (if (buffer-modified-p)
27 (display-buffer shelco))
28 (message "Running %s...done" file)