home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / gnu / emacs / help / 5104 < prev    next >
Encoding:
Text File  |  1992-12-16  |  2.9 KB  |  108 lines

  1. Newsgroups: gnu.emacs.help
  2. Path: sparky!uunet!news.claremont.edu!ucivax!megatek!hollen
  3. From: hollen@megatek.UUCP (Dion Hollenbeck)
  4. Subject: Re: emacs display in X11R5
  5. In-Reply-To: pedersen@seas.smu.edu's message of 13 Dec 92 03: 02:27 GMT
  6. Message-ID: <HOLLEN.92Dec16112323@peg.megatek.UUCP>
  7. Sender: hollen@megatek.com (Dion Hollenbeck)
  8. Organization: Megatek Corporation, San Diego, California
  9. References: <1992Dec13.030227.12401@seas.smu.edu>
  10. Date: Wed, 16 Dec 1992 19:23:23 GMT
  11. Lines: 95
  12.  
  13. >>>>> On 13 Dec 92 03:02:27 GMT, pedersen@seas.smu.edu (Ted Pedersen) said:
  14.  
  15. Ted> I am using emacs 18.59.1 and having some difficulty. When I use an X
  16. Ted> terminal (we run X11R5) my emacs window has little bitty type in it.
  17. Ted> When I expand the window I get a bigger window but the type remains
  18. Ted> the same very small size. Is there a way to make the emacs type size
  19. Ted> larger? Otherwise emacs works fine in this setup. 
  20.  
  21. Nothing that works interactively, however I have a script which
  22. determines what size X screen it is running on and does the right
  23. thing.  It might be useful.  It requires a C program called xgeon,
  24. which is included here also.  The script is smart enough to know you
  25. are NOT in a xterm and do the right thing on an ASCII termainal.  All
  26. I ever do is type "em" no matter where I am and I get the right thing.
  27.  
  28.  
  29. /* xgeom.c */
  30. #include <X11/Xlib.h>
  31. #include <stdio.h>
  32.  
  33. main(argc, argv)
  34.     int argc;
  35.     char **argv;
  36. {
  37.     int screen, h, w;
  38.  
  39.     Display *disp;
  40.  
  41.     if ((disp = XOpenDisplay(NULL)) == NULL)
  42.     {
  43.         fprintf(stderr, "Can't open display\n");
  44.         exit(-1);
  45.     }
  46.     screen = DefaultScreen(disp);
  47.  
  48.     h = DisplayHeight(disp, screen);
  49.     w = DisplayWidth(disp, screen);
  50.     printf("%d %d\n", w, h);
  51.     exit(0);
  52. }
  53.  
  54.  
  55. #! /bin/sh
  56. #
  57. #    script file to start emacs in X windows or outside of it
  58. #
  59. EMACS="emacs"
  60. EINIT="-l ~/Emacs/eshellinit.el"
  61. XSWVBIG="-ib 2 -bd red -w =81x40+10+1050"
  62. XSWBIG="-ib 2 -bd red -w =81x40+310+50"
  63. XSWV="-ib 2 -bd red -w =81x40+5+950"
  64. XSW="-ib 2 -bd red -w =81x40+310+50"
  65. XFONTBIG="-fn 12x24"
  66. XFONT="-fn 10x20"
  67. XCOLORS="-fg white -bg blue -cr white -ms white"
  68.  
  69. if [ "$1" = "tiny" ] ; then
  70. XSWVBIG="-ib 2 -bd red -w =150x60+10+1200"
  71. XFONTBIG="-fn 8x13"
  72. shift
  73. fi
  74.  
  75. if [ "$DISPLAY" -a "$1" != "-nw" ] ; then
  76.     args=$*
  77.     . $XSCRIPTS/fbident
  78.     if [ "$XWMGR" = tvtwm ] ; then
  79.         if [ $wid -ge 1280 ] ; then
  80.             exec $EMACS -i $XCOLORS $XFONTBIG \
  81.                 $XSWVBIG $EINIT $args &
  82.         else
  83.             exec $EMACS -i $XCOLORS $XFONT $XSWV $EINIT $args &
  84.         fi
  85.         exit
  86.     fi
  87.     if [ $wid -ge 1280 ] ; then
  88.         exec $EMACS -i $XCOLORS $XFONTBIG $XSWBIG $EINIT $args &
  89.         exit
  90.     else
  91.         exec $EMACS -i $XCOLORS $XFONT $XSW $EINIT $args &
  92.         exit
  93.     fi
  94. else
  95.     unset DISPLAY
  96.     if [ "$1" = "-nw" ] ; then
  97.         shift
  98.     fi
  99.     exec $EMACS -nw $EINIT $*
  100. fi
  101.  
  102.  
  103. ---------------------------------------------------------------------
  104. -- 
  105. Dion Hollenbeck                        Email: hollen@megatek.com
  106. Senior Software Engineer                      megatek!hollen@uunet.uu.net
  107. Megatek Corporation, San Diego, California    ucsd!megatek.uucp!hollen
  108.