]> code.delx.au - gnu-emacs/commitdiff
Preserve current column, going up/down in thumbnail view.
authorMathias Dahl <mathias.dahl@gmail.com>
Sat, 27 Feb 2016 13:11:02 +0000 (14:11 +0100)
committerMathias Dahl <mathias.dahl@gmail.com>
Mon, 29 Feb 2016 21:56:48 +0000 (22:56 +0100)
lisp/image-dired.el

index a8274f52521913136025cd3b2431e6bb62be8011..67b023dfd707e2484e1acdb90b6a39a034003f18 100644 (file)
@@ -1143,7 +1143,8 @@ image."
 (defun image-dired-next-line ()
   "Move to next line and display properties."
   (interactive)
-  (forward-line 1)
+  (let ((goal-column (current-column)))
+    (next-line))
   ;; If we end up in an empty spot, back up to the next thumbnail.
   (if (not (image-dired-image-at-point-p))
       (image-dired-backward-image))
@@ -1155,7 +1156,8 @@ image."
 (defun image-dired-previous-line ()
   "Move to previous line and display properties."
   (interactive)
-  (forward-line -1)
+  (let ((goal-column (current-column)))
+    (previous-line))
   ;; If we end up in an empty spot, back up to the next
   ;; thumbnail. This should only happen if the user deleted a
   ;; thumbnail and did not refresh, so it is not very common. But we