;ELC ;;; compiled by jwz@thalidomide on Sat May 21 06:41:34 1994 ;;; from file /th/jwz/emacs19/lisp/modes/postscript.el ;;; emacs version 19.10 Lucid (beta25). ;;; bytecomp version 2.24; 26-Apr-94. ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19"))) (error "This file was compiled for Emacs 19.")) (provide 'postscript) (defconst ps-indent-level 2 "\ *Indentation to be used inside of PostScript blocks or arrays") (defconst ps-tab-width 8 "\ *Tab stop width for PostScript mode") (fset 'ps-make-tabs #[(stop) "W \\!B" [stop 132 ps-make-tabs ps-tab-width] 4]) (defconst ps-tab-stop-list (ps-make-tabs ps-tab-width) "\ *Tab stop list for PostScript mode") (defconst ps-postscript-command '("gs" "-") "\ *Command used to invoke with a printer spooler or NeWS server.") (defvar ps-mode-map nil "\ Keymap used in PostScript mode buffers") (defvar ps-mode-syntax-table nil "\ PostScript mode syntax table") (byte-code "!p!Ǝ q !\"ced\"Ϝ,!W\"U#Tb########### #########)ԇ" [boundp ps-balanced-string-syntax-p generate-new-buffer "x" loser b ((byte-code "q\n!" [b kill-buffer loser] 2)) set-syntax-table copy-syntax-table modify-syntax-entry 40 "\")" "((" parse-partial-sexp v 3 t ps-mode-syntax-table 0 i nil 256 char-syntax 119 "_" 32 " " 9 12 13 37 "<" 10 ">" 92 "\\" 63 95 46 47 "'" 41 "\"(" "(" ")" 91 "(]" 93 ")[" 123 "(}" 125 ")}" "' p"] 5) (fset 'postscript-mode #[nil " \n! !!!!\n! !!!!!" [kill-all-local-variables use-local-map ps-mode-map set-syntax-table ps-mode-syntax-table make-local-variable comment-start "% " comment-start-skip "%+ *" comment-column 40 indent-line-function ps-indent-line tab-stop-list ps-tab-stop-list page-delimiter "^showpage" parse-sexp-ignore-comments t "PostScript" mode-name postscript-mode major-mode run-hooks ps-mode-hook postscript-mode-hook] 2 "\ Major mode for editing PostScript files. \\[ps-execute-buffer] will send the contents of the buffer to the NeWS server using psh(1). \\[ps-execute-region] sends the current region. \\[ps-shell] starts an interactive psh(1) window which will be used for subsequent \\[ps-execute-buffer] or \\[ps-execute-region] commands. In this mode, TAB and \\[indent-region] attempt to indent code based on the position of {}, [], and begin/end pairs. The variable ps-indent-level controls the amount of indentation used inside arrays and begin/end pairs. \\{ps-mode-map} \\[postscript-mode] calls the value of the variable postscript-mode-hook with no args, if that value is non-nil." nil]) (fset 'ps-tab #[nil "xn) )" [" " nil ps-indent-line] 2 "\ Command assigned to the TAB key in PostScript mode." nil]) (fset 'ps-indent-line #[nil "y ! ?`dW`fz= ! " [0 delete-horizontal-space looking-at "%%" ps-top-level-p 41 ps-indent-close "\\(dict\\|class\\)?end\\|cdef\\|grestore\\|>>" ps-indent-end ps-indent-in-block] 2 "\ Indents a line of PostScript code." nil]) (fset 'ps-insert-d-char #[(arg) " \n\"y! )" [insert-char last-command-char arg 0 looking-at "^[ ]*\\(\\(dict\\|class\\)?end\\|cdef\\|grestore\\)" delete-horizontal-space ps-indent-end] 3 "\ Awful hack to make \"end\" and \"cdef\" keywords indent themselves." "p"]) (fset 'ps-close #[nil "c! u " [last-command-char backward-char 1 ps-indent-close blink-matching-open] 2 "\ Inserts and indents a close delimiter." nil]) (fset 'ps-indent-close #[nil "xn)`u `\n\"=\n`ZV\nbywi\nb j*" [" " nil oldpoint x backward-sexp count-lines 1 0 delete-horizontal-space] 3 "\ Internal function to indent a line containing a an array close delimiter."]) (fset 'ps-indent-end #[nil "  b i)j)" [ps-block-start goal indent-relative back-to-indentation] 2 "\ Indent an \"end\" token or array close delimiter."]) (fset 'ps-indent-in-block #[nil "  b n i \\)j)" [ps-block-start goal back-to-indentation ps-indent-level] 3 "\ Indent a line which does not open or close a block."]) (fset 'ps-block-start #[nil " !*" [nil (byte-code "!`T)" [backward-up-list 1] 2) ((error)) open ps-begin-end-hack] 3 "\ Returns the character position of the character following the nearest enclosing `[' `{' or `begin' keyword."]) (fset 'ps-begin-end-hack #[(start) "V # #! T S_ = v`*" [1 depth 0 re-search-backward "^[ ]*\\(dict\\|class\\)?\\(end\\|grestore\\|>>\\)\\|\\(begin\\|gsave\\|<<\\)[ ]*\\(%.*\\)*$" start t "^[ ]*cdef.*$" looking-at "[ ]*\\(dict\\|class\\)?\\(end\\|grestore\\|>>\\)"] 5 "\ Search backwards from point to START for enclosing `begin' and returns the character number of the character following `begin' or START if not found."]) (fset 'ps-top-level-p #[nil "!?" [nil (byte-code "`#?" [scan-lists -1 1] 4) ((error t)) ps-begin-end-hack] 3 "\ Awful test to see whether we are inside some sort of PostScript block."]) (byte-code " \"####" [ps-mode-map make-sparse-keymap set-keymap-name define-key " " ps-tab "" ps-execute-buffer "|" ps-execute-region "!" ps-shell] 4) (fset 'ps-execute-buffer #[nil " ed\")" [mark-whole-buffer ps-execute-region] 3 "\ Send the contents of the buffer to a printer or NeWS server." nil]) (fset 'ps-execute-region #[(start end) "` ^` ]ŏ*" [mark end start nil (byte-code "\n {\"" [process-send-string "PostScript" start end] 4) ((error (byte-code " \n #$" [shell-command-on-region start end mapconcat identity ps-postscript-command " " nil] 7)))] 3 "\ Send the region between START and END to a printer or NeWS server. You should kill any existing *PostScript* buffer unless you want the PostScript text to be executed in that process." "r"]) (fset 'ps-shell #[nil "!@A%!!ʉ " [require shell switch-to-buffer-other-window apply make-comint "PostScript" ps-postscript-command nil make-local-variable shell-prompt-pattern "GS>"] 7 "\ Start a shell communicating with a PostScript printer or NeWS server." nil])