(require (quote BibTeX-mode)) (defconst bibtex-notes-env "BTXMODENOTEFILES") (defconst bibtex-notes-path (vortex-mkpath bibtex-notes-env)) (defconst bibtex-notes-prompt-data (quote (((121 32) "SPC/y" yes) ((110 127) "DEL/n" no) ((97 10) "RET/a" asknot) ((100 27) "ESC/d" done) ((18) "C-r" recurse)))) (defun bibtex-view-notefiles (&optional n) "\ Displays the contents of files listed in the `NOTEFILES' field of the current entry. If N is nil, then the user is prompted with the name of each readable file in the field. He can choose to display or skip the file, enter recursive edit, enter `asknot' sub-mode, or return to editing the BibTeX window. `Asknot' sub-mode displays and enters a recursive editing session for each readable file remaining in the list." (interactive "P") (byte-code "ȈÁ ƒ% SÌ 8Í \"?ƒÎÏ \"‚!ŠÐ‹))‚?Ì  ÈÑp! È È ŠÒ‹).)‡" [case-fold-search t n file bibtex-notes-path file-list files cur-file nil bib-window notes-window response bibtex-notefiles-list vortex-file-readable-p error "\"%s\" not readable" ((byte-code "Â!ƒ ÃÁ\"‚Ä!ˆÅÆ!ˆÇ ‡" [file t get-buffer display-buffer find-file-other-window message "Entering recursive edit...(return to current state ESC C-c)" recursive-edit] 6)) get-buffer-window ((byte-code "ÀÁ‡" [finish (byte-code "À…ÕÉ @ \"‰ˆ ?ƒ,ÊË @\"ˆrˆ A‰?…$ ‰ˆ @‰‚Ñ …ÑÌÍ ÎQ\"‰ˆ Ï=ƒ_Ð #‰ˆ A‰?…W ‰ˆ @‰‚Ñ Ñ=ƒx A‰?…p ‰ˆ @‰‚Ñ Ò=ƒŒÓ #ˆ ‰‚Ñ Ô=…”ƒ¬Õ!ˆÊÖ!ˆŠ×‹)ˆÕ!‚Ñ Ô=…µ?ƒÃÊÖ!ˆŠØ‹)‚Ñ Ù=…ÑÊÚ!ˆÛÜÀ\"ˆ‚‡" [t cur-file files bibtex-notes-path file-list response bibtex-notes-prompt-data notes-window bib-window vortex-file-readable-p message "Could not find readable copy of \"%s\" ... (strike any key to continue)" vortex-user-response "Display " "? " yes bibtex-display-notefile no asknot bibtex-display-edit-notefiles recurse select-window "Entering recursive edit...(return to current state ESC C-c)" ((byte-code "À ‡" [recursive-edit] 2)) ((byte-code "À ‡" [recursive-edit] 2)) done "" throw finish] 14)] 2))] 6)) (defun bibtex-notefiles-list nil "\ Returns a list of file names found in the NOTEFILES field of the current entry" (byte-code "ŠÂÁ!@bˆÃÄÅ8Á#…ÆÇÈÉÊË 88!\"))‡" [current-entry nil bibtex-search-entry re-search-forward "[ ,]NOTEFILES\\s *=" 1 mapcar bibtex-remove-spaces vortex-parse-comma-list 2 3 bibtex-current-field-data] 9)) (defun bibtex-remove-spaces (string) "\ Returns STRING with leading and trailing white space removed." (byte-code "ÄÅ \"ÄÆ #ÄÅ # … …,ÄÆ #‰ˆÄÅ #‰ˆ‚ˆ  O+‡" [start string end temp string-match "[^ ]" "[ ]"] 9)) (defun bibtex-readable-files (file-list) "\ Returns a list containing all files in FILE-LIST which are readable. The current directory and all directories on BIBTEX-PATH (global) are checked while trying to find the file." (byte-code "?ƒ Á‚!Ä@ \" ƒ ÅA!B‚ ÅA!)‡" [file-list nil first-file bibtex-path vortex-file-readable-p bibtex-readable-files] 4)) (defun bibtex-display-notefile (file bib-window notes-window) "\ Displays FILE in NOTES-WINDOW, then moves cursor to BIB-WINDOW. If NOTES-WINDOW is nil, FILE is displays in some other window (which is created, if necessary). Returns notes-window." (byte-code "ƒÄ!ˆÅ !ƒÆ !‚Ç !ˆÄ !‚+È !ˆÉp!‰ˆÄ !ˆ‡" [notes-window file bib-window t select-window get-buffer switch-to-buffer find-file find-file-other-window get-buffer-window] 9)) (defun bibtex-display-edit-notefiles (files bib-window notes-window) "\ Displays each file in the list FILES. Once a file has been displayed a recursive editing session is begun. The user switches to the next file by exiting the recursive editing session. (This approach to moving from file to file is taken to avoid having to support another prompt/reply function)." (byte-code "…Ã@ #‰ˆŠÄ‹)ˆA‰ˆ‚‡" [files notes-window bib-window bibtex-display-notefile ((byte-code "Á!ˆÂÃ!ˆÄ ‡" [notes-window select-window message "ESC C-c will display the next file." recursive-edit] 4))] 5))