GNU bug report logs - #14548
24.3.1; [PATCH] image-dired-dired-toggle-marked-thumbs conflicts with other modes using overlays

Previous Next

Package: emacs;

Reported by: E Sabof <esabof <at> gmail.com>

Date: Mon, 3 Jun 2013 13:31:01 UTC

Severity: normal

Tags: patch

Found in version 24.3.1

Fixed in version 24.4

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 14548 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: E Sabof <esabof <at> gmail.com>
Cc: 14548 <at> debbugs.gnu.org
Subject: Re: bug#14548: 24.3.1;
 [PATCH] image-dired-dired-toggle-marked-thumbs conflicts with other
 modes using overlays
Date: Tue, 11 Jun 2013 15:08:46 -0400
E Sabof wrote:

> One such mode is stripe-buffer, which can be fonud here:
>
> https://github.com/sabof/stripe-buffer
>
> the definition below fixes the problem.

Things are much, much more likely to be applied if they come as diffs
with an explanation of what the change is going, rather than "here's a
new version of the function with no explanation".

IIUC, the issue is that image-dired-dired-toggle-marked-thumbs can
remove overlays from other packages, and you suggest a fix like the
following?

The idea seems fine, but as written it won't work without requiring
cl-lib at run-time.


*** lisp/image-dired.el	2013-02-17 00:45:53 +0000
--- lisp/image-dired.el	2013-06-11 19:00:18 +0000
***************
*** 657,665 ****
                  (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))
  	   (put-image thumb-file image-pos)
  	   (setq overlay
                   (cl-loop for o in (overlays-in (point) (1+ (point)))
--- 657,668 ----
                  (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-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)))





This bug report was last modified 11 years and 341 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.