diff options
| author | Juanma Barranquero | 2009-09-24 19:19:41 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2009-09-24 19:19:41 +0000 |
| commit | 1659ada0ffac07e4fe4af4154399cdc75a4ca3d6 (patch) | |
| tree | 322457fe02cdd2db62d7bfcaa6e3df28e8284e9a | |
| parent | b3f01e463a82a1cb6f837f9060ede7a8f70c5143 (diff) | |
| download | emacs-1659ada0ffac07e4fe4af4154399cdc75a4ca3d6.tar.gz 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.
| -rw-r--r-- | etc/ChangeLog | 5 | ||||
| -rw-r--r-- | etc/NEWS | 3 | ||||
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/help-fns.el | 23 |
4 files changed, 29 insertions, 10 deletions
diff --git a/etc/ChangeLog b/etc/ChangeLog index 68fcba4ee06..e63316d2240 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2009-09-22 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | * NEWS: Mention new variable `help-downcase-arguments' | ||
| 4 | and new default for arguments in *Help* buffers. | ||
| 5 | |||
| 1 | 2009-09-15 Juanma Barranquero <lekktu@gmail.com> | 6 | 2009-09-15 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 7 | ||
| 3 | * NEWS: Mention new behavior of -Q and new variable | 8 | * NEWS: Mention new behavior of -Q and new variable |
| @@ -47,6 +47,9 @@ were loaded. | |||
| 47 | 47 | ||
| 48 | * Changes in Emacs 23.2 | 48 | * Changes in Emacs 23.2 |
| 49 | 49 | ||
| 50 | ** Function arguments in *Help* buffers are now in uppercase by default. | ||
| 51 | You can customize the new variable `help-downcase-arguments' to change it. | ||
| 52 | |||
| 50 | ** Unibyte sessions are now considered obsolete. | 53 | ** Unibyte sessions are now considered obsolete. |
| 51 | I.e. the use of the environment variable EMACS_UNIBYTE, or command line | 54 | I.e. the use of the environment variable EMACS_UNIBYTE, or command line |
| 52 | arguments --unibyte, --multibyte, --no-multibyte, and --no-unibyte | 55 | arguments --unibyte, --multibyte, --no-multibyte, and --no-unibyte |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d0394edc7af..0418b72898d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2009-09-24 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | * help-fns.el (help-downcase-arguments): New option, defaulting to nil. | ||
| 4 | (help-default-arg-highlight): Remove. | ||
| 5 | (help-highlight-arg): New function. | ||
| 6 | (help-do-arg-highlight): Use it. | ||
| 7 | Suggested by Drew Adams <drew.adams@oracle.com>. (Bug#4510, bug#4520) | ||
| 8 | |||
| 1 | 2009-09-24 Stefan Monnier <monnier@iro.umontreal.ca> | 9 | 2009-09-24 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 10 | ||
| 3 | * term.el (term-set-scroll-region, term-handle-ansi-escape): | 11 | * term.el (term-set-scroll-region, term-handle-ansi-escape): |
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." | |||
| 158 | (concat "src/" file) | 158 | (concat "src/" file) |
| 159 | file))))) | 159 | file))))) |
| 160 | 160 | ||
| 161 | (defun help-default-arg-highlight (arg) | 161 | (defcustom help-downcase-arguments nil |
| 162 | "Default function to highlight arguments in *Help* buffers. | 162 | "If non-nil, argument names in *Help* buffers are downcased." |
| 163 | It returns ARG in face `help-argument-name'; ARG is also | 163 | :type 'boolean |
| 164 | downcased if it displays differently than the default | 164 | :group 'help |
| 165 | face (according to `face-differs-from-default-p')." | 165 | :version "23.2") |
| 166 | (propertize (if (face-differs-from-default-p 'help-argument-name) | 166 | |
| 167 | (downcase arg) | 167 | (defun help-highlight-arg (arg) |
| 168 | arg) | 168 | "Highlight ARG as an argument name for a *Help* buffer. |
| 169 | 'face 'help-argument-name)) | 169 | Return ARG in face `help-argument-name'; ARG is also downcased |
| 170 | if the variable `help-downcase-arguments' is non-nil." | ||
| 171 | (propertize (if help-downcase-arguments (downcase arg) arg) | ||
| 172 | 'face 'help-argument-name)) | ||
| 170 | 173 | ||
| 171 | (defun help-do-arg-highlight (doc args) | 174 | (defun help-do-arg-highlight (doc args) |
| 172 | (with-syntax-table (make-syntax-table emacs-lisp-mode-syntax-table) | 175 | (with-syntax-table (make-syntax-table emacs-lisp-mode-syntax-table) |
| @@ -184,7 +187,7 @@ face (according to `face-differs-from-default-p')." | |||
| 184 | "\\(?:-[a-z0-9-]+\\)?" ; for ARG-xxx, ARG-n | 187 | "\\(?:-[a-z0-9-]+\\)?" ; for ARG-xxx, ARG-n |
| 185 | "\\(?:-[{([<`\"].*?\\)?"; for ARG-{x}, (x), <x>, [x], `x' | 188 | "\\(?:-[{([<`\"].*?\\)?"; for ARG-{x}, (x), <x>, [x], `x' |
| 186 | "\\>") ; end of word | 189 | "\\>") ; end of word |
| 187 | (help-default-arg-highlight arg) | 190 | (help-highlight-arg arg) |
| 188 | doc t t 1))))) | 191 | doc t t 1))))) |
| 189 | 192 | ||
| 190 | (defun help-highlight-arguments (usage doc &rest args) | 193 | (defun help-highlight-arguments (usage doc &rest args) |