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: Juri Linkov
Subject: Re: help-default-arg-highlight
Date: Sat, 29 May 2004 22:31:34 +0300
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

address@hidden (Kim F. Storm) writes:
> What about this:
>
> (defcustom help-default-arg-highlight-attributes '(:slant italic))
>
> (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."
>    (let (attrs help-default-arg-highlight-attributes)
>    (if (and attrs
>         (display-supports-face-attributes-p attrs))
>         (propertize (downcase arg) 'face attrs)
>       arg)))
>
> Setting that var to nil would undo this feature.

Writing a list of face attributes is a very inconvenient way
to customize a face.

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

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

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