all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Problem with disappearing "table-cell" face.
@ 2019-03-26 21:27 Sebastian Urban
  2019-03-27  8:01 ` tomas
  2019-03-27 12:00 ` Stefan Monnier
  0 siblings, 2 replies; 7+ messages in thread
From: Sebastian Urban @ 2019-03-26 21:27 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

I'm beginner in the world of Emacs and I have a problem with
disappearing 'table-cell' face in Text-based Tables.  I'm using:
Windows 7, GNU Emacs 25.2.1 (i686-w64-mingw32) of 2017-04-24.  I did
test with '-q' option and with version 26.1 - no difference.

In 'Fundamental' or 'Text' mode when I do 'table-insert' or
'table-recognize' I end up with highlighted cells, but it does not
happen when I'm in 'Outline' mode or in *scratch* buffer - cells are
recognized, but they have 'default' face.  If I switch from 'Outline'
to 'Text' mode while being in recognized table and start "TABing",
cells will be highlighted one by one OR will lost highlight all at
once with switch in opposite direction ('Text' to 'Outline' mode).

Is this normal behaviour, do modes with syntax highlighting
override(?) faces from other environment like table?

S. U.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problem with disappearing "table-cell" face.
  2019-03-26 21:27 Sebastian Urban
@ 2019-03-27  8:01 ` tomas
  2019-03-27 12:00 ` Stefan Monnier
  1 sibling, 0 replies; 7+ messages in thread
From: tomas @ 2019-03-27  8:01 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 900 bytes --]

On Tue, Mar 26, 2019 at 10:27:21PM +0100, Sebastian Urban wrote:
> Hello,
> 
> I'm beginner in the world of Emacs and I have a problem with
> disappearing 'table-cell' face in Text-based Tables [...]

> Is this normal behaviour, do modes with syntax highlighting
> override(?) faces from other environment like table?

(For some reason I don't manage to get table-cell face to bear
in my setup, so I can't double-check what I am talking about.
So take with two fists of salt)

It's quite possible that font-lock is obliterating your table-cell
face. To perhaps get an idea of what's going on, just move point
to one of those character positions you think should be fontified
differently and do M-x describe-char. You'll get a description
of the character at point, but also of the properties and overlays
at this position, including the faces and their priorities.

Cheers
-- t

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problem with disappearing "table-cell" face.
  2019-03-26 21:27 Sebastian Urban
  2019-03-27  8:01 ` tomas
@ 2019-03-27 12:00 ` Stefan Monnier
  1 sibling, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2019-03-27 12:00 UTC (permalink / raw)
  To: help-gnu-emacs

> Is this normal behaviour, do modes with syntax highlighting
> override(?) faces from other environment like table?

Yes: font-lock takes over control of the `face` property.
Modes which don't want their faces erased by font-lock can use the
`font-lock-face` property instead.


        Stefan




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problem with disappearing "table-cell" face.
@ 2019-03-28 15:10 Sebastian Urban
  2019-03-29  1:55 ` Stefan Monnier
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastian Urban @ 2019-03-28 15:10 UTC (permalink / raw)
  To: help-gnu-emacs

Thank you for clarifying control 'font-lock' has over faces.

As 'font-lock-face' did you mean group of faces starting with
'font-lock-*something*' for example 'font-lock-doc-face' or
'font-lock-type-face' and consequently instead of face named
'table-cell' it should be something like 'font-lock-table-cell'.
Or it is something completely different?

Because this looks like a bug from perspective of beginner, I think it
should be noted in 'GNU Emacs Manual' somewhere in chapter '11.12 Font
Lock mode'... or perhaps it is already there and I just missed it.

One more thing, what about 'hardcoded faces'? For example in 'Outline'
mode when I quote RET (C-q RET) in headline it will be described
(describe-char) by 'outline-1' face and hardcoded 'escape-glyph' but
it will be painted with the latter.  Hardcoded faces have highest
priority?

S. U.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problem with disappearing "table-cell" face.
  2019-03-28 15:10 Problem with disappearing "table-cell" face Sebastian Urban
@ 2019-03-29  1:55 ` Stefan Monnier
  2019-03-29 15:24   ` Sebastian Urban
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2019-03-29  1:55 UTC (permalink / raw)
  To: help-gnu-emacs

> As 'font-lock-face' did you mean group of faces starting with

No, I'm speaking of the `font-lock-face` *property*.
Look for it in the node "Special Properties" of the Elisp manual.

> Because this looks like a bug from perspective of beginner, I think it

Then I suggest you `M-x report-emacs-bug`.

> One more thing, what about 'hardcoded faces'? For example in 'Outline'
> mode when I quote RET (C-q RET) in headline it will be described
> (describe-char) by 'outline-1' face and hardcoded 'escape-glyph' but
> it will be painted with the latter.  Hardcoded faces have highest
> priority?

When I try it, the two faces are merged.


        Stefan




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problem with disappearing "table-cell" face.
  2019-03-29  1:55 ` Stefan Monnier
@ 2019-03-29 15:24   ` Sebastian Urban
  2019-03-29 15:41     ` Stefan Monnier
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastian Urban @ 2019-03-29 15:24 UTC (permalink / raw)
  To: help-gnu-emacs

 > No, I'm speaking of the `font-lock-face` *property*.
 > Look for it in the node "Special Properties" of the Elisp manual.

Ok, so if mode 'A' use 'face' property it will work as long as mode
'B' with Font lock instructions won't be in use (with enabled Font
lock of course).  But when it (mode 'B') appears, Font lock ignores
any/most(?) faces not defined by mode 'B', unless they have additional
'font-lock-face' property defined.  It is probably simplification but
diving into Elisp would be 'one bridge too far' for now, I just hope
it's at least close enough.

 > When I try it, the two faces are merged.

And now I wonder what did you mean by 'merge'.  I was trying to say
that '^M' has 'brown'(escape-glyph) colour, while the rest of the
(head)line is 'Blue1' (outline-1 -> font-lock-function-name-face).


S. U.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problem with disappearing "table-cell" face.
  2019-03-29 15:24   ` Sebastian Urban
@ 2019-03-29 15:41     ` Stefan Monnier
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2019-03-29 15:41 UTC (permalink / raw)
  To: help-gnu-emacs

> And now I wonder what did you mean by 'merge'.

My headlines are not colored specially but use different fonts, so I see
a ^M that's bold&large and is brown as well (i.e. it combines the
features of the two faces).

> I was trying to say that '^M' has 'brown'(escape-glyph) colour, while
> the rest of the (head)line is 'Blue1' (outline-1 ->
> font-lock-function-name-face).

Apparently, the face applied for control chars (escape-glyph) takes
precedence over the face applied by font-locking, then, yes.


        Stefan




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-03-29 15:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-28 15:10 Problem with disappearing "table-cell" face Sebastian Urban
2019-03-29  1:55 ` Stefan Monnier
2019-03-29 15:24   ` Sebastian Urban
2019-03-29 15:41     ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2019-03-26 21:27 Sebastian Urban
2019-03-27  8:01 ` tomas
2019-03-27 12:00 ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.