all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nikolaj Schumacher <n_schumacher@web.de>
To: emacs-pretest-bug@gnu.org
Subject: Re: Bug: 22.1.50.1; eldoc-argument-case ignored
Date: Wed, 22 Aug 2007 23:06:15 +0200	[thread overview]
Message-ID: <m27innp9dk.fsf@nschum.de> (raw)
In-Reply-To: <yehcmwo0yk.fsf@fencepost.gnu.org> (Glenn Morris's message of "Sat\, 18 Aug 2007 19\:52\:03 -0400")

[-- Attachment #1: Type: text/plain, Size: 766 bytes --]

Glenn Morris <rgm@gnu.org> 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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: eldoc-argument-case patch --]
[-- Type: text/x-patch, Size: 1034 bytes --]

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)) " ")
+	  ")"))
 \f
 ;; 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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: highlight face patch --]
[-- Type: text/x-patch, Size: 1050 bytes --]

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

[-- Attachment #4: Type: text/plain, Size: 142 bytes --]

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

  reply	other threads:[~2007-08-22 21:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-17  9:40 Bug: 22.1.50.1; eldoc-argument-case ignored Nikolaj Schumacher
2007-08-17 20:17 ` Richard Stallman
2007-08-18 23:52   ` Glenn Morris
2007-08-22 21:06     ` Nikolaj Schumacher [this message]
2007-08-24  2:13       ` Richard Stallman
2007-08-24  4:35         ` Miles Bader
2007-08-24 11:15           ` Kim F. Storm
2007-08-24 14:19             ` Stefan Monnier
2007-08-25  9:21               ` Miles Bader
2007-08-25 20:36                 ` Stefan Monnier
2007-08-24  2:36       ` Glenn Morris
2007-08-24  7:25         ` Nikolaj Schumacher

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=m27innp9dk.fsf@nschum.de \
    --to=n_schumacher@web.de \
    --cc=emacs-pretest-bug@gnu.org \
    /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.