Date: Tue, 29 Aug 89 19:16:45 -0400 To: NeWS-makers@brillig.umd.edu Subject: Re: screenlock & Emacstool-like interface ?? From: crdgw1!crdgw1.ge.com!barnett@uunet.uu.net (Bruce Barnett) In article , eho@word (Eric Ho) writes: >Is there any screenlock program under NeWS ? There is Stan Switzer's Blankscreen program that was posted to comp.window.news a while ago. Perhaps the archive server has it. If you don't have it, I have a copy. > Also, is the ps-emacs GNU Emacs interface has the >same functionalities as Emacstool ? Not really. Here is some code I use with GNUemacs and NeWS 1.1 to provide a few functions. I am not much of a Lisp hacker, so this code is very simple. It does give you some ideas on how to add your own menus, functions, etc. in my .emacs file: ;;; NeWS package (autoload 'NeWS-init "NeWS.el" "" t) (if (equal window-system 'NeWS) (NeWS-init) ) ----------------------------- NeWS.el: ------------------------ ;;; (defun NeWS-init () "Initialize NeWS routines" (defun MoVE-R () "Move NeWS session to the right side of the screen" (interactive) (NeWS-set-origin 550 1)) (defun MoVE-L () "Move NeWS session to the left side of the screen" (interactive) (NeWS-set-origin 1 1)) (defun ZoOM () "ZoOM to full size of window " (interactive) (NeWS-set-dimensions 80 50 )) (defun UNZoOM () "UnZoOM to smaller size of window " (interactive) (NeWS-set-dimensions 80 34)) (defun NeWS-W () "NeWS set width to 100 characters" (interactive) (NeWS-set-dimensions 100 34)) (defun Screen-11 () "NeWS - set font to screen , size to 11" (interactive) (NeWS-set-font "Screen" 11)) (defun Screen-13 () "NeWS - set font to screen , size to 13" (interactive) (NeWS-set-font "Screen" 13)) (defun Screen-15 () "NeWS - set font to screen , size to 15" (interactive) (NeWS-set-font "Screen" 15)) (defun Screen-7 () "NeWS - set font to screen , size to 7" (interactive) (NeWS-set-font "Screen" 7)) (defun Courier-14 () "NeWS - set font to Courier , size to 14" (interactive) (NeWS-set-font "Courier" 14)) (defun Courier-13 () "NeWS - set font to Courier , size to 13" (interactive) (NeWS-set-font "Courier" 13)) ;;; define NeWS functions (global-set-key "\C-cr" 'MoVE-R) (global-set-key "\C-cl" 'MoVE-L) (global-set-key "\C-cz" 'ZoOM) (global-set-key "\C-cu" 'UNZoOM) ;;; ;;; set default font size (setq NeWS-FontSize 12) ;;; Set default font ;;; (setq NeWS-Font "Courier") (NeWS-set-font "Courier" 12) (defun NeWS-FontSizeInc () "Increase font size by 1 point" (interactive) (setq NeWS-FontSize ( 1+ NeWS-FontSize)) (NeWS-set-font NeWS-Font NeWS-FontSize)) (defun NeWS-FontSizeDec () "Decrease font size by 1 point" (interactive) (setq NeWS-FontSize (max 0 ( 1- NeWS-FontSize))) (NeWS-set-font NeWS-Font NeWS-FontSize)) (defun NeWS-FontType (Type) "Set NeWS font" (setq NeWS-Font Type) (NeWS-set-font NeWS-Font NeWS-FontSize)) (setq NeWS-setup-hook '(lambda nil (NeWS-set-dimensions 80 50) (NeWS-set-origin 1 1) ;;; (NeWS-set-font "Courier-Bold" 16) ;;; (NeWS-set-dimensions 80 56) (NeWS-set-window-retained t) ;;;; ;;; (NeWS-send-PostScript "0 (Gnews) {(Gnews) emacscmd} ;;; /insertitem window /FrameMenu get send" nil) (NeWS-send-PostScript (file-contents-as-string "~/.emacs.ps") nil) ) ) ) --------------- And in my .emacs.ps file, which is in a separate file so I can use postscript mode: ----------------------- % NeWS code for menus /Courier [ (C14) { (Courier-14) emacscmd} (C13) { (Courier-13) emacscmd} ] /new DefaultMenu send def /Screen [ (S7) { (Screen-7) emacscmd} (S11) { (Screen-11) emacscmd} (S13) { (Screen-13) emacscmd} (S15) { (Screen-15) emacscmd} ] /new DefaultMenu send def /RowCol [ (24x80) { (NeWS-set-dimensions 80 24 ) emacscmd} (34x80) { (NeWS-set-dimensions 80 34 ) emacscmd} (50x80) { (NeWS-set-dimensions 80 50) emacscmd} (24x100) { (NeWS-set-dimensions 100 24) emacscmd} (8x80) { (NeWS-set-dimensions 80 8) emacscmd} (ZoOM) { (ZoOM) emacscmd} (UNZoOM) { (UNZoOM) emacscmd} ] /new DefaultMenu send def /Policies [ (Retain True) { (NeWS-set-window-retained t) emacscmd} (Retain False) { (NeWS-set-window-retained nil) emacscmd} (Input:TypeIn ) { (NeWS-set-input-policy t) emacscmd} (Input:Insert ) { (NeWS-set-input-policy nil) emacscmd} (HardwareLine:On ) { (NeWS-set-i&d-line-ok t) emacscmd} (HardwareLine:Off ) { (NeWS-set-i&d-line-ok nil) emacscmd} (HardwareChar:On ) { (NeWS-set-i&d-char-ok t) emacscmd} (HardwareChar:Off ) { (NeWS-set-i&d-char-ok nil) emacscmd} (HardwareScroll:On ) { (NeWS-set-scroll-region-ok t) emacscmd} (HardwareScroll:Off ) { (NeWS-set-scroll-region-ok nil) emacscmd} ] /new DefaultMenu send def /FontStyles [ (Courier-Bold) { (NeWS-FontType "Courier-Bold") emacscmd} (Courier) { (NeWS-FontType "Courier") emacscmd} (Screen-Bold) { (NeWS-FontType "Screen-Bold") emacscmd} (Screen) { (NeWS-FontType "Screen") emacscmd} (Dali) { (NeWS-FontType "dali") emacscmd} (OldEnglish) { (NeWS-FontType "OldEng") emacscmd} (boxie) { (NeWS-FontType "boxie") emacscmd} (atlanta) { (NeWS-FontType "atlanta") emacscmd} (nonie) { (NeWS-FontType "nonie") emacscmd} (chicago) { (NeWS-FontType "chicago") emacscmd} (broadway) { (NeWS-FontType "broadway") emacscmd} (square_serif) { (NeWS-FontType "square_serif") emacscmd} ] /new DefaultMenu send def /FontSizes [ (Larger) { (NeWS-FontSizeInc) emacscmd} (Smaller) {(NeWS-FontSizeDec) emacscmd} ] /new DefaultMenu send def /Fonts [ (Sizes...) FontSizes (Styles...) FontStyles ] /new DefaultMenu send def { /ClientMenu [ (Fonts...) Fonts % (Courier...) Courier % (Screen....) Screen (Row x Col..) RowCol (Gnews) { (Gnews) emacscmd} (Info) { (info) emacscmd} (Policies...) Policies (Frame...) FrameMenu ] /new DefaultMenu send def } window send % select a color for the frame { /FrameFillColor 1 0 1 rgbcolor def } window send -- Bruce G. Barnett uunet!crdgw1!barnett