Function: bibtex-remove-OPT-or-ALT
bibtex-remove-OPT-or-ALT is an interactive and byte-compiled function
defined in bibtex.el.gz.
Signature
(bibtex-remove-OPT-or-ALT &optional COMMA)
Documentation
Remove the string starting optional/alternative fields.
Align text and go thereafter to end of text. 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-remove-OPT-or-ALT (&optional comma)
"Remove the string starting optional/alternative fields.
Align text and go thereafter to end of text. Optional arg COMMA
is as in `bibtex-enclosing-field'. It is t for interactive calls."
(interactive (list t))
(let ((case-fold-search t)
(bounds (bibtex-enclosing-field comma)))
(save-excursion
(goto-char (bibtex-start-of-name-in-field bounds))
(when (and (looking-at "OPT\\|ALT")
(not (and bibtex-no-opt-remove-re
(string-match
bibtex-no-opt-remove-re
(buffer-substring-no-properties
(bibtex-start-of-name-in-field bounds)
(bibtex-end-of-name-in-field bounds))))))
(delete-region (match-beginning 0) (match-end 0))
;; make field non-OPT
(search-forward "=")
(forward-char -1)
(delete-horizontal-space)
(if bibtex-align-at-equal-sign
(indent-to-column (- bibtex-text-indentation 2))
(insert " "))
(search-forward "=")
(delete-horizontal-space)
(if bibtex-align-at-equal-sign
(insert " ")
(indent-to-column bibtex-text-indentation))))))