clojure-emacs / ac-nrepl

[DEPRECATED] Emacs auto-complete backend for nrepl completions
74 stars 11 forks source link

Documentation pop up text not right on Windows #4

Closed wrn closed 12 years ago

wrn commented 12 years ago

Because of those Linux style line endings in the text (I am really annoyed that Clojure cannot get the doc text right across platforms. Not ac-nrepl's fault)

I just changed ac-nrepl-documentation function to the following:

(defun ac-nrepl-documentation (symbol) "Return documentation for the given SYMBOL, if available." (substring-no-properties (replace-regexp-in-string "\r" "" ;; Fix Linux style line-ending on Windows (replace-regexp-in-string "^( |-------------------------\n)" "" (plist-get (nrepl-send-string-sync (format "(clojure.repl/doc %s)" symbol) (nrepl-current-ns)) :stdout)))))

That fixed the issue on Windows. I did not test if the above will break on Linux.