summaryrefslogtreecommitdiff
path: root/lisp/help-fns.el
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2009-09-24 19:19:41 +0000
committerJuanma Barranquero <lekktu@gmail.com>2009-09-24 19:19:41 +0000
commit1659ada0ffac07e4fe4af4154399cdc75a4ca3d6 (patch)
tree322457fe02cdd2db62d7bfcaa6e3df28e8284e9a /lisp/help-fns.el
parentb3f01e463a82a1cb6f837f9060ede7a8f70c5143 (diff)
downloademacs-1659ada0ffac07e4fe4af4154399cdc75a4ca3d6.tar.gz
emacs-1659ada0ffac07e4fe4af4154399cdc75a4ca3d6.tar.bz2
emacs-1659ada0ffac07e4fe4af4154399cdc75a4ca3d6.zip
* help-fns.el (help-downcase-arguments): New option, defaulting to nil.
(help-default-arg-highlight): Remove. (help-highlight-arg): New function. (help-do-arg-highlight): Use it. Suggested by Drew Adams <drew.adams@oracle.com>. (Bug#4510, bug#4520) * NEWS: Mention new variable `help-downcase-arguments' and new default for arguments in *Help* buffers.
Diffstat (limited to 'lisp/help-fns.el')
-rw-r--r--lisp/help-fns.el23
1 files changed, 13 insertions, 10 deletions
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 2425310cd93..7608e9f24e9 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -158,15 +158,18 @@ KIND should be `var' for a variable or `subr' for a subroutine."
(concat "src/" file)
file)))))
-(defun help-default-arg-highlight (arg)
- "Default function to highlight arguments in *Help* buffers.
-It returns ARG in face `help-argument-name'; ARG is also
-downcased if it displays differently than the default
-face (according to `face-differs-from-default-p')."
- (propertize (if (face-differs-from-default-p 'help-argument-name)
- (downcase arg)
- arg)
- 'face 'help-argument-name))
+(defcustom help-downcase-arguments nil
+ "If non-nil, argument names in *Help* buffers are downcased."
+ :type 'boolean
+ :group 'help
+ :version "23.2")
+
+(defun help-highlight-arg (arg)
+ "Highlight ARG as an argument name for a *Help* buffer.
+Return ARG in face `help-argument-name'; ARG is also downcased
+if the variable `help-downcase-arguments' is non-nil."
+ (propertize (if help-downcase-arguments (downcase arg) arg)
+ 'face 'help-argument-name))
(defun help-do-arg-highlight (doc args)
(with-syntax-table (make-syntax-table emacs-lisp-mode-syntax-table)
@@ -184,7 +187,7 @@ face (according to `face-differs-from-default-p')."
"\\(?:-[a-z0-9-]+\\)?" ; for ARG-xxx, ARG-n
"\\(?:-[{([<`\"].*?\\)?"; for ARG-{x}, (x), <x>, [x], `x'
"\\>") ; end of word
- (help-default-arg-highlight arg)
+ (help-highlight-arg arg)
doc t t 1)))))
(defun help-highlight-arguments (usage doc &rest args)