通知:在回答此问题之前,请先查看我的答案,因为我首先回答了该问题。但是欢迎其他方式或任何建议。
如何打开backup-each-save.el
在dired
中由dired-jump
创建的最新备份文件,例如 1. Get the backup directory of the file connected to current opening file buffer.
2. Open the backup directory.
3. In the dired buffer, go to end of the buffer.
4. Search backward for the basename of opening file.
?
答案 0 :(得分:0)
这是算法及其代码。
算法:
(defun backup-each-save-dired-jump ()
(interactive)
(let* (
(filename (buffer-file-name))
(containing-dir (file-name-directory filename))
(basename (file-name-nondirectory filename))
(backup-container
(format "%s/%s"
backup-each-save-mirror-location
containing-dir))
)
(when (file-exists-p backup-container)
(find-file backup-container)
(goto-char (point-max))
(search-backward basename)
)))
代码:
d3