GNU bug report logs - #16557
24.3; foreground-color-at-point does not define a color produced by facemenu-set-foreground

Previous Next

Package: emacs;

Reported by: Alex Kost <alezost <at> gmail.com>

Date: Sun, 26 Jan 2014 19:12:02 UTC

Severity: normal

Found in version 24.3

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 16557 in the body.
You can then email your comments to 16557 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#16557; Package emacs. (Sun, 26 Jan 2014 19:12:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alex Kost <alezost <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 26 Jan 2014 19:12:02 GMT) Full text and rfc822 format available.

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

From: Alex Kost <alezost <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 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
Recipe:
- 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
 --param=ssp-buffer-size=4'
 'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'
 'CPPFLAGS=-D_FORTIFY_SOURCE=2''




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16557; Package emacs. (Sun, 06 Dec 2020 14:52:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Alex Kost <alezost <at> gmail.com>
Cc: 16557 <at> debbugs.gnu.org
Subject: Re: bug#16557: 24.3; foreground-color-at-point does not define a
 color produced by facemenu-set-foreground
Date: Sun, 06 Dec 2020 15:51:37 +0100
Alex Kost <alezost <at> gmail.com> writes:

> Recipe:
> - 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 

(This bug report unfortunately got no response at the time.)

Thanks for the clear recipe.

I tried reproducing this in Emacs 28, but `foreground-color-at-point'
returns "green" for me there, so I'm going to go ahead and guess that
this problem has been fixed at some point after this bug was reported,
and I'm closing this bug report.

If you're still seeing this issue, please respond to the debbugs address
and we'll reopen.

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




bug closed, send any further explanations to 16557 <at> debbugs.gnu.org and Alex Kost <alezost <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 06 Dec 2020 14:52:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16557; Package emacs. (Tue, 08 Dec 2020 16:56:01 GMT) Full text and rfc822 format available.

Message #13 received at 16557-done <at> debbugs.gnu.org (full text, mbox):

From: Alex Kost <alezost <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 16557-done <at> debbugs.gnu.org
Subject: Re: bug#16557: 24.3;
 foreground-color-at-point does not define a color produced by
 facemenu-set-foreground
Date: Tue, 08 Dec 2020 19:55:27 +0300
Lars Ingebrigtsen (2020-12-06 15:51 +0100) wrote:

> Alex Kost <alezost <at> gmail.com> writes:
>
>> Recipe:
>> - 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 
>
> (This bug report unfortunately got no response at the time.)
>
> Thanks for the clear recipe.
>
> I tried reproducing this in Emacs 28, but `foreground-color-at-point'
> returns "green" for me there, so I'm going to go ahead and guess that
> this problem has been fixed at some point after this bug was reported,
> and I'm closing this bug report.
>
> If you're still seeing this issue, please respond to the debbugs address
> and we'll reopen.

I also don't reproduce it anymore :-)
Thank you for the reply!

-- 
Alex




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

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

Previous Next


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