[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: eldoc hint for dolist is confusing
From: |
Juanma Barranquero |
Subject: |
Re: eldoc hint for dolist is confusing |
Date: |
Sat, 24 Jan 2009 02:36:21 +0100 |
On Sat, Jan 24, 2009 at 01:52, Glenn Morris <address@hidden> wrote:
> It seems to be due to this?
Yes, sorry.
The problem I was fixing is that, without the patch, having a function
(defun test (&optional sometimes)
...)
eldoc thinks that test has two arguments, `&optional' and `sometimes'.
Please try the attached fix.
Juanma
Index: lisp/emacs-lisp/eldoc.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/emacs-lisp/eldoc.el,v
retrieving revision 1.56
diff -u -2 -r1.56 eldoc.el
--- lisp/emacs-lisp/eldoc.el 17 Jan 2009 20:01:17 -0000 1.56
+++ lisp/emacs-lisp/eldoc.el 24 Jan 2009 01:34:05 -0000
@@ -492,8 +492,8 @@
The words \"&rest\", \"&optional\" are returned unchanged."
(mapconcat (lambda (s)
- (if (member s '("&optional" "&rest"))
+ (if (string-match-p "\\`(?&\\(?:optional\\|rest\\))?\\'" s)
s
(funcall eldoc-argument-case s)))
- (split-string argstring "[][ ()]+" t) " "))
+ (split-string argstring) " "))