all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#12213: 24.1; Cannot customize help-argument-name face
@ 2012-08-16 19:00 Raffaele Ricciardi
  2012-08-17  7:15 ` Glenn Morris
  0 siblings, 1 reply; 6+ messages in thread
From: Raffaele Ricciardi @ 2012-08-16 19:00 UTC (permalink / raw)
  To: 12213

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)





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

* bug#12213: 24.1; Cannot customize help-argument-name face
  2012-08-16 19:00 bug#12213: 24.1; Cannot customize help-argument-name face Raffaele Ricciardi
@ 2012-08-17  7:15 ` Glenn Morris
  2012-08-17  7:40   ` Eli Zaretskii
  2012-08-17  8:09   ` Raffaele Ricciardi
  0 siblings, 2 replies; 6+ messages in thread
From: Glenn Morris @ 2012-08-17  7:15 UTC (permalink / raw)
  To: Raffaele Ricciardi; +Cc: 12213

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.)





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

* bug#12213: 24.1; Cannot customize help-argument-name face
  2012-08-17  7:15 ` Glenn Morris
@ 2012-08-17  7:40   ` Eli Zaretskii
  2012-08-17  8:09   ` Raffaele Ricciardi
  1 sibling, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2012-08-17  7:40 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 12213, rfflrccrd

> From: Glenn Morris <rgm@gnu.org>
> Date: Fri, 17 Aug 2012 03:15:19 -0400
> Cc: 12213@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.





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

* bug#12213: 24.1; Cannot customize help-argument-name face
  2012-08-17  7:15 ` Glenn Morris
  2012-08-17  7:40   ` Eli Zaretskii
@ 2012-08-17  8:09   ` Raffaele Ricciardi
  2012-08-17 18:01     ` Glenn Morris
  1 sibling, 1 reply; 6+ messages in thread
From: Raffaele Ricciardi @ 2012-08-17  8:09 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 12213

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.





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

* bug#12213: 24.1; Cannot customize help-argument-name face
  2012-08-17  8:09   ` Raffaele Ricciardi
@ 2012-08-17 18:01     ` Glenn Morris
  2012-08-26  2:58       ` Chong Yidong
  0 siblings, 1 reply; 6+ messages in thread
From: Glenn Morris @ 2012-08-17 18:01 UTC (permalink / raw)
  To: Raffaele Ricciardi; +Cc: 12213

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.






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

* bug#12213: 24.1; Cannot customize help-argument-name face
  2012-08-17 18:01     ` Glenn Morris
@ 2012-08-26  2:58       ` Chong Yidong
  0 siblings, 0 replies; 6+ messages in thread
From: Chong Yidong @ 2012-08-26  2:58 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 12213, Raffaele Ricciardi

Glenn Morris <rgm@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.





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

end of thread, other threads:[~2012-08-26  2:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-16 19:00 bug#12213: 24.1; Cannot customize help-argument-name face Raffaele Ricciardi
2012-08-17  7:15 ` Glenn Morris
2012-08-17  7:40   ` Eli Zaretskii
2012-08-17  8:09   ` Raffaele Ricciardi
2012-08-17 18:01     ` Glenn Morris
2012-08-26  2:58       ` Chong Yidong

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.