Aquamacs has a million things that are customized based upon the developer's decisions, and I haven't spent time with Aquamacs for several months now. Here is something that works with a generic version of Emacs -- the key binding is Control+c f
If it doesn't work for you, let me know what's happening and I'll see if I can figure it out.
EDIT (January 6, 2014): First working draft.
EDIT (January 13, 2014): Added the missing portion of the code relating to the variable path
.
(define-key dired-mode-map (kbd "C-c f") (lambda () (interactive)
(let* (
(input-filename
(if
(or (re-search-backward "^*" nil t)
(re-search-forward "^*" nil t))
(dired-get-marked-files)
(dired-get-file-for-visit)))
(path (if (stringp input-filename)(file-name-directory input-filename))))
(cond
((and
(stringp input-filename)
(not (file-directory-p input-filename))
(file-exists-p input-filename)
(not (equal input-filename (concat path "."))))
(find-file input-filename))
((listp input-filename)
(mapc 'find-file input-filename))))))