diff options
| author | Richard M. Stallman | 1998-06-24 04:31:20 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-06-24 04:31:20 +0000 |
| commit | f0cb603469742949a90b11d907466f6cf7659030 (patch) | |
| tree | ba42e823eac5c23cf462dbf7fdb81abcf0edf8fd | |
| parent | f1df0d6764fd9192212a7805d2fe120572d60eb8 (diff) | |
| download | emacs-f0cb603469742949a90b11d907466f6cf7659030.tar.gz emacs-f0cb603469742949a90b11d907466f6cf7659030.zip | |
Numerous documentation fixups.
Delete periods from error messages.
(bibtex-move-outside-of-entry): If outside an entry,
try not to move point, or only move it minimally.
(bibtex-autokey-get-titlestring): Omit delimiters.
| -rw-r--r-- | lisp/textmodes/bibtex.el | 176 |
1 files changed, 101 insertions, 75 deletions
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index b8c1b0e5398..84ad51e3353 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el | |||
| @@ -111,7 +111,7 @@ of this variable for details)." | |||
| 111 | 111 | ||
| 112 | (defcustom bibtex-entry-format '(opts-or-alts numerical-fields) | 112 | (defcustom bibtex-entry-format '(opts-or-alts numerical-fields) |
| 113 | "*Controls type of formatting performed by `bibtex-clean-entry'. | 113 | "*Controls type of formatting performed by `bibtex-clean-entry'. |
| 114 | It may be t, nil, or a list of symbols out of the following: | 114 | It may be t, nil, or a list of symbols out of the following: |
| 115 | opts-or-alts Delete empty optional and alternative fields and | 115 | opts-or-alts Delete empty optional and alternative fields and |
| 116 | remove OPT and ALT prefixes from used fields. | 116 | remove OPT and ALT prefixes from used fields. |
| 117 | numerical-fields Delete delimiters around numeral fields. | 117 | numerical-fields Delete delimiters around numeral fields. |
| @@ -124,7 +124,7 @@ inherit-booktitle If entry contains a crossref field and booktitle | |||
| 124 | correctly sorted. | 124 | correctly sorted. |
| 125 | realign Realign entries, so that field texts and perhaps equal | 125 | realign Realign entries, so that field texts and perhaps equal |
| 126 | signs (depending on the value of | 126 | signs (depending on the value of |
| 127 | bibtex-align-at-equal-sign) begin in the same column. | 127 | `bibtex-align-at-equal-sign') begin in the same column. |
| 128 | last-comma Add or delete comma on end of last field in entry, | 128 | last-comma Add or delete comma on end of last field in entry, |
| 129 | according to value of `bibtex-comma-after-last-field'. | 129 | according to value of `bibtex-comma-after-last-field'. |
| 130 | delimiters Change delimiters according to variables | 130 | delimiters Change delimiters according to variables |
| @@ -156,7 +156,7 @@ narrowed to just the entry." | |||
| 156 | (defcustom bibtex-sort-ignore-string-entries t | 156 | (defcustom bibtex-sort-ignore-string-entries t |
| 157 | "*If non-nil, BibTeX @String entries are not sort-significant. | 157 | "*If non-nil, BibTeX @String entries are not sort-significant. |
| 158 | That means they are ignored when determining ordering of the buffer | 158 | That means they are ignored when determining ordering of the buffer |
| 159 | (e.g. sorting, locating alphabetical position for new entries, etc.). | 159 | (e.g., sorting, locating alphabetical position for new entries, etc.). |
| 160 | This variable is buffer-local." | 160 | This variable is buffer-local." |
| 161 | :group 'bibtex | 161 | :group 'bibtex |
| 162 | :type 'boolean) | 162 | :type 'boolean) |
| @@ -164,7 +164,7 @@ This variable is buffer-local." | |||
| 164 | 164 | ||
| 165 | (defcustom bibtex-maintain-sorted-entries nil | 165 | (defcustom bibtex-maintain-sorted-entries nil |
| 166 | "*If non-nil, BibTeX mode maintains all BibTeX entries in sorted order. | 166 | "*If non-nil, BibTeX mode maintains all BibTeX entries in sorted order. |
| 167 | Setting this variable to nil will strip off some comfort (e.g. TAB | 167 | Setting this variable to nil will strip off some comfort (e.g., TAB |
| 168 | completion for reference keys in minibuffer, automatic detection of | 168 | completion for reference keys in minibuffer, automatic detection of |
| 169 | duplicates) from BibTeX mode. See also `bibtex-sort-ignore-string-entries'. | 169 | duplicates) from BibTeX mode. See also `bibtex-sort-ignore-string-entries'. |
| 170 | This variable is buffer-local." | 170 | This variable is buffer-local." |
| @@ -184,7 +184,7 @@ This variable is buffer-local." | |||
| 184 | 184 | ||
| 185 | (defcustom bibtex-parse-keys-timeout 60 | 185 | (defcustom bibtex-parse-keys-timeout 60 |
| 186 | "*Specifies interval for parsing buffers. | 186 | "*Specifies interval for parsing buffers. |
| 187 | All BibTeX buffers in emacs are parsed if emacs has been idle | 187 | All BibTeX buffers in Emacs are parsed if Emacs has been idle |
| 188 | `bibtex-parse-keys-timeout' seconds. Only buffers which were modified | 188 | `bibtex-parse-keys-timeout' seconds. Only buffers which were modified |
| 189 | after last parsing and which are maintained in sorted order are parsed." | 189 | after last parsing and which are maintained in sorted order are parsed." |
| 190 | :group 'bibtex | 190 | :group 'bibtex |
| @@ -204,7 +204,7 @@ after last parsing and which are maintained in sorted order are parsed." | |||
| 204 | ((("author" "Author1 [and Author2 ...] [and others]") | 204 | ((("author" "Author1 [and Author2 ...] [and others]") |
| 205 | ("title" "Title of the article (BibTeX converts it to lowercase)")) | 205 | ("title" "Title of the article (BibTeX converts it to lowercase)")) |
| 206 | (("pages" "Pages in the journal") | 206 | (("pages" "Pages in the journal") |
| 207 | ("journal" "Name of the journal (use string, remove braces)") | 207 | ("journal" "Name of the journal (use string, remove braces)") |
| 208 | ("year" "Year of publication") | 208 | ("year" "Year of publication") |
| 209 | ("volume" "Volume of the journal") | 209 | ("volume" "Volume of the journal") |
| 210 | ("number" "Number of the journal") | 210 | ("number" "Number of the journal") |
| @@ -396,7 +396,7 @@ triples. | |||
| 396 | If the third element is nil, the first pair is always used. | 396 | If the third element is nil, the first pair is always used. |
| 397 | If not, the second pair is used in the case of presence of a crossref | 397 | If not, the second pair is used in the case of presence of a crossref |
| 398 | field and the third in the case of absence. | 398 | field and the third in the case of absence. |
| 399 | REQUIRED, OPTIONAL, CROSSREF-REQUIRED and CROSSREF-OPTIONAL are lists. | 399 | REQUIRED, OPTIONAL, CROSSREF-REQUIRED and CROSSREF-OPTIONAL are lists. |
| 400 | Each element of these lists is a list of the form | 400 | Each element of these lists is a list of the form |
| 401 | (FIELD-NAME COMMENT-STRING INIT ALTERNATIVE-FLAG). | 401 | (FIELD-NAME COMMENT-STRING INIT ALTERNATIVE-FLAG). |
| 402 | COMMENT-STRING, INIT, and ALTERNATIVE-FLAG are optional. | 402 | COMMENT-STRING, INIT, and ALTERNATIVE-FLAG are optional. |
| @@ -446,7 +446,7 @@ element is a list with just one element: the string." | |||
| 446 | "*List of BibTeX files containing string definitions. | 446 | "*List of BibTeX files containing string definitions. |
| 447 | Those files must be specified using pathnames relative to the | 447 | Those files must be specified using pathnames relative to the |
| 448 | directories specified in `bibtex-string-file-path'. This variable is only | 448 | directories specified in `bibtex-string-file-path'. This variable is only |
| 449 | evaluated when BibTeX mode is entered (i. e. when loading the BibTeX | 449 | evaluated when BibTeX mode is entered (i.e., when loading the BibTeX |
| 450 | file)." | 450 | file)." |
| 451 | :group 'bibtex | 451 | :group 'bibtex |
| 452 | :type '(repeat file)) | 452 | :type '(repeat file)) |
| @@ -664,7 +664,7 @@ See the documentation of function `bibtex-generate-autokey' for details." | |||
| 664 | "Function to call before the generated key is presented. | 664 | "Function to call before the generated key is presented. |
| 665 | If non-nil this should be a single function, which is called before | 665 | If non-nil this should be a single function, which is called before |
| 666 | the generated key is presented (in entry or, if | 666 | the generated key is presented (in entry or, if |
| 667 | `bibtex-autokey-edit-before-use' is t, in minibuffer). This function | 667 | `bibtex-autokey-edit-before-use' is t, in minibuffer). This function |
| 668 | must take one argument (the automatically generated key), and must | 668 | must take one argument (the automatically generated key), and must |
| 669 | return with a string (the key to use)." | 669 | return with a string (the key to use)." |
| 670 | :group 'bibtex-autokey | 670 | :group 'bibtex-autokey |
| @@ -989,7 +989,7 @@ the value of `bibtex-text-indentation', minus 2." | |||
| 989 | (concat | 989 | (concat |
| 990 | "{" | 990 | "{" |
| 991 | "\\(" | 991 | "\\(" |
| 992 | bibtex-field-string-part-not-braced | 992 | bibtex-field-string-part-not-braced |
| 993 | "\\|" | 993 | "\\|" |
| 994 | "\\(" bibtex-field-string-part-no-inner-braces "\\)" | 994 | "\\(" bibtex-field-string-part-no-inner-braces "\\)" |
| 995 | "\\)*" | 995 | "\\)*" |
| @@ -1028,7 +1028,7 @@ the value of `bibtex-text-indentation', minus 2." | |||
| 1028 | "\\(" | 1028 | "\\(" |
| 1029 | "[^\"\\]" ;; every character except quote or backslash | 1029 | "[^\"\\]" ;; every character except quote or backslash |
| 1030 | "\\|" | 1030 | "\\|" |
| 1031 | ;; "\\(" "\"[a-z-]" "\\)" ;; a quote followed by a letter or dash | 1031 | ;; "\\(" "\"[a-z-]" "\\)" ;; a quote followed by a letter or dash |
| 1032 | ;; "\\|" | 1032 | ;; "\\|" |
| 1033 | ;; last two lines commented out until lines like | 1033 | ;; last two lines commented out until lines like |
| 1034 | ;; author = "Stefan Sch"of" | 1034 | ;; author = "Stefan Sch"of" |
| @@ -1120,7 +1120,7 @@ the value of `bibtex-text-indentation', minus 2." | |||
| 1120 | (list bibtex-type-in-head 'font-lock-function-name-face) | 1120 | (list bibtex-type-in-head 'font-lock-function-name-face) |
| 1121 | (list bibtex-key-in-head 'font-lock-constant-face nil t)) | 1121 | (list bibtex-key-in-head 'font-lock-constant-face nil t)) |
| 1122 | ;; comments | 1122 | ;; comments |
| 1123 | (list | 1123 | (list |
| 1124 | (concat "^\\([ \t]*" bibtex-comment-start ".*\\)$") | 1124 | (concat "^\\([ \t]*" bibtex-comment-start ".*\\)$") |
| 1125 | 1 'font-lock-comment-face) | 1125 | 1 'font-lock-comment-face) |
| 1126 | ;; optional field names (treated as comments) | 1126 | ;; optional field names (treated as comments) |
| @@ -1320,7 +1320,7 @@ the value of `bibtex-text-indentation', minus 2." | |||
| 1320 | (goto-char (match-beginning 0)) | 1320 | (goto-char (match-beginning 0)) |
| 1321 | (if (equal noerror nil) | 1321 | (if (equal noerror nil) |
| 1322 | ;; yell | 1322 | ;; yell |
| 1323 | (error "Search of BibTeX reference failed.")) | 1323 | (error "Search of BibTeX reference failed")) |
| 1324 | (if (equal noerror t) | 1324 | (if (equal noerror t) |
| 1325 | ;; don't move | 1325 | ;; don't move |
| 1326 | (goto-char pnt)) | 1326 | (goto-char pnt)) |
| @@ -1361,7 +1361,7 @@ the value of `bibtex-text-indentation', minus 2." | |||
| 1361 | (point)) | 1361 | (point)) |
| 1362 | (if (equal noerror nil) | 1362 | (if (equal noerror nil) |
| 1363 | ;; yell | 1363 | ;; yell |
| 1364 | (error "Search of BibTeX reference failed.")) | 1364 | (error "Search of BibTeX reference failed")) |
| 1365 | (if (equal noerror t) | 1365 | (if (equal noerror t) |
| 1366 | ;; don't move | 1366 | ;; don't move |
| 1367 | (goto-char pnt)) | 1367 | (goto-char pnt)) |
| @@ -1393,8 +1393,20 @@ the value of `bibtex-text-indentation', minus 2." | |||
| 1393 | 1393 | ||
| 1394 | (defun bibtex-move-outside-of-entry () | 1394 | (defun bibtex-move-outside-of-entry () |
| 1395 | ;; Make sure we are outside of a BibTeX entry. | 1395 | ;; Make sure we are outside of a BibTeX entry. |
| 1396 | (let ((orig-point (point))) | ||
| 1396 | (bibtex-end-of-entry) | 1397 | (bibtex-end-of-entry) |
| 1397 | (skip-chars-forward " \t\n")) | 1398 | (if (< (point) orig-point) |
| 1399 | ;; We moved backward, so we weren't inside an entry to begin with. | ||
| 1400 | ;; Leave point at the beginning of a line, and preferably | ||
| 1401 | ;; at the beginning of a paragraph. | ||
| 1402 | (progn | ||
| 1403 | (goto-char orig-point) | ||
| 1404 | (beginning-of-line 1) | ||
| 1405 | (if (not (= ?\n (char-before (1- (point))))) | ||
| 1406 | (progn | ||
| 1407 | (re-search-forward "^[ \t]*[@\n]" nil 'move) | ||
| 1408 | (backward-char 1))))) | ||
| 1409 | (skip-chars-forward " \t\n"))) | ||
| 1398 | 1410 | ||
| 1399 | (defun bibtex-beginning-of-first-entry () | 1411 | (defun bibtex-beginning-of-first-entry () |
| 1400 | ;; Go to the beginning of the first BibTeX entry in buffer. Return | 1412 | ;; Go to the beginning of the first BibTeX entry in buffer. Return |
| @@ -1440,7 +1452,7 @@ the value of `bibtex-text-indentation', minus 2." | |||
| 1440 | (goto-char old-point) | 1452 | (goto-char old-point) |
| 1441 | (if noerr | 1453 | (if noerr |
| 1442 | (setq success nil) | 1454 | (setq success nil) |
| 1443 | (error "Can't find enclosing BibTeX field."))) | 1455 | (error "Can't find enclosing BibTeX field"))) |
| 1444 | (if (or (not (re-search-forward bibtex-field nil t)) | 1456 | (if (or (not (re-search-forward bibtex-field nil t)) |
| 1445 | (< (match-end 0) old-point) | 1457 | (< (match-end 0) old-point) |
| 1446 | (> (match-beginning 0) old-point)) | 1458 | (> (match-beginning 0) old-point)) |
| @@ -1448,7 +1460,7 @@ the value of `bibtex-text-indentation', minus 2." | |||
| 1448 | (goto-char old-point) | 1460 | (goto-char old-point) |
| 1449 | (if noerr | 1461 | (if noerr |
| 1450 | (setq success nil) | 1462 | (setq success nil) |
| 1451 | (error "Can't find enclosing BibTeX field."))))) | 1463 | (error "Can't find enclosing BibTeX field"))))) |
| 1452 | success)) | 1464 | success)) |
| 1453 | 1465 | ||
| 1454 | (defun bibtex-enclosing-reference-maybe-empty-head () | 1466 | (defun bibtex-enclosing-reference-maybe-empty-head () |
| @@ -1461,18 +1473,18 @@ the value of `bibtex-text-indentation', minus 2." | |||
| 1461 | (re-search-backward | 1473 | (re-search-backward |
| 1462 | bibtex-reference-maybe-empty-head nil t)) | 1474 | bibtex-reference-maybe-empty-head nil t)) |
| 1463 | (progn | 1475 | (progn |
| 1464 | (error "Can't find enclosing BibTeX reference.") | 1476 | (error "Can't find enclosing BibTeX reference") |
| 1465 | (goto-char old-point))) | 1477 | (goto-char old-point))) |
| 1466 | (goto-char (match-beginning bibtex-type-in-head)) | 1478 | (goto-char (match-beginning bibtex-type-in-head)) |
| 1467 | (if (not | 1479 | (if (not |
| 1468 | (bibtex-search-reference t nil t)) | 1480 | (bibtex-search-reference t nil t)) |
| 1469 | (progn | 1481 | (progn |
| 1470 | (error "Can't find enclosing BibTeX reference.") | 1482 | (error "Can't find enclosing BibTeX reference") |
| 1471 | (goto-char old-point))))) | 1483 | (goto-char old-point))))) |
| 1472 | 1484 | ||
| 1473 | (defun bibtex-insert-current-kill (n) | 1485 | (defun bibtex-insert-current-kill (n) |
| 1474 | (if (not bibtex-last-kill-command) | 1486 | (if (not bibtex-last-kill-command) |
| 1475 | (error "BibTeX kill ring is empty.") | 1487 | (error "BibTeX kill ring is empty") |
| 1476 | (let* ((kr (if (equal bibtex-last-kill-command 'field) | 1488 | (let* ((kr (if (equal bibtex-last-kill-command 'field) |
| 1477 | 'bibtex-field-kill-ring | 1489 | 'bibtex-field-kill-ring |
| 1478 | 'bibtex-entry-kill-ring)) | 1490 | 'bibtex-entry-kill-ring)) |
| @@ -1501,7 +1513,7 @@ the value of `bibtex-text-indentation', minus 2." | |||
| 1501 | (insert (elt current 1))) | 1513 | (insert (elt current 1))) |
| 1502 | (t | 1514 | (t |
| 1503 | (error | 1515 | (error |
| 1504 | "Unknown tag field: %s. Please submit a bug report." | 1516 | "Unknown tag field: %s. Please submit a bug report" |
| 1505 | bibtex-last-kill-command)))))) | 1517 | bibtex-last-kill-command)))))) |
| 1506 | 1518 | ||
| 1507 | (defun bibtex-format-entry () | 1519 | (defun bibtex-format-entry () |
| @@ -1515,7 +1527,7 @@ the value of `bibtex-text-indentation', minus 2." | |||
| 1515 | non-empty-alternative) | 1527 | non-empty-alternative) |
| 1516 | (let ((end (copy-marker (bibtex-end-of-entry)))) | 1528 | (let ((end (copy-marker (bibtex-end-of-entry)))) |
| 1517 | (if (equal start (marker-position end)) | 1529 | (if (equal start (marker-position end)) |
| 1518 | (error "Not on a known BibTeX entry.") | 1530 | (error "Not on a known BibTeX entry") |
| 1519 | (goto-char start) | 1531 | (goto-char start) |
| 1520 | (while (re-search-forward bibtex-field end t) | 1532 | (while (re-search-forward bibtex-field end t) |
| 1521 | ;; determine if reference has crossref entry and if at least | 1533 | ;; determine if reference has crossref entry and if at least |
| @@ -1545,7 +1557,7 @@ the value of `bibtex-text-indentation', minus 2." | |||
| 1545 | (not non-empty-alternative)) | 1557 | (not non-empty-alternative)) |
| 1546 | (progn | 1558 | (progn |
| 1547 | (goto-char beg) | 1559 | (goto-char beg) |
| 1548 | (error "All alternatives are empty."))) | 1560 | (error "All alternatives are empty"))) |
| 1549 | (goto-char start) | 1561 | (goto-char start) |
| 1550 | (re-search-forward bibtex-reference-type end) | 1562 | (re-search-forward bibtex-reference-type end) |
| 1551 | (let* ((begin-type (1+ (match-beginning 0))) | 1563 | (let* ((begin-type (1+ (match-beginning 0))) |
| @@ -1616,7 +1628,7 @@ the value of `bibtex-text-indentation', minus 2." | |||
| 1616 | (goto-char begin-name) | 1628 | (goto-char begin-name) |
| 1617 | (bibtex-remove-OPT-or-ALT) | 1629 | (bibtex-remove-OPT-or-ALT) |
| 1618 | (error | 1630 | (error |
| 1619 | "Mandatory field ``%s'' is empty." field-name)) | 1631 | "Mandatory field ``%s'' is empty" field-name)) |
| 1620 | ;; field is optional | 1632 | ;; field is optional |
| 1621 | (delete-region begin-field end-field)) | 1633 | (delete-region begin-field end-field)) |
| 1622 | ;; otherwise: not empty, delete "OPT" | 1634 | ;; otherwise: not empty, delete "OPT" |
| @@ -1683,7 +1695,7 @@ the value of `bibtex-text-indentation', minus 2." | |||
| 1683 | (goto-char begin-text) | 1695 | (goto-char begin-text) |
| 1684 | (forward-char) | 1696 | (forward-char) |
| 1685 | (insert | 1697 | (insert |
| 1686 | (buffer-substring-no-properties | 1698 | (buffer-substring-no-properties |
| 1687 | (1+ (match-beginning bibtex-text-in-field)) | 1699 | (1+ (match-beginning bibtex-text-in-field)) |
| 1688 | (1- (match-end bibtex-text-in-field)))))))) | 1700 | (1- (match-end bibtex-text-in-field)))))))) |
| 1689 | (if (progn | 1701 | (if (progn |
| @@ -1701,7 +1713,7 @@ the value of `bibtex-text-indentation', minus 2." | |||
| 1701 | (assoc-ignore-case | 1713 | (assoc-ignore-case |
| 1702 | field-name req))) | 1714 | field-name req))) |
| 1703 | (error | 1715 | (error |
| 1704 | "Mandatory field ``%s'' is empty." field-name)))) | 1716 | "Mandatory field ``%s'' is empty" field-name)))) |
| 1705 | (if (memq 'unify-case format) | 1717 | (if (memq 'unify-case format) |
| 1706 | (let* ((fl | 1718 | (let* ((fl |
| 1707 | (car (cdr (assoc-ignore-case | 1719 | (car (cdr (assoc-ignore-case |
| @@ -1769,8 +1781,8 @@ the value of `bibtex-text-indentation', minus 2." | |||
| 1769 | 1781 | ||
| 1770 | (defun bibtex-autokey-abbrev (string len) | 1782 | (defun bibtex-autokey-abbrev (string len) |
| 1771 | ;; Returns an abbreviation of string with at least len | 1783 | ;; Returns an abbreviation of string with at least len |
| 1772 | ;; characters. String is aborted only after a consonant or at the | 1784 | ;; characters. String is aborted only after a consonant or at the |
| 1773 | ;; word end. If len is not a number, string is returned unchanged. | 1785 | ;; word end. If len is not a number, string is returned unchanged. |
| 1774 | (cond ((or | 1786 | (cond ((or |
| 1775 | (not (numberp len)) | 1787 | (not (numberp len)) |
| 1776 | (<= (length string) len)) | 1788 | (<= (length string) len)) |
| @@ -1917,8 +1929,8 @@ the value of `bibtex-text-indentation', minus 2." | |||
| 1917 | (bibtex-cfield "title" bibtex-field-text) max t) | 1929 | (bibtex-cfield "title" bibtex-field-text) max t) |
| 1918 | (bibtex-autokey-change | 1930 | (bibtex-autokey-change |
| 1919 | (buffer-substring-no-properties | 1931 | (buffer-substring-no-properties |
| 1920 | (match-beginning bibtex-text-in-cfield) | 1932 | (1+ (match-beginning bibtex-text-in-cfield)) |
| 1921 | (match-end bibtex-text-in-cfield)) | 1933 | (1- (match-end bibtex-text-in-cfield))) |
| 1922 | bibtex-autokey-titleword-change-strings) | 1934 | bibtex-autokey-titleword-change-strings) |
| 1923 | ""))) | 1935 | ""))) |
| 1924 | (index 0) | 1936 | (index 0) |
| @@ -1954,7 +1966,7 @@ the value of `bibtex-text-indentation', minus 2." | |||
| 1954 | titleword | 1966 | titleword |
| 1955 | bibtex-autokey-titleword-ignore) | 1967 | bibtex-autokey-titleword-ignore) |
| 1956 | (setq counter (1- counter)) | 1968 | (setq counter (1- counter)) |
| 1957 | (setq | 1969 | (setq |
| 1958 | titleword | 1970 | titleword |
| 1959 | (funcall bibtex-autokey-titleword-case-convert titleword)) | 1971 | (funcall bibtex-autokey-titleword-case-convert titleword)) |
| 1960 | (if (or (not (numberp bibtex-autokey-titlewords)) | 1972 | (if (or (not (numberp bibtex-autokey-titlewords)) |
| @@ -2057,7 +2069,7 @@ The generation algorithm works as follows: | |||
| 2057 | used as the key. | 2069 | used as the key. |
| 2058 | 17. If the value of `bibtex-autokey-edit-before-use' is non-nil, | 2070 | 17. If the value of `bibtex-autokey-edit-before-use' is non-nil, |
| 2059 | the key is then presented in the minibuffer to the user, | 2071 | the key is then presented in the minibuffer to the user, |
| 2060 | where it can be edited. The key given by the user is then | 2072 | where it can be edited. The key given by the user is then |
| 2061 | used." | 2073 | used." |
| 2062 | (let* ((pnt (point)) | 2074 | (let* ((pnt (point)) |
| 2063 | (min (bibtex-beginning-of-entry)) | 2075 | (min (bibtex-beginning-of-entry)) |
| @@ -2150,12 +2162,12 @@ The generation algorithm works as follows: | |||
| 2150 | (if verbose | 2162 | (if verbose |
| 2151 | (bibtex-progress-message)) | 2163 | (bibtex-progress-message)) |
| 2152 | (let (label | 2164 | (let (label |
| 2153 | label2) | 2165 | label2) |
| 2154 | (cond | 2166 | (cond |
| 2155 | ((looking-at bibtex-reference-head) | 2167 | ((looking-at bibtex-reference-head) |
| 2156 | (setq | 2168 | (setq |
| 2157 | label | 2169 | label |
| 2158 | (buffer-substring-no-properties | 2170 | (buffer-substring-no-properties |
| 2159 | (match-beginning bibtex-key-in-head) | 2171 | (match-beginning bibtex-key-in-head) |
| 2160 | (match-end bibtex-key-in-head))) | 2172 | (match-end bibtex-key-in-head))) |
| 2161 | (let ((p (point)) | 2173 | (let ((p (point)) |
| @@ -2250,7 +2262,7 @@ The generation algorithm works as follows: | |||
| 2250 | (try-completion part-of-word completions)))) | 2262 | (try-completion part-of-word completions)))) |
| 2251 | (cond ((eq completion t) | 2263 | (cond ((eq completion t) |
| 2252 | (if complete-strings | 2264 | (if complete-strings |
| 2253 | ;; remove double-quotes or braces if field is no concatenation | 2265 | ;; remove double-quotes or braces if field is no concatenation |
| 2254 | (save-excursion | 2266 | (save-excursion |
| 2255 | (bibtex-inside-field) | 2267 | (bibtex-inside-field) |
| 2256 | (bibtex-enclosing-field) | 2268 | (bibtex-enclosing-field) |
| @@ -2261,7 +2273,7 @@ The generation algorithm works as follows: | |||
| 2261 | (equal (match-end 0) end)) | 2273 | (equal (match-end 0) end)) |
| 2262 | (bibtex-remove-delimiters)))))) | 2274 | (bibtex-remove-delimiters)))))) |
| 2263 | ((not completion) | 2275 | ((not completion) |
| 2264 | (error "Can't find completion for \"%s\"." part-of-word)) | 2276 | (error "Can't find completion for \"%s\"" part-of-word)) |
| 2265 | ((not (string= part-of-word completion)) | 2277 | ((not (string= part-of-word completion)) |
| 2266 | (delete-region beg end) | 2278 | (delete-region beg end) |
| 2267 | (insert completion) | 2279 | (insert completion) |
| @@ -2433,8 +2445,8 @@ The command \\[bibtex-clean-entry] cleans the current entry, i.e. it removes OPT | |||
| 2433 | from all non-empty optional or alternative fields, checks that no required | 2445 | from all non-empty optional or alternative fields, checks that no required |
| 2434 | fields are empty, and does some formatting dependent on the value of | 2446 | fields are empty, and does some formatting dependent on the value of |
| 2435 | bibtex-entry-format. | 2447 | bibtex-entry-format. |
| 2436 | Note: some functions in BibTeX mode depend on entries being in a special | 2448 | Note: some functions in BibTeX mode depend on entries being in a special |
| 2437 | format (all fields beginning on separate lines), so it is usually a bad | 2449 | format (all fields beginning on separate lines), so it is usually a bad |
| 2438 | idea to remove `realign' from bibtex-entry-format. | 2450 | idea to remove `realign' from bibtex-entry-format. |
| 2439 | 2451 | ||
| 2440 | Use \\[bibtex-find-text] to position the cursor at the end of the current field. | 2452 | Use \\[bibtex-find-text] to position the cursor at the end of the current field. |
| @@ -2483,8 +2495,7 @@ The following may be of interest as well: | |||
| 2483 | Entry to BibTeX mode calls the value of `bibtex-mode-hook' if that value is | 2495 | Entry to BibTeX mode calls the value of `bibtex-mode-hook' if that value is |
| 2484 | non-nil. | 2496 | non-nil. |
| 2485 | 2497 | ||
| 2486 | \\{bibtex-mode-map} | 2498 | \\{bibtex-mode-map}" |
| 2487 | " | ||
| 2488 | (interactive) | 2499 | (interactive) |
| 2489 | (kill-all-local-variables) | 2500 | (kill-all-local-variables) |
| 2490 | (use-local-map bibtex-mode-map) | 2501 | (use-local-map bibtex-mode-map) |
| @@ -2546,7 +2557,7 @@ non-nil. | |||
| 2546 | (set-buffer curbuf) | 2557 | (set-buffer curbuf) |
| 2547 | (setq bibtex-strings compl)) | 2558 | (setq bibtex-strings compl)) |
| 2548 | (error | 2559 | (error |
| 2549 | "File %s not in paths defined by bibtex-string-file-path variable." | 2560 | "File %s not in paths defined by bibtex-string-file-path variable" |
| 2550 | filename)))) | 2561 | filename)))) |
| 2551 | bibtex-string-files) | 2562 | bibtex-string-files) |
| 2552 | (if bibtex-maintain-sorted-entries | 2563 | (if bibtex-maintain-sorted-entries |
| @@ -2677,7 +2688,7 @@ behaviour, I did the following:"))) | |||
| 2677 | (message nil)))) | 2688 | (message nil)))) |
| 2678 | 2689 | ||
| 2679 | (defun bibtex-entry (entry-type) | 2690 | (defun bibtex-entry (entry-type) |
| 2680 | "Inserts a new BibTeX entry. | 2691 | "Insert a new BibTeX entry. |
| 2681 | After insertion it calls the functions in `bibtex-add-entry-hook'." | 2692 | After insertion it calls the functions in `bibtex-add-entry-hook'." |
| 2682 | (interactive (let* ((completion-ignore-case t) | 2693 | (interactive (let* ((completion-ignore-case t) |
| 2683 | (e-t (completing-read | 2694 | (e-t (completing-read |
| @@ -2698,7 +2709,7 @@ After insertion it calls the functions in `bibtex-add-entry-hook'." | |||
| 2698 | (r-n-o (elt e 1)) | 2709 | (r-n-o (elt e 1)) |
| 2699 | (c-ref (elt e 2))) | 2710 | (c-ref (elt e 2))) |
| 2700 | (if (not e) | 2711 | (if (not e) |
| 2701 | (error "Bibtex entry type %s not defined." entry-type)) | 2712 | (error "Bibtex entry type %s not defined" entry-type)) |
| 2702 | (if (and | 2713 | (if (and |
| 2703 | (member entry-type bibtex-include-OPTcrossref) | 2714 | (member entry-type bibtex-include-OPTcrossref) |
| 2704 | c-ref) | 2715 | c-ref) |
| @@ -2723,7 +2734,7 @@ After insertion it calls the functions in `bibtex-add-entry-hook'." | |||
| 2723 | (fboundp bibtex-include-OPTkey)) | 2734 | (fboundp bibtex-include-OPTkey)) |
| 2724 | (bibtex-make-optional-field | 2735 | (bibtex-make-optional-field |
| 2725 | (list "key" nil bibtex-include-OPTkey)) | 2736 | (list "key" nil bibtex-include-OPTkey)) |
| 2726 | (bibtex-make-optional-field '("key")))) | 2737 | (bibtex-make-optional-field '("key")))) |
| 2727 | (mapcar 'bibtex-make-optional-field optional) | 2738 | (mapcar 'bibtex-make-optional-field optional) |
| 2728 | (mapcar 'bibtex-make-optional-field bibtex-user-optional-fields) | 2739 | (mapcar 'bibtex-make-optional-field bibtex-user-optional-fields) |
| 2729 | (if bibtex-comma-after-last-field | 2740 | (if bibtex-comma-after-last-field |
| @@ -2745,7 +2756,7 @@ After insertion it calls the functions in `bibtex-add-entry-hook'." | |||
| 2745 | (bibtex-enclosing-field) | 2756 | (bibtex-enclosing-field) |
| 2746 | (search-failed | 2757 | (search-failed |
| 2747 | (goto-char pnt) | 2758 | (goto-char pnt) |
| 2748 | (error "Not on BibTeX field."))) | 2759 | (error "Not on BibTeX field"))) |
| 2749 | (let ((mb (match-beginning bibtex-name-in-field)) | 2760 | (let ((mb (match-beginning bibtex-name-in-field)) |
| 2750 | (me (match-end bibtex-name-in-field))) | 2761 | (me (match-end bibtex-name-in-field))) |
| 2751 | (goto-char mb) | 2762 | (goto-char mb) |
| @@ -2791,7 +2802,7 @@ After insertion it calls the functions in `bibtex-add-entry-hook'." | |||
| 2791 | 2802 | ||
| 2792 | (defun bibtex-make-field (e-t &optional called-by-yank) | 2803 | (defun bibtex-make-field (e-t &optional called-by-yank) |
| 2793 | "Makes a field named E-T in current BibTeX entry. | 2804 | "Makes a field named E-T in current BibTeX entry. |
| 2794 | This function is for interactive and non-interactive purposes. To call | 2805 | This function is for interactive and non-interactive purposes. To call |
| 2795 | it interactively, just give it no arguments and enter the field name | 2806 | it interactively, just give it no arguments and enter the field name |
| 2796 | using the minibuffer." | 2807 | using the minibuffer." |
| 2797 | (interactive "*P") | 2808 | (interactive "*P") |
| @@ -2851,7 +2862,7 @@ using the minibuffer." | |||
| 2851 | ((fboundp init) | 2862 | ((fboundp init) |
| 2852 | (funcall init)) | 2863 | (funcall init)) |
| 2853 | (t | 2864 | (t |
| 2854 | (error "%s is neither a string nor a function." init)))) | 2865 | (error "%s is neither a string nor a function" init)))) |
| 2855 | (if called-by-yank | 2866 | (if called-by-yank |
| 2856 | "" | 2867 | "" |
| 2857 | (bibtex-field-right-delimiter))) | 2868 | (bibtex-field-right-delimiter))) |
| @@ -2876,7 +2887,7 @@ of the previous entry. | |||
| 2876 | If called from a program, this function returns the new location of point." | 2887 | If called from a program, this function returns the new location of point." |
| 2877 | (interactive) | 2888 | (interactive) |
| 2878 | (let ((case-fold-search t) | 2889 | (let ((case-fold-search t) |
| 2879 | (valid-entry-head | 2890 | (valid-entry-head |
| 2880 | (concat "[ \t]*@[ \t]*\\(" | 2891 | (concat "[ \t]*@[ \t]*\\(" |
| 2881 | (mapconcat | 2892 | (mapconcat |
| 2882 | (lambda (type) | 2893 | (lambda (type) |
| @@ -2919,9 +2930,9 @@ If called from a program, this function returns the new location of point." | |||
| 2919 | (if err | 2930 | (if err |
| 2920 | (progn | 2931 | (progn |
| 2921 | (goto-char pnt) | 2932 | (goto-char pnt) |
| 2922 | (error "Syntactical incorrect entry starts here.")))) | 2933 | (error "Syntactical incorrect entry starts here")))) |
| 2923 | (point)) | 2934 | (point)) |
| 2924 | 2935 | ||
| 2925 | (defun bibtex-reposition-window (arg) | 2936 | (defun bibtex-reposition-window (arg) |
| 2926 | "Make the current BibTeX entry visible." | 2937 | "Make the current BibTeX entry visible." |
| 2927 | (interactive "P") | 2938 | (interactive "P") |
| @@ -2938,8 +2949,8 @@ If called from a program, this function returns the new location of point." | |||
| 2938 | 2949 | ||
| 2939 | (defun bibtex-count-entries (&optional count-string-entries) | 2950 | (defun bibtex-count-entries (&optional count-string-entries) |
| 2940 | "Count number of entries in current buffer or region. | 2951 | "Count number of entries in current buffer or region. |
| 2941 | With prefix argument it counts all entries, otherwise it counts all | 2952 | With prefix argument COUNT-STRING-ENTRIES it counts all entries, |
| 2942 | except Strings. | 2953 | otherwise it counts all except Strings. |
| 2943 | If mark is active it counts entries in region, if not in whole buffer." | 2954 | If mark is active it counts entries in region, if not in whole buffer." |
| 2944 | (interactive "P") | 2955 | (interactive "P") |
| 2945 | (let ((pnt (point)) | 2956 | (let ((pnt (point)) |
| @@ -2978,7 +2989,7 @@ If mark is active it counts entries in region, if not in whole buffer." | |||
| 2978 | (if (not | 2989 | (if (not |
| 2979 | (re-search-forward | 2990 | (re-search-forward |
| 2980 | (bibtex-cfield "abstract" bibtex-field-text) pnt t)) | 2991 | (bibtex-cfield "abstract" bibtex-field-text) pnt t)) |
| 2981 | (error "No abstract in entry."))) | 2992 | (error "No abstract in entry"))) |
| 2982 | (ispell-region (match-beginning bibtex-text-in-cfield) | 2993 | (ispell-region (match-beginning bibtex-text-in-cfield) |
| 2983 | (match-end bibtex-text-in-cfield))) | 2994 | (match-end bibtex-text-in-cfield))) |
| 2984 | 2995 | ||
| @@ -2991,7 +3002,7 @@ If mark is active it counts entries in region, if not in whole buffer." | |||
| 2991 | 3002 | ||
| 2992 | (defun bibtex-hide-entry-bodies (&optional arg) | 3003 | (defun bibtex-hide-entry-bodies (&optional arg) |
| 2993 | "Hide all lines between first and last BibTeX entries not beginning with @. | 3004 | "Hide all lines between first and last BibTeX entries not beginning with @. |
| 2994 | With argument, show all text." | 3005 | With prefix argument ARG, show all text." |
| 2995 | (interactive "P") | 3006 | (interactive "P") |
| 2996 | (save-excursion | 3007 | (save-excursion |
| 2997 | (bibtex-beginning-of-first-entry) | 3008 | (bibtex-beginning-of-first-entry) |
| @@ -3035,13 +3046,13 @@ ignored." | |||
| 3035 | (buffer-substring-no-properties | 3046 | (buffer-substring-no-properties |
| 3036 | (match-beginning bibtex-key-in-head) | 3047 | (match-beginning bibtex-key-in-head) |
| 3037 | (match-end bibtex-key-in-head))))))) | 3048 | (match-end bibtex-key-in-head))))))) |
| 3038 | 3049 | ||
| 3039 | (defun bibtex-find-entry-location (entry-name &optional ignore-dups) | 3050 | (defun bibtex-find-entry-location (entry-name &optional ignore-dups) |
| 3040 | "Looking for place to put the BibTeX entry named ENTRY-NAME. | 3051 | "Looking for place to put the BibTeX entry named ENTRY-NAME. |
| 3041 | Performs a binary search (therefore, buffer is assumed to be in sorted | 3052 | Performs a binary search (therefore, buffer is assumed to be in sorted |
| 3042 | order, without duplicates (see \\[bibtex-validate]), if it is | 3053 | order, without duplicates (see \\[bibtex-validate]), if it is |
| 3043 | not, bibtex-find-entry-location will fail). If entry-name is already | 3054 | not, `bibtex-find-entry-location' will fail). If entry-name is already |
| 3044 | used as a reference key, an error is signaled. However, if optional | 3055 | used as a reference key, an error is signaled. However, if optional |
| 3045 | variable IGNORE-DUPS is non-nil, no error messages about duplicate | 3056 | variable IGNORE-DUPS is non-nil, no error messages about duplicate |
| 3046 | entries are signaled, but the error handling is assumed to be made in | 3057 | entries are signaled, but the error handling is assumed to be made in |
| 3047 | the calling function. | 3058 | the calling function. |
| @@ -3090,7 +3101,7 @@ and t in all other cases." | |||
| 3090 | (if (not ignore-dups) | 3101 | (if (not ignore-dups) |
| 3091 | (progn | 3102 | (progn |
| 3092 | (bibtex-beginning-of-entry) | 3103 | (bibtex-beginning-of-entry) |
| 3093 | (error "Entry with key `%s' already exists." entry-name)))))) | 3104 | (error "Entry with key `%s' already exists" entry-name)))))) |
| 3094 | (if dup | 3105 | (if dup |
| 3095 | (progn | 3106 | (progn |
| 3096 | (bibtex-beginning-of-entry) | 3107 | (bibtex-beginning-of-entry) |
| @@ -3102,8 +3113,8 @@ and t in all other cases." | |||
| 3102 | (match-beginning bibtex-key-in-reference) | 3113 | (match-beginning bibtex-key-in-reference) |
| 3103 | (match-end bibtex-key-in-reference)))) | 3114 | (match-end bibtex-key-in-reference)))) |
| 3104 | (if (or | 3115 | (if (or |
| 3105 | (not actual-key) | 3116 | (not actual-key) |
| 3106 | (string-lessp actual-key entry-name)) | 3117 | (string-lessp actual-key entry-name)) |
| 3107 | ;; buffer contains no valid entries or | 3118 | ;; buffer contains no valid entries or |
| 3108 | ;; greater than last entry --> append | 3119 | ;; greater than last entry --> append |
| 3109 | (progn | 3120 | (progn |
| @@ -3112,7 +3123,7 @@ and t in all other cases." | |||
| 3112 | (newline (forward-line 2))) | 3123 | (newline (forward-line 2))) |
| 3113 | (beginning-of-line)) | 3124 | (beginning-of-line)) |
| 3114 | (goto-char right)) | 3125 | (goto-char right)) |
| 3115 | t))) | 3126 | t))) |
| 3116 | 3127 | ||
| 3117 | (defun bibtex-validate (&optional test-thoroughly) | 3128 | (defun bibtex-validate (&optional test-thoroughly) |
| 3118 | "Validate if buffer or region is syntactically correct. | 3129 | "Validate if buffer or region is syntactically correct. |
| @@ -3166,7 +3177,7 @@ Returns t if test was successful, nil otherwise." | |||
| 3166 | error-list | 3177 | error-list |
| 3167 | (cons (list | 3178 | (cons (list |
| 3168 | (bibtex-current-line) | 3179 | (bibtex-current-line) |
| 3169 | "Syntax error (check esp. commas, braces, and quotes)") | 3180 | "Syntax error (check esp. commas, braces, and quotes)") |
| 3170 | error-list)) | 3181 | error-list)) |
| 3171 | (forward-char))))) | 3182 | (forward-char))))) |
| 3172 | (bibtex-progress-message 'done) | 3183 | (bibtex-progress-message 'done) |
| @@ -3324,7 +3335,7 @@ Returns t if test was successful, nil otherwise." | |||
| 3324 | t))) | 3335 | t))) |
| 3325 | 3336 | ||
| 3326 | (defun bibtex-next-field (arg) | 3337 | (defun bibtex-next-field (arg) |
| 3327 | "Finds end of text of next BibTeX field; with arg, to its beginning." | 3338 | "Finds end of text of next BibTeX field; with ARG, to its beginning." |
| 3328 | (interactive "P") | 3339 | (interactive "P") |
| 3329 | (bibtex-inside-field) | 3340 | (bibtex-inside-field) |
| 3330 | (let ((start (point))) | 3341 | (let ((start (point))) |
| @@ -3371,7 +3382,7 @@ Returns t if test was successful, nil otherwise." | |||
| 3371 | (match-end 0)))) | 3382 | (match-end 0)))) |
| 3372 | (t | 3383 | (t |
| 3373 | (if (not silent) | 3384 | (if (not silent) |
| 3374 | (error "Not on BibTeX field.")))))) | 3385 | (error "Not on BibTeX field")))))) |
| 3375 | 3386 | ||
| 3376 | (defun bibtex-remove-OPT-or-ALT () | 3387 | (defun bibtex-remove-OPT-or-ALT () |
| 3377 | "Removes the string starting optional/alternative fields. | 3388 | "Removes the string starting optional/alternative fields. |
| @@ -3422,7 +3433,7 @@ Aligns text and goes thereafter to end of text." | |||
| 3422 | 3433 | ||
| 3423 | (defun bibtex-kill-field (&optional copy-only) | 3434 | (defun bibtex-kill-field (&optional copy-only) |
| 3424 | "Kills the entire enclosing BibTeX field. | 3435 | "Kills the entire enclosing BibTeX field. |
| 3425 | With prefix arg, copy the current field to `bibtex-field-kill-ring,' | 3436 | With prefix arg COPY-ONLY, copy the current field to `bibtex-field-kill-ring,' |
| 3426 | but do not actually kill it." | 3437 | but do not actually kill it." |
| 3427 | (interactive "P") | 3438 | (interactive "P") |
| 3428 | (let ((pnt (point)) | 3439 | (let ((pnt (point)) |
| @@ -3463,7 +3474,7 @@ but do not actually kill it." | |||
| 3463 | 3474 | ||
| 3464 | (defun bibtex-kill-entry (&optional copy-only) | 3475 | (defun bibtex-kill-entry (&optional copy-only) |
| 3465 | "Kill the entire enclosing BibTeX reference entry. | 3476 | "Kill the entire enclosing BibTeX reference entry. |
| 3466 | With prefix arg copy the current reference entry to | 3477 | With prefix arg COPY-ONLY the current reference entry to |
| 3467 | `bibtex-entry-kill-ring', but do not actually kill it." | 3478 | `bibtex-entry-kill-ring', but do not actually kill it." |
| 3468 | (interactive "P") | 3479 | (interactive "P") |
| 3469 | (let ((pnt (point)) | 3480 | (let ((pnt (point)) |
| @@ -3502,14 +3513,14 @@ With argument N, reinsert the Nth most recently killed BibTeX item. | |||
| 3502 | See also the command \\[bibtex-yank-pop]]." | 3513 | See also the command \\[bibtex-yank-pop]]." |
| 3503 | (interactive "*p") | 3514 | (interactive "*p") |
| 3504 | (bibtex-insert-current-kill (1- n)) | 3515 | (bibtex-insert-current-kill (1- n)) |
| 3505 | (setq this-command 'bibtex-yank)) | 3516 | (setq this-command 'bibtex-yank)) |
| 3506 | 3517 | ||
| 3507 | (defun bibtex-yank-pop (n) | 3518 | (defun bibtex-yank-pop (n) |
| 3508 | "Replace just-yanked killed BibTeX item with a different. | 3519 | "Replace just-yanked killed BibTeX item with a different. |
| 3509 | This command is allowed only immediately after a `bibtex-yank' or a | 3520 | This command is allowed only immediately after a `bibtex-yank' or a |
| 3510 | `bibtex-yank-pop'. | 3521 | `bibtex-yank-pop'. |
| 3511 | At such a time, the region contains a reinserted previously killed | 3522 | At such a time, the region contains a reinserted previously killed |
| 3512 | BibTeX item. `bibtex-yank-pop' deletes that item and inserts in its | 3523 | BibTeX item. `bibtex-yank-pop' deletes that item and inserts in its |
| 3513 | place a different killed BibTeX item. | 3524 | place a different killed BibTeX item. |
| 3514 | 3525 | ||
| 3515 | With no argument, the previous kill is inserted. | 3526 | With no argument, the previous kill is inserted. |
| @@ -3539,14 +3550,14 @@ comes the newest one." | |||
| 3539 | 3550 | ||
| 3540 | (defun bibtex-pop-previous (arg) | 3551 | (defun bibtex-pop-previous (arg) |
| 3541 | "Replace text of current field with the similar field in previous entry. | 3552 | "Replace text of current field with the similar field in previous entry. |
| 3542 | With arg, goes up ARG entries. Repeated, goes up so many times. May be | 3553 | With arg, goes up ARG entries. Repeated, goes up so many times. May be |
| 3543 | intermixed with \\[bibtex-pop-next] (bibtex-pop-next)." | 3554 | intermixed with \\[bibtex-pop-next] (bibtex-pop-next)." |
| 3544 | (interactive "p") | 3555 | (interactive "p") |
| 3545 | (bibtex-pop arg 'previous)) | 3556 | (bibtex-pop arg 'previous)) |
| 3546 | 3557 | ||
| 3547 | (defun bibtex-pop-next (arg) | 3558 | (defun bibtex-pop-next (arg) |
| 3548 | "Replace text of current field with the text of similar field in next entry. | 3559 | "Replace text of current field with the text of similar field in next entry. |
| 3549 | With arg, goes down ARG entries. Repeated, goes down so many times. May be | 3560 | With arg, goes down ARG entries. Repeated, goes down so many times. May be |
| 3550 | intermixed with \\[bibtex-pop-previous] (bibtex-pop-previous)." | 3561 | intermixed with \\[bibtex-pop-previous] (bibtex-pop-previous)." |
| 3551 | (interactive "p") | 3562 | (interactive "p") |
| 3552 | (bibtex-pop arg 'next)) | 3563 | (bibtex-pop arg 'next)) |
| @@ -3609,7 +3620,7 @@ bibtex-clean-entry-hook are called with region narrowed to entry." | |||
| 3609 | (re-search-forward bibtex-reference-head) | 3620 | (re-search-forward bibtex-reference-head) |
| 3610 | (if (not success) | 3621 | (if (not success) |
| 3611 | (error | 3622 | (error |
| 3612 | "New inserted reference yields duplicate key.")))))))) | 3623 | "New inserted reference yields duplicate key")))))))) |
| 3613 | (if (not called-by-reformat) | 3624 | (if (not called-by-reformat) |
| 3614 | (save-excursion | 3625 | (save-excursion |
| 3615 | (save-restriction | 3626 | (save-restriction |
| @@ -3620,9 +3631,9 @@ bibtex-clean-entry-hook are called with region narrowed to entry." | |||
| 3620 | 3631 | ||
| 3621 | (defun bibtex-fill-entry () | 3632 | (defun bibtex-fill-entry () |
| 3622 | "Fill current entry. | 3633 | "Fill current entry. |
| 3623 | Realigns entry, so that every field starts on a separate line. Field | 3634 | Realigns entry, so that every field starts on a separate line. Field |
| 3624 | names appear in column `bibtex-field-indentation', field text starts in | 3635 | names appear in column `bibtex-field-indentation', field text starts in |
| 3625 | column bibtex-text-indentation and continuation lines start here, too. | 3636 | column `bibtex-text-indentation' and continuation lines start here, too. |
| 3626 | If `bibtex-align-at-equal-sign' is non-nil, align equal signs also." | 3637 | If `bibtex-align-at-equal-sign' is non-nil, align equal signs also." |
| 3627 | (interactive "*") | 3638 | (interactive "*") |
| 3628 | (let ((pnt (copy-marker (point))) | 3639 | (let ((pnt (copy-marker (point))) |
| @@ -3672,7 +3683,7 @@ If `bibtex-align-at-equal-sign' is non-nil, align equal signs also." | |||
| 3672 | (defun bibtex-reformat (&optional additional-options called-by-convert-alien) | 3683 | (defun bibtex-reformat (&optional additional-options called-by-convert-alien) |
| 3673 | "Reformat all BibTeX entries in buffer or region. | 3684 | "Reformat all BibTeX entries in buffer or region. |
| 3674 | With prefix argument, read options for reformatting from minibuffer. | 3685 | With prefix argument, read options for reformatting from minibuffer. |
| 3675 | With C-u C-u prefix argument, reuse previous answers (if any) again. | 3686 | With \\[universal-argument] \\[universal-argument] prefix argument, reuse previous answers (if any) again. |
| 3676 | If mark is active it reformats entries in region, if not in whole buffer." | 3687 | If mark is active it reformats entries in region, if not in whole buffer." |
| 3677 | (interactive "*P") | 3688 | (interactive "*P") |
| 3678 | (let* ((pnt (point)) | 3689 | (let* ((pnt (point)) |
| @@ -3813,7 +3824,7 @@ Remove surrounding delimiters if complete string could be expanded." | |||
| 3813 | 3824 | ||
| 3814 | (defun bibtex-complete-key () | 3825 | (defun bibtex-complete-key () |
| 3815 | "Complete word fragment before point to longest prefix of a defined key. | 3826 | "Complete word fragment before point to longest prefix of a defined key. |
| 3816 | If point is not after the part of a word, all keys are listed. This | 3827 | If point is not after the part of a word, all keys are listed. This |
| 3817 | function is most useful in completing crossref entries." | 3828 | function is most useful in completing crossref entries." |
| 3818 | (interactive "*") | 3829 | (interactive "*") |
| 3819 | (if (not bibtex-keys) | 3830 | (if (not bibtex-keys) |
| @@ -3821,58 +3832,72 @@ function is most useful in completing crossref entries." | |||
| 3821 | (bibtex-complete bibtex-keys)) | 3832 | (bibtex-complete bibtex-keys)) |
| 3822 | 3833 | ||
| 3823 | (defun bibtex-Article () | 3834 | (defun bibtex-Article () |
| 3835 | "Insert a new BibTeX @Article entry; see also `bibtex-entry'." | ||
| 3824 | (interactive) | 3836 | (interactive) |
| 3825 | (bibtex-entry "Article")) | 3837 | (bibtex-entry "Article")) |
| 3826 | 3838 | ||
| 3827 | (defun bibtex-Book () | 3839 | (defun bibtex-Book () |
| 3840 | "Insert a new BibTeX @Book entry; see also `bibtex-entry'." | ||
| 3828 | (interactive) | 3841 | (interactive) |
| 3829 | (bibtex-entry "Book")) | 3842 | (bibtex-entry "Book")) |
| 3830 | 3843 | ||
| 3831 | (defun bibtex-Booklet () | 3844 | (defun bibtex-Booklet () |
| 3845 | "Insert a new BibTeX @Booklet entry; see also `bibtex-entry'." | ||
| 3832 | (interactive) | 3846 | (interactive) |
| 3833 | (bibtex-entry "Booklet")) | 3847 | (bibtex-entry "Booklet")) |
| 3834 | 3848 | ||
| 3835 | (defun bibtex-InBook () | 3849 | (defun bibtex-InBook () |
| 3850 | "Insert a new BibTeX @InBook entry; see also `bibtex-entry'." | ||
| 3836 | (interactive) | 3851 | (interactive) |
| 3837 | (bibtex-entry "InBook")) | 3852 | (bibtex-entry "InBook")) |
| 3838 | 3853 | ||
| 3839 | (defun bibtex-InCollection () | 3854 | (defun bibtex-InCollection () |
| 3855 | "Insert a new BibTeX @InCollection entry; see also `bibtex-entry'." | ||
| 3840 | (interactive) | 3856 | (interactive) |
| 3841 | (bibtex-entry "InCollection")) | 3857 | (bibtex-entry "InCollection")) |
| 3842 | 3858 | ||
| 3843 | (defun bibtex-InProceedings () | 3859 | (defun bibtex-InProceedings () |
| 3860 | "Insert a new BibTeX @InProceedings entry; see also `bibtex-entry'." | ||
| 3844 | (interactive) | 3861 | (interactive) |
| 3845 | (bibtex-entry "InProceedings")) | 3862 | (bibtex-entry "InProceedings")) |
| 3846 | 3863 | ||
| 3847 | (defun bibtex-Manual () | 3864 | (defun bibtex-Manual () |
| 3865 | "Insert a new BibTeX @Manual entry; see also `bibtex-entry'." | ||
| 3848 | (interactive) | 3866 | (interactive) |
| 3849 | (bibtex-entry "Manual")) | 3867 | (bibtex-entry "Manual")) |
| 3850 | 3868 | ||
| 3851 | (defun bibtex-MastersThesis () | 3869 | (defun bibtex-MastersThesis () |
| 3870 | "Insert a new BibTeX @MastersThesis entry; see also `bibtex-entry'." | ||
| 3852 | (interactive) | 3871 | (interactive) |
| 3853 | (bibtex-entry "MastersThesis")) | 3872 | (bibtex-entry "MastersThesis")) |
| 3854 | 3873 | ||
| 3855 | (defun bibtex-Misc () | 3874 | (defun bibtex-Misc () |
| 3875 | "Insert a new BibTeX @Misc entry; see also `bibtex-entry'." | ||
| 3856 | (interactive) | 3876 | (interactive) |
| 3857 | (bibtex-entry "Misc")) | 3877 | (bibtex-entry "Misc")) |
| 3858 | 3878 | ||
| 3859 | (defun bibtex-PhdThesis () | 3879 | (defun bibtex-PhdThesis () |
| 3880 | "Insert a new BibTeX @PhdThesis entry; see also `bibtex-entry'." | ||
| 3860 | (interactive) | 3881 | (interactive) |
| 3861 | (bibtex-entry "PhdThesis")) | 3882 | (bibtex-entry "PhdThesis")) |
| 3862 | 3883 | ||
| 3863 | (defun bibtex-Proceedings () | 3884 | (defun bibtex-Proceedings () |
| 3885 | "Insert a new BibTeX @Proceedings entry; see also `bibtex-entry'." | ||
| 3864 | (interactive) | 3886 | (interactive) |
| 3865 | (bibtex-entry "Proceedings")) | 3887 | (bibtex-entry "Proceedings")) |
| 3866 | 3888 | ||
| 3867 | (defun bibtex-TechReport () | 3889 | (defun bibtex-TechReport () |
| 3890 | "Insert a new BibTeX @TechReport entry; see also `bibtex-entry'." | ||
| 3868 | (interactive) | 3891 | (interactive) |
| 3869 | (bibtex-entry "TechReport")) | 3892 | (bibtex-entry "TechReport")) |
| 3870 | 3893 | ||
| 3871 | (defun bibtex-Unpublished () | 3894 | (defun bibtex-Unpublished () |
| 3895 | "Insert a new BibTeX @Unpublished entry; see also `bibtex-entry'." | ||
| 3872 | (interactive) | 3896 | (interactive) |
| 3873 | (bibtex-entry "Unpublished")) | 3897 | (bibtex-entry "Unpublished")) |
| 3874 | 3898 | ||
| 3875 | (defun bibtex-String () | 3899 | (defun bibtex-String () |
| 3900 | "Insert a new BibTeX @String entry." | ||
| 3876 | (interactive) | 3901 | (interactive) |
| 3877 | (if (not bibtex-keys) | 3902 | (if (not bibtex-keys) |
| 3878 | (bibtex-parse-keys nil t)) | 3903 | (bibtex-parse-keys nil t)) |
| @@ -3910,6 +3935,7 @@ function is most useful in completing crossref entries." | |||
| 3910 | (length "@String{"))))) | 3935 | (length "@String{"))))) |
| 3911 | 3936 | ||
| 3912 | (defun bibtex-Preamble () | 3937 | (defun bibtex-Preamble () |
| 3938 | "Insert a new BibTeX @Preamble entry." | ||
| 3913 | (interactive) | 3939 | (interactive) |
| 3914 | (bibtex-move-outside-of-entry) | 3940 | (bibtex-move-outside-of-entry) |
| 3915 | (indent-to-column bibtex-entry-offset) | 3941 | (indent-to-column bibtex-entry-offset) |