From: warsaw@nlm.nih.gov (Barry A. Warsaw)
Newsgroups: alt.lucid-emacs.help
Subject: Re: kind of -geometry wxh+x+y for a new screen
Date: 27 Jan 93 17:45:18 GMT
	<WARSAW.93Jan26153002@anthem.nlm.nih.gov>
Reply-To: warsaw@nlm.nih.gov (Barry A. Warsaw)
Organization: Century Computing, Inc.


Some folks wanted to see how I set up my .Xdefaults files for doing
lemacs screeny things.  Here's some (hopefully) useful excerpts, but
first some background.  I use tvtwm (R5) and my main emacs window
takes up the entire right side of the screen, full length, 80
characters wide. This screen I call RIGHTSCREEN.

My other app icons and virtual desktop take up the lower 1/8 (?) of a
screen on the left side, so I like to sometimes pop up screens on the
left spanning from the top to just above these icons. This screen I
call LEFTSCREEN.

I also like to pop up 2 useful screens in the middle to do some quick
context switching.  The first screen I call QUICK and the other I call
WIDE (which is 120 characters wide).  I use "C-x 5" as a keymap prefix
and have bindings for operating on screens. I'll include the elisp
before the .Xdefault excerpt. Here are my bindings:

C-x 5 l  -- create a new LEFTSCREEN
C-x 5 r  -- create a new RIGHTSCREEN
C-x 5 q  -- create a new QUICK
C-x 5 w  -- create a new WIDE

C-x 5 L  -- create a new LEFTSCREEN, with query for file
C-x 5 R  -- create a new RIGHTSCREEN, with query for file
C-x 5 Q  -- create a new QUICK, with query for file
C-x 5 W  -- create a new WIDE, with query for file

C-x 5 C-l  -- create a new LEFTSCREEN, with query for existing buffer
C-x 5 C-r  -- create a new RIGHTSCREEN, with query for existing buffer
C-x 5 C-q  -- create a new QUICK, with query for existing buffer
C-x 5 C-w  -- create a new WIDE, with query for existing buffer

C-x 5 k -- delete (kill) current screen
C-x 5 1 -- make current screen the only screen
C-x 5 n -- select next screen
C-x 5 p -- select previous screen

Some of my color choices may no doubt seem gaudy, I haven't really
settled on the most pleasing (for me, anyway ;-) combinations.  Good
color combinations are hard to come by!  Anybody wanna post theirs?


;; screenfood.el -- 27-Jan-1993 bwarsaw@cen.com
;; macros might be cleaner, but hey! it works...
(defun baw:new-left-screen ()
  (interactive)
  (x-new-screen "LEFTSCREEN"))

(defun baw:new-right-screen ()
  (interactive)
  (x-new-screen "RIGHTSCREEN"))

(defun baw:new-quick-screen ()
  (interactive)
  (x-new-screen "QUICK"))

(defun baw:new-wide-screen ()
  (interactive)
  (x-new-screen "WIDE"))

(defun baw:find-file-new-screen (filename screen)
  (let ((buf (find-file-noselect filename))
	(scr (x-new-screen screen)))
    (if scr (select-screen scr))
    (switch-to-buffer buf)))

(defun baw:switch-to-buffer-new-screen (buffer screen)
  (let ((scr (x-new-screen screen)))
    (if scr (select-screen scr))
    (switch-to-buffer buffer)))

(defun baw:find-file-left-screen (filename)
  (interactive "FFind file in new left screen: ")
  (baw:find-file-new-screen filename "LEFTSCREEN"))

(defun baw:find-file-right-screen (filename)
  (interactive "FFind file in new right screen: ")
  (baw:find-file-new-screen filename "RIGHTSCREEN"))

(defun baw:find-file-wide-screen (filename)
  (interactive "FFind file in new wide screen: ")
  (baw:find-file-new-screen filename "WIDE"))

(defun baw:find-file-quick-screen (filename)
  (interactive "FFind file in new quick screen: ")
  (baw:find-file-new-screen filename "QUICK"))

(defun baw:buffer-in-left-screen (buffer)
  (interactive "BSwitch to buffer in new left screen: ")
  (baw:switch-to-buffer-new-screen buffer "LEFTSCREEN"))

(defun baw:buffer-in-right-screen (buffer)
  (interactive "BSwitch to buffer in new right screen: ")
  (baw:switch-to-buffer-new-screen buffer "RIGHTSCREEN"))

(defun baw:buffer-in-wide-screen (buffer)
  (interactive "BSwitch to buffer in new wide screen: ")
  (baw:switch-to-buffer-new-screen buffer "WIDE"))

(defun baw:buffer-in-quick-screen (buffer)
  (interactive "BSwitch to buffer in new quick screen: ")
  (baw:switch-to-buffer-new-screen buffer "QUICK"))

(defun baw:next-screen ()
  (interactive)
  (let ((scr (next-screen nil nil t)))
    (select-screen scr)
    (raise-screen scr)))

(defun baw:previous-screen ()
  (interactive)
  (let ((scr (previous-screen nil nil t)))
    (select-screen scr)
    (raise-screen scr)))

;; screens keymap
(defvar baw:screen-keymap ()
  "Keymap for screen commands.")
(if baw:screen-keymap ()
  (setq baw:screen-keymap (make-sparse-keymap))
  (define-key baw:screen-keymap "l"           'baw:new-left-screen)
  (define-key baw:screen-keymap "r"           'baw:new-right-screen)
  (define-key baw:screen-keymap "q"           'baw:new-quick-screen)
  (define-key baw:screen-keymap "w"           'baw:new-wide-screen)
  (define-key baw:screen-keymap "L"           'baw:find-file-left-screen)
  (define-key baw:screen-keymap "R"           'baw:find-file-right-screen)
  (define-key baw:screen-keymap "Q"           'baw:find-file-quick-screen)
  (define-key baw:screen-keymap "W"           'baw:find-file-wide-screen)
  (define-key baw:screen-keymap [(control l)] 'baw:buffer-in-left-screen)
  (define-key baw:screen-keymap [(control r)] 'baw:buffer-in-right-screen)
  (define-key baw:screen-keymap [(control q)] 'baw:buffer-in-quick-screen)
  (define-key baw:screen-keymap [(control w)] 'baw:buffer-in-wide-screen)
  (define-key baw:screen-keymap "k"           'delete-screen)
  (define-key baw:screen-keymap "1"           'one-screen)
  (define-key baw:screen-keymap "n"           'baw:next-screen)
  (define-key baw:screen-keymap "p"           'baw:previous-screen)
  )
(global-set-key [(control x) ?5] baw:screen-keymap)


! Now for .Xdefault entries
! Ain't it great that xrdb filters stuff through cpp? :-)
!
! my standard font for lemacs text
#define TEXT_FONT	lucida.b.12

! for setting b/w and color screen specific resources
! please use X11R5
#ifdef COLOR
#	define COLORONLY(resource) resource
#	define BWONLY(resource)
#else
#	define COLORONLY(resource)
#	define BWONLY(resource) resource
#endif COLOR

#define SMALL	80x24
#define TALL	80x68
#define TALLISH	80x59
#define WIDEG   120x24

#define LEFT	+0+0
#define RIGHT	-2+4

! default settings
                                     Emacs*font: TEXT_FONT
                                 Emacs.geometry: TALL/**/RIGHT
                  Emacs*MHHC_FACE.attributeFont: lucidasans-bolditalic-12

! the following seems broken under 19.4
             Emacs*MHHC_FACE.attributeUnderline: false

! default colors
                     COLORONLY(Emacs*foreground: Black)
                     COLORONLY(Emacs*background: LightYellow)
                   COLORONLY(Emacs*pointerColor: Tomato)
                    COLORONLY(Emacs*cursorColor: Tomato)
               COLORONLY(Emacs*modeline.ATTFORE: Yellow)
               COLORONLY(Emacs*modeline.ATTBACK: Black)
                COLORONLY(Emacs*isearch.ATTBACK: RosyBrown1)
      COLORONLY(Emacs*primary-selection.ATTBACK: Khaki)
              COLORONLY(Emacs*MHHC_FACE.ATTFORE: ForestGreen)

! default for monochrome screens
                   BWONLY(Emacs*isearch.ATTBACK: Black)
                   BWONLY(Emacs*isearch.ATTFORE: White)
             BWONLY(Emacs*isearch.attributeFont: lucidasans-bolditalic-12)
         BWONLY(Emacs*primary-selection.ATTBACK: Black)
         BWONLY(Emacs*primary-selection.ATTFORE: White)
   BWONLY(Emacs*primary-selection.ATTBACKPixmap: nil)

! left/right screen geoms
                      Emacs*LEFTSCREEN.geometry: TALLISH/**/LEFT
                     Emacs*RIGHTSCREEN.geometry: TALL/**/RIGHT

! quick screen
                           Emacs*QUICK.geometry: SMALL/**/+372+49
               COLORONLY(Emacs*QUICK.foreground: Black)
               COLORONLY(Emacs*QUICK.background: PaleGoldenRod)
              COLORONLY(Emacs*QUICK.cursorColor: Tomato)
             COLORONLY(Emacs*QUICK.pointerColor: Tomato)
COLORONLY(Emacs*QUICK.primary-selection.ATTBACK: AliceBlue)

! wide screen
                            Emacs*WIDE.geometry: WIDEG/**/+193+372
          COLORONLY(Emacs*WIDE.modeline.ATTFORE: Blue)
          COLORONLY(Emacs*WIDE.modeline.ATTBACK: White)
                COLORONLY(Emacs*WIDE.foreground: Black)
                COLORONLY(Emacs*WIDE.background: Gainsboro)
               COLORONLY(Emacs*WIDE.cursorColor: Tomato)
              COLORONLY(Emacs*WIDE.pointerColor: Tomato)
 COLORONLY(Emacs*WIDE.primary-selection.ATTBACK: NavajoWhite)
           COLORONLY(Emacs*WIDE.isearch.ATTBACK: Azure)
x-gateway: rodan.UU.NET from help-lucid-emacs to alt.lucid-emacs.help; Wed, 27 Jan 1993 17:58:58 EST
From: piggy%hilbert.maths.utas.edu.au@lucid.com (La Monte Yarroll)
Subject: How to replace self-insert-command?
Date: Wed, 27 Jan 1993 18:42:27 EST
X-Mailer: ELM [version 2.2 PL11]
Newsgroups: alt.lucid-emacs.help