(provide (quote VorTeX-common)) (defvar vortex-default-print-command "lpr -d -P" "\ Print command for use with unknown printer.") (defvar vortex-printer-query t "\ Nil if no need to query for printer name.") (defvar vortex-printer-data (quote (("cx" . "dps -Pcx") ("dp" . "lpr -d -Pdp") ("gp" . "dps -Pgp") ("ps" . "dps -Pps"))) "\ Association list of available printers and their corresponding print commands for .dvi files") (defvar vortex-printer-list (concat "(" (mapconcat (quote car) vortex-printer-data ", ") ")") "\ Printer list for prompting") (defvar vortex-default-printer (let ((env-printer (getenv "PRINTER"))) (if env-printer env-printer "gp")) "\ Default printer") (defvar vortex-default-print-command "lpr -d -P" "\ Print command for use with unknown printer.") (defvar vortex-printer-query t "\ Nil if no need to query for printer name.") (defvar vortex-printer-queue "lpq -P" "\ Default printer") (defvar vortex-extractor "dviselect" "\ Program which extracts pages from DVI file") (defun vortex-user-response (head response-data) "\ Gets the user's response to a request. HEAD is a string which is usually used to request a response. RESPONSE-DATA is a list of three-element lists. The first element is a list of acceptable characters. The second element is a string to be included in the user prompt. The third element is a symbol which will be the return value if the user enters one one of the characters in the first element." (byte-code " #R!r \"?- \"!! *" [prompt head response-data result nil "[" mapconcat (lambda (x) (nth 1 x)) " " "]" message vortex-match-response ding "%s...WHAT?" sit-for 1] 9)) (defun vortex-match-response (char response-data) (byte-code "?  @@>@8 A\"" [response-data nil char 2 vortex-match-response] 3)) (defun vortex-mkpath (env) "\ Make a path, a list of strings, out of ENV, an environment variable." (byte-code "!7\" * O B TO3 B‰ !+" [env path nil to getenv string-match ":" 0 reverse] 6)) (defun vortex-mkstring (pre post l) (byte-code "#" [l mapconcat (lambda (elt) (concat pre elt post)) "\\|"] 4)) (defun vortex-file-exists-p (file &optional path) "\ Check if FILE is in default-directory, if not, check if it's in PATH. Return the full path name of FILE is found, else return nil." (byte-code " #" [file path vortex-file-predicate file-exists-p] 4)) (defun vortex-file-readable-p (file &optional path) "\ Check if FILE is in default-directory and is readable. Otherwise, looks for a readable file of the same name in each directory in PATH." (byte-code " #" [file path vortex-file-predicate file-readable-p] 4)) (defun vortex-file-predicate (file file-predicate path) (byte-code " B \" ȍ*" [path default-directory fn file-predicate file nil funcall done (byte-code "\"@ Q \" \"A" [path fn file file-predicate "/" funcall throw done] 5)] 3)) (defun vortex-memq (key l) (byte-code " @\" A\"" [l key string-equal vortex-memq] 4)) (defun vortex-keymap-util (mode-data) (byte-code "\"" [mode-data mapcar vortex-set-file-bindings] 3)) (defun vortex-set-file-bindings (file-data) (byte-code " @ A \"*" [file file-data map-data-list mapcar (lambda (map-data) (vortex-set-bindings file map-data))] 3)) (defun vortex-set-bindings (file map-data) (byte-code " @K A \"*" [keymap map-data key-data-list mapcar (lambda (key-data) (let ((key-sequence (car key-data)) (key-binding (nth 1 key-data))) (if key-sequence (define-key keymap key-sequence key-binding)) (if file (autoload key-binding file))))] 3)) (defun vortex-parse-comma-list (fl) "\ Parse a string containing comma-separated file names into a list of file names (each of which is a string). If a file name includes a comma, that comma must be 'escaped' with a double backslash (\\), to be ignored as a separator." (byte-code "  \"! SO O!B) C!)" [md fl after-comma match-data string-match "[^\\]," match-end 0 vortex-parse-comma-list nil store-match-data] 8)) (defun vortex-init-process-buffer (buffer-name) (byte-code " !!) !q )" [process buffer-name nil get-buffer-process kill-process get-buffer-create erase-buffer] 5)) (defun vortex-match-string (number) (byte-code "!!\"" [number buffer-substring match-beginning match-end] 5)) (progn (string-match "\\([0-9]+\\)\\.\\([0-9]+\\)" emacs-version) (let ((first-num (string-to-int (substring emacs-version (match-beginning 1) (match-end 1)))) (second-num (string-to-int (substring emacs-version (match-beginning 2) (match-end 2))))) (if (or (< first-num 18) (and (= first-num 18) (< second-num 54))) (defun define-prefix-command (symbol) (fset symbol (make-keymap)))))) (defun vortex-mapcan (func list) (byte-code "?  @\" A\"\"" [list nil func nconc funcall vortex-mapcan] 6))