Function: r2b-barf-output

r2b-barf-output is a byte-compiled function defined in refbib.el.gz.

Signature

(r2b-barf-output)

Documentation

Generate bibtex based on global variables.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/refbib.el.gz
(defun r2b-barf-output ()
   "Generate bibtex based on global variables."
   (let ((standard-output r2b-out-buf) (case-fold-search t)) ;; match

      (r2b-trace "...barfing")
      (sit-for 0)
      (set-buffer r2b-out-buf)

      (setq r2bv-kn (concat r2bv-primary-author r2bv-decade
			r2bv-title-first-word))

      (setq r2bv-entry-kind
	 (cond
	    ((r2b-isa-proceedings r2bv-journal)
	       (r2b-moveq r2bv-booktitle r2bv-journal)
	       (if (r2b-isa-university r2bv-institution)
		  (r2b-moveq r2bv-organization r2bv-institution)
		  (r2b-moveq r2bv-publisher r2bv-institution))
	       (r2b-moveq r2bv-note r2bv-tr)
	       (r2b-require 'r2bv-author)
	       'inproceedings)
	    ((r2b-isa-proceedings r2bv-booktitle)
	       (if (r2b-isa-university r2bv-institution)
		  (r2b-moveq r2bv-organization r2bv-institution)
		  (r2b-moveq r2bv-publisher r2bv-institution))
	       (r2b-moveq r2bv-note r2bv-tr)
	       (r2b-require 'r2bv-author)
	       'inproceedings)
	    ((and r2bv-tr (string-match "phd" r2bv-tr))
	       (r2b-moveq r2bv-school r2bv-institution)
	       (r2b-require 'r2bv-school )
	       (r2b-require 'r2bv-author)
	       'phdthesis)
	    ((and r2bv-tr (string-match "master" r2bv-tr))
	       (r2b-moveq r2bv-school r2bv-institution)
	       (r2b-require 'r2bv-school )
	       (r2b-require 'r2bv-author)
	       'mastersthesis)
	    ((and r2bv-tr (string-match "draft\\|unpublish" r2bv-tr))
	       (r2b-moveq r2bv-note r2bv-institution)
	       (r2b-require 'r2bv-author)
	       'unpublished)
	    (r2bv-journal
	       (r2b-require 'r2bv-author)
	       'article)
	    (r2bv-booktitle
	       (r2b-moveq r2bv-publisher r2bv-institution)
	       (r2b-moveq r2bv-note r2bv-tr)
	       (r2b-require 'r2bv-publisher)
	       (r2b-require 'r2bv-author)
	       'incollection)
	    ((and r2bv-author
		(null r2bv-editor)
		(string-match "\\`personal communication\\'" r2bv-title))
	       'misc)
	    ((r2b-isa-proceedings r2bv-title)
	       (if (r2b-isa-university r2bv-institution)
		  (r2b-moveq r2bv-organization r2bv-institution)
		  (r2b-moveq r2bv-publisher r2bv-institution))
	       (r2b-moveq r2bv-note r2bv-tr)
	       'proceedings)
	    ((or r2bv-editor
		(and r2bv-author
		   (or
		      (null r2bv-tr)
		      (string-match "\\bisbn\\b" r2bv-tr))))
	       (r2b-moveq r2bv-publisher r2bv-institution)
	       (r2b-moveq r2bv-note r2bv-tr)
	       (r2b-require 'r2bv-publisher)
	       (if (null r2bv-editor)
		  (r2b-require 'r2bv-author))
	       'book)
	    (r2bv-tr
	       (r2b-require 'r2bv-institution)
	       (if (string-match
		      "\\`\\(\\(.\\|\n\\)+\\)[ \t\n]+\\([^ \t\n]\\)+\\'"
		      r2bv-tr)
		  (progn
		     (setq r2bv-type (substring r2bv-tr 0 (match-end 1)))
		     (setq r2bv-number (substring r2bv-tr
					  (match-beginning 3)))
		     (setq r2bv-tr nil))
		  (r2b-moveq r2bv-number r2bv-tr))
	       (r2b-require 'r2bv-author)
	       'techreport)
	    (r2bv-institution
	       (r2b-moveq r2bv-organization r2bv-institution)
	       'manual)
	    (t
	       'misc)
	    ))

      (r2b-require '( r2bv-year))

      (if r2b-error-found
	 (princ "\n% Warning -- Errors During Conversion Next Entry\n"))

      (princ "\n@")
      (princ r2bv-entry-kind)
      (princ "( ")
      (princ r2bv-kn)

      (r2b-put-field "author" r2bv-author )
      (r2b-put-field "title" r2bv-title r2b-booktitle-abbrevs)
      (r2b-put-field "year" r2bv-year )

      (r2b-put-field "month" r2bv-month r2b-month-abbrevs)
      (r2b-put-field "journal" r2bv-journal r2b-journal-abbrevs)
      (r2b-put-field "volume" r2bv-volume)
      (r2b-put-field "type" r2bv-type)
      (r2b-put-field "number" r2bv-number)
      (r2b-put-field "booktitle" r2bv-booktitle r2b-booktitle-abbrevs)
      (r2b-put-field "editor" r2bv-editor)
      (r2b-put-field "publisher" r2bv-publisher)
      (r2b-put-field "institution" r2bv-institution)
      (r2b-put-field "organization" r2bv-organization)
      (r2b-put-field "school" r2bv-school)
      (r2b-put-field "pages" r2bv-pages)
      (r2b-put-field "address" r2bv-address)
      (r2b-put-field "note" r2bv-note)
      (r2b-put-field "keywords" r2bv-keywords)
      (r2b-put-field "where" r2bv-where)
      (r2b-put-field "ordering" r2bv-ordering)
      (r2b-put-field "annote" r2bv-annote)

      (princ " )\n")
      )
   )