unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Michael Heerdegen <michael_heerdegen@web.de>, emacs-devel@gnu.org
Subject: RE: bitten by lexical-binding
Date: Sun, 22 Nov 2015 09:08:14 -0800 (PST)	[thread overview]
Message-ID: <c317a59d-b743-4fdf-965e-c9d810c0438e@default> (raw)
In-Reply-To: <87ziy6az2n.fsf@web.de>

> > Starting with Emacs 25, `mouse-drag-track' does not accept
> > the second arg.  But invoking it without that argument meant
> > that (my version of) `mouse-drag-region' no longer copied
> > the text to the kill ring, when `mouse-drag-copy-region'=t.
> > That was the problem.
> 
> Can't reproduce here, built from Nov 21 2015.
> I copied your code into a file, one time with lexical binding
> enabled, one time without.  In emacs -Q, I loaded that file
> and set mouse-drag-copy-region -> t.
> With both file versions, the region was copied to the kill
> ring after dragging with the mouse.

Thanks for checking.

Testing some more, I found that the problem occurred only for
Emacs 24.[45], not for Emacs 25.  (Coulda sworn that I had
the problem for Emacs 25 also, but I sometimes use 24.5 to
avoid crashes I get with Emacs 25, and perhaps that's what
was involved here - faulty testing.)

I've removed the lex binding declaration and fixed the test
for passing two args to mouse-drag-track (which fixes the
problem for Emacs 24.[45]).

Sorry for the noise, and thanks to all for the feedback.

----

BTW, I neglected to say that the point of the code, which is
to let a mouse-1 click in the minibuffer invoke `M-x' and
remove *Messages*, if *Messages* is already shown, needs
these bindings, which are commented out as suggestions in
the file header:

;; ;; Do not use `view-echo-area-messages' for `mouse-1'.
;; ;; Use version of `mouse-drag-region' defined here
;; (when (> emacs-major-version 23)
;;   (define-key minibuffer-inactive-mode-map [down-mouse-1] nil)
;;   (define-key minibuffer-inactive-mode-map [mouse-1]      nil))

This is independent of the normal behavior and copying the
selection to the kill ring, which was the question here.
I mention this only in case someone is interested in this
click-in-echo-area behavior and wants to try it.



      reply	other threads:[~2015-11-22 17:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-21 22:28 bitten by lexical-binding Drew Adams
2015-11-22 14:02 ` Johan Bockgård
2015-11-22 14:12 ` Artur Malabarba
2015-11-22 14:23 ` Andreas Schwab
2015-11-22 14:29   ` David Kastrup
2015-11-22 15:57   ` Drew Adams
2015-11-22 14:28 ` Michael Heerdegen
2015-11-22 17:08   ` Drew Adams [this message]

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=c317a59d-b743-4fdf-965e-c9d810c0438e@default \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=michael_heerdegen@web.de \
    /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).