emacs-devel
[Top][All Lists]
Advanced

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

Re: Bug: 22.1.50.1; eldoc-argument-case ignored


From: Richard Stallman
Subject: Re: Bug: 22.1.50.1; eldoc-argument-case ignored
Date: Thu, 23 Aug 2007 22:13:32 -0400

Would someone please verify this, then install it if correct?
Then please ack.

To: address@hidden
From: Nikolaj Schumacher <address@hidden>
In-Reply-To: <address@hidden> (Glenn Morris's message of
        "Sat\, 18 Aug 2007 19\:52\:03 -0400")
Date: Wed, 22 Aug 2007 23:06:15 +0200
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Cc: 
Subject: Re: Bug: 22.1.50.1; eldoc-argument-case ignored

--=-=-=

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

--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline; filename=emacs-eldoc-argument-case.patch
Content-Description: eldoc-argument-case patch

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

--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline; filename=emacs-eldoc-highlight-face.patch
Content-Description: highlight face patch

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.
     ;;

--=-=-=
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Emacs-devel mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-devel
--=-=-=--







reply via email to

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