From: Juanma Barranquero <lekktu@gmail.com>
To: Drew Adams <drew.adams@oracle.com>
Cc: 4510@emacsbugs.donarmstrong.com
Subject: bug#4510: 23.1; Separate help-argument-face from downcasing
Date: Tue, 22 Sep 2009 01:21:15 +0200 [thread overview]
Message-ID: <f7ccd24b0909211621t1e384965hd15407211475067@mail.gmail.com> (raw)
In-Reply-To: <49ADA31DA6A342CCB1E5FF47158A498A@us.oracle.com>
On Mon, Sep 21, 2009 at 23:35, Drew Adams <drew.adams@oracle.com> wrote:
> The problem is that function `help-default-arg-highlight' couples
> (a) the use of a face to highlight the arguments with (b) downcasing
> the arguments. These two should be separated, so users can highlight
> without downcasing (or downcase without highlighting).
This is the proposed patch; it also renames
`help-default-arg-highlight', which has an unfitting name.
Juanma
2009-09-21 Juanma Barranquero <lekktu@gmail.com>
* help-fns.el (help-downcase-arguments): New option.
(help-default-arg-highlight): Obsolete.
(help-highlight-arg): New function.
(help-do-arg-highlight): Use it.
Suggested by Drew Adams <drew.adams@oracle.com>. (Bug#4510)
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 2425310..fc80966 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -158,15 +158,22 @@ 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
+ (and (face-differs-from-default-p 'help-argument-name) t)
+ "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))
+
+(define-obsolete-function-alias 'help-default-arg-highlight
+ 'help-highlight-arg "23.2")
(defun help-do-arg-highlight (doc args)
(with-syntax-table (make-syntax-table emacs-lisp-mode-syntax-table)
@@ -184,7 +191,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)
next prev parent reply other threads:[~2009-09-21 23:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <f7ccd24b0909241225x11ab6a76qc2e4bfe437bd046b@mail.gmail.com>
2009-09-21 21:35 ` bug#4510: 23.1; Separate help-argument-face from downcasing Drew Adams
2009-09-21 22:17 ` Juanma Barranquero
2009-09-21 23:21 ` Juanma Barranquero [this message]
2009-09-22 14:35 ` Drew Adams
2009-09-22 14:41 ` Juanma Barranquero
2009-09-24 19:30 ` bug#4510: marked as done (23.1; Separate help-argument-face from downcasing) Emacs bug Tracking System
2009-09-22 15:27 ` bug#4520: downcasing function arguments by default not appropriate in multi-tty Dan Nicolaescu
2009-09-22 21:42 ` Juanma Barranquero
2009-09-24 19:30 ` bug#4520: marked as done (downcasing function arguments by default not appropriate in multi-tty) Emacs bug Tracking System
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f7ccd24b0909211621t1e384965hd15407211475067@mail.gmail.com \
--to=lekktu@gmail.com \
--cc=4510@emacsbugs.donarmstrong.com \
--cc=drew.adams@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.