changeset 101429:57e8989174eb

* emacs-lisp/eldoc.el (eldoc-function-argstring-format): Revert 2007-09-26 change; use `string-match-p' to check for &keywords. (eldoc-get-fnsym-args-string, eldoc-highlight-function-argument): Use `string-match-p'.
author Juanma Barranquero <lekktu@gmail.com>
date Sat, 24 Jan 2009 11:34:57 +0000
parents d7b1d5b3b2c1
children 5393fb4f28ac
files lisp/ChangeLog lisp/emacs-lisp/eldoc.el
diffstat 2 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Jan 24 10:39:34 2009 +0000
+++ b/lisp/ChangeLog	Sat Jan 24 11:34:57 2009 +0000
@@ -1,3 +1,10 @@
+2009-01-24  Juanma Barranquero  <lekktu@gmail.com>
+
+	* emacs-lisp/eldoc.el (eldoc-function-argstring-format):
+	Revert 2007-09-26 change; use `string-match-p' to check for &keywords.
+	(eldoc-get-fnsym-args-string, eldoc-highlight-function-argument):
+	Use `string-match-p'.
+
 2009-01-24  Ulf Jasper  <ulf.jasper@web.de>
 
 	* net/newst-treeview.el (newsticker--treeview-first-feed): New.
--- a/lisp/emacs-lisp/eldoc.el	Sat Jan 24 10:39:34 2009 +0000
+++ b/lisp/emacs-lisp/eldoc.el	Sat Jan 24 11:34:57 2009 +0000
@@ -300,7 +300,7 @@
 	   ;; Remove any enclosing (), since e-function-argstring adds them.
 	   (string-match "\\`[^ )]* ?" args)
 	   (setq args (substring args (match-end 0)))
-	   (if (string-match ")\\'" args)
+	   (if (string-match-p ")\\'" args)
 	       (setq args (substring args 0 -1))))
 	  (t
 	   (setq args (help-function-arglist sym))))
@@ -338,7 +338,7 @@
 		     ;; All the rest arguments are the same.
 		     (setq index 1))
 		    ((string= argument "&optional"))
-		    ((string-match "\\.\\.\\.$" argument)
+		    ((string-match-p "\\.\\.\\.$" argument)
 		     (setq index 0))
 		    (t
 		     (setq index (1- index))))))
@@ -491,10 +491,10 @@
   "Apply `eldoc-argument-case' to each word in ARGSTRING.
 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) " "))
 
 
 ;; When point is in a sexp, the function args are not reprinted in the echo