GNU bug report logs - #12213
24.1; Cannot customize help-argument-name face

Previous Next

Package: emacs;

Reported by: Raffaele Ricciardi <rfflrccrd <at> gmail.com>

Date: Thu, 16 Aug 2012 19:10:02 UTC

Severity: minor

Found in version 24.1

Done: Chong Yidong <cyd <at> gnu.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 12213 in the body.
You can then email your comments to 12213 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#12213; Package emacs. (Thu, 16 Aug 2012 19:10:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Raffaele Ricciardi <rfflrccrd <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 16 Aug 2012 19:10:03 GMT) Full text and rfc822 format available.

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

From: Raffaele Ricciardi <rfflrccrd <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.1; Cannot customize help-argument-name face
Date: Thu, 16 Aug 2012 20:00:29 +0100
Dear Sirs,

customizing the `help-argument-name' face has no effect.

How to reproduce:
- emacs -Q
- M-x customize-face RET help-argument-name RET
- set face foreground (i.e. "yellow")
- click on "Set for this session"
- M-x describe-face RET help-argument-name RET
- all the fields in the face specification are "unspecified"

Customizing other faces, like 'font-lock-comment-face', works.

Best Regards
--

In GNU Emacs 24.1.1 (i686-pc-linux-gnu, GTK+ Version 2.20.1)
 of 2012-06-12 on debian
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
Configured using:
 `configure '--prefix=/home/lele/bin/emacs/emacs-24.1''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.utf8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Custom

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

Recent input:
M-x c u s t o - f a <tab> <return> h e l p - <tab>
<return> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <down-mouse-1> <mouse-1> <help-echo>
<down-mouse-1> <mouse-1> <help-echo> <help-echo> <down-mouse-1>
<mouse-1> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> y e r r o <backspace>
<backspace> <backspace> r r o m <backspace> <backspace>
<backspace> <backspace> l l o w <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <down-mouse-1>
<mouse-1> <help-echo> <help-echo> <help-echo> <help-echo>
<down-mouse-1> <mouse-1> <help-echo> <help-echo> <down-mouse-1>
<mouse-1> M-x d e s c r i <tab> f a <tab> <return>
M-p <return> M-x r e p o <tab> r <tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Creating customization items...
Creating customization items ...done
Resetting customization items...done
Creating customization setup...done
Type C-x 1 to delete the help window.
Making completion list...

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail regexp-opt rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils help-fns help-mode view crm thingatpt
cus-edit easymenu cus-start cus-load wid-edit time-date tooltip
ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd
fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer loaddefs button faces cus-face files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty emacs)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12213; Package emacs. (Fri, 17 Aug 2012 07:25:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Raffaele Ricciardi <rfflrccrd <at> gmail.com>
Cc: 12213 <at> debbugs.gnu.org
Subject: Re: bug#12213: 24.1; Cannot customize help-argument-name face
Date: Fri, 17 Aug 2012 03:15:19 -0400
Raffaele Ricciardi wrote:

> - emacs -Q
> - M-x customize-face RET help-argument-name RET
> - set face foreground (i.e. "yellow")
> - click on "Set for this session"
> - M-x describe-face RET help-argument-name RET
> - all the fields in the face specification are "unspecified"
[...]
> In GNU Emacs 24.1.1 (i686-pc-linux-gnu, GTK+ Version 2.20.1)
>  of 2012-06-12 on debian

Thanks for the report, but I cannot reproduce this on x86_64.
I tried on RHEL6 and Debian testing, GTK and Lucid toolkits, and it
works fine for me. (There seems to be an implicit "click on Show All
Attributes" in the recipe.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12213; Package emacs. (Fri, 17 Aug 2012 07:50:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 12213 <at> debbugs.gnu.org, rfflrccrd <at> gmail.com
Subject: Re: bug#12213: 24.1; Cannot customize help-argument-name face
Date: Fri, 17 Aug 2012 10:40:18 +0300
> From: Glenn Morris <rgm <at> gnu.org>
> Date: Fri, 17 Aug 2012 03:15:19 -0400
> Cc: 12213 <at> debbugs.gnu.org
> 
> Raffaele Ricciardi wrote:
> 
> > - emacs -Q
> > - M-x customize-face RET help-argument-name RET
> > - set face foreground (i.e. "yellow")
> > - click on "Set for this session"
> > - M-x describe-face RET help-argument-name RET
> > - all the fields in the face specification are "unspecified"
> [...]
> > In GNU Emacs 24.1.1 (i686-pc-linux-gnu, GTK+ Version 2.20.1)
> >  of 2012-06-12 on debian
> 
> Thanks for the report, but I cannot reproduce this on x86_64.

Neither can I on MS-Windows.




Added tag(s) unreproducible. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 17 Aug 2012 07:53:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12213; Package emacs. (Fri, 17 Aug 2012 08:19:02 GMT) Full text and rfc822 format available.

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

From: Raffaele Ricciardi <rfflrccrd <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 12213 <at> debbugs.gnu.org
Subject: Re: bug#12213: 24.1; Cannot customize help-argument-name face
Date: Fri, 17 Aug 2012 09:09:55 +0100
On 08/17/2012 08:15 AM, Glenn Morris wrote:
> Raffaele Ricciardi wrote:
>
>> - emacs -Q
>> - M-x customize-face RET help-argument-name RET
>> - set face foreground (i.e. "yellow")
>> - click on "Set for this session"
>> - M-x describe-face RET help-argument-name RET
>> - all the fields in the face specification are "unspecified"
> [...]
>> In GNU Emacs 24.1.1 (i686-pc-linux-gnu, GTK+ Version 2.20.1)
>>   of 2012-06-12 on debian
>
> Thanks for the report, but I cannot reproduce this on x86_64.
> I tried on RHEL6 and Debian testing, GTK and Lucid toolkits, and it
> works fine for me.

I have isolated a contributory cause: the bug shows up only when I use a 
bitmap
font.  With a TrueType font, everything works. At first.

No matter the kind of font used, my Emacs behaves weirdly in regard to the
`help-argument-name' face.  `describe-face' correctly describes the 
face, but
if I use it in `font-lock-add-keywords', then the `default' face gets used
instead.  This is strange because Help mode does use the face as expected.

How to reproduce:

 - emacs -Q

 - evaluate:

(defun rr-Info-mode-highlight-argument-names ()
  "Highlight argument names the way they are highlighted in Help mode."
  ;; To avoid highlighting uppercase single letters in the text, highlight
  ;; only symbols more than one character long.
  (font-lock-add-keywords nil
                          '(("\\_<[A-Z][-A-Z[:digit:]]+\\_>"
                             . help-argument-name))))

(add-hook 'Info-mode-hook #'rr-Info-mode-highlight-argument-names)

 - C-h S define-minor-mode RET

Place the cursor over an uppercase argument name, and:

M-x describe-face RET

Emacs says the `default' face is being used.  Now, replace the
`help-argument-name' face with 'font-lock-comment-face' in the hook 
above and
retry.  The highlighting now works.

Moreover, if I "recreate" the face as a copy of the `default' face - 
e.g. by using
`copy-face' - beforehand, then customizations become persistent with a 
bitmap
font as well, but `font-lock-add-keywords' keeps using the `default' 
face instead.

Hope this helps.

Incidentally, I think that the default `help-argument-name' face or any 
other
face looking the same as the 'default' face is an undesirable feature. 
Every
face should look different from `default', to let users know they can 
customize
them. I understand that choosing a color for every face may be a lot of 
work,
but then having a default foreground color that is different from 
`default' when
defining a new face in the Emacs standard libraries would be enough.  If you
want to keep the default foreground color, then I suggest that you use other
attributes like Underline, Weight, etc.

> (There seems to be an implicit "click on Show All
> Attributes" in the recipe.)

Indeed there is.  Sorry for the oversight.

Cheers.




Removed tag(s) unreproducible. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 17 Aug 2012 16:27:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12213; Package emacs. (Fri, 17 Aug 2012 18:11:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Raffaele Ricciardi <rfflrccrd <at> gmail.com>
Cc: 12213 <at> debbugs.gnu.org
Subject: Re: bug#12213: 24.1; Cannot customize help-argument-name face
Date: Fri, 17 Aug 2012 14:01:10 -0400
Raffaele Ricciardi wrote:

> I have isolated a contributory cause: the bug shows up only when I use
> a bitmap font.

Now I see it too. It is obvious what is going on if you look at what
gets written to .emacs:

'(help-argument-name ((((supports :slant italic))
     (:inherit italic :foreground "yellow"))))

Bitmap fonts don't support italic, so the foreground etc does not get
applied.

I'm not sure this is a bug. You can uncheck the supports stuff when you
customize the face.

Since the italic face already has suitable fallbacks for the case where
italic is not supported, the definition of help-argument-name face
should perhaps be simplied to just:

(defface help-argument-name '((t :inherit italic))

> (defun rr-Info-mode-highlight-argument-names ()
>   "Highlight argument names the way they are highlighted in Help mode."
>   ;; To avoid highlighting uppercase single letters in the text, highlight
>   ;; only symbols more than one character long.
>   (font-lock-add-keywords nil
>                           '(("\\_<[A-Z][-A-Z[:digit:]]+\\_>"
>                              . help-argument-name))))

This is the old "face names are not variables" issue.
If you look in messages, you will see:

Error during redisplay: (void-variable help-argument-name) [3 times]

You should write 'help-argument-name to quote the face name.

For historical reasons, `font-lock-comment-face' etc are variables as
well as faces, which is why you don't see this issue with them.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12213; Package emacs. (Sun, 26 Aug 2012 03:00:02 GMT) Full text and rfc822 format available.

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

From: Chong Yidong <cyd <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 12213 <at> debbugs.gnu.org, Raffaele Ricciardi <rfflrccrd <at> gmail.com>
Subject: Re: bug#12213: 24.1; Cannot customize help-argument-name face
Date: Sun, 26 Aug 2012 10:58:04 +0800
Glenn Morris <rgm <at> gnu.org> writes:

> Now I see it too. It is obvious what is going on if you look at what
> gets written to .emacs:
>
> '(help-argument-name ((((supports :slant italic))
>      (:inherit italic :foreground "yellow"))))
>
> Bitmap fonts don't support italic, so the foreground etc does not get
> applied.

This face should not be using `supports', because the italics face
already does it.  Fixed in trunk.




bug closed, send any further explanations to 12213 <at> debbugs.gnu.org and Raffaele Ricciardi <rfflrccrd <at> gmail.com> Request was from Chong Yidong <cyd <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 26 Aug 2012 03:00:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 23 Sep 2012 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 238 days ago.

Previous Next


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