From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: On image-mode-winprops and using image-mode elsewhere Date: Wed, 14 Dec 2016 08:37:12 -0500 Message-ID: References: <87y3zje05j.fsf@udel.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1481722650 30418 195.159.176.226 (14 Dec 2016 13:37:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 14 Dec 2016 13:37:30 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Mark Oteiza Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 14 14:37:23 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 1cH9kG-0006VF-KU for ged-emacs-devel@m.gmane.org; Wed, 14 Dec 2016 14:37:20 +0100 Original-Received: from localhost ([::1]:47799 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cH9kK-0005Lk-Vn for ged-emacs-devel@m.gmane.org; Wed, 14 Dec 2016 08:37:25 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cH9kE-0005Am-Rz for emacs-devel@gnu.org; Wed, 14 Dec 2016 08:37:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cH9kA-0006YK-VP for emacs-devel@gnu.org; Wed, 14 Dec 2016 08:37:18 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:64033) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cH9kA-0006XR-NW for emacs-devel@gnu.org; Wed, 14 Dec 2016 08:37:14 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AkKQAu3EVY/+J3oWxdDgwBAQEBAgEBAQEIAQEBAYMqDgEBAQEBH4RbhVScAiYBll6GHAQCAoIRRBABAgEBAQEBAQFiKIRpAQQBViMFCwsOJhIUGA0kiHoIrRSLRAEBAQcCJYsZigseBY98imqbGoY6kE6BQTYgeBMOhRpZIIZwKoITAQEB X-IPAS-Result: A0AkKQAu3EVY/+J3oWxdDgwBAQEBAgEBAQEIAQEBAYMqDgEBAQEBH4RbhVScAiYBll6GHAQCAoIRRBABAgEBAQEBAQFiKIRpAQQBViMFCwsOJhIUGA0kiHoIrRSLRAEBAQcCJYsZigseBY98imqbGoY6kE6BQTYgeBMOhRpZIIZwKoITAQEB X-IronPort-AV: E=Sophos;i="5.33,749,1477972800"; d="scan'208";a="282628217" Original-Received: from 108-161-119-226.dsl.teksavvy.com (HELO pastel.home) ([108.161.119.226]) by smtp.teksavvy.com with ESMTP; 14 Dec 2016 08:37:13 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 822566233C; Wed, 14 Dec 2016 08:37:12 -0500 (EST) In-Reply-To: <87y3zje05j.fsf@udel.edu> (Mark Oteiza's message of "Tue, 13 Dec 2016 21:04:40 -0500") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:210448 Archived-At: > 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. - I'm not very happy with this code, because it was a pain to make it work and is fiddly. Stefan