emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/tumme.el,v


From: Mathias Dahl
Subject: [Emacs-diffs] Changes to emacs/lisp/tumme.el,v
Date: Wed, 26 Jul 2006 09:55:10 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Mathias Dahl <mathiasdahl>      06/07/26 09:55:10

Index: tumme.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/tumme.el,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -b -r1.42 -r1.43
--- tumme.el    25 Jul 2006 16:20:53 -0000      1.42
+++ tumme.el    26 Jul 2006 09:55:10 -0000      1.43
@@ -1072,32 +1072,46 @@
   (if tumme-track-movement
       (tumme-track-thumbnail)))
 
-(defun tumme-forward-image ()
-  "Move to next image and display properties."
-  (interactive)
-  ;; Before we move, make sure that there is an image two positions
-  ;; forward.
-  (when (save-excursion
-        (forward-char 2)
-        (tumme-image-at-point-p))
+(defun tumme-forward-image (&optional arg)
+  "Move to next image and display properties.
+Optional prefix ARG says how many images to move; default is one
+image."
+  (interactive "p")
+  (let (pos (steps (or arg 1)))
+    (dotimes (i steps)
+      (if (and (not (eobp))
+               (save-excursion
     (forward-char)
     (while (and (not (eobp))
                 (not (tumme-image-at-point-p)))
       (forward-char))
-    (if tumme-track-movement
-        (tumme-track-original-file)))
+                 (setq pos (point))
+                 (tumme-image-at-point-p)))
+          (goto-char pos)
+        (error "At last image"))))
+  (when tumme-track-movement
+    (tumme-track-original-file))
   (tumme-display-thumb-properties))
 
-(defun tumme-backward-image ()
-  "Move to previous image and display properties."
-  (interactive)
-  (when (not (bobp))
+(defun tumme-backward-image (&optional arg)
+  "Move to previous image and display properties.
+Optional prefix ARG says how many images to move; default is one
+image."
+  (interactive "p")
+  (let (pos (steps (or arg 1)))
+    (dotimes (i steps)
+      (if (and (not (bobp))
+               (save-excursion
     (backward-char)
     (while (and (not (bobp))
                 (not (tumme-image-at-point-p)))
       (backward-char))
-    (if tumme-track-movement
-        (tumme-track-original-file)))
+                 (setq pos (point))
+                 (tumme-image-at-point-p)))
+          (goto-char pos)
+        (error "At first image"))))
+  (when tumme-track-movement
+    (tumme-track-original-file))
   (tumme-display-thumb-properties))
 
 (defun tumme-next-line ()




reply via email to

[Prev in Thread] Current Thread [Next in Thread]