diff options
author | E Sabof <esabof@gmail.com> | 2013-06-12 22:10:48 -0700 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2013-06-12 22:10:48 -0700 |
commit | 1261d2daeecea574cac763e3e7b729e6b6b36dad (patch) | |
tree | 512026fdf15f84d00eca3701daa74e75f14469d2 /lisp/image-dired.el | |
parent | 65e704b9ab10582945b4342ce5f7478f7109a873 (diff) | |
download | emacs-1261d2daeecea574cac763e3e7b729e6b6b36dad.tar.gz |
image-dired-dired-toggle-marked-thumbs tiny change
* lisp/image-dired.el (image-dired-dired-toggle-marked-thumbs):
Only remove a `thumb-file' overlay.
Fixes: debbugs:14548
Diffstat (limited to 'lisp/image-dired.el')
-rw-r--r-- | lisp/image-dired.el | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/image-dired.el b/lisp/image-dired.el index bbb41d49a1d..afb940fe337 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -156,8 +156,9 @@ (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))) |