Si realmente quieres eso, solo define tu propio comando para hacerlo. Puede copiar el código de lo mouse-2
que ya está vinculado a dired-mouse-find-file-other-window
, y simplemente cambiar la aparición de find-file-other-window
a find-file
. Luego, vincula tu comando a mouse-2
, en lugar de dired-mouse-find-file-other-window
.
Los únicos cambios que hice aquí son (1) el nombre del comando y (2) en find-file-other-window
lugar de find-file
:
(defun dired-mouse-find-file (event)
"In Dired, visit the file or directory name you click on."
(interactive "e")
(let (window pos file)
(save-excursion
(setq window (posn-window (event-end event))
pos (posn-point (event-end event)))
(if (not (windowp window))
(error "No file chosen"))
(set-buffer (window-buffer window))
(goto-char pos)
(setq file (dired-get-file-for-visit)))
(if (file-directory-p file)
(or (and (cdr dired-subdir-alist)
(dired-goto-subdir file))
(progn
(select-window window)
(dired-other-window file)))
(select-window window)
(find-file (file-name-sans-versions file t)))))
(define-key dired-mode-map [mouse-2] 'dired-mouse-find-file)
Y si también desea reemplazar (matar) el búfer Dired, use en find-alternate-file
lugar de find-file
.
dired
búfer"?