[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#16557: 24.3; foreground-color-at-point does not define a color produ

From: Alex Kost
Subject: bug#16557: 24.3; foreground-color-at-point does not define a color produced by facemenu-set-foreground
Date: Sun, 26 Jan 2014 23:11:09 +0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

- emacs -Q
- Create new buffer (lisp-interaction-mode is not suitable):
  C-x b new RET
- Write some text and select it
- M-x facemenu-set-foreground RET green RET
- The text becomes green, but "M-: (foreground-color-at-point)"
  returns nil 

I see problems both in `foreground-color-at-point' / `background-color-at-point'
and `facemenu-add-face' (the root function for facemenu functions like
`facemenu-set-foreground' or `facemenu-set-background').

1. `foreground-color-at-point' / `background-color-at-point'

According to (info "(elisp) Special Properties") a `face' property can
be a face name, a property list or a list of faces, i.e. a list of face
names or a list of property lists.  But `foreground-color-at-point' and
`background-color-at-point' do not support the latter form.

If you update a face property of some text
like this (create a new buffer and write something there):

  M-: (put-text-property (point-min) (point-max) 'face '(:foreground "green"))

then (foreground-color-at-point) gives the right answer - "green".  But
if you make a *list* of property lists:

  M-: (put-text-property (point-min) (point-max) 'face '((:foreground "green")))

then (foreground-color-at-point) returns nil.

2. `facemenu-add-face'

This function produces even a more nested form.  After "M-x
facemenu-set-foreground RET green RET" on some selected text, move the
point to any green character and "M-: (get-text-property (point) 'face)"
will return (((:foreground "green"))).

In GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 3.10.6)
 of 2014-01-18 on mnt-storage-buildroots-staging-i686-eric
Windowing system distributor `The X.Org Foundation', version 11.0.11500000
Configured using:
 `configure '--prefix=/usr' '--sysconfdir=/etc' '--libexecdir=/usr/lib'
 '--localstatedir=/var' '--with-x-toolkit=gtk3' '--with-xft'
 'CFLAGS=-march=i686 -mtune=generic -O2 -pipe -fstack-protector

reply via email to

[Prev in Thread] Current Thread [Next in Thread]