Commit d427b66a authored by Jim Blandy's avatar Jim Blandy

entered into RCS

parent b2c9579f
......@@ -67,8 +67,8 @@ main (argc,argv)
int depth;
Pixmap pix;
char *string = "Kill the head and the body will die.";
char dash_list[] = {6, 4, 6, 4};
int dashes = 4;
char dash_list[] = {4, 4};
int dashes = 2;
if (argc < 2)
dpy_string = "localhost:0.0";
......@@ -105,24 +105,19 @@ main (argc,argv)
&gc_values);
gc_values.foreground = obtain_color ("red");
gc_values.function = GXor;
gc_values.line_width = 3;
gc_values.line_style = LineOnOffDash;
gc_values.cap_style = CapRound;
gc_values.join_style = JoinRound;
line_xor_gc = XCreateGC (dpy, window,
GCForeground | GCBackground | GCLineStyle
| GCJoinStyle | GCCapStyle | GCLineWidth
| GCFunction,
| GCJoinStyle | GCCapStyle | GCLineWidth,
&gc_values);
XSetDashes (dpy, line_xor_gc, 0, dash_list, dashes);
gc_values.background = WhitePixel (dpy, DefaultScreen (dpy));
gc_values.foreground = obtain_color ("blue");
line_xor_inv_gc = XCreateGC (dpy, window,
GCForeground | GCBackground
| GCLineWidth | GCFunction,
&gc_values);
GCForeground | GCBackground | GCLineWidth,
&gc_values);
depth = DefaultDepthOfScreen (ScreenOfDisplay (dpy, DefaultScreen (dpy)));
pix = XCreateBitmapFromData (dpy, window, page_glyf_bits,
......@@ -137,25 +132,20 @@ main (argc,argv)
switch (event.type)
{
case ButtonPress:
#if 0
if (event.xbutton.state && ShiftMask)
#endif
switch (event.xbutton.button)
{
case Button1:
XDrawLine (dpy, window, line_xor_gc, 25, 75, 125, 75);
XFlush (dpy);
XDrawLine (dpy, window, line_xor_gc, 25, 75, 125, 75);
break;
case Button2:
XDrawLine (dpy, window, line_xor_gc, 25, 75, 125, 75);
break;
case Button3:
XDrawLine (dpy, window, line_xor_gc, 25, 75, 125, 75);
break;
}
switch (event.xbutton.button)
{
case Button1:
XDrawLine (dpy, window, line_xor_gc, 25, 75, 300, 75);
break;
case Button2:
XDrawLine (dpy, window, line_xor_inv_gc, 25, 25, 300, 25);
break;
case Button3:
XDrawLine (dpy, window, line_xor_gc, 25, 25, 25, 125);
break;
}
break;
case KeyPress:
......
#define page_glyf_width 30
#define page_glyf_height 10
static char page_glyf_bits[] = {
0xf0, 0xff, 0xff, 0x03, 0x08, 0x00, 0x00, 0x04, 0xc4, 0x19, 0xf3, 0x08,
0x42, 0xa5, 0x14, 0x10, 0xc1, 0xa5, 0x70, 0x20, 0x41, 0xbc, 0x16, 0x20,
0x42, 0xa4, 0x14, 0x10, 0x44, 0x24, 0xf3, 0x08, 0x08, 0x00, 0x00, 0x04,
0xf0, 0xff, 0xff, 0x03};
......@@ -20,7 +20,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "config.h"
#include <stdio.h>
#undef NULL
#include "lisp.h"
#include "commands.h"
#include "buffer.h"
......@@ -113,9 +112,9 @@ it is called after EXPANSION is inserted.")
Lisp_Object sym, oexp, ohook, tem;
CHECK_VECTOR (table, 0);
CHECK_STRING (name, 1);
if (!NULL (expansion))
if (!NILP (expansion))
CHECK_STRING (expansion, 2);
if (NULL (count))
if (NILP (count))
count = make_number (0);
else
CHECK_NUMBER (count, 0);
......@@ -126,10 +125,10 @@ it is called after EXPANSION is inserted.")
ohook = XSYMBOL (sym)->function;
if (!((EQ (oexp, expansion)
|| (XTYPE (oexp) == Lisp_String && XTYPE (expansion) == Lisp_String
&& (tem = Fstring_equal (oexp, expansion), !NULL (tem))))
&& (tem = Fstring_equal (oexp, expansion), !NILP (tem))))
&&
(EQ (ohook, hook)
|| (tem = Fequal (ohook, hook), !NULL (tem)))))
|| (tem = Fequal (ohook, hook), !NILP (tem)))))
abbrevs_changed = 1;
Fset (sym, expansion);
......@@ -156,7 +155,7 @@ DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev, Sdefine_mode_abbrev, 2, 2,
(name, expansion)
Lisp_Object name, expansion;
{
if (NULL (current_buffer->abbrev_table))
if (NILP (current_buffer->abbrev_table))
error ("Major mode has no abbrev table");
Fdefine_abbrev (current_buffer->abbrev_table, Fdowncase (name),
......@@ -176,19 +175,19 @@ The default is to try buffer's mode-specific abbrev table, then global table.")
{
Lisp_Object sym;
CHECK_STRING (abbrev, 0);
if (!NULL (table))
if (!NILP (table))
sym = Fintern_soft (abbrev, table);
else
{
sym = Qnil;
if (!NULL (current_buffer->abbrev_table))
if (!NILP (current_buffer->abbrev_table))
sym = Fintern_soft (abbrev, current_buffer->abbrev_table);
if (NULL (XSYMBOL (sym)->value))
if (NILP (XSYMBOL (sym)->value))
sym = Qnil;
if (NULL (sym))
if (NILP (sym))
sym = Fintern_soft (abbrev, Vglobal_abbrev_table);
}
if (NULL (XSYMBOL (sym)->value)) return Qnil;
if (NILP (XSYMBOL (sym)->value)) return Qnil;
return sym;
}
......@@ -201,7 +200,7 @@ then ABBREV is looked up in that table only.")
{
Lisp_Object sym;
sym = Fabbrev_symbol (abbrev, table);
if (NULL (sym)) return sym;
if (NILP (sym)) return sym;
return Fsymbol_value (sym);
}
......@@ -221,12 +220,12 @@ Returns t if expansion took place.")
register Lisp_Object sym;
Lisp_Object expansion, hook, tem;
if (!NULL (Vrun_hooks))
if (!NILP (Vrun_hooks))
call1 (Vrun_hooks, Qpre_abbrev_expand_hook);
if (XBUFFER (Vabbrev_start_location_buffer) != current_buffer)
Vabbrev_start_location = Qnil;
if (!NULL (Vabbrev_start_location))
if (!NILP (Vabbrev_start_location))
{
tem = Vabbrev_start_location;
CHECK_NUMBER_COERCE_MARKER (tem, 0);
......@@ -267,9 +266,9 @@ Returns t if expansion took place.")
sym = oblookup (current_buffer->abbrev_table, buffer, p - buffer);
else
XFASTINT (sym) = 0;
if (XTYPE (sym) == Lisp_Int || NULL (XSYMBOL (sym)->value))
if (XTYPE (sym) == Lisp_Int || NILP (XSYMBOL (sym)->value))
sym = oblookup (Vglobal_abbrev_table, buffer, p - buffer);
if (XTYPE (sym) == Lisp_Int || NULL (XSYMBOL (sym)->value))
if (XTYPE (sym) == Lisp_Int || NILP (XSYMBOL (sym)->value))
return Qnil;
if (INTERACTIVE && !EQ (minibuf_window, selected_window))
......@@ -327,7 +326,7 @@ Returns t if expansion took place.")
}
hook = XSYMBOL (sym)->function;
if (!NULL (hook))
if (!NILP (hook))
call0 (hook);
return Qt;
......@@ -367,7 +366,7 @@ write_abbrev (sym, stream)
Lisp_Object sym, stream;
{
Lisp_Object name;
if (NULL (XSYMBOL (sym)->value))
if (NILP (XSYMBOL (sym)->value))
return;
insert (" (", 5);
XSET (name, Lisp_String, XSYMBOL (sym)->name);
......@@ -387,7 +386,7 @@ describe_abbrev (sym, stream)
{
Lisp_Object one;
if (NULL (XSYMBOL (sym)->value))
if (NILP (XSYMBOL (sym)->value))
return;
one = make_number (1);
Fprin1 (Fsymbol_name (sym), stream);
......@@ -395,7 +394,7 @@ describe_abbrev (sym, stream)
Fprin1 (XSYMBOL (sym)->plist, stream);
Findent_to (make_number (20), one);
Fprin1 (XSYMBOL (sym)->value, stream);
if (!NULL (XSYMBOL (sym)->function))
if (!NILP (XSYMBOL (sym)->function))
{
Findent_to (make_number (45), one);
Fprin1 (XSYMBOL (sym)->function, stream);
......@@ -424,7 +423,7 @@ define the abbrev table NAME exactly as it is currently defined.")
XSET (stream, Lisp_Buffer, current_buffer);
if (!NULL (readable))
if (!NILP (readable))
{
insert_string ("(");
Fprin1 (name, stream);
......@@ -457,7 +456,7 @@ of the form (ABBREVNAME EXPANSION HOOK USECOUNT).")
CHECK_SYMBOL (tabname, 0);
table = Fboundp (tabname);
if (NULL (table) || (table = Fsymbol_value (tabname), NULL (table)))
if (NILP (table) || (table = Fsymbol_value (tabname), NILP (table)))
{
table = Fmake_abbrev_table ();
Fset (tabname, table);
......@@ -466,7 +465,7 @@ of the form (ABBREVNAME EXPANSION HOOK USECOUNT).")
}
CHECK_VECTOR (table, 0);
for (;!NULL (defns); defns = Fcdr (defns))
for (;!NILP (defns); defns = Fcdr (defns))
{
elt = Fcar (defns);
name = Fcar (elt);
......
#define ACL$K_LENGTH 12
#define ACL$C_LENGTH 12
#define ACL$C_FILE 1
#define ACL$C_DEVICE 2
#define ACL$C_JOBCTL_QUEUE 3
#define ACL$C_COMMON_EF_CLUSTER 4
#define ACL$C_LOGICAL_NAME_TABLE 5
#define ACL$C_PROCESS 6
#define ACL$C_GROUP_GLOBAL_SECTION 7
#define ACL$C_SYSTEM_GLOBAL_SECTION 8
#define ACL$C_ADDACLENT 1
#define ACL$C_DELACLENT 2
#define ACL$C_MODACLENT 3
#define ACL$C_FNDACLENT 4
#define ACL$C_FNDACETYP 5
#define ACL$C_DELETEACL 6
#define ACL$C_READACL 7
#define ACL$C_ACLLENGTH 8
#define ACL$C_READACE 9
#define ACL$C_RLOCK_ACL 10
#define ACL$C_WLOCK_ACL 11
#define ACL$C_UNLOCK_ACL 12
#define ACL$S_ADDACLENT 255
#define ACL$S_DELACLENT 255
#define ACL$S_MODACLENT 255
#define ACL$S_FNDACLENT 255
#define ACL$S_FNDACETYP 255
#define ACL$S_DELETEACL 255
#define ACL$S_READACL 512
#define ACL$S_ACLLENGTH 4
#define ACL$S_READACE 255
#define ACL$S_RLOCK_ACL 4
#define ACL$S_WLOCK_ACL 4
#define ACL$S_UNLOCK_ACL 4
#define ACL$S_ACLDEF 16
#define ACL$L_FLINK 0
#define ACL$L_BLINK 4
#define ACL$W_SIZE 8
#define ACL$B_TYPE 10
#define ACL$L_LIST 12
......@@ -261,7 +261,10 @@ syms_of_casefiddle ()
keys_of_casefiddle ()
{
initial_define_key (control_x_map, Ctl('U'), "upcase-region");
Fput (intern ("upcase-region"), Qdisabled, Qt);
initial_define_key (control_x_map, Ctl('L'), "downcase-region");
Fput (intern ("downcase-region"), Qdisabled, Qt);
initial_define_key (meta_map, 'u', "upcase-word");
initial_define_key (meta_map, 'l', "downcase-word");
initial_define_key (meta_map, 'c', "capitalize-word");
......
......@@ -45,8 +45,8 @@ See `set-case-table' for more information on these data structures.")
(XTYPE (obj) == Lisp_String && XSTRING (obj)->size == 256)
return (STRING256_P (down)
&& (NULL (up) || STRING256_P (up))
&& ((NULL (canon) && NULL (eqv))
&& (NILP (up) || STRING256_P (up))
&& ((NILP (canon) && NILP (eqv))
|| (STRING256_P (canon) && STRING256_P (eqv)))
? Qt : Qnil);
}
......@@ -57,7 +57,7 @@ check_case_table (obj)
{
register Lisp_Object tem;
while (tem = Fcase_table_p (obj), NULL (tem))
while (tem = Fcase_table_p (obj), NILP (tem))
obj = wrong_type_argument (Qcase_table_p, obj, 0);
return (obj);
}
......@@ -132,13 +132,13 @@ set_case_table (table, standard)
canon = Fcar_safe (Fcdr_safe (Fcdr_safe (table)));
eqv = Fcar_safe (Fcdr_safe (Fcdr_safe (Fcdr_safe (table))));
if (NULL (up))
if (NILP (up))
{
up = Fmake_string (make_number (256), make_number (0));
compute_trt_inverse (XSTRING (down)->data, XSTRING (up)->data);
}
if (NULL (canon))
if (NILP (canon))
{
register int i;
unsigned char *upvec = XSTRING (up)->data;
......
#define CHP$_END 0
#define CHP$_ACCESS 1
#define CHP$_FLAGS 2
#define CHP$_PRIV 3
#define CHP$_ACMODE 4
#define CHP$_ACCLASS 5
#define CHP$_RIGHTS 6
#define CHP$_ADDRIGHTS 7
#define CHP$_MODE 8
#define CHP$_MODES 9
#define CHP$_MINCLASS 10
#define CHP$_MAXCLASS 11
#define CHP$_OWNER 12
#define CHP$_PROT 13
#define CHP$_ACL 14
#define CHP$_AUDITNAME 15
#define CHP$_ALARMNAME 16
#define CHP$_MATCHEDACE 17
#define CHP$_PRIVUSED 18
#define CHP$_MAX_CODE 19
#define CHP$M_SYSPRV 1
#define CHP$M_BYPASS 2
#define CHP$M_UPGRADE 4
#define CHP$M_DOWNGRADE 8
#define CHP$M_GRPPRV 16
#define CHP$M_READALL 32
#define CHP$V_SYSPRV 0
#define CHP$V_BYPASS 1
#define CHP$V_UPGRADE 2
#define CHP$V_DOWNGRADE 3
#define CHP$V_GRPPRV 4
#define CHP$V_READALL 5
#define CHP$M_READ 1
#define CHP$M_WRITE 2
#define CHP$M_USEREADALL 4
#define CHP$V_READ 0
#define CHP$V_WRITE 1
#define CHP$V_USEREADALL 2
/* Cursor motion subroutines for GNU Emacs.
Copyright (C) 1985 Free Software Foundation, Inc.
based primarily on public domain code written by Chris Torek
This file is part of GNU Emacs.
GNU Emacs is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "config.h"
#include <stdio.h>
#include "cm.h"
#include "termhooks.h"
#define BIG 9999 /* 9999 good on VAXen. For 16 bit machines
use about 2000.... */
char *tgoto ();
extern char *BC, *UP;
int cost; /* sums up costs */
/* ARGSUSED */
evalcost (c)
char c;
{
cost++;
}
void
cmputc (c)
char c;
{
if (termscript)
fputc (c & 0177, termscript);
putchar (c & 0177);
}
/* NEXT TWO ARE DONE WITH MACROS */
#if 0
/*
* Assume the cursor is at row row, column col. Normally used only after
* clearing the screen, when the cursor is at (0, 0), but what the heck,
* let's let the guy put it anywhere.
*/
static
at (row, col) {
curY = row;
curX = col;
}
/*
* Add n columns to the current cursor position.
*/
static
addcol (n) {
curX += n;
/*
* If cursor hit edge of screen, what happened?
* N.B.: DO NOT!! write past edge of screen. If you do, you
* deserve what you get. Furthermore, on terminals with
* autowrap (but not magicwrap), don't write in the last column
* of the last line.
*/
if (curX == Wcm.cm_cols) {
/*
* Well, if magicwrap, still there, past the edge of the
* screen (!). If autowrap, on the col 0 of the next line.
* Otherwise on last column.
*/
if (Wcm.cm_magicwrap)
; /* "limbo" */
else if (Wcm.cm_autowrap) {
curX = 0;
curY++; /* Beware end of screen! */
}
else
curX--;
}
}
#endif
/*
* (Re)Initialize the cost factors, given the output speed of the terminal
* in the variable ospeed. (Note: this holds B300, B9600, etc -- ie stuff
* out of <sgtty.h>.)
*/
cmcostinit ()
{
char *p;
#define COST(x,e) (x ? (cost = 0, tputs (x, 1, e), cost) : BIG)
#define CMCOST(x,e) ((x == 0) ? BIG : (p = tgoto(x, 0, 0), COST(p ,e)))
Wcm.cc_up = COST (Wcm.cm_up, evalcost);
Wcm.cc_down = COST (Wcm.cm_down, evalcost);
Wcm.cc_left = COST (Wcm.cm_left, evalcost);
Wcm.cc_right = COST (Wcm.cm_right, evalcost);
Wcm.cc_home = COST (Wcm.cm_home, evalcost);
Wcm.cc_cr = COST (Wcm.cm_cr, evalcost);
Wcm.cc_ll = COST (Wcm.cm_ll, evalcost);
Wcm.cc_tab = Wcm.cm_tabwidth ? COST (Wcm.cm_tab, evalcost) : BIG;
/*
* These last three are actually minimum costs. When (if) they are
* candidates for the least-cost motion, the real cost is computed.
* (Note that "0" is the assumed to generate the minimum cost.
* While this is not necessarily true, I have yet to see a terminal
* for which is not; all the terminals that have variable-cost
* cursor motion seem to take straight numeric values. --ACT)
*/
Wcm.cc_abs = CMCOST (Wcm.cm_abs, evalcost);
Wcm.cc_habs = CMCOST (Wcm.cm_habs, evalcost);
Wcm.cc_vabs = CMCOST (Wcm.cm_vabs, evalcost);
#undef CMCOST
#undef COST
}
/*
* Calculate the cost to move from (srcy, srcx) to (dsty, dstx) using
* up and down, and left and right, motions, and tabs. If doit is set
* actually perform the motion.
*/
static
calccost (srcy, srcx, dsty, dstx, doit)
{
register int deltay,
deltax,
c,
totalcost;
int ntabs,
n2tabs,
tabx,
tab2x,
tabcost;
register char *p;
/* If have just wrapped on a terminal with xn,
don't believe the cursor position: give up here
and force use of absolute positioning. */
if (curX == Wcm.cm_cols)
goto fail;
totalcost = 0;
if ((deltay = dsty - srcy) == 0)
goto x;
if (deltay < 0)
p = Wcm.cm_up, c = Wcm.cc_up, deltay = -deltay;
else
p = Wcm.cm_down, c = Wcm.cc_down;
if (c == BIG) { /* caint get thar from here */
if (doit)
printf ("OOPS");
return c;
}
totalcost = c * deltay;
if (doit)
while (--deltay >= 0)
tputs (p, 1, cmputc);
x:
if ((deltax = dstx - srcx) == 0)
goto done;
if (deltax < 0) {
p = Wcm.cm_left, c = Wcm.cc_left, deltax = -deltax;
goto dodelta; /* skip all the tab junk */
}
/* Tabs (the toughie) */
if (Wcm.cc_tab >= BIG || !Wcm.cm_usetabs)
goto olddelta; /* forget it! */
/*
* ntabs is # tabs towards but not past dstx; n2tabs is one more
* (ie past dstx), but this is only valid if that is not past the
* right edge of the screen. We can check that at the same time
* as we figure out where we would be if we use the tabs (which
* we will put into tabx (for ntabs) and tab2x (for n2tabs)).
*/
ntabs = (deltax + srcx % Wcm.cm_tabwidth) / Wcm.cm_tabwidth;
n2tabs = ntabs + 1;
tabx = (srcx / Wcm.cm_tabwidth + ntabs) * Wcm.cm_tabwidth;
tab2x = tabx + Wcm.cm_tabwidth;
if (tab2x >= Wcm.cm_cols) /* too far (past edge) */
n2tabs = 0;
/*
* Now set tabcost to the cost for using ntabs, and c to the cost
* for using n2tabs, then pick the minimum.
*/
/* cost for ntabs + cost for right motion */
tabcost = ntabs ? ntabs * Wcm.cc_tab + (dstx - tabx) * Wcm.cc_right
: BIG;
/* cost for n2tabs + cost for left motion */
c = n2tabs ? n2tabs * Wcm.cc_tab + (tab2x - dstx) * Wcm.cc_left
: BIG;
if (c < tabcost) /* then cheaper to overshoot & back up */
ntabs = n2tabs, tabcost = c, tabx = tab2x;
if (tabcost >= BIG) /* caint use tabs */
goto newdelta;
/*
* See if tabcost is less than just moving right
*/
if (tabcost < (deltax * Wcm.cc_right)) {
totalcost += tabcost; /* use the tabs */
if (doit)
while (--ntabs >= 0)
tputs (Wcm.cm_tab, 1, cmputc);
srcx = tabx;
}
/*
* Now might as well just recompute the delta.
*/
newdelta:
if ((deltax = dstx - srcx) == 0)
goto done;
olddelta:
if (deltax > 0)