summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2011-04-28 09:46:35 -0600
committerEric Schulte <schulte.eric@gmail.com>2011-04-28 09:46:35 -0600
commitdaef7d8631e3c6c6fbf0dfc2aa89e31d4640467b (patch)
treea58eb7696a8f31439e2fb8c9b9a17deb66f20906
parent1024da4e351a35bf00594a7e04f45f35c4ea4136 (diff)
downloadorg-mode-daef7d8631e3c6c6fbf0dfc2aa89e31d4640467b.tar.gz
org-bibtex: optionally fill in optional fields on bibtex headline creation
Thanks to Tom Dye for suggesting this functionality * lisp/org-bibtex.el (org-bibtex-create): Adding prefix argument which will result in prompting for optional fields.
-rw-r--r--lisp/org-bibtex.el14
1 files changed, 7 insertions, 7 deletions
diff --git a/lisp/org-bibtex.el b/lisp/org-bibtex.el
index d4aa5d5..04baadb 100644
--- a/lisp/org-bibtex.el
+++ b/lisp/org-bibtex.el
@@ -464,20 +464,20 @@ With prefix argument OPTIONAL also prompt for optional fields."
With prefix argument OPTIONAL also prompt for optional fields."
(interactive) (org-map-entries (lambda () (org-bibtex-check optional))))
-(defun org-bibtex-create (type)
+(defun org-bibtex-create (&optional arg)
"Create a new entry at the given level."
- (interactive
- (list (org-icompleting-read
- "Type: "
- (mapcar (lambda (type) (symbol-name (car type))) org-bibtex-types))))
- (let ((type (if (keywordp type) type (intern type))))
+ (interactive "P")
+ (let* ((type (org-icompleting-read
+ "Type: " (mapcar (lambda (type) (symbol-name (car type)))
+ org-bibtex-types)))
+ (type (if (keywordp type) type (intern type))))
(unless (assoc type org-bibtex-types)
(error "type:%s is not known" type))
(org-insert-heading)
(let ((title (org-bibtex-ask :title)))
(insert title) (org-bibtex-put "TITLE" title))
(org-bibtex-put "TYPE" (substring (symbol-name type) 1))
- (org-bibtex-fleshout type)))
+ (org-bibtex-fleshout type arg)))
(defun org-bibtex-read ()
"Read a bibtex entry and save to `*org-bibtex-entries*'.