annotate src/m/pmax.h @ 51207:7e176ef34c10

Make (many) trivial substitutions for renamed and new macros in dispextern.h, frame.h and window.h. (make_window): Initialize new members left_margin_cols, right_margin_cols, left_fringe_width, right_fringe_width, fringes_outside_margins, scroll_bar_width, and vertical_scroll_bar_type. (coordinates_in_window): Adapted to new fringe/margin positions and per-window fringes and scroll-bars. Fix bug related to incorrectly adjusting coordinates by frame's internal_border_width (the effect normally negible since the internal_border_width is typically 0 or 1 pixel, but very noticeable for an internal_border_width of e.g. 25 pixels). Upon successful return (other than ON_NOTHING), the coordinates are now always properly converted to window relative for the given display element. (window_from_coordinates): Add new parameters wx and wy to return the window relative x and y position in the returned window and part. A null arg means, don't return the position. All callers changed. (adjust_window_margins): New function which may reduce the width of the display margins if a window's text area is too small after resizing or splitting windows. (size_window): Fix bug that did not account for display margin widths when checking the minimum width of a window; use adjust_window_margins. (set_window_buffer): Call Fset_window_fringes and Fset_window_scroll_bars to setup per-window elements. Add new arg KEEP_MARGINS_P. Non-nil means to keep window's existing display margin, fringe widths, and scroll bar settings (e.g. after splitting a window or resizing the frame). All callers changed. (Fset_window_buffer): New arg KEEP_MARGINS. All callers changed. (Fsplit_window): Duplicate original window's display margin, fringe, and scroll-bar settings; then call Fset_window_buffer with KEEP_MARGINS non-nil. This fixes a bug which caused a split window to only preserve the display margins in one of the windows. When splitting horisontally, call adjust_window_margins on both windows to ensure that the text area of the new windows is non too narrow. This fixes a bug which could cause emacs to trap if the width of the split window was less than the width of the display margins. (window_box_text_cols): Renamed from window_internal_width. All uses changed. Adapt to per-window fringes and scroll bars. Fix bug that caused vertical separator to be subtracted also on window frames. Fix another bug that did not reduce the returned value by the columns used for display margins. (window_scroll_line_based): Fix bug related to scrolling too much when display margins are present (implicitly fixed by the fix to window_box_text_cols). (scroll_left, scroll_right): Fix bug related to scrolling too far by default when display margins are present (implicitly fixed by the fix to window_box_text_cols). (struct saved_window): Rename members left to left_col, top to top_line, width to total_cols, height to total_lines, orig_top to orig_top_line, orig_height to orig_total_lines. All uses changed. New members left_margin_cols, right_margin_cols, left_fringe_width, right_fringe_width, fringes_outside_margins, scroll_bar_width, and vertical_scroll_bar_type for saving per-window display elements. (Fset_window_configuration): Restore display margins, fringes, and scroll bar settings. This fixes a bug which caused display margins to be discarded when saving and restoring a window configuration. (save_window_save): Save display margins, fringes, and scroll bar settings. This fixes a bug which caused display margins to be discarded when saving and restoring a window configuration. (Fset_window_margins): Do nothing if display margins are not really changed. Otherwise, call adjust_window_margins to ensure the text area doesn't get too narrow. This fixes a bug which could cause emacs to trap if setting display margins wider than the width of the window. (Fset_window_fringes): New defun to allow user to specifically set this window's fringe widths and position vs. display margins. (Fwindow_fringes): New defun to return window's actual fringe settings. (Fset_window_scroll_bars): New defun to allow user to specifically set this window's scroll bar width and position. (Fwindow_scroll_bars): New defun to return window's actual scroll bar settings. (compare_window_configurations): Also compare display margins, fringes, and scroll bar settings. (syms_of_window): Defsubr new defuns for fringe and scroll bars.
author Kim F. Storm <storm@cua.dk>
date Sat, 24 May 2003 22:07:51 +0000
parents 23a1cea22d13
children 695cf19ef79e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1113
0ffcf74fb8ad entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 456
diff changeset
1 /* Machine description file for DEC MIPS machines. */
0ffcf74fb8ad entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 456
diff changeset
2
456
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3 #include "mips.h"
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 45959
diff changeset
5 /* The following line tells the configuration script what sort of
456
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6 operating system this machine is likely to run.
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 45959
diff changeset
7 USUAL-OPSYS="note"
1113
0ffcf74fb8ad entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 456
diff changeset
8
0ffcf74fb8ad entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 456
diff changeset
9 NOTE-START
16484
96df462c5f15 (BROKEN_O_NONBLOCK): Define only if Ultrix.
Richard M. Stallman <rms@gnu.org>
parents: 14036
diff changeset
10 The operating system would be either osf1, ultrix, or NetBSD.
1113
0ffcf74fb8ad entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 456
diff changeset
11 NOTE-END */
456
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
12
45959
b8ede252555b (START_FILES): Define START_FILES for NetBSD and
Pavel Janík <Pavel@Janik.cz>
parents: 44601
diff changeset
13 #ifndef __MIPSEB__
9095
23f72b18b420 (WORDS_BIG_ENDIAN): define or undef appropriately, superseding BIG_ENDIAN.
Karl Heuer <kwzh@gnu.org>
parents: 8892
diff changeset
14 #undef WORDS_BIG_ENDIAN
45959
b8ede252555b (START_FILES): Define START_FILES for NetBSD and
Pavel Janík <Pavel@Janik.cz>
parents: 44601
diff changeset
15 #endif
1113
0ffcf74fb8ad entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 456
diff changeset
16 #undef LIB_STANDARD
0ffcf74fb8ad entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 456
diff changeset
17 #undef START_FILES
0ffcf74fb8ad entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 456
diff changeset
18 #undef COFF
0ffcf74fb8ad entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 456
diff changeset
19 #undef TERMINFO
0ffcf74fb8ad entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 456
diff changeset
20 #define MAIL_USE_FLOCK
0ffcf74fb8ad entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 456
diff changeset
21 #define HAVE_UNION_WAIT
456
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
22
12419
818d7bcf63b0 [MACH]: Use built-in alloca, set START_FILES.
Richard M. Stallman <rms@gnu.org>
parents: 9095
diff changeset
23
818d7bcf63b0 [MACH]: Use built-in alloca, set START_FILES.
Richard M. Stallman <rms@gnu.org>
parents: 9095
diff changeset
24 #ifdef MACH
818d7bcf63b0 [MACH]: Use built-in alloca, set START_FILES.
Richard M. Stallman <rms@gnu.org>
parents: 9095
diff changeset
25 #define START_FILES pre-crt0.o /usr/lib/crt0.o
818d7bcf63b0 [MACH]: Use built-in alloca, set START_FILES.
Richard M. Stallman <rms@gnu.org>
parents: 9095
diff changeset
26 #else
456
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
27 /* This line starts being needed with ultrix 4.0. */
1113
0ffcf74fb8ad entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 456
diff changeset
28 /* You must delete it for version 3.1. */
456
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
29 #define START_FILES pre-crt0.o /usr/lib/cmplrs/cc/crt0.o
12419
818d7bcf63b0 [MACH]: Use built-in alloca, set START_FILES.
Richard M. Stallman <rms@gnu.org>
parents: 9095
diff changeset
30 #endif
456
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
31
19795
319a43900b56 Test __OpenBSD__ along with __NetBSD__.
Richard M. Stallman <rms@gnu.org>
parents: 16484
diff changeset
32 #if defined (__NetBSD__) || defined (__OpenBSD__)
16484
96df462c5f15 (BROKEN_O_NONBLOCK): Define only if Ultrix.
Richard M. Stallman <rms@gnu.org>
parents: 14036
diff changeset
33 #undef START_FILES
45959
b8ede252555b (START_FILES): Define START_FILES for NetBSD and
Pavel Janík <Pavel@Janik.cz>
parents: 44601
diff changeset
34 #define START_FILES pre-crt0.o /usr/lib/crt0.o
16484
96df462c5f15 (BROKEN_O_NONBLOCK): Define only if Ultrix.
Richard M. Stallman <rms@gnu.org>
parents: 14036
diff changeset
35 #undef RUN_TIME_REMAP
96df462c5f15 (BROKEN_O_NONBLOCK): Define only if Ultrix.
Richard M. Stallman <rms@gnu.org>
parents: 14036
diff changeset
36 #undef UNEXEC
27923
325eddf4eb21 (START_FILES, CANNOT_DUMP) [__NetBSD__ || __OpenBSD__]: Don't define.
Gerd Moellmann <gerd@gnu.org>
parents: 19795
diff changeset
37 #define UNEXEC unexelf.o
19795
319a43900b56 Test __OpenBSD__ along with __NetBSD__.
Richard M. Stallman <rms@gnu.org>
parents: 16484
diff changeset
38 #endif /* NetBSD || OpenBSD */
16484
96df462c5f15 (BROKEN_O_NONBLOCK): Define only if Ultrix.
Richard M. Stallman <rms@gnu.org>
parents: 14036
diff changeset
39
456
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
40 /* Supposedly the following will overcome a kernel bug. */
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41 #undef LD_SWITCH_MACHINE
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
42 #undef DATA_START
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
43 #define DATA_START 0x10000000
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
44 #define DATA_SEG_BITS 0x10000000
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
45
1582
689f1697d285 * m/pmax.h: Don't define SYSTEM_MALLOC; this was only necessary
Jim Blandy <jimb@redhat.com>
parents: 1113
diff changeset
46 #if 0
689f1697d285 * m/pmax.h: Don't define SYSTEM_MALLOC; this was only necessary
Jim Blandy <jimb@redhat.com>
parents: 1113
diff changeset
47 /* I don't see any such conflict in Ultrix 4.2, 4.2a, or 4.3. And
689f1697d285 * m/pmax.h: Don't define SYSTEM_MALLOC; this was only necessary
Jim Blandy <jimb@redhat.com>
parents: 1113
diff changeset
48 the relocating allocator is a real win. -JimB */
689f1697d285 * m/pmax.h: Don't define SYSTEM_MALLOC; this was only necessary
Jim Blandy <jimb@redhat.com>
parents: 1113
diff changeset
49
456
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
50 /* In Ultrix 4.1, XvmsAlloc.o in libX11.a seems to insist
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
51 on defining malloc itself. This should avoid conflicting with it. */
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
52 #define SYSTEM_MALLOC
1582
689f1697d285 * m/pmax.h: Don't define SYSTEM_MALLOC; this was only necessary
Jim Blandy <jimb@redhat.com>
parents: 1113
diff changeset
53 #endif
1113
0ffcf74fb8ad entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 456
diff changeset
54
12419
818d7bcf63b0 [MACH]: Use built-in alloca, set START_FILES.
Richard M. Stallman <rms@gnu.org>
parents: 9095
diff changeset
55 /* Override what mips.h says about this. */
27923
325eddf4eb21 (START_FILES, CANNOT_DUMP) [__NetBSD__ || __OpenBSD__]: Don't define.
Gerd Moellmann <gerd@gnu.org>
parents: 19795
diff changeset
56 #if !defined (__NetBSD__)
1113
0ffcf74fb8ad entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 456
diff changeset
57 #undef LINKER
27923
325eddf4eb21 (START_FILES, CANNOT_DUMP) [__NetBSD__ || __OpenBSD__]: Don't define.
Gerd Moellmann <gerd@gnu.org>
parents: 19795
diff changeset
58 #endif
1113
0ffcf74fb8ad entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 456
diff changeset
59
16484
96df462c5f15 (BROKEN_O_NONBLOCK): Define only if Ultrix.
Richard M. Stallman <rms@gnu.org>
parents: 14036
diff changeset
60 #ifdef ultrix
1113
0ffcf74fb8ad entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 456
diff changeset
61 /* Ultrix 4.2 (perhaps also 4.1) implements O_NONBLOCK
0ffcf74fb8ad entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 456
diff changeset
62 but it doesn't work right;
0ffcf74fb8ad entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 456
diff changeset
63 and it causes hanging in read_process_output. */
0ffcf74fb8ad entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 456
diff changeset
64 #define BROKEN_O_NONBLOCK
16484
96df462c5f15 (BROKEN_O_NONBLOCK): Define only if Ultrix.
Richard M. Stallman <rms@gnu.org>
parents: 14036
diff changeset
65 #endif
1113
0ffcf74fb8ad entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 456
diff changeset
66
16484
96df462c5f15 (BROKEN_O_NONBLOCK): Define only if Ultrix.
Richard M. Stallman <rms@gnu.org>
parents: 14036
diff changeset
67 #ifndef __NetBSD__
3571
6c1a1b79536c * config.h.in (HAVE_LIBDNET): New macro, to be defined by
Jim Blandy <jimb@redhat.com>
parents: 3406
diff changeset
68 /* mcc@timessqr.gc.cuny.edu says this makes Emacs work with DECnet. */
6c1a1b79536c * config.h.in (HAVE_LIBDNET): New macro, to be defined by
Jim Blandy <jimb@redhat.com>
parents: 3406
diff changeset
69 #ifdef HAVE_LIBDNET
3396
56ffd7d79f05 (LIBS_MACHINE): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 1582
diff changeset
70 #define LIBS_MACHINE -ldnet
3571
6c1a1b79536c * config.h.in (HAVE_LIBDNET): New macro, to be defined by
Jim Blandy <jimb@redhat.com>
parents: 3406
diff changeset
71 #endif
3403
4151b7a0e415 Comment changes.
Richard M. Stallman <rms@gnu.org>
parents: 3396
diff changeset
72
3406
829998469d86 (KERNEL_FILE): New override definition.
Richard M. Stallman <rms@gnu.org>
parents: 3403
diff changeset
73 /* mcc@timessqr.gc.cuny.edu says it is /vmunix on Ultrix 4.2a. */
3403
4151b7a0e415 Comment changes.
Richard M. Stallman <rms@gnu.org>
parents: 3396
diff changeset
74 #undef KERNEL_FILE
3406
829998469d86 (KERNEL_FILE): New override definition.
Richard M. Stallman <rms@gnu.org>
parents: 3403
diff changeset
75 #define KERNEL_FILE "/vmunix"
16484
96df462c5f15 (BROKEN_O_NONBLOCK): Define only if Ultrix.
Richard M. Stallman <rms@gnu.org>
parents: 14036
diff changeset
76 #endif
4001
20abae0de304 * m/pmax.h (C_SWITCH_X_MACHINE): Set this to
Jim Blandy <jimb@redhat.com>
parents: 3571
diff changeset
77
16484
96df462c5f15 (BROKEN_O_NONBLOCK): Define only if Ultrix.
Richard M. Stallman <rms@gnu.org>
parents: 14036
diff changeset
78 #ifdef ultrix
4001
20abae0de304 * m/pmax.h (C_SWITCH_X_MACHINE): Set this to
Jim Blandy <jimb@redhat.com>
parents: 3571
diff changeset
79 /* Jim Wilson writes:
20abae0de304 * m/pmax.h (C_SWITCH_X_MACHINE): Set this to
Jim Blandy <jimb@redhat.com>
parents: 3571
diff changeset
80 [...] The X11 include files that Dec distributes with Ultrix
20abae0de304 * m/pmax.h (C_SWITCH_X_MACHINE): Set this to
Jim Blandy <jimb@redhat.com>
parents: 3571
diff changeset
81 are bogus.
20abae0de304 * m/pmax.h (C_SWITCH_X_MACHINE): Set this to
Jim Blandy <jimb@redhat.com>
parents: 3571
diff changeset
82
20abae0de304 * m/pmax.h (C_SWITCH_X_MACHINE): Set this to
Jim Blandy <jimb@redhat.com>
parents: 3571
diff changeset
83 When __STDC__ is defined (which is true with gcc), the X11 include files
20abae0de304 * m/pmax.h (C_SWITCH_X_MACHINE): Set this to
Jim Blandy <jimb@redhat.com>
parents: 3571
diff changeset
84 try to define prototypes. The prototypes however use types which haven't
20abae0de304 * m/pmax.h (C_SWITCH_X_MACHINE): Set this to
Jim Blandy <jimb@redhat.com>
parents: 3571
diff changeset
85 been defined yet, and thus we get syntax/parse errors.
20abae0de304 * m/pmax.h (C_SWITCH_X_MACHINE): Set this to
Jim Blandy <jimb@redhat.com>
parents: 3571
diff changeset
86
20abae0de304 * m/pmax.h (C_SWITCH_X_MACHINE): Set this to
Jim Blandy <jimb@redhat.com>
parents: 3571
diff changeset
87 You can not fix this by changing the include files, because the prototypes
20abae0de304 * m/pmax.h (C_SWITCH_X_MACHINE): Set this to
Jim Blandy <jimb@redhat.com>
parents: 3571
diff changeset
88 create circular dependencies, in particular Xutil.h depends on types defined
20abae0de304 * m/pmax.h (C_SWITCH_X_MACHINE): Set this to
Jim Blandy <jimb@redhat.com>
parents: 3571
diff changeset
89 in Xlib.h, and Xlib.h depends on types defined in Xutil.h. So, no matter
20abae0de304 * m/pmax.h (C_SWITCH_X_MACHINE): Set this to
Jim Blandy <jimb@redhat.com>
parents: 3571
diff changeset
90 which order you try to include them in, it will still fail.
20abae0de304 * m/pmax.h (C_SWITCH_X_MACHINE): Set this to
Jim Blandy <jimb@redhat.com>
parents: 3571
diff changeset
91
20abae0de304 * m/pmax.h (C_SWITCH_X_MACHINE): Set this to
Jim Blandy <jimb@redhat.com>
parents: 3571
diff changeset
92 Compiling with -DNeedFunctionPrototypes=0 will solve the problem by
20abae0de304 * m/pmax.h (C_SWITCH_X_MACHINE): Set this to
Jim Blandy <jimb@redhat.com>
parents: 3571
diff changeset
93 directly inhibiting the bad prototypes. This could perhaps just be put in
20abae0de304 * m/pmax.h (C_SWITCH_X_MACHINE): Set this to
Jim Blandy <jimb@redhat.com>
parents: 3571
diff changeset
94 an a Ultrix configuration file.
20abae0de304 * m/pmax.h (C_SWITCH_X_MACHINE): Set this to
Jim Blandy <jimb@redhat.com>
parents: 3571
diff changeset
95
20abae0de304 * m/pmax.h (C_SWITCH_X_MACHINE): Set this to
Jim Blandy <jimb@redhat.com>
parents: 3571
diff changeset
96 Using the MIT X11 distribution instead of the one provided by Dec will
20abae0de304 * m/pmax.h (C_SWITCH_X_MACHINE): Set this to
Jim Blandy <jimb@redhat.com>
parents: 3571
diff changeset
97 also solve the problem, but I doubt you can convince everyone to do this. */
6889
8b9decfed36f (C_SWITCH_X_MACHINE): add -DNeedVarargsProrotypes=0.
Karl Heuer <kwzh@gnu.org>
parents: 5256
diff changeset
98 /* Addendum: the MIT X11 distribution neglects to define certain symbols
8b9decfed36f (C_SWITCH_X_MACHINE): add -DNeedVarargsProrotypes=0.
Karl Heuer <kwzh@gnu.org>
parents: 5256
diff changeset
99 when NeedFunctionPrototypes is 0, but still tries to use them when
14036
621a575db6f7 Comment fixes.
Karl Heuer <kwzh@gnu.org>
parents: 13017
diff changeset
100 NeedVarargsPrototypes is 1 (which is its default value). So if we're
6889
8b9decfed36f (C_SWITCH_X_MACHINE): add -DNeedVarargsProrotypes=0.
Karl Heuer <kwzh@gnu.org>
parents: 5256
diff changeset
101 going to disable non-variadic prototypes, we also need to disable
8b9decfed36f (C_SWITCH_X_MACHINE): add -DNeedVarargsProrotypes=0.
Karl Heuer <kwzh@gnu.org>
parents: 5256
diff changeset
102 variadic prototypes. --kwzh@gnu.ai.mit.edu */
8b9decfed36f (C_SWITCH_X_MACHINE): add -DNeedVarargsProrotypes=0.
Karl Heuer <kwzh@gnu.org>
parents: 5256
diff changeset
103 #define C_SWITCH_X_MACHINE -DNeedFunctionPrototypes=0 -DNeedVarargsPrototypes=0
12419
818d7bcf63b0 [MACH]: Use built-in alloca, set START_FILES.
Richard M. Stallman <rms@gnu.org>
parents: 9095
diff changeset
104 #endif
5256
cd8db400928f (SET_CHILD_PTY_PGRP): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4001
diff changeset
105
cd8db400928f (SET_CHILD_PTY_PGRP): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4001
diff changeset
106 /* Enable a fix in process.c. */
cd8db400928f (SET_CHILD_PTY_PGRP): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4001
diff changeset
107 #define SET_CHILD_PTY_PGRP