]> code.delx.au - gnu-emacs/commitdiff
image-dired-dired-toggle-marked-thumbs tiny change
authorE Sabof <esabof@gmail.com>
Thu, 13 Jun 2013 05:10:48 +0000 (22:10 -0700)
committerGlenn Morris <rgm@gnu.org>
Thu, 13 Jun 2013 05:10:48 +0000 (22:10 -0700)
* lisp/image-dired.el (image-dired-dired-toggle-marked-thumbs):
Only remove a `thumb-file' overlay.

Fixes: debbugs:14548
lisp/ChangeLog
lisp/image-dired.el

index 48124b85fe46ce52a4a2c01a9af5fdc7c647491d..5ff36f1539c86caa778219af2acad182d32ecbee 100644 (file)
@@ -1,3 +1,8 @@
+2013-06-13  E Sabof  <esabof@gmail.com>  (tiny change)
+
+       * image-dired.el (image-dired-dired-toggle-marked-thumbs):
+       Only remove a `thumb-file' overlay.  (Bug#14548)
+
 2013-06-12  GrĂ©goire Jadi  <daimrod@gmail.com>
 
        * mail/reporter.el (reporter-submit-bug-report):
index bbb41d49a1dc9b38af2e00d2bff4c9cfcd3ae166..afb940fe33748d3bba4b66bb71886dcd71dbef30 100644 (file)
 (require 'format-spec)
 (require 'widget)
 
+(require 'cl-lib)
+
 (eval-when-compile
-  (require 'cl-lib)
   (require 'wid-edit))
 
 (defgroup image-dired nil
@@ -657,9 +658,12 @@ previous -ARG, if ARG<0) files."
                 (string-match-p (image-file-name-regexp) image-file))
        (setq thumb-file (image-dired-get-thumbnail-image image-file))
        ;; If image is not already added, then add it.
-       (let ((cur-ov (overlays-in (point) (1+ (point)))))
-         (if cur-ov
-             (delete-overlay (car cur-ov))
+       (let* ((cur-ovs (overlays-in (point) (1+ (point))))
+              (thumb-ov (car (cl-remove-if-not
+                              (lambda (ov) (overlay-get ov 'thumb-file))
+                              cur-ovs))))
+         (if thumb-ov
+             (delete-overlay thumb-ov)
           (put-image thumb-file image-pos)
           (setq overlay
                  (cl-loop for o in (overlays-in (point) (1+ (point)))