aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes/bibtex.el
diff options
context:
space:
mode:
authorGlenn Morris <[email protected]>2007-04-14 19:12:59 +0000
committerGlenn Morris <[email protected]>2007-04-14 19:12:59 +0000
commit84aa4fc6ee7c4602cbb712c30fc2ecef21c56f8b (patch)
tree02d7f0d7bb4ca9ee751f7f7451f7ddd0290f84f9 /lisp/textmodes/bibtex.el
parentc810a796389d675f08ebac6f39ac4e43470e1350 (diff)
(bibtex-insert-kill): Pass non-nil NODELIM arg to bibtex-make-field.
(bibtex-make-field): Add optional fourth arg NODELIM. Insert delimiters around INIT unless this arg is non-nil.
Diffstat (limited to 'lisp/textmodes/bibtex.el')
-rw-r--r--lisp/textmodes/bibtex.el18
1 files changed, 12 insertions, 6 deletions
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index 06fa3a0118..e9c52ecb8d 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -1785,7 +1785,7 @@ Optional arg COMMA is as in `bibtex-enclosing-field'."
(set-mark (point))
(message "Mark set")
(bibtex-make-field (funcall fun 'bibtex-field-kill-ring-yank-pointer
- bibtex-field-kill-ring) t))
+ bibtex-field-kill-ring) t nil t))
;; insert past the current entry
(bibtex-skip-to-valid-entry)
(set-mark (point))
@@ -3020,7 +3020,7 @@ interactive calls."
(if comment (message "%s" (nth 1 comment))
(message "No comment available")))))
-(defun bibtex-make-field (field &optional move interactive)
+(defun bibtex-make-field (field &optional move interactive nodelim)
"Make a field named FIELD in current BibTeX entry.
FIELD is either a string or a list of the form
\(FIELD-NAME COMMENT-STRING INIT ALTERNATIVE-FLAG) as in
@@ -3028,7 +3028,8 @@ FIELD is either a string or a list of the form
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."
+MOVE and INTERACTIVE are t when called interactively.
+INIT is surrounded by delimiters, unless NODELIM is non-nil."
(interactive
(list (let ((completion-ignore-case t)
(field-list (bibtex-field-list
@@ -3058,10 +3059,15 @@ MOVE and INTERACTIVE are t when called interactively."
(indent-to-column (+ bibtex-entry-offset
bibtex-text-indentation)))
(let ((init (nth 2 field)))
- (insert (cond ((stringp init) init)
+ (insert (if nodelim
+ ""
+ (bibtex-field-left-delimiter))
+ (cond ((stringp init) init)
((fboundp init) (funcall init))
- (t (concat (bibtex-field-left-delimiter)
- (bibtex-field-right-delimiter))))))
+ (t ""))
+ (if nodelim
+ ""
+ (bibtex-field-right-delimiter))))
(when interactive
;; (bibtex-find-text nil nil bibtex-help-message)
(if (memq (preceding-char) '(?} ?\")) (forward-char -1))