Navigation Menu

Skip to content
This repository has been archived by the owner on Jan 23, 2018. It is now read-only.

Commit

Permalink
fixed autodoc for nested s-exprs
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoduncan committed Mar 12, 2010
1 parent 83363ec commit 5b0205e
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions src/swank/commands/contrib/swank_arglists.clj
Expand Up @@ -14,17 +14,29 @@
((slime-fn 'operator-arglist) (ffirst raw-specs) *current-package*)
nil)))

(defslimefn autodoc [raw-specs & options]
;; This isn't complete but at least does something
(if (and raw-specs
(seq? raw-specs)
(seq? (first raw-specs)))
((slime-fn 'operator-arglist) (ffirst raw-specs) *current-package*)
nil))
(defslimefn autodoc
"Return a string representing the arglist for the deepest subform in
RAW-FORM that does have an arglist. The highlighted parameter is
wrapped in ===> X <===."
[raw-specs & options]
(let [{:keys [print-right-margin
print-lines]} (if (first options)
(apply hash-map options)
{})]
(if (and raw-specs
(seq? raw-specs))
(let [expr (some #(and (seq? %) (some #{:cursor-marker} %) %)
(tree-seq seq? seq raw-specs))]
(if (and (seq? expr) (not (= (first expr) "")))
((slime-fn 'operator-arglist)
(first expr)
*current-package*)
`:not-available))
`:not-available)))

(defslimefn variable-desc-for-echo-area [variable-name]
(with-emacs-package
(or
(or
(try
(when-let [sym (read-string variable-name)]
(when-let [var (resolve sym)]
Expand Down

0 comments on commit 5b0205e

Please sign in to comment.