0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-08-26 06:02:51 +00:00

org-bibtex: added trailing space after "Type:" thanks to Matt Lundin

This commit is contained in:
Eric Schulte 2011-04-23 08:00:16 -06:00
parent 93e000923f
commit 5a07ae6f11

View file

@ -295,6 +295,7 @@ For example setting to 'BIB_' would allow interoperability with fireforg."
"Fleshout the current heading, ensuring that all required fields are present. "Fleshout the current heading, ensuring that all required fields are present.
With optional argument OPTIONAL, also prompt for optional fields." With optional argument OPTIONAL, also prompt for optional fields."
(flet ((get (key lst) (cdr (assoc key lst))) (flet ((get (key lst) (cdr (assoc key lst)))
(keyword (name) (intern (concat ":" (downcase name))))
(name (keyword) (upcase (substring (symbol-name keyword) 1)))) (name (keyword) (upcase (substring (symbol-name keyword) 1))))
(dolist (field (append (dolist (field (append
(remove :title (get :required (get type org-bibtex-types))) (remove :title (get :required (get type org-bibtex-types)))
@ -304,9 +305,8 @@ With optional argument OPTIONAL, also prompt for optional fields."
(mapcar (mapcar
(lambda (f) (when (org-bibtex-get (name f)) f)) (lambda (f) (when (org-bibtex-get (name f)) f))
field))))) field)))))
(setf field (or present (setf field (or present (keyword (org-icompleting-read
(intern (org-icompleting-read "Field: " (mapcar #'name field)))))))
"Field: " (mapcar #'symbol-name field)))))))
(let ((name (name field))) (let ((name (name field)))
(unless (org-bibtex-get name) (unless (org-bibtex-get name)
(let ((prop (org-bibtex-ask field))) (let ((prop (org-bibtex-ask field)))
@ -439,7 +439,7 @@ With prefix argument OPTIONAL also prompt for optional fields."
"Create a new entry at the given level." "Create a new entry at the given level."
(interactive (interactive
(list (org-icompleting-read (list (org-icompleting-read
"Type:" "Type: "
(mapcar (lambda (type) (symbol-name (car type))) org-bibtex-types)))) (mapcar (lambda (type) (symbol-name (car type))) org-bibtex-types))))
(let ((type (if (keywordp type) type (intern type)))) (let ((type (if (keywordp type) type (intern type))))
(unless (assoc type org-bibtex-types) (unless (assoc type org-bibtex-types)