diff options
author | Raghav Kumar Gautam <raghav@apache.org> | 2015-06-08 19:11:03 -0700 |
---|---|---|
committer | Raghav Kumar Gautam <raghav@apache.org> | 2015-06-08 19:11:03 -0700 |
commit | d877b9ba16f683dea3594fdf3805592bde19b9d0 (patch) | |
tree | 0f9f341fc924f50eb6c63cf30a4d8ee704d62b25 /helm-elisp.el | |
parent | 4ae90a54cbf7aac9fdc691de50e9142699fb63b0 (diff) |
use cl-typecase for one line doc of elisp symbols
Diffstat (limited to 'helm-elisp.el')
-rw-r--r-- | helm-elisp.el | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/helm-elisp.el b/helm-elisp.el index 2f52a99c..a7d79bc5 100644 --- a/helm-elisp.el +++ b/helm-elisp.el @@ -345,13 +345,10 @@ Return a cons \(beg . end\)." (defun helm-get-first-line-documentation (sym) "Return first line documentation of symbol SYM. If SYM is not documented, return \"Not documented\"." - (let ((doc (cond ((fboundp sym) - (documentation sym t)) - ((boundp sym) - (documentation-property sym 'variable-documentation t)) - ((facep sym) - (face-documentation sym)) - (t nil)))) + (let ((doc (cl-typecase sym + (fbound (documentation sym t)) + (bound (documentation-property sym 'variable-documentation t)) + (face (face-documentation sym))))) (if (and doc (not (string= doc "")) ;; `documentation' return "\n\n(args...)" ;; for CL-style functions. |