From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: E Sabof Newsgroups: gmane.emacs.bugs Subject: bug#14548: 24.3.1; [PATCH] image-dired-dired-toggle-marked-thumbs conflicts with other modes using overlays Date: Wed, 12 Jun 2013 13:01:09 +0100 Message-ID: References: <1qr4g8lb29.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7bea3ac2f16d1d04def3c4d8 X-Trace: ger.gmane.org 1371039292 16985 80.91.229.3 (12 Jun 2013 12:14:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Jun 2013 12:14:52 +0000 (UTC) Cc: 14548@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 12 14:14:52 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Umjwx-0005di-7V for geb-bug-gnu-emacs@m.gmane.org; Wed, 12 Jun 2013 14:14:51 +0200 Original-Received: from localhost ([::1]:45982 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Umjww-0007lk-Pc for geb-bug-gnu-emacs@m.gmane.org; Wed, 12 Jun 2013 08:14:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47581) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Umjwp-0007ez-4z for bug-gnu-emacs@gnu.org; Wed, 12 Jun 2013 08:14:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Umjwi-0002Ox-RI for bug-gnu-emacs@gnu.org; Wed, 12 Jun 2013 08:14:43 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54101) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmjkY-0006DI-Mg for bug-gnu-emacs@gnu.org; Wed, 12 Jun 2013 08:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1UmjkY-0000Xi-Ga for bug-gnu-emacs@gnu.org; Wed, 12 Jun 2013 08:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: E Sabof Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 Jun 2013 12:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14548 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 14548-submit@debbugs.gnu.org id=B14548.13710384801880 (code B ref 14548); Wed, 12 Jun 2013 12:02:02 +0000 Original-Received: (at 14548) by debbugs.gnu.org; 12 Jun 2013 12:01:20 +0000 Original-Received: from localhost ([127.0.0.1]:58336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Umjjr-0000UF-D4 for submit@debbugs.gnu.org; Wed, 12 Jun 2013 08:01:20 -0400 Original-Received: from mail-qa0-f44.google.com ([209.85.216.44]:37624) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Umjjn-0000Tl-ED for 14548@debbugs.gnu.org; Wed, 12 Jun 2013 08:01:18 -0400 Original-Received: by mail-qa0-f44.google.com with SMTP id j8so258444qah.3 for <14548@debbugs.gnu.org>; Wed, 12 Jun 2013 05:01:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=XNGNf7wxqHBpwWjg9b3Rw2jdiUQR5dtZ1MS0Ha9GmL8=; b=dDEnLNp2iL/ABPXd/JyPcCKW6NYVBBlYPYwJeCJ8e2zpKX8d7YOnXFzsct6syQLbMu wBZcmLs/3HlQo95F2DHv2mLLKUK72SRlFyZ5W25k2nwV3PK1XOzZwO06At5DdM69Et2n cgrpgQC75ZczYH47hzI4nmSGiXmbhZmU3EPHczyDOtPCL9/Gk9EHeAT8SjahhTdSSMLn iwbJ9vuxvpCwyzmm8AVQydOWaosTzjatH7u5vs7tDDAeymbWT2EJE+ZGhFe75XBeEq0s tptKQUsTk5lHZEz3BJJL/0CU+43kFHVDmNB67RTOjgoiyLt8Wb8UivMD+DZJkjkop4Qc fnvA== X-Received: by 10.49.18.166 with SMTP id x6mr23070560qed.39.1371038469416; Wed, 12 Jun 2013 05:01:09 -0700 (PDT) Original-Received: by 10.49.18.162 with HTTP; Wed, 12 Jun 2013 05:01:09 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:75011 Archived-At: --047d7bea3ac2f16d1d04def3c4d8 Content-Type: text/plain; charset=ISO-8859-1 Bellow is the patch for the trunk version, without cl-remove-if-not diff --git a/lisp/image-dired.el b/lisp/image-dired.el index bbb41d4..2e169ed 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -657,16 +657,24 @@ 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)) - (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))))) + (let (( cur-ovs (overlays-in (point) (1+ (point)))) + thumb-ov) + (while (and cur-ovs + (if (overlay-get (car cur-ovs) 'thumb-file) + (progn + (setq thumb-ov (car cur-ovs)) + nil) + (pop 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 --047d7bea3ac2f16d1d04def3c4d8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Bellow is the patch for the trunk version, without cl= -remove-if-not

diff --git a/lisp/image-dired.el b/= lisp/image-dired.el
index bbb41d4..2e169ed 100644
--- a= /lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -657,16 +657,24 @@ previous -AR= G, if ARG<0) files."
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(= string-match-p (image-file-name-regexp) image-file))
=A0 =A0 =A0 = =A0 (setq thumb-file (image-dired-get-thumbnail-image image-file))
=A0 =A0 =A0 =A0 ;; If image is not already added, then add it.
- =A0 =A0 =A0 (let ((cur-ov (overlays-in (point) (1+ (point)))))
- =A0 =A0 =A0 =A0 (if cur-ov
- =A0 =A0 =A0 =A0 =A0 =A0 (delete= -overlay (car cur-ov))
- =A0 (put-image thumb-f= ile image-pos)
- =A0 (setq overlay
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (cl-loop f= or o in (overlays-in (point) (1+ (point)))
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0when (overlay-get= o 'put-image) collect o into ov
- =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0finally return (car ov)))
- =A0 (overlay-put overlay 'imag= e-file image-file)
- =A0 (overlay-put = overlay 'thumb-file thumb-file)))))
+ =A0 =A0 =A0 (let (( cur= -ovs (overlays-in (point) (1+ (point))))
+ =A0 =A0 =A0 =A0 =A0 = =A0 thumb-ov)
+ =A0 =A0 =A0 =A0 (while (and cur-ovs
+ =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 (if (overlay-get (car cur-ovs) 'thumb-file)
+= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (progn
+ =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (setq thumb-ov (car cur-ovs))<= /div>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 nil)
+= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (pop cur-ovs))))
+ =A0 =A0 =A0 =A0 (if thumb-ov
+ =A0 =A0 =A0 =A0 =A0 =A0 (delete= -overlay thumb-ov)
+ =A0 =A0 =A0 =A0 =A0 =A0 (progn
+ = =A0 =A0 =A0 =A0 =A0 =A0 =A0 (put-image thumb-file image-pos)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 (setq overlay
+ =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 (cl-loop for o in (overlays-in (point) (1+ (poi= nt)))
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0when (overlay-get o 'put-image) collect o into ov
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0finally return= (car ov)))
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 (overlay-put overlay &#= 39;image-file image-file)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 (overlay-= put overlay 'thumb-file thumb-file))))))
=A0 =A0 arg =A0 =A0 =A0 =A0 =A0 =A0 ; Show or hide image on ARG next files.=
=A0 =A0 'show-progress) ; Update dired display after each im= age is updated.
=A0 =A0(add-hook 'dired-after-readin-hook

--047d7bea3ac2f16d1d04def3c4d8--