all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mark Oteiza <mvoteiza@udel.edu>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: On image-mode-winprops and using image-mode elsewhere
Date: Wed, 14 Dec 2016 10:09:59 -0500	[thread overview]
Message-ID: <20161214150959.GA1089@holos.localdomain> (raw)
In-Reply-To: <jwvtwa6od44.fsf-monnier+emacs@gnu.org>

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



  reply	other threads:[~2016-12-14 15:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-14  2:04 On image-mode-winprops and using image-mode elsewhere Mark Oteiza
2016-12-14 13:37 ` Stefan Monnier
2016-12-14 15:09   ` Mark Oteiza [this message]
2016-12-14 15:57     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161214150959.GA1089@holos.localdomain \
    --to=mvoteiza@udel.edu \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.