diff options
author | Jim Blandy <jimb@redhat.com> | 1992-06-30 13:54:21 +0000 |
---|---|---|
committer | Jim Blandy <jimb@redhat.com> | 1992-06-30 13:54:21 +0000 |
commit | 8a097b5b08f3e017994e2df07a618d58fc023df3 (patch) | |
tree | daa1bb7d7f8787084cece10dbc017eaf68cfab16 /src | |
parent | c46996887ff22382a0c27c882a38ddcdd5e71415 (diff) | |
download | emacs-8a097b5b08f3e017994e2df07a618d58fc023df3.tar.gz |
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r-- | src/.gdbinit | 11 | ||||
-rw-r--r-- | src/=Makefile.in | 16 | ||||
-rw-r--r-- | src/=xselect.c.old | 2 | ||||
-rw-r--r-- | src/callint.c | 5 | ||||
-rw-r--r-- | src/dispextern.h | 11 | ||||
-rw-r--r-- | src/dispnew.c | 41 | ||||
-rw-r--r-- | src/emacs.c | 8 | ||||
-rw-r--r-- | src/eval.c | 2 | ||||
-rw-r--r-- | src/fileio.c | 38 | ||||
-rw-r--r-- | src/frame.c | 10 | ||||
-rw-r--r-- | src/frame.h | 101 | ||||
-rw-r--r-- | src/keyboard.c | 19 | ||||
-rw-r--r-- | src/keyboard.h | 6 | ||||
-rw-r--r-- | src/lisp.h | 51 | ||||
-rw-r--r-- | src/lread.c | 4 | ||||
-rw-r--r-- | src/minibuf.c | 2 | ||||
-rw-r--r-- | src/print.c | 2 | ||||
-rw-r--r-- | src/scroll.c | 13 | ||||
-rw-r--r-- | src/term.c | 7 | ||||
-rw-r--r-- | src/termchar.h | 2 | ||||
-rw-r--r-- | src/termhooks.h | 14 | ||||
-rw-r--r-- | src/window.c | 40 | ||||
-rw-r--r-- | src/window.h | 4 | ||||
-rw-r--r-- | src/xdisp.c | 34 | ||||
-rw-r--r-- | src/xterm.c | 21 |
25 files changed, 247 insertions, 217 deletions
diff --git a/src/.gdbinit b/src/.gdbinit index fd470e31384..6d2c08a4ee4 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -119,6 +119,12 @@ end set print pretty on +unset environment TERMCAP +unset environment TERM +set environment DISPLAY :0.0 +show environment DISPLAY +set args -q + # Don't let abort actually run, as it will make # stdio stop working and therefore the `pr' command below as well. break abort @@ -128,8 +134,3 @@ break abort # instead... break _XPrintDefaultError -unset environment TERMCAP -unset environment TERM -set environment DISPLAY :0.0 -show environment DISPLAY -set args -q diff --git a/src/=Makefile.in b/src/=Makefile.in index 8cb7bdbdefa..0717ee9644b 100644 --- a/src/=Makefile.in +++ b/src/=Makefile.in @@ -2,7 +2,7 @@ MAKE = make # BSD doesn't have it as a default. CC =gcc -CPP = $(CC) -E +CPP = $(CC) -E -Is -Im #Note: an alternative is CPP = /lib/cpp # Just to avoid uncertainty. @@ -19,7 +19,7 @@ distclean: -rm -f paths.h config.h machine.h system.h emacs-* temacs xemacs xmakefile core *~ \#* *.o clean: - -rm -f temacs xemacs xmakefile core \#* *.o + -rm -f temacs xemacs xmakefile* core \#* *.o xemacs: xmakefile doxemacs @@ -34,10 +34,16 @@ dotemacs: # If you have a problem with cc -E here, changing # the definition of CPP above may fix it. xmakefile: ymakefile config.h - -rm -f xmakefile junk.c + -rm -f xmakefile xmakefile.new junk.c junk.cpp cp ymakefile junk.c - $(CPP) junk.c | sed -e 's/^#.*//' -e 's/^[ \f\t][ \f\t]*$$//' -e 's/^ / /' | \ - sed -n -e '/^..*$$/p' > xmakefile + $(CPP) junk.c > junk.cpp + < junk.cpp \ + sed -e 's/^#.*//' \ + -e 's/^[ \f\t][ \f\t]*$$//' \ + -e 's/^ / /' \ + | sed -n -e '/^..*$$/p' \ + > xmakefile.new + mv -f xmakefile.new xmakefile rm -f junk.c tags TAGS: diff --git a/src/=xselect.c.old b/src/=xselect.c.old index dea8a1cfca9..8c818b90746 100644 --- a/src/=xselect.c.old +++ b/src/=xselect.c.old @@ -193,7 +193,7 @@ use X selections.") { BLOCK_INPUT; XStoreBytes (x_current_display, - XSTRING (string)->data, + (char *) XSTRING (string)->data, XSTRING (string)->size); UNBLOCK_INPUT; } diff --git a/src/callint.c b/src/callint.c index aeb6ef38720..bb39604744b 100644 --- a/src/callint.c +++ b/src/callint.c @@ -174,7 +174,7 @@ Otherwise, this is done only if an arg is read using the minibuffer.") int arg_from_tty = 0; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; - /* Save this now, since use ofminibuffer will clobber it. */ + /* Save this now, since use of minibuffer will clobber it. */ prefix_arg = Vcurrent_prefix_arg; retry: @@ -233,7 +233,7 @@ Otherwise, this is done only if an arg is read using the minibuffer.") { /* Make a copy of string so that if a GC relocates specs, `string' will still be valid. */ - string = (char *) alloca (XSTRING (specs)->size + 1); + string = (unsigned char *) alloca (XSTRING (specs)->size + 1); bcopy (XSTRING (specs)->data, string, XSTRING (specs)->size + 1); } else if (string == 0) @@ -388,6 +388,7 @@ Otherwise, this is done only if an arg is read using the minibuffer.") (XTYPE (function) == Lisp_Symbol ? (char *) XSYMBOL (function)->name->data : "Command")); + varies[i] = -1; break; case 'm': /* Value of mark. Does not do I/O. */ diff --git a/src/dispextern.h b/src/dispextern.h index 365f229fb53..19a0bfcecfa 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -1,11 +1,11 @@ /* Interface definitions for display code. - Copyright (C) 1985 Free Software Foundation, Inc. + Copyright (C) 1985, 1992 Free Software Foundation, Inc. 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) +the Free Software Foundation; either version 2, or (at your option) any later version. GNU Emacs is distributed in the hope that it will be useful, @@ -93,10 +93,3 @@ struct screen_glyphs * SCREEN_CURRENT_GLYPHS(s)->enable[(n)]) extern void get_display_line (); - -/* Buffer used by `message' for formatting a message. */ -extern char *message_buf; -extern int message_buf_size; - -/* Nonzero means message_buf is being used by print. */ -extern int message_buf_print; diff --git a/src/dispnew.c b/src/dispnew.c index b1ea5d22664..c5b802679d4 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -106,25 +106,17 @@ int cursor_in_echo_area; SCREEN_PTR selected_screen; +/* A screen which is not just a minibuffer, or 0 if there are no such + screens. This is usually the most recent such screen that was + selected. In a single-screen version, this variable always remains 0. */ +SCREEN_PTR last_nonminibuf_screen; + /* In a single-screen version, the information that would otherwise - exist inside a `struct screen' lives in the following variables instead. */ + exist inside screen objects lives in the following structure instead. */ #ifndef MULTI_SCREEN - -/* Desired terminal cursor position (to show position of point), - origin zero */ - -int cursX, cursY; - -/* Description of current screen contents */ - -struct screen_glyphs *current_glyphs; - -/* Description of desired screen contents */ - -struct screen_glyphs *desired_glyphs; - -#endif /* not MULTI_SCREEN */ +struct screen the_only_screen; +#endif /* This is a vector, made larger whenever it isn't large enough, which is used inside `update_screen' to hold the old contents @@ -142,8 +134,6 @@ extern short ospeed; /* Output speed (from sg_ospeed) */ int in_display; /* 1 if in redisplay: can't handle SIGWINCH now. */ int delayed_size_change; /* 1 means SIGWINCH happened when not safe. */ -int delayed_screen_height; /* Remembered new screen height. */ -int delayed_screen_width; /* Remembered new screen width. */ #ifdef MULTI_SCREEN @@ -834,8 +824,8 @@ cancel_my_columns (w) struct window *w; { register int vpos; - register SCREEN_PTR screen = XSCREEN (w->screen); - register struct screen_glyphs *desired_glyphs = screen->desired_glyphs; + register struct screen_glyphs *desired_glyphs = + SCREEN_DESIRED_GLYPHS (XSCREEN (w->screen)); register int start = XFASTINT (w->left); register int bot = XFASTINT (w->top) + XFASTINT (w->height); @@ -1049,8 +1039,10 @@ update_screen (s, force, inhibit_hairy_id) #endif /* HAVE_X_WINDOWS */ } +#ifdef HAVE_X_WINDOWS if (SCREEN_IS_X (s)) downto += LINE_HEIGHT(s, i); +#endif } pause = (i < SCREEN_HEIGHT (s) - 1) ? i : 0; @@ -1603,11 +1595,10 @@ window_change_signal () { Lisp_Object tail; + SCREEN_PTR s; - for (tail = Vscreen_list; CONSP (tail); tail = XCONS (tail)->cdr) + FOR_EACH_SCREEN (tail, s) { - SCREEN_PTR s = XSCREEN (XCONS (tail)->car); - if (SCREEN_IS_TERMCAP (s)) { ++in_display; @@ -1632,12 +1623,12 @@ do_pending_window_change () while (delayed_size_change) { Lisp_Object tail; + SCREEN_PTR s; delayed_size_change = 0; - for (tail = Vscreen_list; CONSP (tail); tail = XCONS (tail)->cdr) + FOR_EACH_SCREEN (tail, s) { - SCREEN_PTR s = XSCREEN (XCONS (tail)->car); int height = SCREEN_NEW_HEIGHT (s); int width = SCREEN_NEW_WIDTH (s); diff --git a/src/emacs.c b/src/emacs.c index 104ba671253..df698ee8309 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -63,6 +63,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Command line args from shell, as list of strings */ Lisp_Object Vcommand_line_args; +/* Hook run by `kill-emacs' before it does really anything. */ +Lisp_Object Vkill_emacs_hook; + /* Set nonzero after Emacs has started up the first time. Prevents reinitialization of the Lisp world and keymaps on subsequent starts. */ @@ -761,4 +764,9 @@ syms_of_emacs () DEFVAR_BOOL ("noninteractive", &noninteractive1, "Non-nil means Emacs is running without interactive terminal."); + + Vkill_emacs_hook = Qnil; + + DEFVAR_LISP ("kill-emacs-hook", &Vkill_emacs_hook, + "Hook to be run whenever kill-emacs is called."); } diff --git a/src/eval.c b/src/eval.c index 0e012d45008..572410e9617 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1094,7 +1094,9 @@ See also the function `condition-case'.") if (gc_in_progress || waiting_for_input) abort (); +#ifdef HAVE_X_WINDOWS TOTALLY_UNBLOCK_INPUT; +#endif conditions = Fget (sig, Qerror_conditions); diff --git a/src/fileio.c b/src/fileio.c index c6d3ee424fc..71a07938b11 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -621,7 +621,7 @@ See also the function `substitute-in-file-name'.") #ifdef VMS || nm[1] == ':' #endif /* VMS */ - || nm[1] == 0)/* ~/filename */ + || nm[1] == 0)/* ~ by itself */ { if (!(newdir = (unsigned char *) egetenv ("HOME"))) newdir = (unsigned char *) ""; @@ -642,15 +642,18 @@ See also the function `substitute-in-file-name'.") o [p - nm] = 0; pw = (struct passwd *) getpwnam (o + 1); - if (!pw) - error ("\"%s\" isn't a registered user", o + 1); - + if (pw) + { + newdir = (unsigned char *) pw -> pw_dir; #ifdef VMS - nm = p + 1; /* skip the terminator */ + nm = p + 1; /* skip the terminator */ #else - nm = p; + nm = p; #endif /* VMS */ - newdir = (unsigned char *) pw -> pw_dir; + } + + /* If we don't find a user of that name, leave the name + unchanged; don't move nm forward to p. */ } if (nm[0] != '/' @@ -794,7 +797,8 @@ See also the function `substitute-in-file-name'.") return make_string (target, o - target); } #if 0 -DEFUN ("expand-file-name", Fexpand_file_name, Sexpand_file_name, 1, 2, 0, +/* Changed this DEFUN to a DEAFUN, so as not to confuse `make-docfile'. +DEAFUN ("expand-file-name", Fexpand_file_name, Sexpand_file_name, 1, 2, 0, "Convert FILENAME to absolute, and canonicalize it.\n\ Second arg DEFAULT is directory to start with if FILENAME is relative\n\ (does not start with slash); if DEFAULT is nil or missing,\n\ @@ -1589,38 +1593,38 @@ Signals a `file-already-exists' error if a file NEWNAME already exists\n\ unless optional third argument OK-IF-ALREADY-EXISTS is non-nil.\n\ A number as third arg means request confirmation if NEWNAME already exists.\n\ This happens for interactive use with M-x.") - (filename, newname, ok_if_already_exists) - Lisp_Object filename, newname, ok_if_already_exists; + (filename, linkname, ok_if_already_exists) + Lisp_Object filename, linkname, ok_if_already_exists; { #ifdef NO_ARG_ARRAY Lisp_Object args[2]; #endif struct gcpro gcpro1, gcpro2; - GCPRO2 (filename, newname); + GCPRO2 (filename, linkname); CHECK_STRING (filename, 0); - CHECK_STRING (newname, 1); + CHECK_STRING (linkname, 1); #if 0 /* This made it impossible to make a link to a relative name. */ filename = Fexpand_file_name (filename, Qnil); #endif - newname = Fexpand_file_name (newname, Qnil); + linkname = Fexpand_file_name (linkname, Qnil); if (NILP (ok_if_already_exists) || XTYPE (ok_if_already_exists) == Lisp_Int) - barf_or_query_if_file_exists (newname, "make it a link", + barf_or_query_if_file_exists (linkname, "make it a link", XTYPE (ok_if_already_exists) == Lisp_Int); - if (0 > symlink (XSTRING (filename)->data, XSTRING (newname)->data)) + if (0 > symlink (XSTRING (filename)->data, XSTRING (linkname)->data)) { /* If we didn't complain already, silently delete existing file. */ if (errno == EEXIST) { unlink (XSTRING (filename)->data); - if (0 <= symlink (XSTRING (filename)->data, XSTRING (newname)->data)) + if (0 <= symlink (XSTRING (filename)->data, XSTRING (linkname)->data)) return Qnil; } #ifdef NO_ARG_ARRAY args[0] = filename; - args[1] = newname; + args[1] = linkname; report_file_error ("Making symbolic link", Flist (2, args)); #else report_file_error ("Making symbolic link", Flist (2, &filename)); diff --git a/src/frame.c b/src/frame.c index 6f190e4c535..41df7e26caf 100644 --- a/src/frame.c +++ b/src/frame.c @@ -20,6 +20,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <stdio.h> #include "config.h" + +#ifdef MULTI_SCREEN + #include "lisp.h" #include "screen.h" #include "window.h" @@ -34,11 +37,6 @@ Lisp_Object Vdefault_minibuffer_screen; Lisp_Object Vdefault_screen_alist; Lisp_Object Qminibuffer; -/* A screen which is not just a minibuffer, or 0 if there are no - such screens. This is usually the most recent such screen that - was selected. */ -struct screen *last_nonminibuf_screen; - extern Lisp_Object Vminibuffer_list; extern Lisp_Object get_minibuffer (); @@ -1220,3 +1218,5 @@ For values specific to the separate minibuffer screen, see\n\ defsubr (&Srubber_band_rectangle); #endif /* HAVE_X11 */ } + +#endif diff --git a/src/frame.h b/src/frame.h index a9fca616c8c..f9e270e52c5 100644 --- a/src/frame.h +++ b/src/frame.h @@ -1,11 +1,11 @@ /* Define screen-object for GNU Emacs. - Copyright (C) 1988 Free Software Foundation, Inc. + Copyright (C) 1988, 1992 Free Software Foundation, Inc. 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) +the Free Software Foundation; either version 2, or (at your option) any later version. GNU Emacs is distributed in the hope that it will be useful, @@ -18,7 +18,12 @@ along with GNU Emacs; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifdef MULTI_SCREEN +/* The structure representing a screen. + + We declare this even if MULTI_SCREEN is not defined, because when + we lack multi-screen support, we use one instance of this structure + to represent the one screen we support. This is cleaner than + having miscellaneous random variables scattered about. */ enum output_method { output_termcap, output_x_window }; @@ -34,15 +39,13 @@ struct screen /* glyphs we'd like to appear on the screen */ struct screen_glyphs *desired_glyphs; + /* See do_line_insertion_deletion_costs for info on these arrays. */ /* Cost of inserting 1 line on this screen */ int *insert_line_cost; - /* Cost of deleting 1 line on this screen */ int *delete_line_cost; - /* Cost of inserting n lines on this screen */ int *insert_n_lines_cost; - /* Cost of deleting n lines on this screen */ int *delete_n_lines_cost; @@ -148,6 +151,8 @@ struct screen int scroll_bottom_vpos; }; +#ifdef MULTI_SCREEN + typedef struct screen *SCREEN_PTR; #define XSCREEN(p) ((struct screen *) XPNTR (p)) @@ -157,7 +162,6 @@ typedef struct screen *SCREEN_PTR; #define SCREENP(s) (XTYPE(s) == Lisp_Screen) #define SCREEN_LIVE_P(s) ((s)->display.nothing != 0) -#define SET_SCREEN_GARBAGED(s) (screen_garbaged = 1, s->garbaged = 1) #define SCREEN_IS_TERMCAP(s) ((s)->output_method == output_termcap) #define SCREEN_IS_X(s) ((s)->output_method == output_x_window) #define SCREEN_MINIBUF_ONLY_P(s) \ @@ -173,6 +177,7 @@ typedef struct screen *SCREEN_PTR; #define SCREEN_CURSOR_X(s) (s)->cursor_x #define SCREEN_CURSOR_Y(s) (s)->cursor_y #define SCREEN_VISIBLE_P(s) (s)->visible +#define SET_SCREEN_GARBAGED(s) (screen_garbaged = 1, s->garbaged = 1) #define SCREEN_GARBAGED_P(s) (s)->garbaged #define SCREEN_NO_SPLIT_P(s) (s)->no_split #define SCREEN_WANTS_MODELINE_P(s) (s)->wants_modeline @@ -202,6 +207,22 @@ typedef struct screen *SCREEN_PTR; x = wrong_type_argument (Qlive_screen_p, (x)); \ } +/* FOR_EACH_SCREEN (LIST_VAR, SCREEN_VAR) followed by a statement is a + `for' loop which iterates over the elements of Vscreen_list. The + loop will set SCREEN_VAR, a SCREEN_PTR, to each screen in + Vscreen_list in succession and execute the statement. LIST_VAR + should be a Lisp_Object; it is used to iterate through the + Vscreen_list. + + If MULTI_SCREEN isn't defined, then this loop expands to something which + executes the statement once. */ +#define FOR_EACH_SCREEN(list_var, screen_var) \ + for ((list_var) = Vscreen_list; \ + (CONSP (list_var) \ + && (screen_var = XSCREEN (XCONS (list_var)->car), 1)); \ + list_var = XCONS (list_var)->cdr) + + extern Lisp_Object Qscreenp, Qlive_screen_p; extern struct screen *selected_screen; @@ -212,6 +233,10 @@ extern struct screen *make_screen (); extern struct screen *make_minibuffer_screen (); extern struct screen *make_screen_without_minibuffer (); +/* Nonzero means SCREEN_MESSAGE_BUF (selected_screen) is being used by + print. */ +extern int message_buf_print; + extern Lisp_Object Vscreen_list; extern Lisp_Object Vdefault_screen_alist; @@ -223,47 +248,65 @@ extern Lisp_Object Vterminal_screen; #define SCREEN_PTR int +extern struct screen the_only_screen; + extern int selected_screen; -#define last_nonminibuf_screen selected_screen +extern int last_nonminibuf_screen; + +/* Nonzero means SCREEN_MESSAGE_BUF (selected_screen) is being used by + print. */ +extern int message_buf_print; #define XSCREEN(s) selected_screen #define WINDOW_SCREEN(w) selected_screen #define SCREENP(s) (XTYPE(s) == Lisp_Screen) #define SCREEN_LIVE_P(s) 1 -#define SET_SCREEN_GARBAGED(s) (screen_garbaged = 1) #define SCREEN_IS_TERMCAP(s) 1 #define SCREEN_IS_X(s) 0 -#define SCREEN_IS_MINIBUF_ONLY(s) 0 +#define SCREEN_MINIBUF_ONLY_P(s) 0 #define SCREEN_HAS_MINIBUF(s) 1 -#define SCREEN_CURRENT_GLYPHS(s) current_glyphs -#define SCREEN_DESIRED_GLYPHS(s) desired_glyphs -#define SCREEN_TEMP_GLYPHS(s) temp_glyphs -#define SCREEN_HEIGHT(s) screen_height -#define SCREEN_WIDTH(s) screen_width -#define SCREEN_NEW_HEIGHT(s) delayed_screen_height -#define SCREEN_NEW_WIDTH(s) delayed_screen_width -#define SCREEN_CURSOR_X(s) cursX -#define SCREEN_CURSOR_Y(s) cursY +#define SCREEN_CURRENT_GLYPHS(s) the_only_screen.current_glyphs +#define SCREEN_DESIRED_GLYPHS(s) the_only_screen.desired_glyphs +#define SCREEN_TEMP_GLYPHS(s) the_only_screen.temp_glyphs +#define SCREEN_HEIGHT(s) the_only_screen.height +#define SCREEN_WIDTH(s) the_only_screen.width +#define SCREEN_NEW_HEIGHT(s) the_only_screen.new_height +#define SCREEN_NEW_WIDTH(s) the_only_screen.new_width +#define SCREEN_CURSOR_X(s) the_only_screen.cursor_x +#define SCREEN_CURSOR_Y(s) the_only_screen.cursor_y #define SCREEN_VISIBLE_P(s) 1 +#define SET_SCREEN_GARBAGED(s) (screen_garbaged = 1) #define SCREEN_GARBAGED_P(s) screen_garbaged #define SCREEN_NO_SPLIT_P(s) 0 #define SCREEN_WANTS_MODELINE_P(s) 1 #define SCREEN_ICONIFIED_P(s) 0 #define SCREEN_MINIBUF_WINDOW(s) minibuf_window -#define SCREEN_ROOT_WINDOW(s) root_window +#define SCREEN_ROOT_WINDOW(s) the_only_screen.root_window #define SCREEN_SELECTED_WINDOW(s) selected_window #define SET_GLYPHS_SCREEN(glyphs,screen) -#define SCREEN_INSERT_COST(screen) insert_line_cost -#define SCREEN_DELETE_COST(screen) delete_line_cost -#define SCREEN_INSERTN_COST(screen) insert_n_lines_cost -#define SCREEN_DELETEN_COST(screen) delete_n_lines_cost -#define SCREEN_MESSAGE_BUF(s) message_buf -#define SCREEN_SCROLL_BOTTOM_VPOS(s) scroll_bottom_vpos +#define SCREEN_INSERT_COST(screen) the_only_screen.insert_line_cost +#define SCREEN_DELETE_COST(screen) the_only_screen.delete_line_cost +#define SCREEN_INSERTN_COST(screen) the_only_screen.insert_n_lines_cost +#define SCREEN_DELETEN_COST(screen) the_only_screen.delete_n_lines_cost +#define SCREEN_MESSAGE_BUF(s) the_only_screen.message_buf +#define SCREEN_SCROLL_BOTTOM_VPOS(s) the_only_screen.scroll_bottom_vpos +#define SCREEN_FOCUS_SCREEN(s) 0 #define CHECK_SCREEN(x, i) { ; } - -extern int screen_width, screen_height; -extern int cursX, cursY; +#define CHECK_LIVE_SCREEN(x, y) { ; } + +/* FOR_EACH_SCREEN (LIST_VAR, SCREEN_VAR) followed by a statement is a + `for' loop which iterates over the elements of Vscreen_list. The + loop will set SCREEN_VAR, a SCREEN_PTR, to each screen in + Vscreen_list in succession and execute the statement. LIST_VAR + should be a Lisp_Object; it is used to iterate through the + Vscreen_list. + + If MULTI_SCREEN _is_ defined, then this loop expands to a real + `for' loop which traverses Vscreen_list using LIST_VAR and + SCREEN_VAR. */ +#define FOR_EACH_SCREEN(list_var, screen_var) \ + for (screen_var = (SCREEN_PTR) 1; screen_var; screen_var = (SCREEN_PTR) 0) #endif /* not MULTI_SCREEN */ diff --git a/src/keyboard.c b/src/keyboard.c index 97b98c98b98..cb2e56adf36 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -310,7 +310,7 @@ Lisp_Object Qevent_unmodified; /* Symbols to use for non-text mouse positions. */ Lisp_Object Qmode_line; -Lisp_Object Qvertical_split; +Lisp_Object Qvertical_line; /* Address (if not 0) of EMACS_TIME to zero out if a SIGIO interrupt @@ -1625,7 +1625,8 @@ kbd_buffer_get_event () else if (do_mouse_tracking && mouse_moved) { SCREEN_PTR screen; - Lisp_Object x, y, time; + Lisp_Object x, y; + unsigned long time; (*mouse_position_hook) (&screen, &x, &y, &time); XSET (Vlast_event_screen, Lisp_Screen, screen); @@ -1779,7 +1780,7 @@ make_lispy_event (event) if (part == 1) posn = Qmode_line; else if (part == 2) - posn = Qvertical_split; + posn = Qvertical_line; else XSET (posn, Lisp_Int, buffer_posn_from_coords (XWINDOW (window), @@ -1831,7 +1832,7 @@ static Lisp_Object make_lispy_movement (screen, x, y, time) SCREEN_PTR screen; Lisp_Object x, y; - Lisp_Object time; + unsigned long time; { Lisp_Object window; int ix, iy; @@ -1852,7 +1853,7 @@ make_lispy_movement (screen, x, y, time) if (part == 1) posn = Qmode_line; else if (part == 2) - posn = Qvertical_split; + posn = Qvertical_line; else XSET (posn, Lisp_Int, buffer_posn_from_coords (XWINDOW (window), ix, iy)); @@ -1864,7 +1865,7 @@ make_lispy_movement (screen, x, y, time) Fcons (window, Fcons (posn, Fcons (Fcons (x, y), - Fcons (time, Qnil))))); + Fcons (make_number (time), Qnil))))); } @@ -2638,6 +2639,7 @@ read_key_sequence (keybuf, bufsize, prompt) Vquit_flag = Qnil; +#ifdef MULTI_SCREEN /* What buffer was this event typed/moused at? */ if (XTYPE (key) == Lisp_Int || XTYPE (key) == Lisp_Symbol) buf = (XBUFFER @@ -2674,6 +2676,7 @@ read_key_sequence (keybuf, bufsize, prompt) goto restart; } +#endif } first_binding = (follow_key (key, @@ -3512,8 +3515,8 @@ syms_of_keyboard () Qmode_line = intern ("mode-line"); staticpro (&Qmode_line); - Qvertical_split = intern ("vertical-split"); - staticpro (&Qvertical_split); + Qvertical_line = intern ("vertical-line"); + staticpro (&Qvertical_line); Qevent_kind = intern ("event-type"); staticpro (&Qevent_kind); diff --git a/src/keyboard.h b/src/keyboard.h index a1b00ba94cf..d1cb78d7827 100644 --- a/src/keyboard.h +++ b/src/keyboard.h @@ -1,11 +1,11 @@ /* Declarations useful when processing input. - Copyright (C) 1985, 1986, 1987 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc. 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) +the Free Software Foundation; either version 2, or (at your option) any later version. GNU Emacs is distributed in the hope that it will be useful, @@ -64,5 +64,5 @@ extern Lisp_Object Qscrollbar_click; (Fget ((event_head), Qevent_kind)) /* Symbols to use for non-text mouse positions. */ -extern Lisp_Object Qmode_line, Qvertical_split; +extern Lisp_Object Qmode_line, Qvertical_line; diff --git a/src/lisp.h b/src/lisp.h index 86885456602..d981fd74bc5 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -97,30 +97,33 @@ enum Lisp_Type Lisp_Internal_Stream, /* Used in a symbol value cell when the symbol's value is per-buffer. - The actual contents are a cons cell which starts a list like this: - (REALVALUE BUFFER CURRENT-ALIST-ELEMENT . DEFAULT-VALUE)). - - BUFFER is the last buffer for which this symbol's value was - made up to date. - - CURRENT-ALIST-ELEMENT is a pointer to an element of BUFFER's - b_local_var_alist, that being the element whose car is this variable. - Or it can be a pointer to the (CURRENT-ALIST-ELEMENT . DEFAULT-VALUE), if BUFFER - does not have an element in its alist for this variable - (that is, if BUFFER sees the default value of this variable). - - If we want to examine or set the value and BUFFER is current, - we just examine or set REALVALUE. - If BUFFER is not current, we store the current REALVALUE value into - CURRENT-ALIST-ELEMENT, then find the appropriate alist element for - the buffer now current and set up CURRENT-ALIST-ELEMENT. - Then we set REALVALUE out of that element, and store into BUFFER. - - If we are setting the variable and the current buffer does not have - an alist entry for this variable, an alist entry is created. - - Note that REALVALUE can be a forwarding pointer. - Each time it is examined or set, forwarding must be done. */ + The actual contents are a cons cell which starts a list like this: + (REALVALUE BUFFER CURRENT-ALIST-ELEMENT . DEFAULT-VALUE). + + BUFFER is the last buffer for which this symbol's value was + made up to date. + + CURRENT-ALIST-ELEMENT is a pointer to an element of BUFFER's + local_var_alist, that being the element whose car is this + variable. Or it can be a pointer to the + (CURRENT-ALIST-ELEMENT . DEFAULT-VALUE), + if BUFFER does not have an element in its alist for this + variable (that is, if BUFFER sees the default value of this + variable). + + If we want to examine or set the value and BUFFER is current, + we just examine or set REALVALUE. If BUFFER is not current, we + store the current REALVALUE value into CURRENT-ALIST-ELEMENT, + then find the appropriate alist element for the buffer now + current and set up CURRENT-ALIST-ELEMENT. Then we set + REALVALUE out of that element, and store into BUFFER. + + If we are setting the variable and the current buffer does not + have an alist entry for this variable, an alist entry is + created. + + Note that REALVALUE can be a forwarding pointer. Each time it + is examined or set, forwarding must be done. */ Lisp_Buffer_Local_Value, /* Like Lisp_Buffer_Local_Value with one difference: diff --git a/src/lread.c b/src/lread.c index 1f81d76b69c..630a39a4fb0 100644 --- a/src/lread.c +++ b/src/lread.c @@ -188,6 +188,7 @@ DEFUN ("read-event", Fread_event, Sread_event, 0, 0, 0, val = read_char (0); return val; } +#endif DEFUN ("read-char-exclusive", Fread_char_exclusive, Sread_char_exclusive, 0, 0, 0, "Read a character from the command input (keyboard or macro).\n\ @@ -206,7 +207,6 @@ It is returned as a number. Non character events are ignored.") return val; } -#endif /* HAVE_X_WINDOWS */ DEFUN ("get-file-char", Fget_file_char, Sget_file_char, 0, 0, 0, "Don't use this yourself.") @@ -501,7 +501,7 @@ readevalloop (readcharfun, stream, evalfun, printflag) #ifndef standalone -DEFUN ("eval-buffer", Feval_buffer, Seval_buffer, 0, 1, "", +DEFUN ("eval-buffer", Feval_buffer, Seval_buffer, 0, 2, "", "Execute the current buffer as Lisp code.\n\ Programs can pass two arguments, BUFFER and PRINTFLAG.\n\ BUFFER is the buffer to evaluate (nil means use current buffer).\n\ diff --git a/src/minibuf.c b/src/minibuf.c index e024e5ecd11..9f96f15d5df 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -348,7 +348,7 @@ If non-nil second arg INITIAL-INPUT is a string to insert before reading.") return Fread_from_minibuffer (prompt, initial_input, Qnil, Qnil, Qnil); } -DEFUN ("read-no-blanks-input", Fread_no_blanks_input, Sread_no_blanks_input, 2, 1, 0, +DEFUN ("read-no-blanks-input", Fread_no_blanks_input, Sread_no_blanks_input, 2, 2, 0, "Args PROMPT and INIT, strings. Read a string from the terminal, not allowing blanks.\n\ Prompt with PROMPT, and provide INIT as an initial value of the input string.") (prompt, init) diff --git a/src/print.c b/src/print.c index 2cd2b9c781e..534d5d67b22 100644 --- a/src/print.c +++ b/src/print.c @@ -159,7 +159,7 @@ glyph_to_str_cpy (glyphs, str) #define PRINTCHAR(ch) printchar (ch, printcharfun) -/* Index of first unused element of message_buf */ +/* Index of first unused element of SCREEN_MESSAGE_BUF(selected_screen). */ static int printbufidx; static void diff --git a/src/scroll.c b/src/scroll.c index 64dfd9aef25..ed45318a26b 100644 --- a/src/scroll.c +++ b/src/scroll.c @@ -1,11 +1,11 @@ /* Calculate what line insertion or deletion to do, and do it, - Copyright (C) 1985, 1986, 1990 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1990, 1992 Free Software Foundation, Inc. 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) +the Free Software Foundation; either version 2, or (at your option) any later version. GNU Emacs is distributed in the hope that it will be useful, @@ -54,15 +54,6 @@ struct matrix_elt char deletecount; }; -/* See do_line_insertion_deletion_costs for info on these arrays. */ - -#ifndef MULTI_SCREEN -static int *insert_line_cost; -static int *delete_line_cost; -static int *insert_n_lines_cost; -static int *delete_n_lines_cost; -#endif - /* Determine, in matrix[i,j], the cost of updating the first j old lines into the first i new lines. diff --git a/src/term.c b/src/term.c index e9f7ddbcd18..3663c44ff91 100644 --- a/src/term.c +++ b/src/term.c @@ -43,11 +43,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Terminal charateristics that higher levels want to look at. These are all extern'd in termchar.h */ -#ifndef MULTI_SCREEN -int screen_width; /* Number of usable columns */ -int screen_height; /* Number of lines */ -#endif - int must_write_spaces; /* Nonzero means spaces in the text must actually be output; can't just skip over some columns to leave them blank. */ @@ -103,7 +98,7 @@ int (*read_socket_hook) (); void (*mouse_position_hook) ( /* SCREEN_PTR *s, Lisp_Object *x, Lisp_Object *y, - Lisp_Object *time */ ); + unsigned long *time */ ); /* When reading from a minibuffer in a different screen, Emacs wants to shift the highlight from the selected screen to the minibuffer's diff --git a/src/termchar.h b/src/termchar.h index d82ccb0bad9..7a93d762bb4 100644 --- a/src/termchar.h +++ b/src/termchar.h @@ -19,8 +19,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ extern int baud_rate; /* Output speed in baud */ -extern int screen_width; /* Number of usable columns */ -extern int screen_height; /* Number of lines */ extern int must_write_spaces; /* Nonzero means spaces in the text must actually be output; can't just skip over some columns to leave them blank. */ diff --git a/src/termhooks.h b/src/termhooks.h index b9363eb16d7..5b5cac7315e 100644 --- a/src/termhooks.h +++ b/src/termhooks.h @@ -50,7 +50,7 @@ extern int (*read_socket_hook) (); extern void (*mouse_position_hook) ( /* SCREEN_PTR *s, Lisp_Object *x, Lisp_Object *y, - Lisp_Object *time */ ); + unsigned long *time */ ); /* The window system handling code should set this if the mouse has moved since the last call to the mouse_position_hook. Calling that @@ -135,8 +135,20 @@ struct input_event { Lisp_Object code; Lisp_Object part; + +/* This is obviously wrong, but I'm not sure what else I should do. + Obviously, this should be a SCREEN_PTR. But that would require that + every file which #includes this one should also #include "screen.h", + which would mean that files like cm.c and other innocents would be + dragged into the set of screen.h users. Maybe the definition of this + structure should be elsewhere? In its own file? */ +#ifdef MULTI_SCREEN struct screen *screen; +#else + int screen; +#endif int modifiers; /* See enum below for interpretation. */ + Lisp_Object x, y; unsigned long timestamp; }; diff --git a/src/window.c b/src/window.c index ddb2661c71b..b1876a219bb 100644 --- a/src/window.c +++ b/src/window.c @@ -47,14 +47,6 @@ static struct window *decode_window(); Lisp_Object selected_window; -#ifndef MULTI_SCREEN - -/* The root window for the screen. - This is accessed via SCREEN_ROOT_WINDOW (selected_screen). */ -Lisp_Object root_window; - -#endif - /* The minibuffer window of the selected screen. Note that you cannot test for minibufferness of an arbitrary window by comparing against this; but you can test for minibufferness of @@ -222,7 +214,7 @@ POS defaults to point; WINDOW, to the selected window.") posval = *compute_motion (top, 0, 0, posint, height, 0, XFASTINT (w->width) - 1 - (XFASTINT (w->width) + XFASTINT (w->left) - != XSCREEN (w->screen)->width), + != SCREEN_WIDTH (XSCREEN (w->screen))), XINT (w->hscroll), 0); return posval.vpos < height ? Qt : Qnil; @@ -363,9 +355,9 @@ measured in characters from the upper-left corner of the screen.\n\ screen.\n\ If COORDINATES are in the text portion of WINDOW,\n\ the coordinates relative to the window are returned.\n\ -If they are in the mode line of WINDOW, 'mode-line is returned.\n\ +If they are in the mode line of WINDOW, `mode-line' is returned.\n\ If they are on the border between WINDOW and its right sibling,\n\ - 'vertical-split is returned.") + `vertical-line' is returned.") (coordinates, window) register Lisp_Object coordinates, window; { @@ -388,7 +380,7 @@ If they are on the border between WINDOW and its right sibling,\n\ return Qmode_line; case 3: /* On right border of window. */ - return Qvertical_split; + return Qvertical_line; default: abort (); @@ -642,8 +634,8 @@ replace_window (old, replacement) /* If OLD is its screen's root_window, then replacement is the new root_window for that screen. */ - if (old == XSCREEN (o->screen)->root_window) - XSCREEN (o->screen)->root_window = replacement; + if (old == SCREEN_ROOT_WINDOW (XSCREEN (o->screen))) + SCREEN_ROOT_WINDOW (XSCREEN (o->screen)) = replacement; p->left = o->left; p->top = o->top; @@ -1062,7 +1054,8 @@ window_loop (type, obj, mini, screens) case GET_LRU_WINDOW: /* t as arg means consider only full-width windows */ - if (!NILP (obj) && XFASTINT (XWINDOW (w)->width) != screen->width) + if (!NILP (obj) && XFASTINT (XWINDOW (w)->width) + != SCREEN_WIDTH (screen)) break; #if 0 /* Ignore invisible and iconified screens. */ @@ -2614,32 +2607,33 @@ init_window_once () #else /* not MULTI_SCREEN */ extern Lisp_Object get_minibuffer (); - root_window = make_window (); + SCREEN_ROOT_WINDOW (selected_screen) = make_window (); minibuf_window = make_window (); - XWINDOW (root_window)->next = minibuf_window; - XWINDOW (minibuf_window)->prev = root_window; + XWINDOW (SCREEN_ROOT_WINDOW (selected_screen))->next = minibuf_window; + XWINDOW (minibuf_window)->prev = SCREEN_ROOT_WINDOW (selected_screen); /* These values 9 and 10 are arbitrary, just so that there is "something there." Correct values are put in in init_xdisp */ - XFASTINT (XWINDOW (root_window)->width) = 10; + XFASTINT (XWINDOW (SCREEN_ROOT_WINDOW (selected_screen))->width) = 10; XFASTINT (XWINDOW (minibuf_window)->width) = 10; - XFASTINT (XWINDOW (root_window)->height) = 9; + XFASTINT (XWINDOW (SCREEN_ROOT_WINDOW (selected_screen))->height) = 9; XFASTINT (XWINDOW (minibuf_window)->top) = 9; XFASTINT (XWINDOW (minibuf_window)->height) = 1; /* Prevent error in Fset_window_buffer. */ - XWINDOW (root_window)->buffer = Qt; + XWINDOW (SCREEN_ROOT_WINDOW (selected_screen))->buffer = Qt; XWINDOW (minibuf_window)->buffer = Qt; /* Now set them up for real. */ - Fset_window_buffer (root_window, Fcurrent_buffer ()); + Fset_window_buffer (SCREEN_ROOT_WINDOW (selected_screen), + Fcurrent_buffer ()); Fset_window_buffer (minibuf_window, get_minibuffer (0)); - selected_window = root_window; + selected_window = SCREEN_ROOT_WINDOW (selected_screen); /* Make sure this window seems more recently used than a newly-created, never-selected window. Increment window_select_count so the first selection ever will get diff --git a/src/window.h b/src/window.h index eedaef3be16..62a6c5b0c2e 100644 --- a/src/window.h +++ b/src/window.h @@ -1,11 +1,11 @@ /* Window definitions for GNU Emacs. - Copyright (C) 1985, 1986 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1992 Free Software Foundation, Inc. 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) +the Free Software Foundation; either version 2, or (at your option) any later version. GNU Emacs is distributed in the hope that it will be useful, diff --git a/src/xdisp.c b/src/xdisp.c index 60bdafea9d8..2808c515d47 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -167,31 +167,7 @@ int clip_changed; int windows_or_buffers_changed; -#ifndef MULTI_SCREEN - -DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "", - "Clear the screen and output again what is supposed to appear on it.") - () -{ - if (screen_height == 0) abort (); /* Some bug zeros some core */ - clear_screen (); - fflush (stdout); - clear_screen_records (); - if (screen_height == 0) abort (); /* Some bug zeros some core */ - windows_or_buffers_changed++; - /* Mark all windows as INaccurate, - so that every window will have its redisplay done. */ - mark_window_display_accurate (XWINDOW (minibuf_window)->prev, 0); - if (screen_height == 0) abort (); /* Some bug zeros some core */ - return Qnil; -} - -#endif /* not MULTI_SCREEN */ - -/* Buffer used for messages formatted by `message'. */ -char *message_buf; - -/* Nonzero if message_buf is being used by print; +/* Nonzero if SCREEN_MESSAGE_BUF (selected_screen) is being used by print; zero if being used by message. */ int message_buf_print; @@ -310,7 +286,7 @@ echo_area_display () /* If desired cursor location is on this line, put it at end of text */ if (SCREEN_CURSOR_Y (s) == vpos) - SCREEN_CURSOR_X (s) = s->desired_glyphs->used[vpos]; + SCREEN_CURSOR_X (s) = SCREEN_DESIRED_GLYPHS (s)->used[vpos]; /* Fill the rest of the minibuffer window with blank lines. */ { @@ -1786,7 +1762,7 @@ display_mode_line (w) and the rest of this line is mode lines of the sibling windows). */ if (XFASTINT (w->width) == SCREEN_WIDTH (s) || XFASTINT (XWINDOW (w->parent)->width) == SCREEN_WIDTH (s)) - s->desired_glyphs->highlight[vpos] = mode_line_inverse_video; + SCREEN_DESIRED_GLYPHS (s)->highlight[vpos] = mode_line_inverse_video; #ifdef HAVE_X_WINDOWS /* I'm trying this out because I saw Unimpress use it, but it's @@ -2325,10 +2301,6 @@ If this is zero, point is always centered after it moves off screen."); DEFVAR_BOOL ("mode-line-inverse-video", &mode_line_inverse_video, "*Non-nil means use inverse video for the mode line."); mode_line_inverse_video = 1; - -#ifndef MULTI_SCREEN - defsubr (&Sredraw_display); -#endif /* MULTI_SCREEN */ } /* initialize the window system */ diff --git a/src/xterm.c b/src/xterm.c index 194f8d6177a..43f59d03ad2 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1522,7 +1522,7 @@ construct_mouse_click (result, event, s, part, prefix) other kinds of events (focus changes and button clicks, for example), or by XQueryPointer calls; when one of these happens, we get another MotionNotify event the next time the mouse moves. This - is at least as efficient than getting motion events when mouse + is at least as efficient as getting motion events when mouse tracking is on, and I suspect only negligibly worse when tracking is off. @@ -1536,6 +1536,14 @@ construct_mouse_click (result, event, s, part, prefix) static SCREEN_PTR last_mouse_screen; static XRectangle last_mouse_glyph; +/* This is a hack. We would really prefer that XTmouse_position would + return the time associated with the position it returns, but there + doesn't seem to be any way to wrest the timestamp from the server + along with the position query. So, we just keep track of the time + of the last movement we received, and return that in hopes that + it's somewhat accurate. */ +static Time last_mouse_movement_time; + /* Function to report a mouse movement to the mainstream Emacs code. The input handler calls this. @@ -1549,6 +1557,8 @@ note_mouse_position (screen, event) XMotionEvent *event; { + last_mouse_movement_time = event->time; + /* Has the mouse moved off the glyph it was on at the last sighting? */ if (event->x < last_mouse_glyph.x || event->x >= last_mouse_glyph.x + last_mouse_glyph.width @@ -1580,7 +1590,7 @@ static void XTmouse_position (s, x, y, time) SCREEN_PTR *s; Lisp_Object *x, *y; - Lisp_Object *time; + unsigned long *time; { int ix, iy, dummy; Display *d = x_current_display; @@ -1635,8 +1645,11 @@ XTmouse_position (s, x, y, time) mouse_moved = 0; /* I don't know how to find the time for the last movement; it seems - like XQueryPointer ought to return it, but it doesn't. */ - *time = Qnil; + like XQueryPointer ought to return it, but it doesn't. So, we'll + return the time of the last MotionNotify event we received. Note + that the use of motion hints means that this isn't guaranteed to + be accurate at all. */ + *time = last_mouse_movement_time; UNBLOCK_INPUT; } |