]> code.delx.au - gnu-emacs/commitdiff
(help-arg-highlighting-function, help-argument-name): Delete.
authorJuanma Barranquero <lekktu@gmail.com>
Thu, 13 May 2004 01:18:00 +0000 (01:18 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Thu, 13 May 2004 01:18:00 +0000 (01:18 +0000)
(help-default-arg-highlight): New function.
(help-do-arg-highlighting): Use it.

lisp/ChangeLog
lisp/help-fns.el

index 74c6984c682216a9862f815b74f3cafaf79f09e0..a03b43cfad6edc856fec710d45b31c743bd07b96 100644 (file)
@@ -1,3 +1,10 @@
+2004-05-13  Juanma Barranquero  <lektu@terra.es>
+
+       * help-fns.el (help-arg-highlighting-function)
+       (help-argument-name): Delete.
+       (help-default-arg-highlight): New function.
+       (help-do-arg-highlighting): Use it.
+
 2004-05-13  Glenn Morris  <gmorris@ast.cam.ac.uk>
 
        * calendar/appt.el (appt-disp-window): Use
index e006a7f471412f1e5ca07d82280c2b77d03b2fba..e0692119a218ae49eafd7efddd5c9b58b885d367 100644 (file)
@@ -237,16 +237,14 @@ KIND should be `var' for a variable or `subr' for a subroutine."
            (concat "src/" file)
          file)))))
 
-(defface help-argument-name '((t (:slant italic)))
-  "Face to highlight function arguments in *Help* buffers.
-You can customize this face.  For more extensive customization,
-see variable `help-arg-highlighting-function'.")
-
-(defvar help-arg-highlighting-function
-  #'(lambda (arg) (propertize (downcase arg) 'face 'help-argument-name))
-  "Function to call to highlight function arguments in *Help* buffers.
-The function receives the argument to highlight, as a string.
-It must return the string with the desired highlighting (properties).")
+(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 '(:slant italic)))
+    (if (display-supports-face-attributes-p attrs)
+        (propertize (downcase arg) 'face attrs)
+      arg)))
 
 (defun help-do-arg-highlight (doc args)
   (with-syntax-table (make-syntax-table emacs-lisp-mode-syntax-table)
@@ -264,7 +262,7 @@ It must return the string with the desired highlighting (properties).")
                            "\\(?:es\\|s\\|th\\)?"  ; for ARGth, ARGs
                            "\\(?:-[a-z-]+\\)?"     ; for ARG-xxx
                            "\\>")                  ; end of word
-                   (funcall help-arg-highlighting-function arg)
+                   (help-default-arg-highlight arg)
                    doc t t 1))))
     doc))