To achieve the desired effect you need to change two lines in the source code of 'follow.el' as done below:
(defun follow--window-sorter (w1 w2)
"Sorting function for W1 and W2 based on their positions.
Return non-nil if W1 is above W2; if their top-lines
are at the same position, return non-nil if W1 is to the
left of W2."
(let* ((edge-1 (window-pixel-edges w1))
(edge-2 (window-pixel-edges w2))
(y1 (nth 1 edge-1))
(y2 (nth 1 edge-2)))
(if (= y1 y2)
;; (< (car edge-1) (car edge-2)) ;; <<<===
(< (car edge-2) (car edge-1))
;; (< y1 y2)))) ;; <<<===
(< y2 y1))))
See how it looks like if changed as above:
Knowing this above feel free to update my answer with code of a function follow-toggle-right-to-left-order
toggling a value of follow-right-to-left-order
variable used to switch the sorting order in follow--window-sorter
.
Below the not yet tested code of a patch with the above mentioned functionality:
(setq follow-right-to-left-order nil)
(defun follow-toggle-right-to-left-order ()
"toggle value used by (defun follow--window-sorter ..."
(= follow-right-to-left-order t
(setq follow-right-to-left-order nil)
(setq follow-right-to-left-order t)
)
)
(defun follow--window-sorter (w1 w2)
"Sorting function for W1 and W2 based on their positions.
Return non-nil if W1 is above W2; if their top-lines
are at the same position, return non-nil if W1 is to the
left of W2."
(let* ((edge-1 (window-pixel-edges w1))
(edge-2 (window-pixel-edges w2))
(y1 (nth 1 edge-1))
(y2 (nth 1 edge-2))))
(if (= y1 y2)
(if follow-right-to-left-order
(< (car edge-2) (car edge-1))
(< (car edge-1) (car edge-2))
))
(if follow-right-to-left-order
(< y2 y1)
(< y1 y2)
)
)
;; *
;; May the Code be with You!
;; . .
;; *
;; /\/|_ __/\\
;; / -\ /- ~\ . '
;; \ = Y =T_ = /
;; )==*(` `) ~ \
;; / \ / \
;; | | ) ~ (
;; / \ / ~ \
;; \ / \~ ~/
;; _/\_/\_/\__ _/_/\_/\__~__/_/\_/\_/\_/\_/\_
;; | | | | ) ) | | | (( | | | | | |
;; | | | |( ( | | | \\ | | | | | |
;; | | | | )_) | | | |))| | | | | |
;; | | | | | | | | (/ | | | | | |
;; | | | | | | | | | | | | | | |
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
follow-mode
assumes that windows to the left should display earlier parts of the buffer, this is hardcoded into the algorithm. When I wrote it I didn't envision that anybody would like it the other way around, sorry about that... Just curious, why would you like the swap the windows?