aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2004-05-09 00:45:49 +0000
committerJuanma Barranquero2004-05-09 00:45:49 +0000
commitfef3a3ab7c63a3e9d399b90e75dbd28b129e16f0 (patch)
tree7ac9e556d32cd60b14551fa4df18e72ac855fea2
parente6662c8bbbdc84837e5bb6773b9335f79ffb4b5d (diff)
downloademacs-fef3a3ab7c63a3e9d399b90e75dbd28b129e16f0.tar.gz
emacs-fef3a3ab7c63a3e9d399b90e75dbd28b129e16f0.zip
(help-highlight-arguments): Don't try to highlight missing or autoloaded
arglists. Accept structured arguments, like the first ones of `do' and `flet'.
-rw-r--r--lisp/help-fns.el33
1 files changed, 16 insertions, 17 deletions
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index f19bdbf1c35..51850288b70 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -45,10 +45,10 @@ If there's no tutorial in that language, `TUTORIAL' is selected.
45With ARG, you are asked to choose which language." 45With ARG, you are asked to choose which language."
46 (interactive "P") 46 (interactive "P")
47 (let ((lang (if arg 47 (let ((lang (if arg
48 (let ((minibuffer-setup-hook minibuffer-setup-hook)) 48 (let ((minibuffer-setup-hook minibuffer-setup-hook))
49 (add-hook 'minibuffer-setup-hook 49 (add-hook 'minibuffer-setup-hook
50 'minibuffer-completion-help) 50 'minibuffer-completion-help)
51 (read-language-name 'tutorial "Language: " "English")) 51 (read-language-name 'tutorial "Language: " "English"))
52 (if (get-language-info current-language-environment 'tutorial) 52 (if (get-language-info current-language-environment 'tutorial)
53 current-language-environment 53 current-language-environment
54 "English"))) 54 "English")))
@@ -253,17 +253,16 @@ KIND should be `var' for a variable or `subr' for a subroutine."
253 253
254(defun help-highlight-arguments (usage doc &rest args) 254(defun help-highlight-arguments (usage doc &rest args)
255 (when usage 255 (when usage
256 (let ((case-fold-search nil) 256 (with-temp-buffer
257 (next (not args)) 257 (insert usage)
258 (opt nil)) 258 (goto-char (point-min))
259 ;; Make a list of all arguments 259 (let ((case-fold-search nil)
260 (with-temp-buffer 260 (next (not (or args (looking-at "\\["))))
261 (insert usage) 261 (opt nil))
262 (goto-char (point-min))
263 ;; Make a list of all arguments 262 ;; Make a list of all arguments
264 (while next 263 (while next
265 (or opt (not (looking-at " &")) (setq opt t)) 264 (or opt (not (looking-at " &")) (setq opt t))
266 (if (not (re-search-forward " \\([\\[(]?\\)\\([^] &)\.]+\\)" nil t)) 265 (if (not (re-search-forward " \\([\\[(]*\\)\\([^] &)\.]+\\)" nil t))
267 (setq next nil) 266 (setq next nil)
268 (setq args (cons (match-string 2) args)) 267 (setq args (cons (match-string 2) args))
269 (when (and opt (string= (match-string 1) "(")) 268 (when (and opt (string= (match-string 1) "("))
@@ -272,11 +271,11 @@ KIND should be `var' for a variable or `subr' for a subroutine."
272 (search-backward "(") 271 (search-backward "(")
273 (goto-char (scan-sexps (point) 1))))) 272 (goto-char (scan-sexps (point) 1)))))
274 ;; Highlight aguments in the USAGE string 273 ;; Highlight aguments in the USAGE string
275 (setq usage (help-do-arg-highlight (buffer-string) args))) 274 (setq usage (help-do-arg-highlight (buffer-string) args))))
276 ;; Highlight arguments in the DOC string 275 ;; Highlight arguments in the DOC string
277 (setq doc (and doc (help-do-arg-highlight doc args))) 276 (setq doc (and doc (help-do-arg-highlight doc args)))
278 ;; Return value is like the one from help-split-fundoc, but highlighted 277 ;; Return value is like the one from help-split-fundoc, but highlighted
279 (cons usage doc)))) 278 (cons usage doc)))
280 279
281;;;###autoload 280;;;###autoload
282(defun describe-function-1 (function) 281(defun describe-function-1 (function)