From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: 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 Message-ID: <1qr4g8lb29.fsf@fencepost.gnu.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1370977792 6574 80.91.229.3 (11 Jun 2013 19:09:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Jun 2013 19:09:52 +0000 (UTC) Cc: 14548@debbugs.gnu.org To: E Sabof Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 11 21:09:53 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 1UmTx2-00049k-6b for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 Jun 2013 21:09:52 +0200 Original-Received: from localhost ([::1]:48908 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmTx1-0003A2-Hy for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 Jun 2013 15:09:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49539) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmTwy-00039u-HH for bug-gnu-emacs@gnu.org; Tue, 11 Jun 2013 15:09:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UmTwv-00056o-KV for bug-gnu-emacs@gnu.org; Tue, 11 Jun 2013 15:09:48 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52707) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmTwv-00056k-EL for bug-gnu-emacs@gnu.org; Tue, 11 Jun 2013 15:09:45 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1UmTxB-0001yz-Ig for bug-gnu-emacs@gnu.org; Tue, 11 Jun 2013 15:10:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Jun 2013 19:10:01 +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.13709777467486 (code B ref 14548); Tue, 11 Jun 2013 19:10:01 +0000 Original-Received: (at 14548) by debbugs.gnu.org; 11 Jun 2013 19:09:06 +0000 Original-Received: from localhost ([127.0.0.1]:56941 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UmTwI-0001wf-DI for submit@debbugs.gnu.org; Tue, 11 Jun 2013 15:09:06 -0400 Original-Received: from fencepost.gnu.org ([208.118.235.10]:37716 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UmTwG-0001wX-3i for 14548@debbugs.gnu.org; Tue, 11 Jun 2013 15:09:04 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1UmTvy-0007xh-Rh; Tue, 11 Jun 2013 15:08:46 -0400 X-Spook: Axis of Evil Islam Abduganievich Karimov Juiliett Class X-Ran: k5\(dIKqq)4IIE$5~4U\BZXWt!fD"yasYh,[-]'u3 X-Hue: blue X-Attribution: GM In-Reply-To: (E. Sabof's message of "Mon, 3 Jun 2013 14:28:28 +0100") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) 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:74978 Archived-At: 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)))