;;; refbib.el --- convert refer-style references to ones usable by Latex bib
-;; Copyright (C) 1989, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 1989, 2001-2015 Free Software Foundation, Inc.
;; Author: Henry Kautz <kautz@research.att.com>
-;; Maintainer: FSF
+;; Maintainer: emacs-devel@gnu.org
;; Keywords: bib, tex
;; This file is part of GNU Emacs.
:group 'wp)
(defcustom r2b-trace-on nil
- "*Non-nil means trace conversion."
+ "Non-nil means trace conversion."
:type 'boolean
:group 'refbib)
This is in addition to the `r2b-capitalize-title-stop-words'.")
(defcustom r2b-delimit-with-quote t
- "*If true, then use \" to delimit fields, otherwise use braces."
+ "If true, then use \" to delimit fields, otherwise use braces."
:type 'boolean
:group 'refbib)
(defun r2b-capitalize-title (s)
"Like `capitalize', but don't capitalize stop words, except the first."
- (save-excursion
- (set-buffer (get-buffer-create "$$$Scratch$$$"))
- (erase-buffer)
- (insert s)
- (r2b-capitalize-title-region (point-min) (point-max))
- (buffer-string)))
+ (with-current-buffer (get-buffer-create "$$$Scratch$$$")
+ (erase-buffer)
+ (insert s)
+ (r2b-capitalize-title-region (point-min) (point-max))
+ (buffer-string)))
;*********************************************************
(defun r2b-reset ()
(buffer-substring (match-beginning exp) (match-end exp)))
(defcustom r2b-out-buf-name "*Out*"
- "*Name of buffer for output from refer-to-bibtex."
+ "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."
+ "Name of buffer for logs errors from refer-to-bibtex."
:type 'string
:group 'refbib)
(defun r2b-convert-buffer (output)
- "Transform current buffer and append to buffer OUTPUT.
+ "Transform current buffer and append to buffer OUTPUT.
Do `\\[r2b-help]' for more info."
- (interactive
- (list (read-string "Output to buffer: " r2b-out-buf-name)))
- (save-excursion
- (setq r2b-log (get-buffer-create r2b-log-name))
- (set-buffer r2b-log)
- (erase-buffer))
- (widen)
- (goto-char (point-min))
- (message "Working, please be patient...")
- (sit-for 0)
- (while (r2b-convert-record output) t)
- (message "Done, results in %s, errors in %s"
- r2b-out-buf-name r2b-log-name)
- )
+ (interactive
+ (list (read-string "Output to buffer: " r2b-out-buf-name)))
+ (with-current-buffer (setq r2b-log (get-buffer-create r2b-log-name))
+ (erase-buffer))
+ (widen)
+ (goto-char (point-min))
+ (message "Working, please be patient...")
+ (sit-for 0)
+ (while (r2b-convert-record output) t)
+ (message "Done, results in %s, errors in %s"
+ r2b-out-buf-name r2b-log-name))
(defvar r2b-help-message
" Refer to Bibtex Bibliography Conversion
(defun r2b-help ()
- "Print help describing the `refbib' package."
- (interactive)
- (with-output-to-temp-buffer "*Help*"
- (princ r2b-help-message)
- (save-excursion
- (set-buffer standard-output)
- (help-mode))))
+ "Print help describing the `refbib' package."
+ (interactive)
+ (with-output-to-temp-buffer "*Help*"
+ (princ r2b-help-message)
+ (with-current-buffer standard-output
+ (help-mode))))
(provide 'refbib)
(provide 'refer-to-bibtex)
-;; arch-tag: 664afee2-6e76-4408-ba56-981d8a179586
;;; refbib.el ends here