diff options
| author | Nick Roberts | 2006-01-30 09:52:49 +0000 |
|---|---|---|
| committer | Nick Roberts | 2006-01-30 09:52:49 +0000 |
| commit | 0868cd7045274b08107a5659421fc617643e3e67 (patch) | |
| tree | 897d58e704fb3b6bf31caf1f3f7a21458bee7729 | |
| parent | 75e49434a5b90f797fe9b0250d426793793fb8e7 (diff) | |
| download | emacs-0868cd7045274b08107a5659421fc617643e3e67.tar.gz emacs-0868cd7045274b08107a5659421fc617643e3e67.zip | |
(thumbs-marked-list): Make buffer-local and
permanent-local.
(thumbs-insert-thumb): Make help-echo non-sticky.
(thumbs-file-alist): Use eolp as check for (non)-image.
| -rw-r--r-- | lisp/thumbs.el | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lisp/thumbs.el b/lisp/thumbs.el index 9999dd72812..bcab502b0f4 100644 --- a/lisp/thumbs.el +++ b/lisp/thumbs.el | |||
| @@ -174,6 +174,8 @@ this value can let another user see some of your images." | |||
| 174 | 174 | ||
| 175 | (defvar thumbs-marked-list nil | 175 | (defvar thumbs-marked-list nil |
| 176 | "List of marked files.") | 176 | "List of marked files.") |
| 177 | (make-variable-buffer-local 'thumbs-marked-list) | ||
| 178 | (put 'thumbs-marked-list 'permanent-local t) | ||
| 177 | 179 | ||
| 178 | (defalias 'thumbs-gensym | 180 | (defalias 'thumbs-gensym |
| 179 | (if (fboundp 'gensym) | 181 | (if (fboundp 'gensym) |
| @@ -334,9 +336,9 @@ smaller according to whether INCREMENT is 1 or -1." | |||
| 334 | ((string-match ".*\\.tiff?\\'" img) 'tiff))) | 336 | ((string-match ".*\\.tiff?\\'" img) 'tiff))) |
| 335 | 337 | ||
| 336 | (defun thumbs-file-size (img) | 338 | (defun thumbs-file-size (img) |
| 337 | (let ((i (image-size (find-image `((:type ,(thumbs-image-type img) :file ,img))) t))) | 339 | (let ((i (image-size |
| 338 | (concat (number-to-string (round (car i))) | 340 | (find-image `((:type ,(thumbs-image-type img) :file ,img))) t))) |
| 339 | "x" | 341 | (concat (number-to-string (round (car i))) "x" |
| 340 | (number-to-string (round (cdr i)))))) | 342 | (number-to-string (round (cdr i)))))) |
| 341 | 343 | ||
| 342 | ;;;###autoload | 344 | ;;;###autoload |
| @@ -366,7 +368,8 @@ If MARKED is non-nil, the image is marked." | |||
| 366 | (thumbs-make-thumb img) 'jpeg thumbs-relief marked) | 368 | (thumbs-make-thumb img) 'jpeg thumbs-relief marked) |
| 367 | (add-text-properties (1- (point)) (point) | 369 | (add-text-properties (1- (point)) (point) |
| 368 | `(thumb-image-file ,img | 370 | `(thumb-image-file ,img |
| 369 | help-echo ,(file-name-nondirectory img)))) | 371 | help-echo ,(file-name-nondirectory img) |
| 372 | rear-nonsticky help-echo))) | ||
| 370 | 373 | ||
| 371 | (defun thumbs-do-thumbs-insertion (list) | 374 | (defun thumbs-do-thumbs-insertion (list) |
| 372 | "Insert all thumbnails into thumbs buffer." | 375 | "Insert all thumbnails into thumbs buffer." |
| @@ -488,7 +491,7 @@ Open another window." | |||
| 488 | (let (list) | 491 | (let (list) |
| 489 | (goto-char (point-min)) | 492 | (goto-char (point-min)) |
| 490 | (while (not (eobp)) | 493 | (while (not (eobp)) |
| 491 | (unless (= 0 (mod (point) (1+ thumbs-per-line))) | 494 | (unless (eolp) |
| 492 | (if (thumbs-current-image) | 495 | (if (thumbs-current-image) |
| 493 | (push (cons (point-marker) | 496 | (push (cons (point-marker) |
| 494 | (thumbs-current-image)) | 497 | (thumbs-current-image)) |
| @@ -774,8 +777,7 @@ ACTION and ARG should be a valid convert command." | |||
| 774 | (define-derived-mode thumbs-mode | 777 | (define-derived-mode thumbs-mode |
| 775 | fundamental-mode "thumbs" | 778 | fundamental-mode "thumbs" |
| 776 | "Preview images in a thumbnails buffer" | 779 | "Preview images in a thumbnails buffer" |
| 777 | (setq buffer-read-only t) | 780 | (setq buffer-read-only t)) |
| 778 | (set (make-local-variable 'thumbs-marked-list) nil)) | ||
| 779 | 781 | ||
| 780 | (defvar thumbs-view-image-mode-map | 782 | (defvar thumbs-view-image-mode-map |
| 781 | (let ((map (make-sparse-keymap))) | 783 | (let ((map (make-sparse-keymap))) |