diff lisp/thumbs.el @ 83463:38c49afb29d9

Merged from Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-31 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-503
author Karoly Lorentey <lorentey@elte.hu>
date Wed, 01 Feb 2006 02:04:15 +0000
parents 6511ba48ed7a
children 3bd95f4f2941 7432ca837c8d
line wrap: on
line diff
--- a/lisp/thumbs.el	Mon Jan 30 20:00:11 2006 +0000
+++ b/lisp/thumbs.el	Wed Feb 01 02:04:15 2006 +0000
@@ -174,6 +174,8 @@
 
 (defvar thumbs-marked-list nil
   "List of marked files.")
+(make-variable-buffer-local 'thumbs-marked-list)
+(put 'thumbs-marked-list 'permanent-local t)
 
 (defalias 'thumbs-gensym
     (if (fboundp 'gensym)
@@ -334,9 +336,9 @@
 	((string-match ".*\\.tiff?\\'" img) 'tiff)))
 
 (defun thumbs-file-size (img)
-  (let ((i (image-size (find-image `((:type ,(thumbs-image-type img) :file ,img))) t)))
-    (concat (number-to-string (round (car i)))
-	    "x"
+  (let ((i (image-size
+	    (find-image `((:type ,(thumbs-image-type img) :file ,img))) t)))
+    (concat (number-to-string (round (car i))) "x"
 	    (number-to-string (round (cdr i))))))
 
 ;;;###autoload
@@ -366,7 +368,8 @@
    (thumbs-make-thumb img) 'jpeg thumbs-relief marked)
   (add-text-properties (1- (point)) (point)
 		     `(thumb-image-file ,img
-		       help-echo ,(file-name-nondirectory img))))
+		       help-echo ,(file-name-nondirectory img)
+		       rear-nonsticky help-echo)))
 
 (defun thumbs-do-thumbs-insertion (list)
   "Insert all thumbnails into thumbs buffer."
@@ -488,7 +491,7 @@
       (let (list)
 	(goto-char (point-min))
 	(while (not (eobp))
-	  (unless (= 0 (mod (point) (1+ thumbs-per-line)))
+	  (unless (eolp)
 	    (if (thumbs-current-image)
 		(push (cons (point-marker)
 			    (thumbs-current-image))
@@ -774,8 +777,7 @@
 (define-derived-mode thumbs-mode
   fundamental-mode "thumbs"
   "Preview images in a thumbnails buffer"
-  (setq buffer-read-only t)
-  (set (make-local-variable 'thumbs-marked-list) nil))
+  (setq buffer-read-only t))
 
 (defvar thumbs-view-image-mode-map
   (let ((map (make-sparse-keymap)))