Article View: gnu.epoch.misc
Article #1798Some epoch enhancements.
From: Jim Mayer
Date: Thu, 19 Sep 1991 16:36
Date: Thu, 19 Sep 1991 16:36
301 lines
12973 bytes
12973 bytes
These are some changes I made to epoch 3.2. They are enhancements,
not bug fixes, and may be worth incorporating into the next release or
distributing as patches. The second change is, in my opinion,
paricularly important. I did not send this to the epoch mailing list
because I really am not is a position to support it and I didn't want
a lot of people blindly applying the patch to their epoch systems. If
you folks want to distribute it, its fine with me.
While several files have changed, there are only two logical changes:
(1) I added an EPOCHLOADPATH variable, analogous to EMACSLOADPATH. If
it is not defined in the environment, then EMACSLOADPATH is used
instead. This is, therefore, a completely upward compatible
extension. The only file changed here was "lread.c". Why did I add
this? Well, we use a system here that allows us to "enable" and
"disable" various packages and versions of packages. Some of these
packages contain emacs lisp code, and the "enable" and "disable"
commands modify EMACSLOADPATH. By adding EPOCHLOADPATH, and by
modifying the "enable" and "disable" scripts to modify both
EMACSLOADPATH and EPOCHLOADPATH, I can maintain an environment where
both editors can be used independently.
One could argue that the right thing to do is to set EMACSLOADPATH and
have the ".emacs" file add the "epoch-lisp" directory to the path at
startup time; I wouldn't necessarily disagree with this. On the other
hand, having separate paths offers the opportunity to customize the
two environments differently.
(2) This next patch is more important. I changed the way screen
geometry information is passed to the window manager to work better
with "olwm". In the distributed code, the program always specifies
either PPosition and PSize (if no geometry was specified), or
USPosition and USSize (if a geometry was specified). This works well
with TWM and friends, but since OLWM honors the "PPosition" and
"PSize" requests epoch screens always come up in the same place.
My changes add two new resources:
epoch*screen.default_geometry
and
epoch*minibuf.default_geometry
These have default values corresponding exactly to the distributed
code. If, however, they are set to strings that do not specify
positions (e.g. "80x24"), then when the new screen is created neither
the USPosition or the PPosition flag will be passed to the window
manager. In this case, OLWM will assign a position to the new screen.
There is also some code that makes sure that there is always a
reasonable width and height default for the screen and minibuffer.
This is an upward compatible change, since unless the new resources
are specified, behavior is the same as with the distributed release.
A set of context diffs follows, they should be installed in the "src"
directory.
-- Jim Mayer Webster Research Center
Xerox Corporation
Phone: (716) 422-9407 FAX: x2126 800 Phillips Road, 0128-29E
Internet: mayer@wrc.xerox.com Webster, New York 14580
---------------------- START OF PATCHES -----------------------
*** lread.c.dist Thu Sep 5 16:04:06 1991
--- lread.c Thu Sep 5 16:13:03 1991
***************
*** 1236,1241 ****
--- 1236,1242 ----
init_read ()
{
+ char *env;
char *normal = PATH_LOADSEARCH;
Lisp_Object normal_path;
***************
*** 1256,1262 ****
Vvalues = Qnil;
! Vload_path = decode_env_path ("EMACSLOADPATH", normal);
#ifndef CANNOT_DUMP
if (!NULL (Vpurify_flag))
Vload_path = Fcons (build_string ("../epoch-lisp"),
--- 1257,1268 ----
Vvalues = Qnil;
! if (egetenv("EPOCHLOADPATH"))
! env = "EPOCHLOADPATH";
! else
! env = "EMACSLOADPATH";
!
! Vload_path = decode_env_path (env, normal);
#ifndef CANNOT_DUMP
if (!NULL (Vpurify_flag))
Vload_path = Fcons (build_string ("../epoch-lisp"),
***************
*** 1297,1304 ****
DEFVAR_LISP ("load-path", &Vload_path,
"*List of directories to search for files to load.\n\
Each element is a string (directory name) or nil (try default directory).\n\
! Initialized based on EMACSLOADPATH environment variable, if any,\n\
! otherwise to default specified in by file paths.h when emacs was built.");
DEFVAR_BOOL ("load-in-progress", &load_in_progress,
"Non-nil iff inside of load.");
--- 1303,1311 ----
DEFVAR_LISP ("load-path", &Vload_path,
"*List of directories to search for files to load.\n\
Each element is a string (directory name) or nil (try default directory).\n\
! Initialized based on EPOCHLOADPATH environment variable, if any,\n\
! otherwise to default specified by the EMACSLOADPATH environment\n\
! variable or in the file paths.h when emacs was built.");
DEFVAR_BOOL ("load-in-progress", &load_in_progress,
"Non-nil iff inside of load.");
*** screen.c.dist Wed Sep 4 04:48:39 1991
--- screen.c Thu Sep 19 10:53:31 1991
***************
*** 122,127 ****
--- 122,129 ----
XD_screen.resource = XD_minibuf.resource = (char *)0;
XD_screen.in_border = XD_minibuf.in_border = 2;
XD_screen.out_border = XD_minibuf.out_border = 2;
+ XD_screen.fallback_geometry = "80x24";
+ XD_minibuf.fallback_geometry = "80x1";
XD_screen.default_geometry = "80x24+0+64";
XD_minibuf.default_geometry = "80x1+0+0";
XD_screen.initial_state = XD_minibuf.initial_state = 1;
***************
*** 232,241 ****
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
static void
! x_set_hints(rb,xd,gmask)
struct Root_Block *rb;
struct Default_Set *xd;
! unsigned int gmask;
{
XS_DEF; WS_DEF;
XSizeHints size_hints;
--- 234,243 ----
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
static void
! x_set_hints(rb,xd,def_gmask,gmask)
struct Root_Block *rb;
struct Default_Set *xd;
! unsigned int def_gmask, gmask;
{
XS_DEF; WS_DEF;
XSizeHints size_hints;
***************
*** 265,272 ****
#else
size_hints.flags = PMinSize | PResizeInc;
#endif
! size_hints.flags |= (gmask & (XValue|YValue)) ? USPosition : PPosition;
! size_hints.flags |= (gmask & (WidthValue|HeightValue)) ? USSize : PSize;
HOLD_INPUT(XSetNormalHints(xs->display,xs->xid,&size_hints));
/* resource and class names */
--- 267,280 ----
#else
size_hints.flags = PMinSize | PResizeInc;
#endif
! if (gmask & (XValue|YValue))
! size_hints.flags |= USPosition;
! else if (def_gmask & (XValue|YValue))
! size_hints.flags |= PPosition;
! if (gmask & (WidthValue|HeightValue))
! size_hints.flags |= USSize;
! else if (def_gmask & (WidthValue|HeightValue))
! size_hints.flags |= PSize;
HOLD_INPUT(XSetNormalHints(xs->display,xs->xid,&size_hints));
/* resource and class names */
***************
*** 315,321 ****
struct Default_Set *xdbase; /* user specified values */
Lisp_Object alist;
{
! unsigned int gmask; /* geometry parse return */
int x,y,dx,dy; /* base and size */
int i; /* scratch index */
unsigned long xcursor_color; /* X cursor color */
--- 323,329 ----
struct Default_Set *xdbase; /* user specified values */
Lisp_Object alist;
{
! unsigned int def_gmask, gmask; /* geometry parse return */
int x,y,dx,dy; /* base and size */
int i; /* scratch index */
unsigned long xcursor_color; /* X cursor color */
***************
*** 354,362 ****
}
/* set up the geometry */
! /* the value returned is a mask of what was actually changed. We don't
! * worry about it since we know that default_geometry contains
! * enough info to fill them all in.
* The original version is much different, and makes no sense to me.
* It used XGeometry() with bizarre parameters, and appeared to be
* confused about whether it meant pixels or characters. I have chosen
--- 362,381 ----
}
/* set up the geometry */
! /* the value returned is a mask of what was actually changed.
! * Values may be specified in one of several places:
! * xd.fallback_geometry -- Size, but not position, is
! * always specified here. This value cannot be overriden by
! * the user.
! * xd.default_geometry -- The user can set this to specify
! * a default size and position. If these values are set
! * and are not overridden by the "requested_geometry", then
! * they will be presented to the window manager with the PSize
! * and PPosition request flags set.
! * xd.requested_geometry -- The user can set this on the command
! * line (or in .Xdefaults) to request a particular geometry.
! * These values will be presented to the window manager with
! * the USSize and USPosition request flags set.
* The original version is much different, and makes no sense to me.
* It used XGeometry() with bizarre parameters, and appeared to be
* confused about whether it meant pixels or characters. I have chosen
***************
*** 370,376 ****
/* XGeometry is not used because it assumes the specs are in pixels,
* not in characters.
*/
! gmask = XParseGeometry(xd.default_geometry,&x,&y,&dx,&dy);
gmask = XParseGeometry(xd.requested_geometry,&x,&y,&dx,&dy);
/* clip to proper range */
--- 389,396 ----
/* XGeometry is not used because it assumes the specs are in pixels,
* not in characters.
*/
! (void) XParseGeometry(xd.fallback_geometry,&x,&y,&dx,&dy);
! def_gmask = XParseGeometry(xd.default_geometry,&x,&y,&dx,&dy);
gmask = XParseGeometry(xd.requested_geometry,&x,&y,&dx,&dy);
/* clip to proper range */
***************
*** 519,525 ****
xs->vis_x = 0; /* and it isn't anywhere yet */
xs->vis_y = 0;
! x_set_hints(root,&xd,gmask); /* set window-manager hints */
root->motion_hints = xd.motion_hints ? Qt : Qnil;
--- 539,545 ----
xs->vis_x = 0; /* and it isn't anywhere yet */
xs->vis_y = 0;
! x_set_hints(root,&xd,def_gmask,gmask); /* set window-manager hints */
root->motion_hints = xd.motion_hints ? Qt : Qnil;
*** xd.h.dist Tue Oct 16 14:46:16 1990
--- xd.h Thu Sep 19 10:41:42 1991
***************
*** 6,11 ****
--- 6,16 ----
/* set starting X-windows defaults */
static struct XDefaultEntry xdef[] =
{
+ { (VOID *)&XD_screen.default_geometry,XDT_String,
+ ".screen.default_geometry",".Screen.Default_geometry" },
+ { (VOID *)&XD_minibuf.default_geometry,XDT_String,
+ ".minibuf.default_geometry",".Minibuf.Default_Geometry" },
+
{ (VOID *)&XD_screen.requested_geometry,XDT_String,
".screen.geometry",".Screen.Geometry" },
{ (VOID *)&XD_minibuf.requested_geometry,XDT_String,
No differences encountered
*** xdefault.h.dist Tue Oct 16 14:46:16 1990
--- xdefault.h Thu Sep 19 10:55:09 1991
***************
*** 25,31 ****
char *name; /* name of the screen */
char *resource; /* resource name for screen */
char *class; /* resource class for the screen */
! char *default_geometry; /* hard-wired default */
char *requested_geometry; /* user-specified value */
char *foreground; /* foreground color */
char *background; /* background color */
--- 25,32 ----
char *name; /* name of the screen */
char *resource; /* resource name for screen */
char *class; /* resource class for the screen */
! char *fallback_geometry; /* hard-wired default */
! char *default_geometry; /* user specified default */
char *requested_geometry; /* user-specified value */
char *foreground; /* foreground color */
char *background; /* background color */
---------------------- END OF PATCHES ----------------------------
Technical Details
Message-ID:
<9109191636.AA28185@fliff.wrc.xerox.com>Path:
arc1-ca.pugleaf.net!gmdzi!unido!math.fu-berlin.de!ira.uka.de!yale.edu!qt.cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!wrc.xerox.COM!mayerShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fc7ee,e8f25d283cf63952,start X-Google-Attributes: gidfc7ee,public X-Google-ArrivalTime: 1991-09-20 07:26:43 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!math.fu-berlin.de!ira.uka.de!yale.edu!qt.cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!wrc.xerox.COM!mayer From: mayer@wrc.xerox.COM (Jim Mayer) Newsgroups: gnu.epoch.misc Subject: Some epoch enhancements. Message-ID: <9109191636.AA28185@fliff.wrc.xerox.com> Date: 19 Sep 91 16:36:26 GMT Sender: daemon@cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 301