From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mark Oteiza Newsgroups: gmane.emacs.devel Subject: Re: On image-mode-winprops and using image-mode elsewhere Date: Wed, 14 Dec 2016 10:09:59 -0500 Message-ID: <20161214150959.GA1089@holos.localdomain> References: <87y3zje05j.fsf@udel.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1481728471 2243 195.159.176.226 (14 Dec 2016 15:14:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 14 Dec 2016 15:14:31 +0000 (UTC) User-Agent: Mutt/1.7.2+4 (df1d1e379477) (2016-11-26) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 14 16:14:27 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cHBGA-00086r-Er for ged-emacs-devel@m.gmane.org; Wed, 14 Dec 2016 16:14:22 +0100 Original-Received: from localhost ([::1]:48273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cHBGE-0004Ap-Jw for ged-emacs-devel@m.gmane.org; Wed, 14 Dec 2016 10:14:26 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58011) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cHBCz-0002RY-OC for emacs-devel@gnu.org; Wed, 14 Dec 2016 10:11:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cHBCw-0004RL-JH for emacs-devel@gnu.org; Wed, 14 Dec 2016 10:11:05 -0500 Original-Received: from mail-qk0-f174.google.com ([209.85.220.174]:35908) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cHBCw-0004Qj-DD for emacs-devel@gnu.org; Wed, 14 Dec 2016 10:11:02 -0500 Original-Received: by mail-qk0-f174.google.com with SMTP id n21so23741433qka.3 for ; Wed, 14 Dec 2016 07:11:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=udel-edu.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=wpxZDhXyr2lSUpeDzD4A4a+JCzCj28VVJA3PhXQVHtI=; b=AwjAV3PhwU8eL2NZ4gIrijNRESk05TGqNRN7j6jij+Fr8OY3shPgR+uCsgV5SeJNd7 VYN9GagoQRVkLJ++XN2HVgLqfq4N5e0hgTj7uOEKbmgdZKzkkooSGSL5um0mGguCQXSK iNtryMhJfmzPnqwv2o99KOjDwd01fuhsItHkW0hA1uRRCzIpfsQUngVZ4p05eud8D7UG UVWqWF2fKrxag6iFvkkw2npJCUZ3tDcLJ5YoriG0CHY8UuvjRgLSnmiRybu63dxnl2l+ cZqH/kZQ611Kazycf8UZdUgbjWXZYZdt4Na8mtRoIFFFenzzGzA08Us8+qEOTWJSnFzj Jkjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=wpxZDhXyr2lSUpeDzD4A4a+JCzCj28VVJA3PhXQVHtI=; b=EWewl1BCTvD52uDk7t+G+aXN77jU7ehPgY8MCqVij59ASH6oI5utRkmTBx1Zf1k3l7 nqGpmBE25YMK3n3Vlr+mfyj27ClRwTceye6E3B5XYdXt8iQhHakY4HO1EfwZtd2U7DJm wEwtqe/7ELQrwkf/1ZanocKqlFmZWjzXY+zhWbcjCHSE0fpbKu6xH98GjTX8YF1CS2F+ LmaEyLLI+1qdXD+OHf03FUjeYf3ywMPITErfnlkSJBqhOLERd11pmCNw53mik63erR5Y 9JcMd9OwRoP3PrOvZODURSlXU6cbkl1Q4qCHs9bslHUNlCqUffAqkeg5ifWpQ6jubMS9 uzvw== X-Gm-Message-State: AIkVDXJ8LlqDeYAAJWMsZQH65lSOkiT0V65qwveqjMn1hoKU1dK897H+bMZJ1XAYk9RwWlEI X-Received: by 10.55.4.19 with SMTP id 19mr3543371qke.18.1481728201427; Wed, 14 Dec 2016 07:10:01 -0800 (PST) Original-Received: from holos.localdomain ([69.250.222.218]) by smtp.gmail.com with ESMTPSA id q3sm31802736qte.41.2016.12.14.07.10.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Dec 2016 07:10:00 -0800 (PST) Original-Received: by holos.localdomain (Postfix, from userid 1000) id E57FA66151; Wed, 14 Dec 2016 10:09:59 -0500 (EST) Content-Disposition: inline In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.220.174 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:210453 Archived-At: On 14/12/16 at 08:37am, Stefan Monnier wrote: > > I've been poking image-dired lately and wanted to use the navigation > > commands implemented in image-mode in image-dired-display-image-mode. > > This should be as simple as setting a keymap parent, but I am greeted > > with > > > (wrong-type-argument listp t) > > > which appears to me to be due to 83600dc. In particular, the line > > > (defvar-local image-mode-winprops-alist t) > > > but I think this should be nil. Thought I'd ask before I change it. > > I'm pretty sure there was a good reason why I put t in there. > > I can't remember the details, but here's what I can tell you: > > - the main source of complexity in that code is the desire to be able to > move within the image differently in each window when the buffer is > displayed in several windows. And also to try and "remember where we > were" if you temporarily switch to some other buffer and come back. > IOW, the desire to reproduce what usually happens with `point` but in > the context of images where `point` can't play its role. > > - this is also used in doc-view-mode (where it's even more important, > since it lets you see different pages of the document at the same time > in different windows). > > - I seem to remember that the code is picky for good reasons: if you're > not careful earlier, you end up with a problem later which is rather > difficult/painful to understand. > > - the code needs window-configuration-change-hook (and that's probably > why just setting a keymap parent isn't good enough). Maybe we could > make the "just set the keymap parent" work by making the commands > ensure the hook is in place. Ah, adding that does make everything work, but it appears that it simply sets the alist to nil anyways if it's not #'consp. Further, after reading a little more carefully I can't find anything that actually checks if image-mode-winprops-alist is t, as opposed to an object within that can be '(t . ALIST). That (image-mode-winprops t) is invariably an error makes me think that the alist always gets set to nil and possibly has elements added to it before a call to image-mode-winprops happens. But perhaps there is a reason for it! In any case, looks like I don't need to touch it by taking care of the window configuration hook. Thanks