v087mxgb@ubvmsa.cc.buffalo.edu (Shawn E Thompson) (01/11/91)
Hi, I am hoping you can help me (maybe there is an easy solution); how can I print a file I am editing in Microemacs. I do not care if it gets buffered with the DOS print command or just copied out the lpt port.... I know I could write a macro that would save temp file and print that out, but how can I do this without the temp file??? Shawn E. Thompson "....the beatings will continue until moral improves!!" v087mxgb@ubvms.cc.buffalo.edu | set@autarch.acsu.buffalo.edu University @ Buffalo|Graduate School of Mechanical Engineering CAD Engineering|Leica, Inc.|PO Box 123|Buffalo, NY 14240-0123|(716)891-3375
wallace@ynotme.enet.dec.com (Ray Wallace) (01/12/91)
In article <54082@eerie.acsu.Buffalo.EDU>, v087mxgb@ubvmsa.cc.buffalo.edu (Shawn E Thompson) writes... >how can I print a file I am editing in Microemacs. I do not >care if it gets buffered with the DOS print command or just >copied out the lpt port.... > >I know I could write a macro that would save temp file and >print that out, but how can I do this without the temp file??? If you don't want to use a macro (which I've attached) Place the following in your RC file and use META-P to print the current buffer. This code sends the buffer to the PRN: device. If you are using a different device name, just change the write-file line (!force write-file "prn:") appropriatly. bind-to-key execute-macro-39 M-P ; Print the current buffer. ; Uses buffer <Print>. Does NOT affect any other buffers. 39 store-macro set $discmd FALSE ; Don't display commands set %buffer $cbufname print "Creating <Print> buffer" 5 set-mark beginning-of-file set-mark end-of-file copy-region 5 goto-mark select-buffer "<Print>" yank set %ok TRUE beginning-of-file ;If you do not want a form-feed sent at the end, then delete the next 2 lines end-of-file insert-string "~f" print "Printing..." ;MUST set $ssave to FALSE else Emacs will try to RENAME a file to ;PRN: which will fail. set %Ssave $ssave set $ssave FALSE !force write-file "prn:" set %Status $status set $ssave %Ssave ;Restore the original value !if ¬ %Status print "Printer not available" unmark-buffer ;Unmark it so the delete-buffer doesn't fail !else clear-message-line !endif select-buffer %buffer delete-buffer "<Print>" remove-mark set $discmd TRUE !endm --- Ray Wallace (INTERNET,UUCP) wallace@oldtmr.enet.dec.com (UUCP) ...!decwrl!oldtmr.enet!wallace (INTERNET) wallace%oldtmr.enet@decwrl.dec.com ---