emacs-devel
[Top][All Lists]
Advanced

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

Re: new *Help* argument highlighting


From: Juanma Barranquero
Subject: Re: new *Help* argument highlighting
Date: Tue, 11 May 2004 11:02:20 +0200

On Mon, 10 May 2004 18:26:21 -0400
Miles Bader <address@hidden> wrote:

> Then change the docstring for the help-arguments face to say `you might want
> to change this variable too'.

Patch attached. (I'm not commiting it yet, let's see if the dust settles...)

                                                                Juanma



--- help-fns.el.orig    2004-05-09 21:02:38.000000000 +0200
+++ help-fns.el 2004-05-11 10:59:31.000000000 +0200
@@ -239,5 +239,13 @@
 
 (defface help-argument-name '((t (:slant italic)))
-  "Face to highlight function arguments in docstrings.")
+  "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-do-arg-highlight (doc args)
@@ -248,5 +256,5 @@
         (setq doc (replace-regexp-in-string
                    (concat "\\<\\(" arg "\\)\\(?:es\\|s\\|th\\)?\\>")
-                   (propertize arg 'face 'help-argument-name)
+                   (funcall help-arg-highlighting-function arg)
                    doc t t 1))))
     doc))





reply via email to

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