]> git.eshelyaron.com Git - emacs.git/commitdiff
(bibtex-field-list): Use functionp.
authorRoland Winkler <Roland.Winkler@physik.uni-erlangen.de>
Sun, 15 Apr 2007 16:05:19 +0000 (16:05 +0000)
committerRoland Winkler <Roland.Winkler@physik.uni-erlangen.de>
Sun, 15 Apr 2007 16:05:19 +0000 (16:05 +0000)
(bibtex-make-field): Check that INIT is a string. Use functionp.

lisp/ChangeLog
lisp/textmodes/bibtex.el

index af1b86a28909b346a88c943ac5b243ff21a5ed5e..2f0006b5e57c04539d2c77d162158c935b053ef1 100644 (file)
@@ -1,3 +1,8 @@
+2007-04-15  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
+
+       * textmodes/bibtex.el (bibtex-field-list): Use functionp.
+       (bibtex-make-field): Check that INIT is a string. Use functionp.
+
 2007-04-14  Glenn Morris  <rgm@gnu.org>
 
        * complete.el (PC-goto-end): New buffer-local variable.
index e9c52ecb8d63bc28cf665227578a08030e7f8c17..2c8406f86565ec7501ffd46143b47bf4ac69804c 100644 (file)
@@ -2831,7 +2831,7 @@ and `bibtex-user-optional-fields'."
         (push (list "key"
                     "Used for reference key creation if author and editor fields are missing"
                     (if (or (stringp bibtex-include-OPTkey)
-                            (fboundp bibtex-include-OPTkey))
+                            (functionp bibtex-include-OPTkey))
                         bibtex-include-OPTkey))
               optional))
     (if (member-ignore-case entry-type bibtex-include-OPTcrossref)
@@ -3029,7 +3029,7 @@ If MOVE is non-nil, move point past the present field before making
 the new field.  If INTERACTIVE is non-nil, move point to the end of
 the new field.  Otherwise move point past the new field.
 MOVE and INTERACTIVE are t when called interactively.
-INIT is surrounded by delimiters, unless NODELIM is non-nil."
+INIT is surrounded by field delimiters, unless NODELIM is non-nil."
   (interactive
    (list (let ((completion-ignore-case t)
                (field-list (bibtex-field-list
@@ -3059,14 +3059,12 @@ INIT is surrounded by delimiters, unless NODELIM is non-nil."
     (indent-to-column (+ bibtex-entry-offset
                          bibtex-text-indentation)))
   (let ((init (nth 2 field)))
-    (insert (if nodelim
-                ""
-              (bibtex-field-left-delimiter))
-            (cond ((stringp init) init)
-                  ((fboundp init) (funcall init))
-                  (t ""))
-            (if nodelim
-                ""
+    (if (not init) (setq init "")
+      (if (functionp init) (setq init (funcall init)))
+      (unless (stringp init) (error "`%s' is not a string" init)))
+    ;; NODELIM is required by `bibtex-insert-kill'
+    (if nodelim (insert init)
+      (insert (bibtex-field-left-delimiter) init
               (bibtex-field-right-delimiter))))
   (when interactive
     ;; (bibtex-find-text nil nil bibtex-help-message)