Function: bibtex-kill-field

bibtex-kill-field is an interactive and byte-compiled function defined in bibtex.el.gz.

Signature

(bibtex-kill-field &optional COPY-ONLY COMMA)

Documentation

Kill the entire enclosing BibTeX field.

With prefix arg COPY-ONLY, copy the current field to bibtex-field-kill-ring, but do not actually kill it. Optional arg COMMA is as in bibtex-enclosing-field. It is t for interactive calls.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/bibtex.el.gz
(defun bibtex-kill-field (&optional copy-only comma)
  "Kill the entire enclosing BibTeX field.
With prefix arg COPY-ONLY, copy the current field to `bibtex-field-kill-ring',
but do not actually kill it.  Optional arg COMMA is as in
`bibtex-enclosing-field'.  It is t for interactive calls."
  (interactive (list current-prefix-arg t))
  (save-excursion
    (let* ((case-fold-search t)
           (bounds (bibtex-enclosing-field comma))
           (end (bibtex-end-of-field bounds))
           (beg (bibtex-start-of-field bounds)))
      (goto-char end)
      ;; Preserve white space at end of BibTeX entry
      (if (looking-at "[ \t\n]*[)}]")
          (progn (skip-chars-backward " \t\n")
                 (setq end (point)))
        (skip-chars-forward ","))
      (push (list (bibtex-name-in-field bounds) nil
                  (bibtex-text-in-field-bounds bounds))
            bibtex-field-kill-ring)
      (if (> (length bibtex-field-kill-ring) bibtex-field-kill-ring-max)
          (setcdr (nthcdr (1- bibtex-field-kill-ring-max)
                          bibtex-field-kill-ring)
                  nil))
      (setq bibtex-field-kill-ring-yank-pointer bibtex-field-kill-ring)
      (unless copy-only
        (delete-region beg end))))
  (setq bibtex-last-kill-command 'field))