diff options
| author | Romain Francoise | 2005-10-01 20:09:23 +0000 |
|---|---|---|
| committer | Romain Francoise | 2005-10-01 20:09:23 +0000 |
| commit | 1fdecd0cd47bd3edda9dbe55b4fc21789aaa3547 (patch) | |
| tree | 4f26f9f35aca7aa8b5d8181a46122dd4620f89fa | |
| parent | 95f76284557566be55a67d2f3bffbc4456606032 (diff) | |
| download | emacs-1fdecd0cd47bd3edda9dbe55b4fc21789aaa3547.tar.gz emacs-1fdecd0cd47bd3edda9dbe55b4fc21789aaa3547.zip | |
2005-10-01 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de>
* textmodes/bibtex.el (bibtex-valid-entry-whitespace-re): Do not
match newline.
(bibtex-realign): Do not use bibtex-valid-entry-whitespace-re.
(bibtex-summary): remove unnecessary save-excursion.
(bibtex-fill-field-bounds): Use fill-region-as-paragraph.
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/textmodes/bibtex.el | 70 |
2 files changed, 43 insertions, 35 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0ea1e141bce..69fb7798069 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2005-10-01 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de> | ||
| 2 | |||
| 3 | * textmodes/bibtex.el (bibtex-valid-entry-whitespace-re): | ||
| 4 | Do not match newline. | ||
| 5 | (bibtex-realign): Do not use bibtex-valid-entry-whitespace-re. | ||
| 6 | (bibtex-summary): Remove unnecessary save-excursion. | ||
| 7 | (bibtex-fill-field-bounds): Use fill-region-as-paragraph. | ||
| 8 | |||
| 1 | 2005-10-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 9 | 2005-10-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
| 2 | 10 | ||
| 3 | * term/mac-win.el: Add charset info for "iso10646-1". Modify | 11 | * term/mac-win.el: Add charset info for "iso10646-1". Modify |
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index b85299c27e5..2177f72fd0d 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el | |||
| @@ -1120,7 +1120,7 @@ The CDRs of the elements are t for header keys and nil for crossref keys.") | |||
| 1120 | "Regexp matching the name of a valid BibTeX entry.") | 1120 | "Regexp matching the name of a valid BibTeX entry.") |
| 1121 | 1121 | ||
| 1122 | (defvar bibtex-valid-entry-whitespace-re | 1122 | (defvar bibtex-valid-entry-whitespace-re |
| 1123 | (concat "[ \t\n]*\\(" bibtex-valid-entry-re "\\)") | 1123 | (concat "[ \t]*\\(" bibtex-valid-entry-re "\\)") |
| 1124 | "Regexp matching the name of a valid BibTeX entry preceded by whitespace.") | 1124 | "Regexp matching the name of a valid BibTeX entry preceded by whitespace.") |
| 1125 | 1125 | ||
| 1126 | (defvar bibtex-any-valid-entry-re | 1126 | (defvar bibtex-any-valid-entry-re |
| @@ -2566,34 +2566,33 @@ Use `bibtex-summary-function' to generate summary." | |||
| 2566 | "Return summary of current BibTeX entry. | 2566 | "Return summary of current BibTeX entry. |
| 2567 | Used as default value of `bibtex-summary-function'." | 2567 | Used as default value of `bibtex-summary-function'." |
| 2568 | ;; It would be neat to customize this function. How? | 2568 | ;; It would be neat to customize this function. How? |
| 2569 | (save-excursion | 2569 | (if (looking-at bibtex-entry-maybe-empty-head) |
| 2570 | (if (looking-at bibtex-entry-maybe-empty-head) | 2570 | (let* ((bibtex-autokey-name-case-convert 'identity) |
| 2571 | (let* ((bibtex-autokey-name-case-convert 'identity) | 2571 | (bibtex-autokey-name-length 'infty) |
| 2572 | (bibtex-autokey-name-length 'infty) | 2572 | (bibtex-autokey-names 1) |
| 2573 | (bibtex-autokey-names 1) | 2573 | (bibtex-autokey-names-stretch 0) |
| 2574 | (bibtex-autokey-names-stretch 0) | 2574 | (bibtex-autokey-name-separator " ") |
| 2575 | (bibtex-autokey-name-separator " ") | 2575 | (bibtex-autokey-additional-names " etal") |
| 2576 | (bibtex-autokey-additional-names " etal") | 2576 | (names (bibtex-autokey-get-names)) |
| 2577 | (names (bibtex-autokey-get-names)) | 2577 | (bibtex-autokey-year-length 4) |
| 2578 | (bibtex-autokey-year-length 4) | 2578 | (year (bibtex-autokey-get-year)) |
| 2579 | (year (bibtex-autokey-get-year)) | 2579 | (bibtex-autokey-titlewords 5) |
| 2580 | (bibtex-autokey-titlewords 5) | 2580 | (bibtex-autokey-titlewords-stretch 2) |
| 2581 | (bibtex-autokey-titlewords-stretch 2) | 2581 | (bibtex-autokey-titleword-case-convert 'identity) |
| 2582 | (bibtex-autokey-titleword-case-convert 'identity) | 2582 | (bibtex-autokey-titleword-length 5) |
| 2583 | (bibtex-autokey-titleword-length 5) | 2583 | (bibtex-autokey-titleword-separator " ") |
| 2584 | (bibtex-autokey-titleword-separator " ") | 2584 | (title (bibtex-autokey-get-title)) |
| 2585 | (title (bibtex-autokey-get-title)) | 2585 | (journal (bibtex-autokey-get-field |
| 2586 | (journal (bibtex-autokey-get-field | 2586 | "journal" bibtex-autokey-transcriptions)) |
| 2587 | "journal" bibtex-autokey-transcriptions)) | 2587 | (volume (bibtex-autokey-get-field "volume")) |
| 2588 | (volume (bibtex-autokey-get-field "volume")) | 2588 | (pages (bibtex-autokey-get-field "pages" '(("-.*\\'" . ""))))) |
| 2589 | (pages (bibtex-autokey-get-field "pages" '(("-.*\\'" . ""))))) | 2589 | (mapconcat (lambda (arg) |
| 2590 | (mapconcat (lambda (arg) | 2590 | (if (not (string= "" (cdr arg))) |
| 2591 | (if (not (string= "" (cdr arg))) | 2591 | (concat (car arg) (cdr arg)))) |
| 2592 | (concat (car arg) (cdr arg)))) | 2592 | `((" " . ,names) (" " . ,year) (": " . ,title) |
| 2593 | `((" " . ,names) (" " . ,year) (": " . ,title) | 2593 | (", " . ,journal) (" " . ,volume) (":" . ,pages)) |
| 2594 | (", " . ,journal) (" " . ,volume) (":" . ,pages)) | 2594 | "")) |
| 2595 | "")) | 2595 | (error "Entry not found"))) |
| 2596 | (error "Entry not found")))) | ||
| 2597 | 2596 | ||
| 2598 | (defun bibtex-pop (arg direction) | 2597 | (defun bibtex-pop (arg direction) |
| 2599 | "Fill current field from the ARGth same field's text in DIRECTION. | 2598 | "Fill current field from the ARGth same field's text in DIRECTION. |
| @@ -3950,9 +3949,9 @@ If optional arg MOVE is non-nil move point to end of field." | |||
| 3950 | (insert " ") | 3949 | (insert " ") |
| 3951 | (indent-to-column bibtex-text-indentation))) | 3950 | (indent-to-column bibtex-text-indentation))) |
| 3952 | (re-search-forward "[ \t\n]*=[ \t\n]*" end-field)) | 3951 | (re-search-forward "[ \t\n]*=[ \t\n]*" end-field)) |
| 3953 | (while (re-search-forward "[ \t\n]+" end-field 'move) | 3952 | ;; Paragraphs within fields are not preserved. Bother? |
| 3954 | (replace-match " ")) | 3953 | (fill-region-as-paragraph (line-beginning-position) end-field |
| 3955 | (do-auto-fill) | 3954 | default-justification nil (point)) |
| 3956 | (if move (goto-char end-field)))) | 3955 | (if move (goto-char end-field)))) |
| 3957 | 3956 | ||
| 3958 | (defun bibtex-fill-field (&optional justify) | 3957 | (defun bibtex-fill-field (&optional justify) |
| @@ -3992,13 +3991,14 @@ If `bibtex-align-at-equal-sign' is non-nil, align equal signs, too." | |||
| 3992 | (defun bibtex-realign () | 3991 | (defun bibtex-realign () |
| 3993 | "Realign BibTeX entries such that they are separated by one blank line." | 3992 | "Realign BibTeX entries such that they are separated by one blank line." |
| 3994 | (goto-char (point-min)) | 3993 | (goto-char (point-min)) |
| 3995 | (let ((case-fold-search t)) | 3994 | (let ((case-fold-search t) |
| 3995 | (valid-entry (concat "[ \t\n]*\\(" bibtex-valid-entry-re "\\)"))) | ||
| 3996 | ;; No blank lines prior to the first valid entry if there no | 3996 | ;; No blank lines prior to the first valid entry if there no |
| 3997 | ;; non-white characters in front of it. | 3997 | ;; non-white characters in front of it. |
| 3998 | (when (looking-at bibtex-valid-entry-whitespace-re) | 3998 | (when (looking-at valid-entry) |
| 3999 | (replace-match "\\1")) | 3999 | (replace-match "\\1")) |
| 4000 | ;; Valid entries are separated by one blank line. | 4000 | ;; Valid entries are separated by one blank line. |
| 4001 | (while (re-search-forward bibtex-valid-entry-whitespace-re nil t) | 4001 | (while (re-search-forward valid-entry nil t) |
| 4002 | (replace-match "\n\n\\1")) | 4002 | (replace-match "\n\n\\1")) |
| 4003 | ;; One blank line past the last valid entry if it is followed by | 4003 | ;; One blank line past the last valid entry if it is followed by |
| 4004 | ;; non-white characters, no blank line otherwise. | 4004 | ;; non-white characters, no blank line otherwise. |