all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Alex <agrambot@gmail.com>
Cc: 24030@debbugs.gnu.org
Subject: bug#24030: 25.0.95; mouse-drag-region regression
Date: Wed, 20 Jul 2016 17:40:09 +0300	[thread overview]
Message-ID: <83wpkgz83a.fsf@gnu.org> (raw)
In-Reply-To: <87y44x2s7v.fsf@gmail.com> (message from Alex on Tue, 19 Jul 2016 16:11:48 -0600)

> From: Alex <agrambot@gmail.com>
> Date: Tue, 19 Jul 2016 16:11:48 -0600
> 
> If you attempt to create a region by dragging the mouse in a
> never-before-focused window, then the region isn't shown until letting
> go of the mouse button.

More accurately, it's not the window that was never the selected one,
it's the buffer that is displayed in it.  To see that, after selecting
the window, switch back to the other window (showing *scratch* in the
recipe), then type the same C-h f command again, and you will see the
problem, even though the window was already selected.  That's because
each C-h f erases and fills up the *Help* buffer again.

AFAICT, the root cause is the fact that region-active-p returns nil
under the specific circumstances of the recipe.  Why it returns nil is
less clear; AFAICS it's because mark-active is nil after the first
click of the mouse, when redisplay--update-region-highlight is called
from the display engine.  And mark-active is nil because some code
that I was unable to track down sets deactivate-mark to non-nil, so
the command loop deactivates the mark.

I hope someone else will be able to pick up where I left off, and find
the offending code.

> This doesn't work in the pretest, but it did in Emacs 24.5.

Right.

Btw, debugging such core features which are implemented in Lisp that
is called from the display engine is a nightmare, because there's no
easy way of displaying values of key Lisp variables, for the obvious
reasons.  My conclusion is that such refactoring brings significant
maintenance headaches, which need to be carefully considered as part
of similar decisions in the future.  If someone knows of handy
techniques to make this easier, I'd love to hear about them.

Thanks.





  reply	other threads:[~2016-07-20 14:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-19 22:11 bug#24030: 25.0.95; mouse-drag-region regression Alex
2016-07-20 14:40 ` Eli Zaretskii [this message]
2016-07-22  6:09   ` Alex
2016-07-23 13:02     ` Eli Zaretskii
2016-07-23 17:17       ` Stefan Monnier
2016-07-23 17:56         ` Eli Zaretskii
2016-07-23 21:16           ` Stefan Monnier
2016-07-24 14:12             ` Eli Zaretskii
2016-07-24 15:02               ` Stefan Monnier
2016-07-24 15:17                 ` Eli Zaretskii
2016-07-24 20:16                   ` Stefan Monnier
2016-07-30  8:33                     ` Eli Zaretskii
2016-07-24 17:33               ` Alex

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=83wpkgz83a.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=24030@debbugs.gnu.org \
    --cc=agrambot@gmail.com \
    /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.