Emacs Dired Behavior

I have been using emacs for many years and am used to having emacs open the selected file in the same window where dired is running. In recent versions, when dired is performed with two windows open, the selected file will be displayed in an alternative window from the firmware. How can I configure emacs to use the same window to display the file as dead (letting me view two files at the same time - how does emacs work)?

+3
source share
2 answers

According to the comments above, check C-h k RETwhen you want to see what you are attached to RET(or similarly, if you use a different key).

dired-find-file switch-to-buffer, :

, `pop-to-buffer ' .

, .

edit: , . , Emacs, Emacs .

, : dired C-h k, ( 1), :

----------------- up-event ( ) ----------------

< mouse-1 > < mouse-2 > , dired-mouse-find-file-other-window, Lisp `dired.el '.

(dired-mouse-find-file-other-window EVENT)

Dired , .

dired-mouse-find-file, :

(add-hook 'dired-mode-hook 'my-dired-mode-hook)
(defun my-dired-mode-hook ()
  (local-set-key (kbd "<mouse-2>") 'dired-mouse-find-file))

(defun dired-mouse-find-file (event)
  "In Dired, visit the file or directory name you click on."
  (interactive "e")
  (require 'cl)
  (flet ((find-file-other-window
          (filename &optional wildcards)
          (find-file filename wildcards)))
    (dired-mouse-find-file-other-window event)))
+8

"Enter" . o dired . , .emacs?

+5

Source: https://habr.com/ru/post/1796023/


All Articles