emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: help-default-arg-highlight


From: Kim F. Storm
Subject: Re: help-default-arg-highlight
Date: 30 May 2004 01:21:55 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Juri Linkov <address@hidden> writes:

> It's better to have a face defined by `defface' and don't do the
> downcasing if this face inherits from `default'.
> 
> This will require adding a new rule like `((supports :slant italic))'
> to the `defface' specification.
> 
> (defface help-argument-name
>   '((((supports :slant italic)) :slant italic)
>      (t (:inherit default)))
>   "Face for help argument names."
>   :group 'help)
> 
> (defun help-default-arg-highlight (arg)
>   "Default function to highlight arguments in *Help* buffers.
> It returns ARG in lowercase italics, if the display supports it;
> else ARG is returned in uppercase normal."
>   (if (face-attr-match-p 'help-argument-name '(:inherit default))
>       arg
>     (propertize (downcase arg) 'face 'help-argument-name)))

IMO That's a nice solution.

-- 
Kim F. Storm  http://www.cua.dk





reply via email to

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