From unknown Sat Sep 13 00:38:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26672: 25.2; Flyspell overlay conflicts with table.el Resent-From: Allen Li Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Apr 2017 22:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 26672 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 26672@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.149324402031580 (code B ref -1); Wed, 26 Apr 2017 22:01:02 +0000 Received: (at submit) by debbugs.gnu.org; 26 Apr 2017 22:00:20 +0000 Received: from localhost ([127.0.0.1]:42103 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d3Uyy-0008DI-GP for submit@debbugs.gnu.org; Wed, 26 Apr 2017 18:00:20 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36862) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d3Uyw-0008D6-PN for submit@debbugs.gnu.org; Wed, 26 Apr 2017 18:00:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d3Uyq-0004Hi-Ma for submit@debbugs.gnu.org; Wed, 26 Apr 2017 18:00:13 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:47348) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d3Uyq-0004Hb-JJ for submit@debbugs.gnu.org; Wed, 26 Apr 2017 18:00:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56058) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3Uyp-0006qS-EG for bug-gnu-emacs@gnu.org; Wed, 26 Apr 2017 18:00:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d3Uyk-0004BJ-WD for bug-gnu-emacs@gnu.org; Wed, 26 Apr 2017 18:00:11 -0400 Received: from mail-oi0-x234.google.com ([2607:f8b0:4003:c06::234]:35999) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d3Uyk-0004AT-RB for bug-gnu-emacs@gnu.org; Wed, 26 Apr 2017 18:00:06 -0400 Received: by mail-oi0-x234.google.com with SMTP id w12so17384107oiw.3 for ; Wed, 26 Apr 2017 15:00:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=cyScinlr2mTHq6RlmrUDXjnUY7QMHi2r9i4fjRKsEhQ=; b=I835rOXVpnTUKTN1m02z/S3RJ3gBN89e6slXfq07nr5+8cGalgQe23fvCkgmkKkzbF T+3eGt8oQjJAp+WDCXX8/727ztYXKhl3sZDZFzek9yMZ28sVDdXRaP2U39uyDdpoUs3O Q7UTjsDCedp16lTOw/9ohjB2+W1+Id0NqR/1A8+0+RRSJ1Fbp6WO1K5Ftc44IjtP/A1l WeyhCJhshunYHJAnZ/ydjeyJQFncHODSHaeSFVeogwvb17T7UF7mcVxlLxA/Y92oMRRo nr9oPygH9BGofBbjq2Ps+HSM67Bk56t4+w9omEvCQUuiLNKKbti97w+NXUowR8lpJdlq HpKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=cyScinlr2mTHq6RlmrUDXjnUY7QMHi2r9i4fjRKsEhQ=; b=chQDIpwKJmrN8piFGLV9tlWGiE8/bPYCfGnP4q1K6UP4PHEHYn/v+pD3ei4Buus7+J mSRaiQMJo2WDINex5RMirN2HqkHyezfZ8YOO78BSkQlBmo9E9UNojr0La2mMVvKZlEwU BdByYWtlKAxp8KGRPciHG0tJrWpj+KgQrhybLMgxyPK9t5VTSDqQGAqVPtznZgXru8FX AbgKn7vBTz+EDm4pqhYNAgdueyomXEIJYU8i8KJ0yeL5SSZmH3bmPSuQ+cSpfsm4GF7n YXEyKLILf2EI1ozHDiZn63H/fNaGKJF1BsA9q6g+6AvFT/Kw/b3VLH+XHN58MBHa5shK Oe1w== X-Gm-Message-State: AN3rC/64vIHzgOtF5R+mq+tpWXceHagUJBOcJksHU5N9UrfzJMa5e5DW m7Zv1rDlAO5S3tAq+zMPkghbHA9FUsgpBn4= X-Received: by 10.157.5.178 with SMTP id 47mr1205716otd.39.1493244005514; Wed, 26 Apr 2017 15:00:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.42.79 with HTTP; Wed, 26 Apr 2017 15:00:05 -0700 (PDT) From: Allen Li Date: Wed, 26 Apr 2017 15:00:05 -0700 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Flyspell's overlay for misspelled words conflicts with table.el table.el adds its keymap as a text property to the text in table cells. When Flyspell detects a misspelled word, it adds an overlay with a keymap binding mouse2 to =E2=80=98flyspell-correct-word=E2=80=99. Apparent= ly, this overlay keymap overrides table.el=E2=80=99s =E2=80=98keymap=E2=80=99 text p= roperty. The effect of this is that pressing TAB to move between table cells will instead insert a literal tab character if your cursor happens to be on a misspelled word. This is extremely annoying. More generally, I=E2=80=99m not sure that an overlay keymap replacing the =E2=80=98keymap=E2=80=99 text property is desired behavior. At the very le= ast, there should be an escape hatch option on the overlay keymap that defers to the =E2=80=98keymap=E2=80=99 text property for cases like Flyspell where re= placing the =E2=80=98keymap=E2=80=99 text property is not desired behavior. I am aware that there=E2=80=99s an option =E2=80=98flyspell-highlight-prope= rties=E2=80=99 to prevent Flyspell adding its overlay if the text has properties, but that=E2=80=99s not really useful since most modes other than perhaps fundam= ental or text will add various properties to text. From unknown Sat Sep 13 00:38:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26672: 25.2; Flyspell overlay conflicts with table.el Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Apr 2017 09:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26672 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Allen Li Cc: 26672@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 26672-submit@debbugs.gnu.org id=B26672.149337064921794 (code B ref 26672); Fri, 28 Apr 2017 09:11:02 +0000 Received: (at 26672) by debbugs.gnu.org; 28 Apr 2017 09:10:49 +0000 Received: from localhost ([127.0.0.1]:43577 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d41vN-0005fR-12 for submit@debbugs.gnu.org; Fri, 28 Apr 2017 05:10:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58489) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d41vK-0005fE-Sm for 26672@debbugs.gnu.org; Fri, 28 Apr 2017 05:10:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d41v8-0008MH-MR for 26672@debbugs.gnu.org; Fri, 28 Apr 2017 05:10:41 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57936) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d41v8-0008MB-Ii; Fri, 28 Apr 2017 05:10:34 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2697 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1d41v7-0008Tk-Up; Fri, 28 Apr 2017 05:10:34 -0400 Date: Fri, 28 Apr 2017 12:10:00 +0300 Message-Id: <83o9vgnbiv.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Allen Li on Wed, 26 Apr 2017 15:00:05 -0700) References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Allen Li > Date: Wed, 26 Apr 2017 15:00:05 -0700 > > Flyspell's overlay for misspelled words conflicts with table.el > > table.el adds its keymap as a text property to the text in table cells. > When Flyspell detects a misspelled word, it adds an overlay with a > keymap binding mouse2 to ‘flyspell-correct-word’. Apparently, this > overlay keymap overrides table.el’s ‘keymap’ text property. > > The effect of this is that pressing TAB to move between table cells will > instead insert a literal tab character if your cursor happens to be on a > misspelled word. This is extremely annoying. Thank you for your report. Could you please provide a complete recipe for reproducing the problem, starting with "emacs -Q", and loading all the necessary packages and visiting files if needed? I think I know how to fix this, but I need a clear-cut test case, and I don't use table.el to easily know how to do that. Also, is the problem only with TAB, or are there other keys which conflict with the Flyspell overlay keymap? > More generally, I’m not sure that an overlay keymap replacing the > ‘keymap’ text property is desired behavior. At the very least, there > should be an escape hatch option on the overlay keymap that defers to > the ‘keymap’ text property for cases like Flyspell where replacing the > ‘keymap’ text property is not desired behavior. I think we do have the necessary infrastructure in Emacs to achieve the effect you want, it's just a matter of using it. Whether to use it in any given case is a decision that should be made on a case by case basis, since the user and/or application could want one or the other. From unknown Sat Sep 13 00:38:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26672: 25.2; Flyspell overlay conflicts with table.el Resent-From: Allen Li Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Apr 2017 04:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26672 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 26672@debbugs.gnu.org Received: via spool by 26672-submit@debbugs.gnu.org id=B26672.14934395888430 (code B ref 26672); Sat, 29 Apr 2017 04:20:01 +0000 Received: (at 26672) by debbugs.gnu.org; 29 Apr 2017 04:19:48 +0000 Received: from localhost ([127.0.0.1]:45366 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4JrI-0002Bt-Fc for submit@debbugs.gnu.org; Sat, 29 Apr 2017 00:19:48 -0400 Received: from mail-oi0-f51.google.com ([209.85.218.51]:34940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4JrF-0002Bb-CE for 26672@debbugs.gnu.org; Sat, 29 Apr 2017 00:19:46 -0400 Received: by mail-oi0-f51.google.com with SMTP id c62so5391292oif.2 for <26672@debbugs.gnu.org>; Fri, 28 Apr 2017 21:19:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=6/qz8/pdvy4eYmpfp+x1VUo5tuvEJGTMFlq6Am/Vvk8=; b=O0Nb6Zj0yg4S+Yl0muQ21ud8R/BqLRGaPqf4hjTbUcxqS+jNjZc4aK5XTB2/JgL79g y9lNIYbI/IC+3TofvgNgdPPQBGkfMscXq2AT+NSReXh3EyMX8OCLwncMEx18T1yN4D9t 2dPXm+QTckCAMVuvpjuoav3sq6S6SsuoG363Uu6Fj2Fu0nDP9QgIxl0eWBHuTa4a9aVv Ir4qpijxo1fZMQZfZ8odrDw+9ubJYcCloDpXXBRAWbkJb6jSClTODehFd8Tv+y7mDn25 0DpyIe/eezC9+spCkSGtvC1Vl8Esoc40I7IM6M14Rjc2G0uyOD2N99m1I9Mr4I4lwAXn hrTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=6/qz8/pdvy4eYmpfp+x1VUo5tuvEJGTMFlq6Am/Vvk8=; b=Sk6EjexK570AprKBxgCDX2tJbcA4se3HmE1LvZsbBonBiS1r67yQgsmPaKfmC/rsF+ 6th18dUoFU4AqJ053pX4+iV9IPPy2S3A/pINtqrq4EEiBlD5HjWXhY6PdnW+u3El52bn L/IFC3IkXG1qFvBFGWFM6ewByLDpb6uhly80LmtjrO83Zs9WNTzXjaE5CI87wmmgIJ1B JjzhoYk39KsqOwgzMBSQ9/O1Gxd9wf28QjBZZGVl31cWHpcwW1/0GNAfsP7ouwD2mr5y fPJ9BR/TjIG9WDHfm8aI/mUCuAeKFuokpERpb2LN66jG5JG+V/y+jQB8121TKqsqFeRs ftpg== X-Gm-Message-State: AN3rC/5zsk4NoiG+tkL8qLA+NUp6tnbnHVtCXER8jqqtyXAlzfz4SrGZ J7jEsi3qlW2MQXVnaJvcUylrKbi+rQ== X-Received: by 10.157.56.248 with SMTP id k53mr5667032ote.1.1493439578557; Fri, 28 Apr 2017 21:19:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.42.79 with HTTP; Fri, 28 Apr 2017 21:19:38 -0700 (PDT) In-Reply-To: <83o9vgnbiv.fsf@gnu.org> References: <83o9vgnbiv.fsf@gnu.org> From: Allen Li Date: Fri, 28 Apr 2017 21:19:38 -0700 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) 1. emacs -Q 2. M-x flyspell-mode 3. M-x table-insert RET RET RET ... (the defaults are fine) 4. apple M-b TAB (apple is spelled correctly, TAB works) 5. asdf M-b TAB (wait for flyspell to mark the misspelling, TAB doesn't wor= k) On Fri, Apr 28, 2017 at 2:10 AM, Eli Zaretskii wrote: >> From: Allen Li >> Date: Wed, 26 Apr 2017 15:00:05 -0700 >> >> Flyspell's overlay for misspelled words conflicts with table.el >> >> table.el adds its keymap as a text property to the text in table cells. >> When Flyspell detects a misspelled word, it adds an overlay with a >> keymap binding mouse2 to =E2=80=98flyspell-correct-word=E2=80=99. Appar= ently, this >> overlay keymap overrides table.el=E2=80=99s =E2=80=98keymap=E2=80=99 tex= t property. >> >> The effect of this is that pressing TAB to move between table cells will >> instead insert a literal tab character if your cursor happens to be on a >> misspelled word. This is extremely annoying. > > Thank you for your report. > > Could you please provide a complete recipe for reproducing the > problem, starting with "emacs -Q", and loading all the necessary > packages and visiting files if needed? I think I know how to fix > this, but I need a clear-cut test case, and I don't use table.el to > easily know how to do that. > > Also, is the problem only with TAB, or are there other keys which > conflict with the Flyspell overlay keymap? > >> More generally, I=E2=80=99m not sure that an overlay keymap replacing th= e >> =E2=80=98keymap=E2=80=99 text property is desired behavior. At the very= least, there >> should be an escape hatch option on the overlay keymap that defers to >> the =E2=80=98keymap=E2=80=99 text property for cases like Flyspell where= replacing the >> =E2=80=98keymap=E2=80=99 text property is not desired behavior. > > I think we do have the necessary infrastructure in Emacs to achieve > the effect you want, it's just a matter of using it. Whether to use > it in any given case is a decision that should be made on a case by > case basis, since the user and/or application could want one or the > other. From unknown Sat Sep 13 00:38:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26672: 25.2; Flyspell overlay conflicts with table.el Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Apr 2017 09:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26672 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Allen Li Cc: 26672@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 26672-submit@debbugs.gnu.org id=B26672.14934569923107 (code B ref 26672); Sat, 29 Apr 2017 09:10:02 +0000 Received: (at 26672) by debbugs.gnu.org; 29 Apr 2017 09:09:52 +0000 Received: from localhost ([127.0.0.1]:45505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4ONy-0000o2-PD for submit@debbugs.gnu.org; Sat, 29 Apr 2017 05:09:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46004) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4ONx-0000np-5P for 26672@debbugs.gnu.org; Sat, 29 Apr 2017 05:09:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d4ONn-00015E-RN for 26672@debbugs.gnu.org; Sat, 29 Apr 2017 05:09:43 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57270) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d4ONn-000158-NU; Sat, 29 Apr 2017 05:09:39 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4647 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1d4ONn-000787-0Z; Sat, 29 Apr 2017 05:09:39 -0400 Date: Sat, 29 Apr 2017 12:09:08 +0300 Message-Id: <8360hnmvgr.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Allen Li on Fri, 28 Apr 2017 21:19:38 -0700) References: <83o9vgnbiv.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Allen Li > Date: Fri, 28 Apr 2017 21:19:38 -0700 > Cc: 26672@debbugs.gnu.org > > 1. emacs -Q > 2. M-x flyspell-mode > 3. M-x table-insert RET RET RET ... (the defaults are fine) > 4. apple M-b TAB (apple is spelled correctly, TAB works) > 5. asdf M-b TAB (wait for flyspell to mark the misspelling, TAB doesn't work) Thanks. Does the change below give good results? diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 0edf9b1..ecf729d 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -447,7 +447,9 @@ flyspell-prog-mode ;;* The minor mode declaration. */ ;;*---------------------------------------------------------------------*/ (defvar flyspell-mouse-map - (make-sparse-keymap) + (let ((map (make-sparse-keymap))) + (define-key map [mouse-2] 'flyspell-correct-word) + map) "Keymap for Flyspell to put on erroneous words.") (defvar flyspell-mode-map @@ -1759,6 +1761,9 @@ make-flyspell-overlay (overlay-put overlay 'flyspell-overlay t) (overlay-put overlay 'evaporate t) (overlay-put overlay 'help-echo "mouse-2: correct word at point") + ;; If misspelled text has a 'keymap' property, let that remain in + ;; effect for the bindings that flyspell-mouse-map doesn't override. + (set-keymap-parent flyspell-mouse-map (get-char-property beg 'keymap)) (overlay-put overlay 'keymap flyspell-mouse-map) (when (eq face 'flyspell-incorrect) (and (stringp flyspell-before-incorrect-word-string) From unknown Sat Sep 13 00:38:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26672: 25.2; Flyspell overlay conflicts with table.el Resent-From: Allen Li Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Apr 2017 21:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26672 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 26672@debbugs.gnu.org Received: via spool by 26672-submit@debbugs.gnu.org id=B26672.149350214320863 (code B ref 26672); Sat, 29 Apr 2017 21:43:01 +0000 Received: (at 26672) by debbugs.gnu.org; 29 Apr 2017 21:42:23 +0000 Received: from localhost ([127.0.0.1]:46721 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4a8F-0005QO-4R for submit@debbugs.gnu.org; Sat, 29 Apr 2017 17:42:23 -0400 Received: from mail-oi0-f49.google.com ([209.85.218.49]:35557) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4a8E-0005QA-0t for 26672@debbugs.gnu.org; Sat, 29 Apr 2017 17:42:22 -0400 Received: by mail-oi0-f49.google.com with SMTP id l18so975727oig.2 for <26672@debbugs.gnu.org>; Sat, 29 Apr 2017 14:42:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=IUQEIS5pmF9ZB2Uj00BqbRduDrcebvyD86wFkDrlu6k=; b=FKj1OHBvEBxwZyrx1xj7TNmDM5H3EpxSbj6HjnSRJwuuTSFbwIEk+2tGtJCstZyUlP Y2mBJnKrje8OyTuy4vD5sB/FnLH7wfSZTL3TArDo26tKVrUDO67lPjeft0rLe807So4J obI+x6rx93BWeJHdHvW6gPrCuJD4ycE3ih0TZOLJ/78k/WpaxcjAbQWv4uVzUuMXTlPo f55+ooc4H7WQlPXw7GetlAq12NKtu//i0C9z1ZVX9vWwQOEtbAIDv9OlAy8/1OfEoJd2 E/TkNaWnxA1bPS1CaYTDGzLu6whSLutT0i4GHNV9YMCXPXlq8NCP+YWJE644tUy1HlO9 dTHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=IUQEIS5pmF9ZB2Uj00BqbRduDrcebvyD86wFkDrlu6k=; b=Ljx7KDS0De2EyyaE4C8guZramM5FOHfOCNYAJys8l/U/kLWRPA4AuaY2VIRBuN1cB8 ExwmW+J/mKGZRTu6rQXIctAoITau6IlZwnfsymQIJkbmsdRiusF8Voa/NetGucclB4X6 SOYJLtXXDR/wYhIWpgVopMOu7loALxfGjnvaYYAmXAX57WKitpBHadztEnqJUKgzXFAQ MgTzXfAwraPwvN6uxu8lLRXvCqDdXKFPAj4MhkIN2EOPCVzAjYhAy7Pw8wkSqDmCr3bg r0Aa1PCjqSdaMQ1tnTNsysQQO1xC0YgSRxLXzt0wyq0UJDJa8Sh9qoFJdXlMed6GJaRo MS+w== X-Gm-Message-State: AN3rC/6qj03iI3lmKUvdwa3XmjVldhjl3Bzuq2QMmtXqi47DqM3w9u36 bs6KWEMD/2kimbVFcXCvc2Xx8DryRw== X-Received: by 10.202.170.207 with SMTP id t198mr7461603oie.12.1493502136178; Sat, 29 Apr 2017 14:42:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.42.79 with HTTP; Sat, 29 Apr 2017 14:42:15 -0700 (PDT) In-Reply-To: <8360hnmvgr.fsf@gnu.org> References: <83o9vgnbiv.fsf@gnu.org> <8360hnmvgr.fsf@gnu.org> From: Allen Li Date: Sat, 29 Apr 2017 14:42:15 -0700 Message-ID: Content-Type: text/plain; charset=UTF-8 X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) Works, thanks, although I had to rebase the patch on emacs-25 branch as I couldn't get the master branch to compile. On Sat, Apr 29, 2017 at 2:09 AM, Eli Zaretskii wrote: >> From: Allen Li >> Date: Fri, 28 Apr 2017 21:19:38 -0700 >> Cc: 26672@debbugs.gnu.org >> >> 1. emacs -Q >> 2. M-x flyspell-mode >> 3. M-x table-insert RET RET RET ... (the defaults are fine) >> 4. apple M-b TAB (apple is spelled correctly, TAB works) >> 5. asdf M-b TAB (wait for flyspell to mark the misspelling, TAB doesn't work) > > Thanks. Does the change below give good results? > > diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el > index 0edf9b1..ecf729d 100644 > --- a/lisp/textmodes/flyspell.el > +++ b/lisp/textmodes/flyspell.el > @@ -447,7 +447,9 @@ flyspell-prog-mode > ;;* The minor mode declaration. */ > ;;*---------------------------------------------------------------------*/ > (defvar flyspell-mouse-map > - (make-sparse-keymap) > + (let ((map (make-sparse-keymap))) > + (define-key map [mouse-2] 'flyspell-correct-word) > + map) > "Keymap for Flyspell to put on erroneous words.") > > (defvar flyspell-mode-map > @@ -1759,6 +1761,9 @@ make-flyspell-overlay > (overlay-put overlay 'flyspell-overlay t) > (overlay-put overlay 'evaporate t) > (overlay-put overlay 'help-echo "mouse-2: correct word at point") > + ;; If misspelled text has a 'keymap' property, let that remain in > + ;; effect for the bindings that flyspell-mouse-map doesn't override. > + (set-keymap-parent flyspell-mouse-map (get-char-property beg 'keymap)) > (overlay-put overlay 'keymap flyspell-mouse-map) > (when (eq face 'flyspell-incorrect) > (and (stringp flyspell-before-incorrect-word-string) From unknown Sat Sep 13 00:38:30 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Allen Li Subject: bug#26672: closed (Re: bug#26672: 25.2; Flyspell overlay conflicts with table.el) Message-ID: References: <83y3uhk9jv.fsf@gnu.org> X-Gnu-PR-Message: they-closed 26672 X-Gnu-PR-Package: emacs Reply-To: 26672@debbugs.gnu.org Date: Sun, 30 Apr 2017 18:59:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1493578742-26077-1" This is a multi-part message in MIME format... ------------=_1493578742-26077-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #26672: 25.2; Flyspell overlay conflicts with table.el which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 26672@debbugs.gnu.org. --=20 26672: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D26672 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1493578742-26077-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 26672-done) by debbugs.gnu.org; 30 Apr 2017 18:58:38 +0000 Received: from localhost ([127.0.0.1]:48044 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4u3K-0006m1-Bc for submit@debbugs.gnu.org; Sun, 30 Apr 2017 14:58:38 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33093) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4u3I-0006lm-Kj for 26672-done@debbugs.gnu.org; Sun, 30 Apr 2017 14:58:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d4u38-00076f-JQ for 26672-done@debbugs.gnu.org; Sun, 30 Apr 2017 14:58:31 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49110) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d4u38-00076a-GW; Sun, 30 Apr 2017 14:58:26 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2542 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1d4u36-0004Fw-DV; Sun, 30 Apr 2017 14:58:26 -0400 Date: Sun, 30 Apr 2017 21:57:40 +0300 Message-Id: <83y3uhk9jv.fsf@gnu.org> From: Eli Zaretskii To: Allen Li In-reply-to: (message from Allen Li on Sat, 29 Apr 2017 14:42:15 -0700) Subject: Re: bug#26672: 25.2; Flyspell overlay conflicts with table.el References: <83o9vgnbiv.fsf@gnu.org> <8360hnmvgr.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 26672-done Cc: 26672-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Allen Li > Date: Sat, 29 Apr 2017 14:42:15 -0700 > Cc: 26672@debbugs.gnu.org > > Works, thanks, although I had to rebase the patch on emacs-25 branch > as I couldn't get the master branch to compile. Thanks, pushed to the master branch. ------------=_1493578742-26077-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 26 Apr 2017 22:00:20 +0000 Received: from localhost ([127.0.0.1]:42103 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d3Uyy-0008DI-GP for submit@debbugs.gnu.org; Wed, 26 Apr 2017 18:00:20 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36862) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d3Uyw-0008D6-PN for submit@debbugs.gnu.org; Wed, 26 Apr 2017 18:00:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d3Uyq-0004Hi-Ma for submit@debbugs.gnu.org; Wed, 26 Apr 2017 18:00:13 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:47348) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d3Uyq-0004Hb-JJ for submit@debbugs.gnu.org; Wed, 26 Apr 2017 18:00:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56058) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3Uyp-0006qS-EG for bug-gnu-emacs@gnu.org; Wed, 26 Apr 2017 18:00:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d3Uyk-0004BJ-WD for bug-gnu-emacs@gnu.org; Wed, 26 Apr 2017 18:00:11 -0400 Received: from mail-oi0-x234.google.com ([2607:f8b0:4003:c06::234]:35999) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d3Uyk-0004AT-RB for bug-gnu-emacs@gnu.org; Wed, 26 Apr 2017 18:00:06 -0400 Received: by mail-oi0-x234.google.com with SMTP id w12so17384107oiw.3 for ; Wed, 26 Apr 2017 15:00:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=cyScinlr2mTHq6RlmrUDXjnUY7QMHi2r9i4fjRKsEhQ=; b=I835rOXVpnTUKTN1m02z/S3RJ3gBN89e6slXfq07nr5+8cGalgQe23fvCkgmkKkzbF T+3eGt8oQjJAp+WDCXX8/727ztYXKhl3sZDZFzek9yMZ28sVDdXRaP2U39uyDdpoUs3O Q7UTjsDCedp16lTOw/9ohjB2+W1+Id0NqR/1A8+0+RRSJ1Fbp6WO1K5Ftc44IjtP/A1l WeyhCJhshunYHJAnZ/ydjeyJQFncHODSHaeSFVeogwvb17T7UF7mcVxlLxA/Y92oMRRo nr9oPygH9BGofBbjq2Ps+HSM67Bk56t4+w9omEvCQUuiLNKKbti97w+NXUowR8lpJdlq HpKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=cyScinlr2mTHq6RlmrUDXjnUY7QMHi2r9i4fjRKsEhQ=; b=chQDIpwKJmrN8piFGLV9tlWGiE8/bPYCfGnP4q1K6UP4PHEHYn/v+pD3ei4Buus7+J mSRaiQMJo2WDINex5RMirN2HqkHyezfZ8YOO78BSkQlBmo9E9UNojr0La2mMVvKZlEwU BdByYWtlKAxp8KGRPciHG0tJrWpj+KgQrhybLMgxyPK9t5VTSDqQGAqVPtznZgXru8FX AbgKn7vBTz+EDm4pqhYNAgdueyomXEIJYU8i8KJ0yeL5SSZmH3bmPSuQ+cSpfsm4GF7n YXEyKLILf2EI1ozHDiZn63H/fNaGKJF1BsA9q6g+6AvFT/Kw/b3VLH+XHN58MBHa5shK Oe1w== X-Gm-Message-State: AN3rC/64vIHzgOtF5R+mq+tpWXceHagUJBOcJksHU5N9UrfzJMa5e5DW m7Zv1rDlAO5S3tAq+zMPkghbHA9FUsgpBn4= X-Received: by 10.157.5.178 with SMTP id 47mr1205716otd.39.1493244005514; Wed, 26 Apr 2017 15:00:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.42.79 with HTTP; Wed, 26 Apr 2017 15:00:05 -0700 (PDT) From: Allen Li Date: Wed, 26 Apr 2017 15:00:05 -0700 Message-ID: Subject: 25.2; Flyspell overlay conflicts with table.el To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Flyspell's overlay for misspelled words conflicts with table.el table.el adds its keymap as a text property to the text in table cells. When Flyspell detects a misspelled word, it adds an overlay with a keymap binding mouse2 to =E2=80=98flyspell-correct-word=E2=80=99. Apparent= ly, this overlay keymap overrides table.el=E2=80=99s =E2=80=98keymap=E2=80=99 text p= roperty. The effect of this is that pressing TAB to move between table cells will instead insert a literal tab character if your cursor happens to be on a misspelled word. This is extremely annoying. More generally, I=E2=80=99m not sure that an overlay keymap replacing the =E2=80=98keymap=E2=80=99 text property is desired behavior. At the very le= ast, there should be an escape hatch option on the overlay keymap that defers to the =E2=80=98keymap=E2=80=99 text property for cases like Flyspell where re= placing the =E2=80=98keymap=E2=80=99 text property is not desired behavior. I am aware that there=E2=80=99s an option =E2=80=98flyspell-highlight-prope= rties=E2=80=99 to prevent Flyspell adding its overlay if the text has properties, but that=E2=80=99s not really useful since most modes other than perhaps fundam= ental or text will add various properties to text. ------------=_1493578742-26077-1--