aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier2009-10-02 14:36:54 +0000
committerStefan Monnier2009-10-02 14:36:54 +0000
commit8d6c1239cb77da219180facf7937c259fc66767c (patch)
treefe57546bf7b7a8be5bbbe76a2a174caf95f50b70 /lisp
parentc4861de07b4cb7d2379c621bb67d44dd3497efff (diff)
downloademacs-8d6c1239cb77da219180facf7937c259fc66767c.tar.gz
emacs-8d6c1239cb77da219180facf7937c259fc66767c.zip
* help-fns.el (help-function-arglist): Don't check advertised-signature-table.
(describe-function-1): Do it here instead so it also applies to subrs. * emacs-lisp/eldoc.el (eldoc-get-fnsym-args-string): Obey advertised-signature-table.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog13
-rw-r--r--lisp/emacs-lisp/eldoc.el5
-rw-r--r--lisp/help-fns.el23
3 files changed, 27 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4baa1ad304c..58349083f55 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12009-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * emacs-lisp/eldoc.el (eldoc-get-fnsym-args-string):
4 Obey advertised-signature-table.
5
6 * help-fns.el (help-function-arglist): Don't check
7 advertised-signature-table.
8 (describe-function-1): Do it here instead so it also applies to subrs.
9
12009-10-02 Michael Albinus <michael.albinus@gmx.de> 102009-10-02 Michael Albinus <michael.albinus@gmx.de>
2 11
3 * simple.el (start-file-process): Say in the doc-string, that file 12 * simple.el (start-file-process): Say in the doc-string, that file
@@ -9,8 +18,8 @@
9 (ange-ftp-delete-directory): Implement RECURSIVE case. Change to 18 (ange-ftp-delete-directory): Implement RECURSIVE case. Change to
10 root directory ("device busy" error otherwise). 19 root directory ("device busy" error otherwise).
11 20
12 * net/tramp-smb.el (tramp-smb-handle-make-directory-internal): Flush 21 * net/tramp-smb.el (tramp-smb-handle-make-directory-internal):
13 file properties of created directory. 22 Flush file properties of created directory.
14 23
152009-10-02 Eli Zaretskii <eliz@gnu.org> 242009-10-02 Eli Zaretskii <eliz@gnu.org>
16 25
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index 47f4dd470bc..f1a92035bb9 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -290,11 +290,14 @@ or elsewhere, return a 1-line docstring. Calls the functions
290former calls `eldoc-argument-case'; the latter gives the 290former calls `eldoc-argument-case'; the latter gives the
291function name `font-lock-function-name-face', and optionally 291function name `font-lock-function-name-face', and optionally
292highlights argument number INDEX." 292highlights argument number INDEX."
293 (let (args doc) 293 (let (args doc advertised)
294 (cond ((not (and sym (symbolp sym) (fboundp sym)))) 294 (cond ((not (and sym (symbolp sym) (fboundp sym))))
295 ((and (eq sym (aref eldoc-last-data 0)) 295 ((and (eq sym (aref eldoc-last-data 0))
296 (eq 'function (aref eldoc-last-data 2))) 296 (eq 'function (aref eldoc-last-data 2)))
297 (setq doc (aref eldoc-last-data 1))) 297 (setq doc (aref eldoc-last-data 1)))
298 ((listp (setq advertised (gethash (indirect-function sym)
299 advertised-signature-table t)))
300 (setq args advertised))
298 ((setq doc (help-split-fundoc (documentation sym t) sym)) 301 ((setq doc (help-split-fundoc (documentation sym t) sym))
299 (setq args (car doc)) 302 (setq args (car doc))
300 ;; Remove any enclosing (), since e-function-argstring adds them. 303 ;; Remove any enclosing (), since e-function-argstring adds them.
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index a080cd22ea0..e30fe28682c 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -101,15 +101,13 @@ ARGLIST can also be t or a string of the form \"(FUN ARG1 ARG2 ...)\"."
101 ;; Handle symbols aliased to other symbols. 101 ;; Handle symbols aliased to other symbols.
102 (if (and (symbolp def) (fboundp def)) (setq def (indirect-function def))) 102 (if (and (symbolp def) (fboundp def)) (setq def (indirect-function def)))
103 ;; If definition is a macro, find the function inside it. 103 ;; If definition is a macro, find the function inside it.
104 (let ((advertised (gethash def advertised-signature-table t))) 104 (if (eq (car-safe def) 'macro) (setq def (cdr def)))
105 (if (listp advertised) advertised 105 (cond
106 (if (eq (car-safe def) 'macro) (setq def (cdr def))) 106 ((byte-code-function-p def) (aref def 0))
107 (cond 107 ((eq (car-safe def) 'lambda) (nth 1 def))
108 ((byte-code-function-p def) (aref def 0)) 108 ((and (eq (car-safe def) 'autoload) (not (eq (nth 4 def) 'keymap)))
109 ((eq (car-safe def) 'lambda) (nth 1 def)) 109 "[Arg list not available until function definition is loaded.]")
110 ((and (eq (car-safe def) 'autoload) (not (eq (nth 4 def) 'keymap))) 110 (t t)))
111 "[Arg list not available until function definition is loaded.]")
112 (t t)))))
113 111
114(defun help-make-usage (function arglist) 112(defun help-make-usage (function arglist)
115 (cons (if (symbolp function) function 'anonymous) 113 (cons (if (symbolp function) function 'anonymous)
@@ -469,14 +467,17 @@ suitable file is found, return nil."
469 (re-search-backward "`\\([^`']+\\)'" nil t) 467 (re-search-backward "`\\([^`']+\\)'" nil t)
470 (help-xref-button 1 'help-function-cmacro function lib))))) 468 (help-xref-button 1 'help-function-cmacro function lib)))))
471 (princ ".\n\n")) 469 (princ ".\n\n"))
472 (let* ((arglist (help-function-arglist def)) 470 (let* ((advertised (gethash def advertised-signature-table t))
471 (arglist (if (listp advertised)
472 advertised (help-function-arglist def)))
473 (doc (documentation function)) 473 (doc (documentation function))
474 (usage (help-split-fundoc doc function))) 474 (usage (help-split-fundoc doc function)))
475 (with-current-buffer standard-output 475 (with-current-buffer standard-output
476 ;; If definition is a keymap, skip arglist note. 476 ;; If definition is a keymap, skip arglist note.
477 (unless (keymapp function) 477 (unless (keymapp function)
478 (if usage (setq doc (cdr usage)))
478 (let* ((use (cond 479 (let* ((use (cond
479 (usage (setq doc (cdr usage)) (car usage)) 480 ((and usage (not (listp advertised))) (car usage))
480 ((listp arglist) 481 ((listp arglist)
481 (format "%S" (help-make-usage function arglist))) 482 (format "%S" (help-make-usage function arglist)))
482 ((stringp arglist) arglist) 483 ((stringp arglist) arglist)