Description
By debug suffixes data of function backup-walker-refresh, its structure is (".~3~" ".~2~" ".~1~")
Every time you
- press "p" (prev changes) to increase(+)
index pointer, like from ".~3~" to ".~2~" (for older changes)
- press "n" (next changes) to decrease(-)
index pointer, like from ".~2~" to ".~3~" (for newer changes)
The first item ".~3~" is most recent, this is different from git notation like HEAD~3
So in your code, left-file with (setq left-file (concat prefix (nth (1- index) suffixes))) means more recent file, right-file means older file
But you passed them to function diff-no-select in reversed order
|
(if (eq index 0) |
|
(setq left-file (cdr (assq :original-file backup-walker-data-alist)) |
|
left-version "orig") |
|
(setq left-file (concat prefix (nth (1- index) suffixes)) |
|
left-version (format "%i" (backup-walker-get-version left-file)))) |
|
(setq diff-buf (diff-no-select left-file right-file nil 'noasync)) |
see? you write (diff old new switches no-async)
|
(or (fboundp 'diff-no-select) |
|
(defun diff-no-select (old new &optional switches no-async) |
|
(save-window-excursion (diff old new switches no-async)) |
|
(get-buffer-create "*Diff*"))) |
What you expect?
(setq diff-buf (diff-no-select left-file right-file nil 'noasync))
should be
(setq diff-buf (diff-no-select right-file left-file nil 'noasync))
Description
By debug
suffixesdata of functionbackup-walker-refresh, its structure is(".~3~" ".~2~" ".~1~")Every time you
indexpointer, like from".~3~"to".~2~"(for older changes)indexpointer, like from".~2~"to".~3~"(for newer changes)The first item
".~3~"is most recent, this is different from git notation likeHEAD~3So in your code,
left-filewith(setq left-file (concat prefix (nth (1- index) suffixes)))means more recent file,right-filemeans older fileBut you passed them to function
diff-no-selectin reversed orderbackup-walker/backup-walker.el
Lines 269 to 274 in 934a412
see? you write
(diff old new switches no-async)backup-walker/backup-walker.el
Lines 120 to 123 in 934a412
What you expect?
(setq diff-buf (diff-no-select left-file right-file nil 'noasync))should be
(setq diff-buf (diff-no-select right-file left-file nil 'noasync))