;**********************************************************
; User Parameters
-(defvar r2b-trace-on nil "*trace conversion")
-
-(defvar r2b-journal-abbrevs
- '(
- )
- " Abbreviation list for journal names.
+(defgroup refbib nil
+ "Convert refer-style references to ones usable by Latex bib."
+ :prefix "r2b-"
+ :group 'wp)
+
+(defcustom r2b-trace-on nil
+ "*Non-nil means trace conversion."
+ :type 'boolean
+ :group 'refbib)
+
+(defcustom r2b-journal-abbrevs
+ '(
+ )
+ "Abbreviation list for journal names.
If the car of an element matches a journal name exactly, it is replaced by
the cadr when output. Braces must be included if replacement is a
{string}, but not if replacement is a bibtex abbreviation. The cadr
For example, a value of '((\"Aij\" \"{Artificial Intelligence}\")
\(\"Ijcai81\" \"ijcai7\")) would expand Aij to the text string
\"Artificial Intelligence\", but would replace Ijcai81 with the
-BibTeX macro \"ijcai7\".")
-
-(defvar r2b-booktitle-abbrevs
- '(
- )
- " Abbreviation list for book and proceedings names. If the car of
-an element matches a title or booktitle exactly, it is replaced by
-the cadr when output. Braces must be included if replacement is
-a {string}, but not if replacement is a bibtex abbreviation. The cadr
-may be eliminated if is exactly the same as the car.
+BibTeX macro \"ijcai7\"."
+ :type '(repeat (list string string))
+ :group 'refbib)
+
+(defcustom r2b-booktitle-abbrevs
+ '(
+ )
+ "Abbreviation list for book and proceedings names.
+If the car of an element matches a title or booktitle exactly, it is
+replaced by the cadr when output. Braces must be included if
+replacement is a {string}, but not if replacement is a bibtex
+abbreviation. The cadr may be eliminated if is exactly the same as
+the car.
Because titles are capitalized before matching, the abbreviated title
should be listed as beginning with a capital letter, even if it doesn't.
For example, a value of '((\"Aij\" \"{Artificial Intelligence}\")
\(\"Ijcai81\" \"ijcai7\")) would expand Aij to the text string
\"Artificial Intelligence\", but would replace Ijcai81 with the
-BibTeX macro \"ijcai7\".")
+BibTeX macro \"ijcai7\"."
+ :type '(repeat (list string string))
+ :group 'refbib)
-(defvar r2b-proceedings-list
- '()
- " Assoc list of books or journals which are really conference proceedings,
+(defcustom r2b-proceedings-list
+ '()
+ "Assoc list of books or journals which are really conference proceedings,
but whose name and whose abbrev expansion (as defined in `r2b-journal-abbrevs'
and `r2b-booktitle-abbrevs') does not contain the words \"conference\" or
\"proceedings\". (Those cases are handled automatically.)
`r2b-proceedings-list' should be '((\"Ijcai81\") ...). If instead its
expansion were \"Proceedings of the Seventh International Conference
on Artificial Intelligence\", then you would NOT need to include Ijcai81
-in `r2b-proceedings-list' (although it wouldn't cause an error).")
+in `r2b-proceedings-list' (although it wouldn't cause an error)."
+ :type '(repeat (list string string))
+ :group 'refbib)
(defvar r2b-additional-stop-words
- "Some\\|What"
- "Words not to be used to build the citation key.
+ "Some\\|What"
+ "Words not to be used to build the citation key.
This is in addition to the `r2b-capitalize-title-stop-words'.")
-(defvar r2b-delimit-with-quote
- t
- "*If true, then use \" to delimit fields, otherwise use braces")
+(defcustom r2b-delimit-with-quote t
+ "*If true, then use \" to delimit fields, otherwise use braces."
+ :type 'boolean
+ :group 'refbib)
;**********************************************************
; Utility Functions
"Returns string matched in current buffer."
(buffer-substring (match-beginning exp) (match-end exp)))
-(defvar r2b-out-buf-name "*Out*" "*output from refer-to-bibtex" )
-(defvar r2b-log-name "*Log*" "*logs errors from refer-to-bibtex" )
+(defcustom r2b-out-buf-name "*Out*"
+ "*Name of buffer for output from refer-to-bibtex."
+ :type 'string
+ :group 'refbib)
+
+(defcustom r2b-log-name "*Log*"
+ "*Name of buffer for logs errors from refer-to-bibtex."
+ :type 'string
+ :group 'refbib)
+
(defvar r2b-in-buf nil)
(defvar r2b-out-buf nil)
(defvar r2b-log nil)
(defun r2b-convert-buffer (output-name)
- "Transform current buffer and append to buffer OUTPUT;
-do \"M-x r2b-help\" for more info."
+ "Transform current buffer and append to buffer OUTPUT.
+Do `M-x r2b-help' for more info."
(interactive
(list (read-string "Output to buffer: " r2b-out-buf-name)))
(save-excursion
r2b-out-buf-name r2b-log-name)
)
-(defvar r2b-load-quietly nil "*Don't print help message when loaded")
-
(defvar r2b-help-message
" Refer to Bibtex Bibliography Conversion
r2b-proceedings-list
for information on these features.
-If you don't want to see this help message when you load this utility,
-then include the following line in your .emacs file:
- (setq r2b-load-quietly t)
-To see this message again, perform
- M-x r2b-help
Please send bug reports and suggestions to
Henry Kautz
kautz@research.att.com
(defun r2b-help ()
- "Print help message."
+ "Print help describing the `refbib' package."
(interactive)
(with-output-to-temp-buffer "*Help*"
(princ r2b-help-message)
(set-buffer standard-output)
(help-mode))))
-(if (not r2b-load-quietly)
- (r2b-help))
-
-(message "r2b loaded")
-
+(provide 'refbib)
(provide 'refer-to-bibtex)
;;; refbib.el ends here