[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Zmacs window size



    Date: Fri, 12 Jun 1992 13:00 EDT
    From: Steven L. Smith <smith@icat.larc.nasa.gov>

    I would like to set up my init-file to configure my Zmacs window a designated size.

For most situations, this is enough:
(tv:set-default-window-size 'zwei:zmacs-frame tv:main-screen t :left 100 ...) ; fill in your choices

You can get the existing defaults from:
(cdr (assoc 'zwei:zmacs-frame
	    (cdr (assoc tv:main-screen tv:*default-window-size-alist*))))

and the size of the main-screen from: (send tv:main-screen :inside-edges)


Finally, if you're being totally compulsive, you could emulate this:

 ;; Set the default size of the editor window, remembering the old defaults for
 ;; logout-forms. Unfortunately, this is not quite enough as the standard value of the
 ;; defaults upon startup sets :width only and relies on :left defaulting to 0.  So a
 ;; kludge has been added, that if the old default doesn't contain :left or both :width
 ;; and :right, then a spec for :left is added.

 (let ((elem (assq tv:main-screen tv:*default-window-size-alist*)))
   (multiple-value-bind (left top right bottom) (send tv:main-screen :inside-edges)
     (let ((old-defaults (cdr (assq 'zwei:zmacs-frame (cdr elem))))
	 (new-defaults (list ':left (+ left 100) ':top top ':right right ':bottom bottom)))
       ;; here's the kludge
       (when (not (or (memq ':left old-defaults) (and (memq ':width old-defaults) (memq ':right old-defaults))))
	 (setq old-defaults (append old-defaults `(:left ,left))))
       ;; here's the proper stuff
       (lexpr-funcall #'tv:set-default-window-size 'zwei:zmacs-frame tv:main-screen t new-defaults)
       (push `(tv:set-default-window-size 'zwei:zmacs-frame tv:main-screen t ,.old-defaults)
	     si:logout-list))))