* [PATCH] More options in use of headlines as substitute for title field
@ 2011-04-30 13:03 Matt Lundin
0 siblings, 0 replies; only message in thread
From: Matt Lundin @ 2011-04-30 13:03 UTC (permalink / raw)
To: Org Mode
* lisp/org-bibtex.el (org-bibtex-treat-headline-as-title): New
defcustom.
(org-bibtex-headline): Only use headline text (not TODO or other
metadata) to generate title field and auto key.
(org-bibtex-fleshout): Allow user to choose whether to treat
headline as title.
---
This patch consolidates the three patches for org-bibtex I sent last
night. Please delete those patches from the patchwork server.
Thanks! Matt
lisp/org-bibtex.el | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/lisp/org-bibtex.el b/lisp/org-bibtex.el
index f4614fb..8070755 100644
--- a/lisp/org-bibtex.el
+++ b/lisp/org-bibtex.el
@@ -223,6 +223,14 @@ For example setting to 'BIB_' would allow interoperability with fireforg."
:group 'org-bibtex
:type 'string)
+(defcustom org-bibtex-treat-headline-as-title t
+ "Treat headline text as title if title property is absent.
+If an entry is missing a title property, use the headline text as
+the property. If this value is t, `org-bibtex-check` will ignore
+a missing title field."
+ :group 'org-bibtex
+ :type 'boolean)
+
(defcustom org-bibtex-export-arbitrary-fields nil
"When converting to bibtex allow fields not defined in `org-bibtex-fields'.
This only has effect if org-bibtex-prefix is defined, so as to
@@ -289,7 +297,7 @@ IDs must be unique."
(lambda (field)
(let ((value (or (org-bibtex-get (from field))
(and (equal :title field)
- (org-get-heading)))))
+ (nth 4 (org-heading-components))))))
(when value (cons (from field) value))))
(flatten
(val :required (val (to type) org-bibtex-types))
@@ -329,7 +337,9 @@ With optional argument OPTIONAL, also prompt for optional fields."
(keyword (name) (intern (concat ":" (downcase name))))
(name (keyword) (upcase (substring (symbol-name keyword) 1))))
(dolist (field (append
- (remove :title (val :required (val type org-bibtex-types)))
+ (if org-bibtex-treat-headline-as-title
+ (remove :title (val :required (val type org-bibtex-types)))
+ (val :required (val type org-bibtex-types)))
(when optional (val :optional (val type org-bibtex-types)))))
(when (consp field) ; or'd pair of fields e.g., (:editor :author)
(let ((present (first (remove nil
--
1.7.5
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-04-30 13:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-30 13:03 [PATCH] More options in use of headlines as substitute for title field Matt Lundin
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.