(require (quote BibTeX-mode)) (defun bibtex-goto-context (att) (byte-code "Á8@b‡" [att 3] 2)) (defun bibtex-previous-entry (&optional n &optional att-only) "\ Moves point to Nth previous entry label, if any, and return its attribute list. If the optional ATT-ONLY is non-nil, return the list only (point remains unchanged)." (interactive "P") (byte-code "ƈÁ † ljˆ ÈVƒeŠÉ ) …#Š @bˆÉ ) ÇV…+ …A S‰ˆŠ @bˆÉ )‰ˆ‚$ˆ ƒV ƒNÆ‚QÊ !ˆ ‚a ƒ^Æ‚aËÌ!*‚v ÈWƒsÍ [ \"‚vÎ !)‡" [case-fold-search t n ce pe att-only nil 1 0 bibtex-search-entry bibtex-goto-context error "Failed to find previous entry." bibtex-next-entry bibtex-current-entry] 8)) (defun bibtex-current-entry (&optional att-only) "\ Moves point to current entry label, if any, and return its attribute list. If the optional ATT-ONLY is non-nil, return the list only (point remains unchanged)." (interactive "P") (byte-code "ĈÁŠÅ ) ƒ ƒÄ‚Æ !ˆ ‚( ƒ%Ä‚(ÇÈ!*‡" [case-fold-search t ce att-only nil bibtex-search-entry bibtex-goto-context error "Failed to find current entry."] 4)) (defun bibtex-next-entry (&optional n &optional att-only) "\ Moves point to Nth next entry label, if any, and return its attribute list. If the optional ATT-ONLY is non-nil, return the list only (point remains unchanged)." (interactive "P") (byte-code "ňÁ † Ɖˆ ÇVƒZŠÈÁ!) ÆV… …6 S‰ˆŠÉ !ˆÈÁ!)‰ˆ‚ˆ ƒK ƒCÅ‚FÉ !ˆ ‚V ƒSÅ‚VÊË!)‚k ÇWƒhÌ [ \"‚kÍ !)‡" [case-fold-search t n ne att-only nil 1 0 bibtex-search-entry bibtex-goto-context error "Failed to find next entry." bibtex-previous-entry bibtex-current-entry] 8)) (defun bibtex-dup-previous-entry (&optional n &optional quiet) "\ Duplicate Nth previous entry, if any, above current entry. Move point to the new entry label. If the optional QUIET is non-nil, do this quietly." (interactive "P") (byte-code "ˆ†ȉˆ ƒ‚ÉÊ\"ˆÄËÄ\" ƒLÌ 8È 8bˆÍÎ\"!ˆÏ ˆ ƒD‚HÉÐ\"*‚X ƒT‚XÑÒ\"*‡" [n quiet nil case-fold-search t pe eb ee 1 message "Duplicating previous entry #%d..." bibtex-previous-entry 0 insert-string buffer-substring bibtex-current-entry "Duplicating previous entry #%d...done" error "Duplicating previous entry #%d...abort (entry not found)"] 9)) (defun bibtex-dup-current-entry (&optional quiet) "\ Copies current entry, if any, below current entry, and moves point to the new entry label. If the optional QUIET is non-nil, does this quietly." (interactive "P") (byte-code "Áˆƒ Á‚ ÇÈ!ˆÃÉÃ! ƒ?Ê 8Ë 8bˆÌÍ \"!ˆÉ ˆƒ8Á‚;ÇÎ!*‚JƒGÁ‚JÏÐ!*‡" [quiet nil case-fold-search t ce eb ee message "Duplicating current entry..." bibtex-current-entry 0 1 insert-string buffer-substring "Duplicating current entry...done" error "Duplicating current entry...abort (entry not found)"] 8)) (defun bibtex-dup-next-entry (&optional n &optional quiet) "\ Duplicate Nth next entry, if any, below current entry. Move point to the new entry label. If the optional QUIET is non-nil, do this quietly." (interactive "P") (byte-code "ˆ†ȉˆ ƒ‚ÉÊ\"ˆÄËÄ\" ƒLÌ 8È 8bˆÍÎ\"!ˆÏ ˆ ƒD‚HÉÐ\"*‚X ƒT‚XÑÒ\"*‡" [n quiet nil case-fold-search t ne eb ee 1 message "Duplicating next entry #%d..." bibtex-next-entry 0 insert-string buffer-substring bibtex-current-entry "Duplicating next entry #%d...done" error "Duplicating next entry #%d...abort (entry not found)"] 9)) (defun bibtex-kill-previous-entry (&optional n &optional quiet) "\ Kill Nth previous entry, if any. Point remains unchanged. If the optional QUIET is non-nil, do this quietly." (interactive "P") (byte-code "ˆ†ȉˆ ƒ‚ÉÊ\"ˆÄËÄ\" ƒCÌ 8È 8Í\"ˆ ƒ;‚?ÉÎ\"*‚O ƒK‚OÏÐ\"*‡" [n quiet nil case-fold-search t pe eb ee 1 message "Killing previous entry #%d..." bibtex-previous-entry 0 kill-region "Killing previous entry #%d...done" error "Killing previous entry #%d...abort (entry not found)"] 7)) (defun bibtex-kill-current-entry (&optional quiet) "\ Kill current entry, if any. Point is moved to next entry label, if any; else point is moved to previous entry label, if any. If the optional QUIET is non-nil, do this quietly." (interactive "P") (byte-code "Áˆƒ Á‚ ÉÊ!ˆÃËÃ! ƒTÌ 8Í 8ÎÍÃ\"Ï \"ˆƒ7Î ‚DËÃ!…CË )ˆƒMÁ‚PÉÐ!+‚_ƒ\\Á‚_ÑÒ!*‡" [quiet nil case-fold-search t ce eb ee ne pe message "Killing current entry..." bibtex-current-entry 0 1 bibtex-next-entry kill-region "Killing current entry...done" error "Killing current entry...abort (entry not found)"] 10)) (defun bibtex-kill-next-entry (&optional n &optional quiet) "\ Kill Nth next entry, if any. Point remains unchanged. If the optional QUIET is non-nil, do this quietly." (interactive "P") (byte-code "ˆ†ȉˆ ƒ‚ÉÊ\"ˆÄËÄ\" ƒCÌ 8È 8Í\"ˆ ƒ;‚?ÉÎ\"*‚O ƒK‚OÏÐ\"*‡" [n quiet nil case-fold-search t ne eb ee 1 message "Killing next entry #%d..." bibtex-next-entry 0 kill-region "Killing next entry #%d...done" error "Killing next entry #%d...abort (entry not found)"] 7)) (defun bibtex-rename-current-entry (new) "\ Rename current entry to one of type NEW." (interactive "aRename current entry: ") (byte-code "ȈÁÉÉÊÁ!88ËÌ !!Í !ˆÎÏ #ˆŠÊ Ð 8`bˆÑ ˆ`W…EÒÐÁ\"ˆÓ ˆÔÕ!ˆ‚/ˆ`U…QÒÐÁ\"ˆÖÐÁ\"+)ˆÎ× #+‡" [case-fold-search t type1 type2 new ce ee boundary nil 2 bibtex-current-entry upcase symbol-name funcall message "Renaming current entry from %s to %s..." 1 bibtex-current-field bibtex-text-previous-entry bibtex-previous-field sit-for 0 bibtex-kill-previous-entry "Renaming current entry from %s to %s...done"] 16)) (defun bibtex-current-field nil "\ Moves point to current field text, if any, and return its attribute list." (interactive) (byte-code "ÁˆÂ ƒÃ8@bˆ‚ÄÅ!)‡" [cf nil bibtex-current-field-data 3 error "Failed to find current field."] 3)) (defun bibtex-next-field (&optional n) "\ Move point to Nth next field text, if any, and return its attribute list." (interactive "P") (byte-code "È?… ĉˆÅWƒÆ[!‚9ÅUƒ#Ç ‚9È! ƒ5É 8@bˆ ‚8ÊË!)‡" [n t nf nil 1 0 bibtex-previous-field bibtex-current-field bibtex-next-field-data 3 error "Failed to find next field."] 5)) (defun bibtex-previous-field (&optional n) "\ Move point to Nth previous field text, if any, and return its attribute list." (interactive "P") (byte-code "È?… ĉˆÅWƒÆ[!‚9ÅUƒ#Ç ‚9È! ƒ5É 8@bˆ ‚8ÊË!)‡" [n t pf nil 1 0 bibtex-next-field bibtex-current-field bibtex-previous-field-data 3 error "Failed to find previous field."] 5)) (defconst bibtex-id-regexp "[a-z][]a-z0-9.:;?!`[---/*@$&~_^\\+|<>]*" "\ Matches bibtex entry and field names and abbreviations. Based on pages 12 and 143 of the LaTeX book") (defconst bibtex-key-regexp "[]a-z0-9.:;?!`'()[-/*@]*" "\ Matches BibTeX keys and the empty string. Based on pages 12 and 73 of the LaTeX book.") (defconst bibtex-entry-name-regexp (concat "[@%]\\s *\\(" bibtex-id-regexp "\\)\\s *[{(]") "\ Matches the entry name and intial paren or brace.") (defconst bibtex-field-name-regexp (concat "[ ,{(]\\(" bibtex-id-regexp "\\)\\s *=") "Matches the field name and equal sign.") (defconst bibtex-field-regexp (concat bibtex-entry-name-regexp "\\|" bibtex-field-name-regexp)) (defun bibtex-next-field-data (number) (byte-code "ŠÉ Â…ÊËÌÌ88\"Ç… …#ÍÌ88bˆ ÎV…0ÏÇÂ#…NÐ ‰ˆÊÑÎ!\"†C …J S‰ˆ‚$ˆ Î=ƒ[Ò !‚\\Ç,)‡" [cf case-fold-search t string-p md number bibtex-field-regexp nil bibtex-field-match bibtex-current-field-data string-match "@string" 2 1 0 re-search-forward match-data vortex-match-string bibtex-field-value] 9)) (defun bibtex-previous-field-data (number) (byte-code "È ÂÆÉ8`Wƒ$ ÉUƒ‚!@bˆÊ S!‚lŠ@bˆ ËV…4Ì ÆÂ#…]Í ‰ˆÎ ˆÏÐË!\"†RÏÑÒÒÈ 88\"…Y S‰ˆ‚)ˆ Ë=ƒjÓ !‚kÆ)+‡" [cf case-fold-search t md number bibtex-field-regexp nil bibtex-field-match bibtex-current-field-data 1 bibtex-previous-field-data 0 re-search-backward match-data forward-char string-match vortex-match-string "@STRING" 2 bibtex-field-value] 14)) (defun bibtex-current-field-data nil (byte-code "ŠÁŠÉ ˆ`)`ÈÈÈÊÈÁ#ƒ-Ë ÌÍ!‰ˆÎÏ!b‚/ebˆÐÈÁ#…=Ë ‰ˆ ?…M ?†M ÑÏ!WƒTÈ‚‘ ?ƒ_Ò !‚‘ ÑÏ!YƒxƒrÒ !‚uÒ !‚‘Š bˆÐÓÑÏ!Á#)?ƒŽÒ !‚‘Ò !.)‡" [case-fold-search t bol pos md1 md2 string-p bibtex-field-regexp nil beginning-of-line re-search-backward match-data looking-at "@\\s *string" match-end 0 re-search-forward match-beginning bibtex-field-value "[^ ]"] 17)) (defun bibtex-field-value (header-match-data) (byte-code "Ö!ˆ×Ø!ÙØ!Ú T\"ÛÜ \"ÛÝ \" †! ƒ( ‚* T× †2 ƒ9Ø‚:Þ!× †C ƒJß‚KÞ!Ù †T ƒ[ß‚\\Þ! Ú \" Ï Ï Ï Ï bˆ …àá \"ƒ¹Ü P ŠâãÏÐ#ˆ×Ø!)‰ ˆä Ð#ƒ¯×Ø! ÙØ!‰ ‚¶  ‰ ‚¶ ƒâÜ P‰ ˆäåæQÏÐ#ˆÙØ! ×ß! Ùß!‰ ‚¶ ƒç‰ ˆäåæQÏÐ#ˆÙØ! ×ß! Ùß!‰ ‚¶äèÏÐ#ƒ²×Ø!ÙØ!Ú\"àé\"ƒYbˆê ˆ`S‰ ˆäëÏÐ#ˆÛìØ!í\"ƒL T‚OÙØ! ‰ ‚®îïP Ð#ƒ…Ûð\"ƒq‚tS ×Ø!T ÙØ!‰ ‚®ß Z=…“ñ ˆòcˆÛð\"ƒ¡‚£ T T  ‰ +‚¶ЉˆƒÀÏ‚×   E  Ú  \"EF.‡" [header-match-data bofm eofm first-char entry group bof bon real-bon eon name eof bot eot fail nil t bibtex-id-regexp bibtex-key-regexp stop-char next-char char store-match-data match-beginning 0 match-end buffer-substring string-equal "@" "%" 2 1 string-match "string" search-forward "=" re-search-forward "\\(" "\\)\\s *," "%GROUP" "[\"{,}]" "[\"{]" forward-sexp "[,}]" vortex-match-string "}" re-search-backward "[ =]" "," backward-char " "] 48)) (defun bibtex-erase-delimiters (&optional quiet) "\ Erase the embracing field delimiters of current field, if any." (interactive) (byte-code "Áˆƒ Á‚ ÇÈ!ˆÃÉ Ê 8@ SbˆËÌ!ƒD`ÍÎ!ˆÏÐ!ˆbˆÏÎ!ˆƒ=Á‚@ÇÑ!)‚OƒLÁ‚OÒÓ!+‡" [quiet nil case-fold-search t cf fb back message "Erasing current field delimiters..." bibtex-current-field-data 3 looking-at "[{\"]" forward-sexp 1 delete-char -1 "Erasing current field delimiters...done" error "Erasing current field delimiters...abort (delimiters missing)"] 9)) (defun bibtex-erase-field (&optional quiet) "\ Erase current field, if any. Move point to next field, if any; else move point to previous field, if any. If the optional QUIET is non-nil, do this quietly." (interactive) (byte-code "Áˆƒ Á‚ ÊË!ˆÃÌ  ƒoÍ 8Î 8ÏÎ!…8Î8U…8 S‰ˆÐ \"ˆÑÎ!ƒPÒ!‚^Ó   …]Ò !))ˆƒhÁ‚kÊÔ!+‚zƒwÁ‚zÕÖ!*‡" [quiet nil case-fold-search t cf fb fe pf nf new-cf message "Erasing current field..." bibtex-current-field-data 0 1 bibtex-previous-field-data kill-region bibtex-next-field-data bibtex-goto-context bibtex-current-field "Erasing current field...done" error "Erasing current field...abort (field missing)"] 11)) (defun bibtex-erase-text (&optional quiet) "\ Erase the text of current field. Point remains unchanged. If the optional QUIET is non-nil, do this quietly." (interactive) (byte-code "Áˆƒ Á‚ ÈÉ!ˆÃÊ  ƒ:Ë 8 @Ì 8Í\"ˆƒ3Á‚6ÈÎ!+‚EƒBÁ‚EÈÏ!*‡" [quiet nil case-fold-search t cf xt xb xe message "Erasing current text..." bibtex-current-field 3 1 kill-region "Erasing current text...done" "Erasing current text...abort (text missing)"] 6)) (defun bibtex-text-previous-entry (&optional n &optional quiet) "\ Copy field text from Nth previous entry, if any, before point. If the optional QUIET is non-nil, do this quietly." (interactive "P") (byte-code "ˆ†͉ˆ ƒ‚ÎÏ\"ˆÄÐ  ƒ›ÑÄ\"ƒ‹Ò 8@Í8 Ò8 Ó  \"ƒY ƒR‚VÔÕ\"‚‡ŠbˆÖ !)ƒ~×ÒØ88!ˆ ƒw‚{ÎÙ\"‚‡Ú Û %,‚— ƒ“‚—ÔÜ\")‚§ ƒ£Â‚§ÔÝ\"*‡" [n quiet nil case-fold-search t cf pe tp tb te type bibtex-abbrev bibtex-entry-match 1 message "Copying text from previous entry #%d..." bibtex-current-field-data bibtex-previous-entry 2 string-equal error "Copying text from previous entry #%d...abort (can't copy abbreviation)" looking-at insert-string 3 "Copying text from previous entry #%d...done (entry label)" bibtex-get-text "previous" "Copying text from previous entry #%d...abort (entry not found)" "Copying text from previous entry #%d...abort (field missing)"] 14)) (defun bibtex-text-next-entry (&optional n &optional quiet) "\ Copy field text from Nth next entry, if any, before point. If the optional QUIET is non-nil, do this quietly." (interactive "P") (byte-code "ˆ†͉ˆ ƒ‚ÎÏ\"ˆÄÐ  ƒ›ÑÄ\"ƒ‹Ò 8@Í8 Ò8 Ó  \"ƒY ƒR‚VÔÕ\"‚‡ŠbˆÖ !)ƒ~×ÒØ88!ˆ ƒw‚{ÎÙ\"‚‡Ú Û %,‚— ƒ“‚—ÔÜ\")‚§ ƒ£Â‚§ÔÝ\"*‡" [n quiet nil case-fold-search t cf ne tp tb te type bibtex-abbrev bibtex-entry-match 1 message "Copying text from next entry #%d..." bibtex-current-field-data bibtex-next-entry 2 string-equal error "Copying text from next entry #%d...abort (can't copy abbreviation)" looking-at insert-string 3 "Copying text from next entry #%d...done (entry label)" bibtex-get-text "next" "Copying text from next entry #%d...abort (entry not found)" "Copying text from next entry #%d...abort (missing field)"] 14)) (defun bibtex-get-text (n entry type p-or-n &optional quiet) (byte-code " @Í 8Î #ŠbˆÏ È#†# …#Ï È#…(Ð )Ñ …MÒÒ88‰ ˆÓ \"†MÔ Õ ÖR!ƒoÒ×88cˆ ƒcØÙ!‚lØÚ   $‚… ƒzØÙ!‚…Û ˆØÜ  $-‡" [eb entry ee regexp type bibtex-field-types bibtex-field-specs source t label quiet p-or-n n 1 bibtex-get-spec re-search-forward bibtex-current-field nil 2 string-equal y-or-n-p " not found, copy " " instead? " 3 message "" "Copying text from %s entry #%d...done (%s)." ding "Copying text from %s entry #%d...abort (field %s not in entry)"] 15)) (defun bibtex-zap-name nil (interactive) (byte-code "ĈÁÄÄŠÅÆ!ˆÇÈ!ˆ`T‰ˆÉÊ!ˆË lƒ$`‚&`S\"‰)ˆhÌUƒ6 c‚:ÍÌ \"ˆÎÏ!+‡" [case-fold-search t begin name nil search-backward "@" forward-word 1 re-search-forward ":\\|,\\|$" buffer-substring 32 insert capitalize-word -1] 7))