home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2 / Openstep-4.2-Intel-User.iso / usr / lib / emacs / lisp / bibtex.elc < prev    next >
Text File  |  1991-01-09  |  11KB  |  166 lines

  1.  
  2. (defvar bibtex-mode-syntax-table nil "\
  3. ")
  4.  
  5. (defvar bibtex-mode-abbrev-table nil "\
  6. ")
  7.  
  8. (define-abbrev-table (quote bibtex-mode-abbrev-table) nil)
  9.  
  10. (defvar bibtex-mode-map (make-sparse-keymap) "\
  11. ")
  12.  
  13. (defun bibtex-mode nil "\
  14. Major mode for editing bibtex files.  Commands:
  15. \\{bibtex-mode-map}
  16.  
  17. A command such as \\[bibtex-Book] will outline the fields for a BibTeX
  18. book entry.
  19.  
  20. The optional fields are preceded by \"OPT\", thus ignored by BibTeX.
  21. Use \\[bibtex-remove-opt] to remove \"OPT\" on the current line.
  22.  
  23. Use \\[bibtex-find-it] to position the dot at the end of the string on the same line.
  24. Use \\[bibtex-next-position] to move to the next position to fill in.  Use \\[kill-current-line]
  25. to kill the whole line.
  26.  
  27. M-x bibtex-x-environment binds a mode-specific X menu to control+right
  28. mouse button.
  29. M-x bibtex-sun-environment binds a mode-specific Sun menu to right
  30. mouse button.
  31.  
  32. Fields:
  33.     address
  34.            Publisher's address
  35.     annote
  36.            Long annotation used for annotated bibliographies (begins sentence)
  37.     author
  38.            Name(s) of author(s), in BibTeX name format
  39.     booktitle
  40.            Book title when the thing being referenced isn't the whole book.
  41.            For book entries, the title field should be used instead.
  42.     chapter
  43.            Chapter number
  44.     edition
  45.            Edition of a book (e.g., \"second\")
  46.     editor
  47.            Name(s) of editor(s), in BibTeX name format.
  48.            If there is also an author field, then the editor field should be
  49.            for the book or collection that the work appears in
  50.     howpublished
  51.             How something strange has been published (begins sentence)
  52.     institution
  53.            Sponsoring institution
  54.     journal
  55.            Journal name (macros are provided for many)
  56.     key
  57.            Alphabetizing and labeling key (needed when no author or editor)
  58.     month
  59.            Month (macros are provided)
  60.     note
  61.            To help the reader find a reference (begins sentence)
  62.     number
  63.            Number of a journal or technical report
  64.     organization
  65.            Organization (sponsoring a conference)
  66.     pages
  67.            Page number or numbers (use `--' to separate a range)
  68.     publisher
  69.            Publisher name
  70.     school
  71.            School name (for theses)
  72.     series
  73.            The name of a series or set of books.
  74.            An individual book will will also have it's own title
  75.     title
  76.            The title of the thing being referenced
  77.     type
  78.            Type of a Techreport (e.g., \"Research Note\") to be used instead of
  79.            the default \"Technical Report\"
  80.     volume
  81.            Volume of a journal or multivolume work
  82.     year
  83.            Year---should contain only numerals
  84. ---------------------------------------------------------
  85. Entry to this mode calls the value of bibtex-mode-hook
  86. if that value is non-nil." (interactive) (byte-code "¨È² È?Ä˚ Éȸ!ȳ˝˛\"ȳˇ—\"ȳ±¼\"ȳ½¼\"ȳ¾à\"ȳáà\"Èâ    !ÈãÉÈäÉȸ!ÈÉÈå˘!ÈçÉÈè    éê#Èè    ëì#Èè    Æí#Èè    ªî#Èè    ïð#Èè    ñŁ#Èè    ØŒ#Èè    ºò#Èè    óô#Èè    õŒ#Èè    öæ#Èè    ùú#Èè    ûı#Èè    üý#Èè    łø#Èè    œß#Èè    þÿ#Èè    #Èè    À@ÀA#Èè    ÀBÀC#ÈÀDÀE!ÈÀFÉÈÀGÀH!Ç" [bibtex-mode-syntax-table bibtex-mode-map major-mode mode-name local-abbrev-table bibtex-mode-abbrev-table paragraph-start left-margin nil kill-all-local-variables copy-syntax-table set-syntax-table modify-syntax-entry 36 "$$  " 37 "<   " 12 ">   " 10 39 "w   " 64 use-local-map bibtex-mode "BibTeX" make-local-variable "^[ 
  87.     ]*$" define-key "    " bibtex-find-it "
  88. " bibtex-next-position "\"" bibtex-remove-double-quotes " " kill-current-line "" bibtex-Article "" bibtex-Book "" bibtex-InProceedings "    " bibtex-InBook "i" bibtex-InCollection "I" "" bibtex-Manual "m" bibtex-MastersThesis "M" bibtex-Misc "" bibtex-remove-opt "" bibtex-PhdThesis "p" bibtex-Proceedings "" bibtex-TechReport "" bibtex-string "" bibtex-Unpublished "?" describe-mode auto-fill-mode 1 17 run-hooks bibtex-mode-hook] 35))
  89.  
  90. (defun bibtex-move-outside-of-entry nil "\
  91. Make sure we are outside of a bib entry" (byte-code "`dUÅ`eUÅˋ´!¹Áˆ È˜ È¯˘d¹#Ç" [t looking-at "[ 
  92. ]*@" backward-paragraph forward-paragraph re-search-forward "[     
  93. ]*"] 7))
  94.  
  95. (defun bibtex-entry (entry-type required optional) (byte-code "ˆ È˜¯QcÈ˘˙!Ȩ²    ˚#cÈ    Ä˚cȨ¸
  96. ˚#cȳ˝!È˛ˇ!Ç" [entry-type required optional bibtex-move-outside-of-entry "@" "{,
  97.  
  98. }
  99.  
  100. " previous-line 3 mapconcat bibtex-make-entry ",
  101. " bibtex-make-opt-entry up-list -1 forward-char 1] 7))
  102.  
  103. (defun bibtex-make-entry (str) (interactive "s") (byte-code "ˋÈ´ˆQÇ" [str nil "  " " =     \"\""] 3))
  104.  
  105. (defun bibtex-make-opt-entry (str) (interactive "s") (byte-code "ˋÈ´ˆQÇ" [str nil "  OPT" " =     \"\""] 3))
  106.  
  107. (defun bibtex-Article nil (interactive) (byte-code "¹Èˋ´ˆ˜#Ç" [nil bibtex-entry "Article" ("author" "title" "journal" "year") ("volume" "number" "pages" "month" "note")] 4))
  108.  
  109. (defun bibtex-Book nil (interactive) (byte-code "¹Èˋ´ˆ˜#Ç" [nil bibtex-entry "Book" ("author" "title" "publisher" "year") ("editor" "volume" "series" "address" "edition" "month" "note")] 4))
  110.  
  111. (defun bibtex-Booklet nil (interactive) (byte-code "¹Èˋ´ˆ˜#Ç" [nil bibtex-entry "Booklet" ("title") ("author" "howpublished" "address" "month" "year" "note")] 4))
  112.  
  113. (defun bibtex-InBook nil (interactive) (byte-code "¹Èˋ´ˆ˜#Ç" [nil bibtex-entry "InBook" ("author" "title" "chapter" "publisher" "year") ("editor" "pages" "volume" "series" "address" "edition" "month" "note")] 4))
  114.  
  115. (defun bibtex-InCollection nil (interactive) (byte-code "¹Èˋ´ˆ˜#Ç" [nil bibtex-entry "InCollection" ("author" "title" "booktitle" "publisher" "year") ("editor" "chapter" "pages" "address" "month" "note")] 4))
  116.  
  117. (defun bibtex-InProceedings nil (interactive) (byte-code "¹Èˋ´ˆ˜#Ç" [nil bibtex-entry "InProceedings" ("author" "title" "booktitle" "year") ("editor" "pages" "organization" "publisher" "address" "month" "note")] 4))
  118.  
  119. (defun bibtex-Manual nil (interactive) (byte-code "¹Èˋ´ˆ˜#Ç" [nil bibtex-entry "Manual" ("title") ("author" "organization" "address" "edition" "year" "month" "note")] 4))
  120.  
  121. (defun bibtex-MastersThesis nil (interactive) (byte-code "¹Èˋ´ˆ˜#Ç" [nil bibtex-entry "MastersThesis" ("author" "title" "school" "year") ("address" "month" "note")] 4))
  122.  
  123. (defun bibtex-Misc nil (interactive) (byte-code "¹Èˋ´¹ˆ#Ç" [nil bibtex-entry "Misc" ("author" "title" "howpublished" "year" "month" "note")] 4))
  124.  
  125. (defun bibtex-PhdThesis nil (interactive) (byte-code "¹Èˋ´ˆ˜#Ç" [nil bibtex-entry "PhDThesis" ("author" "title" "school" "year") ("address" "month" "note")] 4))
  126.  
  127. (defun bibtex-Proceedings nil (interactive) (byte-code "¹Èˋ´ˆ˜#Ç" [nil bibtex-entry "Proceedings" ("title" "year") ("editor" "publisher" "organization" "address" "month" "note")] 4))
  128.  
  129. (defun bibtex-TechReport nil (interactive) (byte-code "¹Èˋ´ˆ˜#Ç" [nil bibtex-entry "TechReport" ("author" "title" "institution" "year") ("type" "number" "address" "month" "note")] 4))
  130.  
  131. (defun bibtex-Unpublished nil (interactive) (byte-code "¹Èˋ´ˆ˜#Ç" [nil bibtex-entry "Unpublished" ("author" "title" "note") ("year" "month")] 4))
  132.  
  133. (defun bibtex-string nil (interactive) (byte-code "¹Èˋ È´cȈ˜!ȯ˘!Ç" [nil bibtex-move-outside-of-entry "@string{ = \"\"}
  134. " previous-line 1 forward-char 8] 4))
  135.  
  136. (defun bibtex-next-position nil "\
  137. Finds next position to write in." (interactive) (byte-code "¹Èˋ´!Ȉ Ç" [nil forward-line 1 bibtex-find-it] 3))
  138.  
  139. (defun bibtex-find-it nil (interactive) (byte-code "´ÈˆÈ˜ È`¯ È˘˙ˋ#Ȩ²!È˚¸! ˋÁ#³²!)Ç" [beg t nil "Find position on current line (if possible) to add entry text." beginning-of-line end-of-line search-backward "," backward-char 1 looking-at "\"" forward-char] 7))
  140.  
  141. (defun bibtex-remove-opt nil "\
  142. Removes the 'OPT' starting optional arguments." (interactive) (byte-code "¹Èˋ È´ˆ!Ș¯!Ģ˙!Ȩ Ç" [nil beginning-of-line forward-char 2 looking-at "OPT" delete-char 3 bibtex-find-it] 6))
  143.  
  144. (defun kill-current-line nil "\
  145. Kills the current line." (interactive) (byte-code "¹Èˋ È´ˆ!Ç" [nil beginning-of-line kill-line 1] 3))
  146.  
  147. (defun bibtex-remove-double-quotes nil "\
  148. Removes \"\" around string." (interactive) (byte-code "ˆÈ˜ È`¯ È`˘ È˙¨    ´#Â)²˚!È˙¨    ´#Ä&²˚!Á+b*Ç" [here eol t nil bibtex-find-it end-of-line beginning-of-line search-forward "\"" delete-char -1] 9))
  149.  
  150. (defun bibtex-x-help (arg) "\
  151. Mouse commands for BibTeX mode" (byte-code "´    ˆ\"Ä ˜!)Ç" [selection arg x-popup-menu ("BibTeX commands" ("Document types" ("article in Conference Proceedings" . bibtex-InProceedings) ("article in journal" . bibtex-Article) ("Book" . bibtex-Book) ("Booklet" . bibtex-Booklet) ("Master's Thesis" . bibtex-MastersThesis) ("PhD. Thesis" . bibtex-PhdThesis) ("Technical Report" . bibtex-TechReport) ("technical Manual" . bibtex-Manual) ("Conference Proceedings" . bibtex-Proceedings) ("in a Book" . bibtex-InBook) ("in a Collection" . bibtex-InCollection) ("miscellaneous" . bibtex-Misc) ("unpublished" . bibtex-Unpublished)) ("others" ("next field" . bibtex-next-position) ("to end of field" . bibtex-find-it) ("remove OPT" . bibtex-remove-opt) ("remove quotes" . bibtex-remove-double-quotes) ("remove this line" . kill-current-line) ("describe BibTeX mode" . describe-mode) ("string" . bibtex-string))) call-interactively] 3))
  152.  
  153. (defun bibtex-x-environment nil "\
  154. Set up X menus for BibTeX mode.  Call it as bibtex-mode-hook, or interactively" (interactive) (byte-code "´Èˆ˜!ȯ    ˘#Ç" [mouse-map x-button-c-right nil require x-mouse define-key bibtex-x-help] 5))
  155.  
  156. (defmenu bibtex-sun-entry-menu ("Article In Conf. Proc." (lambda nil (eval-in-window *menu-window* (bibtex-InProceedings)))) ("Article In Journal" (lambda nil (eval-in-window *menu-window* (bibtex-Article)))) ("Book" (lambda nil (eval-in-window *menu-window* (bibtex-Book)))) ("Booklet" (lambda nil (eval-in-window *menu-window* (bibtex-Booklet)))) ("Master's Thesis" (lambda nil (eval-in-window *menu-window* (bibtex-MastersThesis)))) ("PhD. Thesis" (lambda nil (eval-in-window *menu-window* (bibtex-PhdThesis)))) ("Technical Report" (lambda nil (eval-in-window *menu-window* (bibtex-TechReport)))) ("Technical Manual" (lambda nil (eval-in-window *menu-window* (bibtex-Manual)))) ("Conference Proceedings" (lambda nil (eval-in-window *menu-window* (bibtex-Proceedings)))) ("In A Book" (lambda nil (eval-in-window *menu-window* (bibtex-InBook)))) ("In A Collection" (lambda nil (eval-in-window *menu-window* (bibtex-InCollection)))) ("Miscellaneous" (lambda nil (eval-in-window *menu-window* (bibtex-Misc)))) ("Unpublished" (lambda nil (eval-in-window *menu-window* (bibtex-Unpublished)))))
  157.  
  158. (defmenu bibtex-sun-menu ("BibTeX menu") ("add entry" . bibtex-sun-entry-menu) ("add string" (lambda nil (eval-in-window *menu-window* (bibtex-string)))) ("describe BibTeX mode" (lambda nil (eval-in-window *menu-window* (describe-mode)))) ("Main Emacs menu" . emacs-menu))
  159.  
  160. (defun bibtex-sun-menu-eval (window x y) "\
  161. Pop-up menu of BibTeX commands." (byte-code "ˆ    T
  162. S˜$Ç" [window x y sun-menu-evaluate bibtex-sun-menu] 5))
  163.  
  164. (defun bibtex-sun-environment nil "\
  165. Set up sun menus for BibTeX mode.  Call it as bibtex-mode-hook, or interactively" (interactive) (byte-code "¹Èˋ´ˆ\"Ç" [nil local-set-mouse (text right) bibtex-sun-menu-eval] 3))
  166.