Philip Kaludercic writes: > + ;; copy the text between hunks > + (let (start) > + (save-window-excursion > + (save-excursion > + (forward-line -1) > + (diff-goto-source) > + (forward-line +1) > + (setq start (point)))) One issue I still have here is that the `forwarad-line' might scroll the window, which `save-window-excursion' doesn't restore. To fix this I have written a general macro for subr.el to restore the scroll position: