From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.devel Subject: Re: Odd block highlighting [master build] Date: Tue, 20 Sep 2016 19:45:01 +0000 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114850e8b2121d053cf5aae7 X-Trace: blaine.gmane.org 1474400803 24355 195.159.176.226 (20 Sep 2016 19:46:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 20 Sep 2016 19:46:43 +0000 (UTC) To: John Mastro , Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 20 21:46:39 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 1bmQzp-0004Ty-RO for ged-emacs-devel@m.gmane.org; Tue, 20 Sep 2016 21:46:26 +0200 Original-Received: from localhost ([::1]:37714 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmQzo-0002fq-4P for ged-emacs-devel@m.gmane.org; Tue, 20 Sep 2016 15:46:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57013) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmQyk-0002e9-F3 for emacs-devel@gnu.org; Tue, 20 Sep 2016 15:45:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmQyj-0004Ah-3r for emacs-devel@gnu.org; Tue, 20 Sep 2016 15:45:18 -0400 Original-Received: from mail-vk0-x22a.google.com ([2607:f8b0:400c:c05::22a]:35458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmQyi-0004AM-Tq for emacs-devel@gnu.org; Tue, 20 Sep 2016 15:45:17 -0400 Original-Received: by mail-vk0-x22a.google.com with SMTP id g9so40738066vkg.2 for ; Tue, 20 Sep 2016 12:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=kTQuThNdDLbZhO7ALtHm0HPPatqGAqDOA5918X+7Sd4=; b=HnGc9+YScC87PCeewvpHgGJ3L9GCwaQO9rR2QAectPsgxH1K2oYcwRl1wdmFLpnScG e85QOc2rcq9k4oVhAtTAgMiyeBqvw6q+bQ34489xaBGYhMaWaEhXa0YqGBVA8S67rT2Z 1JRghHRi5Y8yyTYJ8rEV1JmPJxUoJIPZVhm2dIXdVk4MD5uFSiuLF2ptUT2j3Ek7uHvN 8LG6QhJtgvpuOxW0e9EkTC5/CJKDBEv7xv/xUFcSq3G6AoctNb2HZm9e/s3NOKKIGAh5 qBSzYSuPZPrvJrdHqXz+7hwO6SLkKWh8wbSnuwZPogrmI0yvtmQE3bPzWRbHiH2qMPhI VJBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=kTQuThNdDLbZhO7ALtHm0HPPatqGAqDOA5918X+7Sd4=; b=AmOliRyzjtgio9H3Wy1fKPZJmzj+zrQqnYt5yK5BFGYBCod43YFJqRaA9bbmZOcN+L /fQYgYKlCCO3lkwnoHujEfg5uCNIY3Pee1UkSM1hXsH65t/mwajp9g3H2alrlPXmU7lC SrTJ1Ls3GPCTbDRPEtVRs410644oAlYVANjzU5QwGHlOTjjYfjyAoIbF6oelYB6ivEl/ Kb2kM8f0rfzivuPj4RsJbhNrZtkgMkYXgV4MEPGz4LnDs8gsyEGzCsIuf+8RhuCkmblN RD9mO3VyHbMV2wQUtp+5CIsESZRnNP+PFsIpkr0fLZhW1qEN18DKM1krIFjMHRWNuZ3L H5NA== X-Gm-Message-State: AE9vXwOZgAG6DCU9I2ooHhVCTuUYeK2FBALcXlF4SQo482X+FfFMtaiz665be9SQ/65gjaqvvkd2G8JojNSpGg== X-Received: by 10.31.78.4 with SMTP id c4mr5897549vkb.126.1474400712002; Tue, 20 Sep 2016 12:45:12 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400c:c05::22a 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:207636 Archived-At: --001a114850e8b2121d053cf5aae7 Content-Type: text/plain; charset=UTF-8 On Tue, Sep 20, 2016 at 3:35 PM John Mastro wrote: > Kaushal Modi wrote: > > I don't have any insight into this, but I noticed that the highlighting > (and the change in your mouse cursor) seems to mirror what happens when > you move your mouse over the strings. Correct. I have seen that happen and on investigating further, it is caused by the flyspell package if the string is detected to have a typo. As seen in the gifv, those strings are gibberish and so flyspell puts overlays on those.. and maybe some weird regexp match is causing the same overlay to be put on the whole block? Here is a code excerpt from flyspell.el: (defun make-flyspell-overlay (beg end face mouse-face) "Allocate an overlay to highlight an incorrect word. BEG and END specify the range in the buffer of that word. FACE and MOUSE-FACE specify the `face' and `mouse-face' properties for the overlay." (let ((overlay (make-overlay beg end nil t nil))) (overlay-put overlay 'face face) (overlay-put overlay 'mouse-face mouse-face) (overlay-put overlay 'flyspell-overlay t) (overlay-put overlay 'evaporate t) (overlay-put overlay 'help-echo "mouse-2: correct word at point") (overlay-put overlay 'keymap flyspell-mouse-map) (when (eq face 'flyspell-incorrect) (and (stringp flyspell-before-incorrect-word-string) (overlay-put overlay 'before-string flyspell-before-incorrect-word-string)) (and (stringp flyspell-after-incorrect-word-string) (overlay-put overlay 'after-string flyspell-after-incorrect-word-string))) overlay)) Next time, this happen I will put debug statements in the flyspell-highlight-incorrect-region function. > Since you didn't mention the thing > with the strings, is it safe to assume that's expected? > I expected that, but did not investigate what caused that as it looked right. Now I know that probably flyspell is causing this.. > If so, what major/minor mode provides that functionality? From a > position of ignorance, my first thought is that it seems related. > It was a good question :) John > -- Kaushal Modi --001a114850e8b2121d053cf5aae7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Tue, Sep 20= , 2016 at 3:35 PM John Mastro <john.b.mastro@gmail.com> wrote:
Kaushal Modi <kaushal.modi@gmail.com> wrote:

I don't have any insight into this, but I noticed that the highlighting=
(and the change in your mouse cursor) seems to mirror what happens when
you move your mouse over the strings.

Corr= ect. I have seen that happen and on investigating further, it is caused by = the flyspell package if the string is detected to have a typo. As seen in t= he gifv, those strings are gibberish and so flyspell puts overlays on those= .. and maybe some weird regexp match is causing the same overlay to be put = on the whole block?

Here is a code excerpt from fl= yspell.el:

(defun make-flyspell-overlay (beg = end face mouse-face)
=C2=A0 "Allocate an overlay to highligh= t an incorrect word.
BEG and END specify the range in the buffer = of that word.
FACE and MOUSE-FACE specify the `face' and `mou= se-face' properties
for the overlay."
=C2=A0 (= let ((overlay (make-overlay beg end nil t nil)))
=C2=A0 =C2=A0 (o= verlay-put overlay 'face face)
=C2=A0 =C2=A0 (overlay-put ove= rlay 'mouse-face mouse-face)
=C2=A0 =C2=A0 (overlay-put overl= ay 'flyspell-overlay t)
=C2=A0 =C2=A0 (overlay-put overlay &#= 39;evaporate t)
=C2=A0 =C2=A0 (overlay-put overlay 'help-echo= "mouse-2: correct word at point")
=C2=A0 =C2=A0 (overl= ay-put overlay 'keymap flyspell-mouse-map)
=C2=A0 =C2=A0 (whe= n (eq face 'flyspell-incorrect)
=C2=A0 =C2=A0 =C2=A0 (and (st= ringp flyspell-before-incorrect-word-string)
=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0(overlay-put overlay 'before-string
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 flyspell-before-incorrect-word-string))
=C2=A0 =C2=A0 =C2= =A0 (and (stringp flyspell-after-incorrect-word-string)
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(overlay-put overlay 'after-string
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 flyspell-after-incorrect-word-string)))
=C2=A0 = =C2=A0 overlay))

Next time, this happen I wi= ll put debug statements in the=C2=A0flyspell-highlight-incorrect-region fun= ction.
=C2=A0
Since you didn&= #39;t mention the thing
with the strings, is it safe to assume that's expected?

I expected that, but did not investigate what caused t= hat as it looked right. Now I know that probably flyspell is causing this..=
=C2=A0
If so, what major/minor mode provides that functionality? From a
position of ignorance, my first thought is that it seems related.

It was a good question :)=C2=A0

=C2=A0 =C2=A0 =C2=A0 =C2=A0 John
--

Kaushal Modi

--001a114850e8b2121d053cf5aae7--