[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug: 22.1.50.1; eldoc-argument-case ignored
From: |
Nikolaj Schumacher |
Subject: |
Re: Bug: 22.1.50.1; eldoc-argument-case ignored |
Date: |
Wed, 22 Aug 2007 23:06:15 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (darwin) |
Glenn Morris <address@hidden> wrote:
>> eldoc's new function argument highlighting seems to disregard
>> `eldoc-argument-case', as setting it to 'downcase has no effect.
>
> Actually, I think it worked as well as it did before, which was only
> sometimes. I believe I have fixed it now, but it's possible I have
> just made a hideous mess.
Thanks.
As far as I can see, there's just a small issue.
`eldoc-argument-case' is called with these arguments:
"(foo" "bar" "baz)"
It should probably be:
"foo" "bar" "baz"
for best backwards compatibility.
The attached patch should take care of that.
On a related issue, I strongly suggest making the highlighting face
customizable. Currently 'bold is hardcoded. Patch is attached, as well.
regards,
Nikolaj Schumacher
Index: lisp/emacs-lisp/eldoc.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/emacs-lisp/eldoc.el,v
retrieving revision 1.47
diff -d -u -r1.47 eldoc.el
--- lisp/emacs-lisp/eldoc.el 19 Aug 2007 03:04:13 -0000 1.47
+++ lisp/emacs-lisp/eldoc.el 22 Aug 2007 20:53:25 -0000
@@ -471,11 +476,12 @@
(defun eldoc-function-argstring-format (argstring)
"Apply `eldoc-argument-case' to each word in argstring.
The words \"&rest\", \"&optional\" are returned unchanged."
- (mapconcat (lambda (s)
- (if (member s '("&optional" "&rest"))
- s
- (funcall eldoc-argument-case s)))
- (split-string argstring) " "))
+ (concat "(" (mapconcat (lambda (s)
+ (if (member s '("&optional" "&rest"))
+ s
+ (funcall eldoc-argument-case s)))
+ (split-string (substring argstring 1 -1)) " ")
+ ")"))
;; When point is in a sexp, the function args are not reprinted in the echo
;; area after every possible interactive command because some of them print
Index: lisp/emacs-lisp/eldoc.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/emacs-lisp/eldoc.el,v
retrieving revision 1.47
diff -d -u -r1.47 eldoc.el
--- lisp/emacs-lisp/eldoc.el 19 Aug 2007 03:04:13 -0000 1.47
+++ lisp/emacs-lisp/eldoc.el 22 Aug 2007 20:31:35 -0000
@@ -101,6 +101,11 @@
enable argument list to fit on one line" truncate-sym-name-if-fit))
:group 'eldoc)
+(defface eldoc-highlight-function-argument-face
+ '((default (:weight bold)))
+ "*Face used for the argument at point in a function's argument list."
+ :group 'eldoc)
+
;;; No user options below here.
(defvar eldoc-message-commands-table-size 31
@@ -303,7 +308,7 @@
In the absence of INDEX, just call `eldoc-docstring-format-sym-doc'."
(let ((start nil)
(end 0)
- (argument-face 'bold))
+ (argument-face 'eldoc-highlight-function-argument-face))
;; Find the current argument in the argument string. We need to
;; handle `&rest' and informal `...' properly.
;;
- Bug: 22.1.50.1; eldoc-argument-case ignored, Nikolaj Schumacher, 2007/08/17
- Re: Bug: 22.1.50.1; eldoc-argument-case ignored, Richard Stallman, 2007/08/17
- Re: Bug: 22.1.50.1; eldoc-argument-case ignored, Glenn Morris, 2007/08/18
- Re: Bug: 22.1.50.1; eldoc-argument-case ignored,
Nikolaj Schumacher <=
- Re: Bug: 22.1.50.1; eldoc-argument-case ignored, Richard Stallman, 2007/08/23
- Re: Bug: 22.1.50.1; eldoc-argument-case ignored, Miles Bader, 2007/08/24
- Re: Bug: 22.1.50.1; eldoc-argument-case ignored, Kim F. Storm, 2007/08/24
- Re: Bug: 22.1.50.1; eldoc-argument-case ignored, Stefan Monnier, 2007/08/24
- Re: Bug: 22.1.50.1; eldoc-argument-case ignored, Miles Bader, 2007/08/25
- Re: Bug: 22.1.50.1; eldoc-argument-case ignored, Stefan Monnier, 2007/08/25
- Re: Bug: 22.1.50.1; eldoc-argument-case ignored, Glenn Morris, 2007/08/23
- Re: Bug: 22.1.50.1; eldoc-argument-case ignored, Nikolaj Schumacher, 2007/08/24