From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org, JD Smith <jdsmith@as.arizona.edu>
Subject: Re: transient-mark-mode in 22.0
Date: Sun, 12 Jun 2005 12:09:38 -0400 [thread overview]
Message-ID: <87vf4j8t7k.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <E1Dgs86-0003PI-63@fencepost.gnu.org> (Richard Stallman's message of "Fri, 10 Jun 2005 18:37:34 -0400")
> To fix this problem, I maybe mouse-show-mark should be rewritten to
> not use (read-event), but instead to use something like
> pre-command-hook.
> I think that is too risky. The reason this code has some bugs
> is that there is no obvious simple rule for what it should do.
> I could only patch it case by case, as various cases showed up
> that did not work.
> If you rewrite it to work differently, you'll have to start this
> process from scratch, which means it will be more unstable than
> it is now.
No, the current code and the change-log-trail make it pretty clear what the
function is meant to do:
1 - preserve the mouse-drag-overlay highlighting until the "next" command,
where things like scrolls and switch-frames aren't considered
real commands.
2 - implement the mouse-region-delete-keys functionality.
The problem is that the loop that does
read-event/key-binding/call-interactively basically can't be reliably
re-implemented in elisp. That's why a solution using pre-command-hook would
probably be more reliable.
> if the event is `switch-frame', we'll do a key lookup for
> [vertical-scroll-bar switch-frame] which of course will fail.
> Does that lead to the wrong results?
It don't know of any bug it introduces but since it fails to call
handle-switch-frame at the proper time, I guess reading the code of
handle-switch-frame should make it reasonably easy to come up with
a scenario where it doesn't do the right thing.
> - the overlay management has apparently been rendered completely
> useless by the use of the temporary transient-mark-mode. So all that
> this code really does is implement the mouse-region-delete-keys.
> This variable was introduced in 1996, but is not documented anywhere.
> We must have forgotten to document the feature. However, the feature
> is not just this variable. The feature is that typing DELETE deletes
> the selected region.
That's what I meant by the "mouse-region-delete-keys" feature, of course.
> It isn't documented, but I would expect that many people have simply
> tried it, expecting it to work, and found that it did, so they use it.
Could be.
> Does anybody use
> this? (I expect that people who want such a functionality probably use
> delete-selection-mode instead anyway).
> They might; but it isn't exactly the same, and it would not surprise
> me if many users use this feature and don't use delete-selection-mode.
> Perhaps they would be happy switching to delete-selection-mode, but it
> is not obvious.
> However, if the only function of that code is to implement this
> feature, it might easy to reimplement the feature in a simpler way.
Indeed.
Stefan
next prev parent reply other threads:[~2005-06-12 16:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-06 17:24 transient-mark-mode in 22.0 JD Smith
2005-06-08 12:02 ` Richard Stallman
2005-06-08 21:17 ` JD Smith
2005-06-09 14:41 ` Richard Stallman
2005-06-09 17:54 ` JD Smith
2005-06-10 22:37 ` Richard Stallman
2005-06-10 22:49 ` JD Smith
2005-06-11 23:16 ` Richard Stallman
2005-06-12 16:29 ` Stefan Monnier
2005-06-12 16:09 ` Stefan Monnier [this message]
2005-06-13 15:02 ` Richard Stallman
2005-06-09 21:39 ` 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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87vf4j8t7k.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=jdsmith@as.arizona.edu \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).