GNU bug report logs - #35481
25.2; table.el should use 'font-lock-face' instead of 'face'

Previous Next

Package: emacs;

Reported by: Sebastian Urban <mrsebastianurban <at> gmail.com>

Date: Sun, 28 Apr 2019 21:32:02 UTC

Severity: minor

Tags: confirmed, easy, fixed, patch

Found in version 25.2

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 35481 in the body.
You can then email your comments to 35481 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#35481; Package emacs. (Sun, 28 Apr 2019 21:32:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sebastian Urban <mrsebastianurban <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 28 Apr 2019 21:32:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Sebastian Urban <mrsebastianurban <at> gmail.com>
To: Bug GNU Emacs <bug-gnu-emacs <at> gnu.org>
Subject: 25.2; table.el should use 'font-lock-face' instead of 'face'
Date: Sun, 28 Apr 2019 23:31:27 +0200
This is follow up (part two of solution) to this bug#35044:
https://lists.gnu.org/archive/html/bug-gnu-emacs/2019-03/msg01011.html
and then (two months split)
https://lists.gnu.org/archive/html/bug-gnu-emacs/2019-04/msg00739.html
or at debbugs
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=35044

In short "table.el" uses text property 'face' (table-cell) which causes
losing of cell highlight when user switches from modes like "Text" or
"Fundamental" to modes that use "Font lock", like "Outline".  Also when
user switches back, 'face' is not applied immediately in every cell, but
one by one, when cursor is moved from cell to cell.

For both problems a solution seems to be an update to "table.el", which
will change 'face' to 'font-lock-face'.

If it helps, I found 4 places in code that probably need to be changed:
- 'defface table-cell' at line 680,
- 'defun table--put-cell-face-property' at line 5172,
- 'defun table--remove-cell-properties' at line 5189,
- 'defun table--update-cell-face' at line 5209.

---

In GNU Emacs 25.2.1 (i686-w64-mingw32)
 of 2017-04-24 built on LAPHROAIG
Windowing system distributor 'Microsoft Corp.', version 6.1.7601
Configured using:
 'configure --host=i686-w64-mingw32 --without-dbus
 --without-compress-install 'CFLAGS=-static -O2 -g3''

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS

Important settings:
  value of $LANG: PLK
  locale-coding-system: cp1250

Major mode: Fundamental

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Preparing diary...
No diary entries for Niedziela, 28 KwiecieĊ„ 2019
Preparing diary...done
For information about GNU Emacs and the GNU system, type C-h C-a.
next-line: End of buffer

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message dired format-spec rfc822 mml
mml-sec password-cache epg gnus-util mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils cal-china
lunar solar cal-dst cal-bahai cal-islam cal-hebrew holidays hol-loaddefs
diary-lib diary-loaddefs cal-menu calendar cal-loaddefs finder-inf
package epg-config seq byte-opt gv bytecomp byte-compile cl-extra
help-mode easymenu cconv cl-loaddefs pcase cl-lib time-date mule-util
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel dos-w32 ls-lisp disp-table w32-win w32-vars term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment
elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan
thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese charscript
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote w32notify w32 multi-tty
make-network-process emacs)

Memory information:
((conses 8 114624 7479)
 (symbols 32 22205 0)
 (miscs 32 94 203)
 (strings 16 23812 4853)
 (string-bytes 1 741124)
 (vectors 8 15933)
 (vector-slots 4 485829 3692)
 (floats 8 712 215)
 (intervals 28 263 31)
 (buffers 520 21))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35481; Package emacs. (Sun, 28 Apr 2019 22:06:01 GMT) Full text and rfc822 format available.

Message #8 received at 35481 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Sebastian Urban <mrsebastianurban <at> gmail.com>
Cc: 35481 <at> debbugs.gnu.org
Subject: Re: bug#35481: 25.2;
 table.el should use 'font-lock-face' instead of 'face'
Date: Sun, 28 Apr 2019 18:04:56 -0400
severity 35481 minor
tags 35481 + easy confirmed
quit

Sebastian Urban <mrsebastianurban <at> gmail.com> writes:

> For both problems a solution seems to be an update to "table.el", which
> will change 'face' to 'font-lock-face'.
>
> If it helps, I found 4 places in code that probably need to be changed:
> - 'defface table-cell' at line 680,

The defface can be left alone.  It's only the use of the 'face' text
property that can be a problem.

> - 'defun table--put-cell-face-property' at line 5172,
> - 'defun table--remove-cell-properties' at line 5189,
> - 'defun table--update-cell-face' at line 5209.




Severity set to 'minor' from 'normal' Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 28 Apr 2019 22:06:02 GMT) Full text and rfc822 format available.

Added tag(s) confirmed and easy. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 28 Apr 2019 22:06:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35481; Package emacs. (Mon, 13 May 2019 07:17:01 GMT) Full text and rfc822 format available.

Message #15 received at 35481 <at> debbugs.gnu.org (full text, mbox):

From: Sebastian Urban <mrsebastianurban <at> gmail.com>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 35481 <at> debbugs.gnu.org
Subject: Re: bug#35481: 25.2; table.el should use 'font-lock-face' instead of
 'face'
Date: Mon, 13 May 2019 09:16:23 +0200
This is just a reminder, because "This bug report was last modified 13
days ago."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35481; Package emacs. (Sun, 04 Aug 2019 12:10:01 GMT) Full text and rfc822 format available.

Message #18 received at 35481 <at> debbugs.gnu.org (full text, mbox):

From: Sebastian Urban <mrsebastianurban <at> gmail.com>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 35481 <at> debbugs.gnu.org
Subject: Re: bug#35481: 25.2; table.el should use 'font-lock-face' instead of
 'face'
Date: Sun, 4 Aug 2019 14:09:39 +0200
This is just a reminder, because "This bug report was last modified 80
days ago."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35481; Package emacs. (Wed, 30 Oct 2019 19:45:01 GMT) Full text and rfc822 format available.

Message #21 received at 35481 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Sebastian Urban <mrsebastianurban <at> gmail.com>
Cc: 35481 <at> debbugs.gnu.org
Subject: Re: 25.2; table.el should use 'font-lock-face' instead of 'face'
Date: Wed, 30 Oct 2019 20:44:14 +0100
Sebastian Urban <mrsebastianurban <at> gmail.com> writes:

> In short "table.el" uses text property 'face' (table-cell) which causes
> losing of cell highlight when user switches from modes like "Text" or
> "Fundamental" to modes that use "Font lock", like "Outline".  Also when
> user switches back, 'face' is not applied immediately in every cell, but
> one by one, when cursor is moved from cell to cell.
>
> For both problems a solution seems to be an update to "table.el", which
> will change 'face' to 'font-lock-face'.
>
> If it helps, I found 4 places in code that probably need to be changed:
> - 'defface table-cell' at line 680,
> - 'defun table--put-cell-face-property' at line 5172,
> - 'defun table--remove-cell-properties' at line 5189,
> - 'defun table--update-cell-face' at line 5209.

The patch below does this, but I'm not sure it's right.  When we're
using font-lock-face instead of face, then things work as normal when
we're using global-font-lock-mode, but if that's off, then we won't get
any faces at all.

Which would be bad.

I grepped around, but other modes don't seem to care about that.  But I
guess it's somewhat unusual for a minor mode to do stuff like this?

I think putting both font-lock-face and face on the text would do the
trick here, but is that the way to go?

diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el
index 839df035d2..92aaa46ad6 100644
--- a/lisp/textmodes/table.el
+++ b/lisp/textmodes/table.el
@@ -5151,7 +5151,7 @@ table--put-cell-indicator-property
 
 (defun table--put-cell-face-property (beg end &optional object)
   "Put cell face property."
-  (put-text-property beg end 'face 'table-cell object))
+  (put-text-property beg end 'font-lock-face 'table-cell object))
 
 (defun table--put-cell-keymap-property (beg end &optional object)
   "Put cell keymap property."
@@ -5178,7 +5178,7 @@ table--remove-cell-properties
 				   'table-cell nil
 				   'table-justify nil
 				   'table-valign nil
-				   'face nil
+				   'font-lock-face nil
 				   'rear-nonsticky nil
 				   'cursor-sensor-functions nil
 				   'keymap nil)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) patch. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 30 Oct 2019 19:45:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35481; Package emacs. (Sun, 17 Nov 2019 09:08:01 GMT) Full text and rfc822 format available.

Message #26 received at 35481 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Sebastian Urban <mrsebastianurban <at> gmail.com>
Cc: 35481 <at> debbugs.gnu.org
Subject: Re: bug#35481: 25.2; table.el should use 'font-lock-face' instead
 of 'face'
Date: Sun, 17 Nov 2019 10:07:06 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I grepped around, but other modes don't seem to care about that.  But I
> guess it's somewhat unusual for a minor mode to do stuff like this?
>
> I think putting both font-lock-face and face on the text would do the
> trick here, but is that the way to go?

There weren't any comments in two weeks, and this change does fix the
problem (if inelegantly), so I've applied it.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 17 Nov 2019 09:08:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 35481 <at> debbugs.gnu.org and Sebastian Urban <mrsebastianurban <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 17 Nov 2019 09:08:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35481; Package emacs. (Thu, 28 Nov 2019 23:28:01 GMT) Full text and rfc822 format available.

Message #33 received at 35481 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Sebastian Urban <mrsebastianurban <at> gmail.com>, 35481 <at> debbugs.gnu.org
Subject: Re: bug#35481: 25.2;
 table.el should use 'font-lock-face' instead of 'face'
Date: Thu, 28 Nov 2019 18:27:28 -0500
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> The patch below does this, but I'm not sure it's right.  When we're
> using font-lock-face instead of face, then things work as normal when
> we're using global-font-lock-mode, but if that's off, then we won't get
> any faces at all.
>
> Which would be bad.

I missed this the first time around, but, why would that be bad?  If the
user turns off font-lock-mode then not getting faces should be expected,
no?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35481; Package emacs. (Thu, 05 Dec 2019 09:56:01 GMT) Full text and rfc822 format available.

Message #36 received at 35481 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: Sebastian Urban <mrsebastianurban <at> gmail.com>, 35481 <at> debbugs.gnu.org
Subject: Re: bug#35481: 25.2; table.el should use 'font-lock-face' instead
 of 'face'
Date: Thu, 05 Dec 2019 10:55:21 +0100
Noam Postavsky <npostavs <at> gmail.com> writes:

> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> The patch below does this, but I'm not sure it's right.  When we're
>> using font-lock-face instead of face, then things work as normal when
>> we're using global-font-lock-mode, but if that's off, then we won't get
>> any faces at all.
>>
>> Which would be bad.
>
> I missed this the first time around, but, why would that be bad?  If the
> user turns off font-lock-mode then not getting faces should be expected,
> no?

Font locking is about adding decorative highlights.  The background face
table.el adds is functional -- it says what cell is selected.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 02 Jan 2020 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 322 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.