In org-elisp-symbol.el: correctly handle function with no documentation.

This commit is contained in:
Bastien Guerry 2008-03-05 01:55:46 +00:00
parent b6cc5e606d
commit 2a5f2004ba
2 changed files with 14 additions and 8 deletions

View File

@ -1,3 +1,8 @@
2008-03-05 Bastien Guerry <bzg@altern.org>
* lisp/org-elisp-symbol.el (org-elisp-symbol-store-link):
Correctly handle function with no documentation.
2008-02-29 Tokuya Kameshima <kames@fa2.so-net.ne.jp>
* lisp/org-bookmark.el (org-bookmark-store-link): Use

View File

@ -51,7 +51,7 @@
;;
;; And a remember template like:
;;
;; (setq org-remember-templates
;; (setq org-remember-templates
;; '((?s "* DEBUG `%:name' (%:args)\n\n%?\n\nFixme: %:fixme\n \
;; Doc: \"%:doc\"\n\n%a")))
;;
@ -65,7 +65,7 @@
;; Fixme: update the docstring
;; Doc: "Convert lists to LaTeX."
;;
;; [[file:~/path/file.el::defun%20org-export-latex-lists][Function: org-export-latex-lists]]
;; [[file:~/path/file.el::defun%20my-func][Function: my-func]]
;; =====================================================================
;;
;; Put this file into your load-path and the following into your ~/.emacs:
@ -93,8 +93,8 @@
(save-excursion
(or (looking-at "^(") (beginning-of-defun))
(looking-at "^(\\([a-z]+\\) \\([^)\n ]+\\) ?\n?[ \t]*\\(?:(\\(.*\\))\\)?")
(let* ((end (save-excursion
(save-match-data
(let* ((end (save-excursion
(save-match-data
(end-of-defun) (point))))
(def (match-string 1))
(name (match-string 2))
@ -107,12 +107,13 @@
(t "Symbol")))
(args (if (match-string 3)
(mapconcat (lambda (a) (unless (string-match "^&" a) a))
(split-string (match-string 3)) " ")
(split-string (match-string 3)) " ")
"no arg"))
(docstring (cond ((functionp sym-name)
(documentation sym-name))
(or (documentation sym-name)
"[no documentation]"))
((string-match "[Vv]ariable" stype)
(documentation-property sym-name
(documentation-property sym-name
'variable-documentation))
(t "no documentation")))
(doc (and (string-match "^\\([^\n]+\\)$" docstring)
@ -135,7 +136,7 @@
(setq description (concat stype ": " name))
(org-store-link-props
:type "elisp-symbol"
:link link
:link link
:description description
:def def
:name name