comparison lisp/textmodes/bibtex.el @ 3591:507f64624555

Apply typo patches from Paul Eggert.
author Jim Blandy <jimb@redhat.com>
date Wed, 09 Jun 1993 11:59:12 +0000
parents 84fded047f22
children 58f653fa4e5b
comparison
equal deleted inserted replaced
3590:d5f22061277d 3591:507f64624555
142 ;;; C-c$ ispell-bibtex-entry 142 ;;; C-c$ ispell-bibtex-entry
143 ;;; M-C-a beginning-of-bibtex-entry 143 ;;; M-C-a beginning-of-bibtex-entry
144 ;;; M-C-e end-of-bibtex-entry 144 ;;; M-C-e end-of-bibtex-entry
145 ;;; Mike Newton (newton@gumby.cs.caltech.edu) 90.11.17 145 ;;; Mike Newton (newton@gumby.cs.caltech.edu) 90.11.17
146 ;;; * Handle items like 146 ;;; * Handle items like
147 ;;; title = poft # "Fifth Tri-quaterly" # random-conf, 147 ;;; title = poft # "Fifth Tri-quarterly" # random-conf,
148 ;;; and title = {This title is inside curlies} 148 ;;; and title = {This title is inside curlies}
149 ;;; * added user settable, always present, optional fields 149 ;;; * added user settable, always present, optional fields
150 ;;; * fixed 'bibtex-find-it's doc string's location 150 ;;; * fixed 'bibtex-find-it's doc string's location
151 ;;; * bibtex-field-text made more general (it wouldnt handle the # construct) 151 ;;; * bibtex-field-text made more general (it wouldn't handle the # construct)
152 ;;; and it now handles a small subset of the {} cases 152 ;;; and it now handles a small subset of the {} cases
153 153
154 ;;; Bengt Martensson, March 6 154 ;;; Bengt Martensson, March 6
155 ;;; Adapted to Bibtex 0.99 by updating the optional fields according 155 ;;; Adapted to Bibtex 0.99 by updating the optional fields according
156 ;;; to the document BibTeXing, Oren Patashnik, dated January 31, 1988. 156 ;;; to the document BibTeXing, Oren Patashnik, dated January 31, 1988.
551 (defconst bibtex-text-alignment (length " organization = ") 551 (defconst bibtex-text-alignment (length " organization = ")
552 "Alignment for the text part in BibTeX fields. 552 "Alignment for the text part in BibTeX fields.
553 Equal to the space needed for the longest name part.") 553 Equal to the space needed for the longest name part.")
554 554
555 (defun bibtex-current-entry-label (&optional include-cite kill) 555 (defun bibtex-current-entry-label (&optional include-cite kill)
556 "Return the label of the bibtex entry containing, or preceeding point. 556 "Return the label of the bibtex entry containing, or preceding point.
557 Optional argument INCLUDE-CITE, if true means put a '\\cite{}' around the 557 Optional argument INCLUDE-CITE, if true means put a '\\cite{}' around the
558 returned value. Second optional argument KILL, if true, means place the 558 returned value. Second optional argument KILL, if true, means place the
559 returned value in the kill buffer. Interactively; providing prefix 559 returned value in the kill buffer. Interactively; providing prefix
560 argument makes INCLUDE-CITE true, and kill is true by default. 560 argument makes INCLUDE-CITE true, and kill is true by default.
561 561
562 Rationale: 562 Rationale:
563 The intention is that someone will write a function that can be bound to 563 The intention is that someone will write a function that can be bound to
564 a mouse key so that people entering TeX can just mouse on the bibtex entry 564 a mouse key so that people entering TeX can just mouse on the bibtex entry
565 and have the citation key inserted at the current point (which will almost 565 and have the citation key inserted at the current point (which will almost
566 certainly be in some other bufer). In the interim this function is 566 certainly be in some other buffer). In the interim this function is
567 marginally useful for keyboard binding and is not bound by default. 567 marginally useful for keyboard binding and is not bound by default.
568 Suggested binding is ^C-k." 568 Suggested binding is ^C-k."
569 (interactive (list current-prefix-arg t)) 569 (interactive (list current-prefix-arg t))
570 (save-excursion 570 (save-excursion
571 (beginning-of-bibtex-entry) 571 (beginning-of-bibtex-entry)
687 (setq mode-name "BibTeX") 687 (setq mode-name "BibTeX")
688 (set-syntax-table bibtex-mode-syntax-table) 688 (set-syntax-table bibtex-mode-syntax-table)
689 (setq local-abbrev-table bibtex-mode-abbrev-table) 689 (setq local-abbrev-table bibtex-mode-abbrev-table)
690 (make-local-variable 'paragraph-start) 690 (make-local-variable 'paragraph-start)
691 (setq paragraph-start "^[ \f\n\t]*$") 691 (setq paragraph-start "^[ \f\n\t]*$")
692 (auto-fill-mode 1) ; nice alignements 692 (auto-fill-mode 1) ; nice alignments
693 (setq left-margin (+ bibtex-text-alignment 1)) 693 (setq left-margin (+ bibtex-text-alignment 1))
694 694
695 (run-hooks 'bibtex-mode-hook)) 695 (run-hooks 'bibtex-mode-hook))
696 696
697 (defun bibtex-move-outside-of-entry () 697 (defun bibtex-move-outside-of-entry ()
811 Text before the first bibtex entry, and following the last is not affected. 811 Text before the first bibtex entry, and following the last is not affected.
812 If bibtex-sort-ignore-string-entries is true, @string entries will be ignored. 812 If bibtex-sort-ignore-string-entries is true, @string entries will be ignored.
813 813
814 Bugs: 814 Bugs:
815 1. Text between the closing brace ending one bibtex entry, and the @ starting 815 1. Text between the closing brace ending one bibtex entry, and the @ starting
816 the next, is considered part of the PRECEEDING entry. Perhaps it should be 816 the next, is considered part of the PRECEDING entry. Perhaps it should be
817 part of the following entry." 817 part of the following entry."
818 (interactive) 818 (interactive)
819 (save-restriction 819 (save-restriction
820 (beginning-of-first-bibtex-entry) 820 (beginning-of-first-bibtex-entry)
821 (narrow-to-region (point) 821 (narrow-to-region (point)
823 (goto-char (point-max)) 823 (goto-char (point-max))
824 (beginning-of-bibtex-entry) 824 (beginning-of-bibtex-entry)
825 (end-of-bibtex-entry) 825 (end-of-bibtex-entry)
826 (point))) 826 (point)))
827 (sort-subr nil ; reversep 827 (sort-subr nil ; reversep
828 ;; begining of record function 828 ;; beginning of record function
829 'forward-line 829 'forward-line
830 ;; end of record function 830 ;; end of record function
831 (function (lambda () (and (re-search-forward "}\\s-*\n[\n \t]*@" nil 'move) 831 (function (lambda () (and (re-search-forward "}\\s-*\n[\n \t]*@" nil 'move)
832 (forward-char -2)))) 832 (forward-char -2))))
833 ;; start of key function 833 ;; start of key function