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


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Glenn Morris <rgm <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#14548: closed (24.3.1; [PATCH] image-dired-dired-toggle-marked-thumbs
 conflicts with other modes using overlays)
Date: Thu, 13 Jun 2013 05:12:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 13 Jun 2013 01:11:10 -0400
with message-id <oir4g64mtt.fsf <at> fencepost.gnu.org>
and subject line Re: bug#14548: 24.3.1; [PATCH] image-dired-dired-toggle-marked-thumbs conflicts with other modes using overlays
has caused the debbugs.gnu.org bug report #14548,
regarding 24.3.1; [PATCH] image-dired-dired-toggle-marked-thumbs conflicts with other modes using overlays
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
14548: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14548
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: E Sabof <esabof <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.1; [PATCH] image-dired-dired-toggle-marked-thumbs conflicts with
	other modes using overlays
Date: Mon, 3 Jun 2013 14:28:28 +0100
[Message part 3 (text/plain, inline)]
One such mode is stripe-buffer, which can be fonud here:

https://github.com/sabof/stripe-buffer

the definition below fixes the problem.

Evgeni

(ad-unadvise 'image-dired-dired-toggle-marked-thumbs) ; stripe-buffer
monkey-patches the function.

 (defun image-dired-dired-toggle-marked-thumbs (&optional arg)
    "Toggle thumbnails in front of file names in the dired buffer.
If no marked file could be found, insert or hide thumbnails on the
current line.  ARG, if non-nil, specifies the files to use instead
of the marked files.  If ARG is an integer, use the next ARG (or
previous -ARG, if ARG<0) files."
    (interactive "P")
    (dired-map-over-marks
     (let* ((image-pos  (dired-move-to-filename))
            (image-file (dired-get-filename nil t))
            thumb-file
            overlay)
       (when (and image-file
                  (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)
               (progn
                 (put-image thumb-file image-pos)
                 (setq overlay
                       (cl-loop for o in (overlays-in (point) (1+ (point)))
                                when (overlay-get o 'put-image) collect o
into ov
                                finally return (car ov)))
                 (overlay-put overlay 'image-file image-file)
                 (overlay-put overlay 'thumb-file thumb-file))))))
     arg             ; Show or hide image on ARG next files.
     'show-progress) ; Update dired display after each image is updated.
    (add-hook 'dired-after-readin-hook
              'image-dired-dired-after-readin-hook nil t))
[Message part 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
From: Glenn Morris <rgm <at> gnu.org>
To: 14548-done <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: Thu, 13 Jun 2013 01:11:10 -0400
Version: 24.4

Applied in this form.

> *** 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 342 days ago.

Previous Next


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