]> code.delx.au - gnu-emacs/blobdiff - lisp/textmodes/bib-mode.el
Merge from emacs-24; up to 2012-04-21T14:12:27Z!sdl.web@gmail.com
[gnu-emacs] / lisp / textmodes / bib-mode.el
index d7aa455ef8f7b67f211ca26004ba2c722214e304..c8881fa5f9d6c76da828f6c9231459e2d96ab4aa 100644 (file)
@@ -1,17 +1,18 @@
 ;;; bib-mode.el --- major mode for editing bib files
 
-;; Copyright (C) 1989, 2001, 2002, 2003, 2004, 2005,
-;;   2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 1989, 2001-2012  Free Software Foundation, Inc.
 
+;; Author: Henry Kautz
+;; (according to authors.el)
 ;; Maintainer: FSF
 ;; Keywords: bib
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,9 +20,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
    :type 'file
    :group 'bib)
 
-(defvar bib-mode-map (copy-keymap text-mode-map))
-(define-key bib-mode-map "\C-M" 'return-key-bib)
-(define-key bib-mode-map "\C-c\C-u" 'unread-bib)
-(define-key bib-mode-map "\C-c\C-@" 'mark-bib)
-(define-key bib-mode-map "\e`" 'abbrev-mode)
+(defvar bib-mode-map
+  (let ((map (make-sparse-keymap)))
+    (set-keymap-parent map text-mode-map)
+    (define-key map "\C-M" 'return-key-bib)
+    (define-key map "\C-c\C-u" 'unread-bib)
+    (define-key map "\C-c\C-@" 'mark-bib)
+    (define-key map "\e`" 'abbrev-mode)
+    map))
 
 (defun addbib ()
    "Set up editor to add to troff bibliography file specified
@@ -135,7 +137,7 @@ with the cdr.")
 
 
 (defcustom bib-auto-capitalize t
-  "*True to automatically capitalize appropriate fields in Bib mode."
+  "True to automatically capitalize appropriate fields in Bib mode."
   :type 'boolean
   :group 'bib)
 
@@ -228,14 +230,12 @@ named by variable `unread-bib-file'."
 
 (defun bib-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)
-      (bib-capitalize-title-region (point-min) (point-max))
-      (buffer-string)))
+   (with-current-buffer (get-buffer-create "$$$Scratch$$$")
+     (erase-buffer)
+     (insert s)
+     (bib-capitalize-title-region (point-min) (point-max))
+     (buffer-string)))
 
 (provide 'bib-mode)
 
-;; arch-tag: e3a97958-3c2c-487f-9557-fafc3c98452d
 ;;; bib-mode.el ends here