diff options
| author | Miles Bader | 2004-07-23 04:30:44 +0000 |
|---|---|---|
| committer | Miles Bader | 2004-07-23 04:30:44 +0000 |
| commit | 6bb4a8bf9aaa63141ad7c12ab6b6ba9939050178 (patch) | |
| tree | ffe1b6fc55a6ef858938f3e80a9fd79ae096ad10 /src | |
| parent | cd9fc52e16bd2c780919c927bbf734039dd9a7dc (diff) | |
| parent | 9586e1d3a4255c58bf827400ab7c038a3ee988a3 (diff) | |
| download | emacs-6bb4a8bf9aaa63141ad7c12ab6b6ba9939050178.tar.gz emacs-6bb4a8bf9aaa63141ad7c12ab6b6ba9939050178.zip | |
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-25
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-459
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-463
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-464
Update from CVS: lisp/progmodes/make-mode.el: Fix comments.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-465
Update from CVS
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 95 | ||||
| -rw-r--r-- | src/atimer.c | 6 | ||||
| -rw-r--r-- | src/buffer.c | 5 | ||||
| -rw-r--r-- | src/dispnew.c | 10 | ||||
| -rw-r--r-- | src/eval.c | 3 | ||||
| -rw-r--r-- | src/frame.c | 30 | ||||
| -rw-r--r-- | src/keyboard.c | 27 | ||||
| -rw-r--r-- | src/mac.c | 145 | ||||
| -rw-r--r-- | src/macterm.c | 4 | ||||
| -rw-r--r-- | src/print.c | 10 | ||||
| -rw-r--r-- | src/process.c | 7 | ||||
| -rw-r--r-- | src/s/gnu-linux.h | 2 | ||||
| -rw-r--r-- | src/sysdep.c | 4 | ||||
| -rw-r--r-- | src/w32fns.c | 4 | ||||
| -rw-r--r-- | src/widget.c | 1 | ||||
| -rw-r--r-- | src/window.c | 70 | ||||
| -rw-r--r-- | src/window.h | 5 | ||||
| -rw-r--r-- | src/xdisp.c | 32 |
18 files changed, 335 insertions, 125 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 1dfaa3f9ce4..e51cdf554ce 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,98 @@ | |||
| 1 | 2004-07-22 Barry Fishman <barry_fishman@att.net> (tiny change) | ||
| 2 | |||
| 3 | * s/gnu-linux.h: Use GC_MARK_STACK if __amd64__ is defined. | ||
| 4 | |||
| 5 | 2004-07-21 Kim F. Storm <storm@cua.dk> | ||
| 6 | |||
| 7 | * window.h (struct glyph_matrix): New members nrows_scale_factor | ||
| 8 | and ncols_scale_factor. | ||
| 9 | |||
| 10 | * window.c (make_window): Initialize nrows_scale_factor and | ||
| 11 | ncols_scale_factor members. | ||
| 12 | |||
| 13 | * dispnew.c (margin_glyphs_to_reserve): Apply ncols_scale_factor. | ||
| 14 | (allocate_matrices_for_frame_redisplay): Fix left/right margin mix-up. | ||
| 15 | (required_matrix_height): Apply nrows_scale_factor. | ||
| 16 | (required_matrix_width): Apply ncols_scale_factor. | ||
| 17 | |||
| 18 | * xdisp.c (display_line): Increment nrows_scale_factor and set | ||
| 19 | fonts_changed_p if past last allocated row. | ||
| 20 | (append_glyph, append_composite_glyph, produce_image_glyph) | ||
| 21 | (append_stretch_glyph): Increment ncols_scale_factor and set | ||
| 22 | fonts_changed_p if current area is full. | ||
| 23 | |||
| 24 | 2004-07-21 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 25 | |||
| 26 | * widget.c (EmacsFrameDestroy): Don't abort if normal_gc is 0. | ||
| 27 | |||
| 28 | 2004-07-19 Luc Teirlinck <teirllm@auburn.edu> | ||
| 29 | |||
| 30 | * window.c (Fpos_visible_in_window_p, Fset_window_hscroll) | ||
| 31 | (Fwindow_inside_pixel_edges, Fwindow_end, Fset_window_point) | ||
| 32 | (Fset_window_start, Fscroll_up, Fscroll_down) | ||
| 33 | (Fother_window_for_scrolling, Fscroll_other_window) | ||
| 34 | (Fsave_window_excursion, Fset_window_vscroll) | ||
| 35 | (syms_of_window) <window-size-fixed>: Doc fixes. | ||
| 36 | |||
| 37 | 2004-07-19 KOBAYASHI Yasuhiro <kobayays@otsukakj.co.jp> (tiny change) | ||
| 38 | |||
| 39 | * w32fns.c (Fx_file_dialog): Use ENCODE_FILE instead of | ||
| 40 | ENCODE_SYSTEM for filenames. | ||
| 41 | |||
| 42 | 2004-07-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 43 | |||
| 44 | * mac.c (sys_select): Block input around call to | ||
| 45 | ReceiveNextEvent to prevent breakage. Correctly handle | ||
| 46 | blocking on event queue only by calling ReceiveNextEvent | ||
| 47 | instead of select (since GUI events aren't on an fd). | ||
| 48 | (sys_read): Remove function | ||
| 49 | * sysdep.c: Remove redefine of read to sys_read if HAVE_CARBON | ||
| 50 | |||
| 51 | 2004-07-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 52 | |||
| 53 | * mac.c (sys_select): Redo sys_select to use alarm-based | ||
| 54 | polling instead of 1 sec timeouts (like solaris). | ||
| 55 | |||
| 56 | * macterm.c (x_make_frame_visible): Comment in polling on | ||
| 57 | frame creation. | ||
| 58 | |||
| 59 | * keyboard.c: Undef SIGIO on Carbon | ||
| 60 | |||
| 61 | * atimer.c (alarm_signal_handler): Call alarm handlers after | ||
| 62 | scheduling. | ||
| 63 | |||
| 64 | * eval.c (Feval): Remove quit_char test | ||
| 65 | |||
| 66 | * process.c (wait_reading_process_input): Remove clearing | ||
| 67 | stdin for select call on process input. | ||
| 68 | |||
| 69 | 2004-07-18 Luc Teirlinck <teirllm@auburn.edu> | ||
| 70 | |||
| 71 | * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Correct | ||
| 72 | capitalization error in docstring. | ||
| 73 | |||
| 74 | 2004-07-17 Juanma Barranquero <lektu@terra.es> | ||
| 75 | |||
| 76 | * keyboard.c (not_single_kboard_state): Do nothing unless | ||
| 77 | MULTI_KBOARD is defined. | ||
| 78 | |||
| 79 | 2004-07-17 Richard M. Stallman <rms@gnu.org> | ||
| 80 | |||
| 81 | * window.c (coordinates_in_window): Inside the window but outside | ||
| 82 | its box to the L or R, return ON_VERTICAL_BORDER. | ||
| 83 | (window_list_1): Rotate the list to start with WINDOW. | ||
| 84 | |||
| 85 | * print.c (print_preprocess): Test for print_depth at limit | ||
| 86 | before entering in being_printed. | ||
| 87 | |||
| 88 | * keyboard.c (not_single_kboard_state): New function. | ||
| 89 | (stuff_buffered_input): Now no-op only if no SIGTSTP. | ||
| 90 | |||
| 91 | * frame.c (Fdelete_frame): If we're in single_bboard_state on | ||
| 92 | this kboard, and we delete its last frame, go to any_kboard_state. | ||
| 93 | |||
| 94 | * buffer.c (syms_of_buffer) <transient-mark-mode>: Doc fix. | ||
| 95 | |||
| 1 | 2004-07-15 KOBAYASHI Yasuhiro <kobayays@otsukakj.co.jp> (tiny change) | 96 | 2004-07-15 KOBAYASHI Yasuhiro <kobayays@otsukakj.co.jp> (tiny change) |
| 2 | 97 | ||
| 3 | * w32fns.c (Fx_file_dialog): Encode strings in system coding | 98 | * w32fns.c (Fx_file_dialog): Encode strings in system coding |
diff --git a/src/atimer.c b/src/atimer.c index 7e78bdad9c0..9ec0238ff28 100644 --- a/src/atimer.c +++ b/src/atimer.c | |||
| @@ -375,7 +375,9 @@ alarm_signal_handler (signo) | |||
| 375 | 375 | ||
| 376 | t = atimers; | 376 | t = atimers; |
| 377 | atimers = atimers->next; | 377 | atimers = atimers->next; |
| 378 | #ifndef MAC_OSX | ||
| 378 | t->fn (t); | 379 | t->fn (t); |
| 380 | #endif | ||
| 379 | 381 | ||
| 380 | if (t->type == ATIMER_CONTINUOUS) | 382 | if (t->type == ATIMER_CONTINUOUS) |
| 381 | { | 383 | { |
| @@ -387,6 +389,10 @@ alarm_signal_handler (signo) | |||
| 387 | t->next = free_atimers; | 389 | t->next = free_atimers; |
| 388 | free_atimers = t; | 390 | free_atimers = t; |
| 389 | } | 391 | } |
| 392 | #ifdef MAC_OSX | ||
| 393 | /* Fix for Ctrl-G. Perhaps this should apply to all platforms. */ | ||
| 394 | t->fn (t); | ||
| 395 | #endif | ||
| 390 | 396 | ||
| 391 | EMACS_GET_TIME (now); | 397 | EMACS_GET_TIME (now); |
| 392 | } | 398 | } |
diff --git a/src/buffer.c b/src/buffer.c index 8bc20776957..fb8fa9bc332 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -5877,7 +5877,10 @@ all windows or just the selected window. | |||
| 5877 | 5877 | ||
| 5878 | If the value is `lambda', that enables Transient Mark mode temporarily | 5878 | If the value is `lambda', that enables Transient Mark mode temporarily |
| 5879 | until the next buffer modification. If a command sets the value to `only', | 5879 | until the next buffer modification. If a command sets the value to `only', |
| 5880 | that enables Transient Mark mode for the following command only. */); | 5880 | that enables Transient Mark mode for the following command only. |
| 5881 | During that following command, the value of `transient-mark-mode' | ||
| 5882 | is `identity'. If it is still `identity' at the end of that command, | ||
| 5883 | it changes to nil. */); | ||
| 5881 | Vtransient_mark_mode = Qnil; | 5884 | Vtransient_mark_mode = Qnil; |
| 5882 | 5885 | ||
| 5883 | DEFVAR_LISP ("inhibit-read-only", &Vinhibit_read_only, | 5886 | DEFVAR_LISP ("inhibit-read-only", &Vinhibit_read_only, |
diff --git a/src/dispnew.c b/src/dispnew.c index 8edc8993a05..90ef0f64dbd 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -579,7 +579,7 @@ margin_glyphs_to_reserve (w, total_glyphs, margin) | |||
| 579 | int width = XFASTINT (w->total_cols); | 579 | int width = XFASTINT (w->total_cols); |
| 580 | double d = max (0, XFLOATINT (margin)); | 580 | double d = max (0, XFLOATINT (margin)); |
| 581 | d = min (width / 2 - 1, d); | 581 | d = min (width / 2 - 1, d); |
| 582 | n = (int) ((double) total_glyphs / width * d); | 582 | n = (int) ((double) total_glyphs / width * d) * w->ncols_scale_factor; |
| 583 | } | 583 | } |
| 584 | else | 584 | else |
| 585 | n = 0; | 585 | n = 0; |
| @@ -1911,10 +1911,10 @@ allocate_matrices_for_frame_redisplay (window, x, y, dim_only_p, | |||
| 1911 | || dim.width != w->desired_matrix->matrix_w | 1911 | || dim.width != w->desired_matrix->matrix_w |
| 1912 | || dim.height != w->desired_matrix->matrix_h | 1912 | || dim.height != w->desired_matrix->matrix_h |
| 1913 | || (margin_glyphs_to_reserve (w, dim.width, | 1913 | || (margin_glyphs_to_reserve (w, dim.width, |
| 1914 | w->right_margin_cols) | 1914 | w->left_margin_cols) |
| 1915 | != w->desired_matrix->left_margin_glyphs) | 1915 | != w->desired_matrix->left_margin_glyphs) |
| 1916 | || (margin_glyphs_to_reserve (w, dim.width, | 1916 | || (margin_glyphs_to_reserve (w, dim.width, |
| 1917 | w->left_margin_cols) | 1917 | w->right_margin_cols) |
| 1918 | != w->desired_matrix->right_margin_glyphs)) | 1918 | != w->desired_matrix->right_margin_glyphs)) |
| 1919 | *window_change_flags |= CHANGED_LEAF_MATRIX; | 1919 | *window_change_flags |= CHANGED_LEAF_MATRIX; |
| 1920 | 1920 | ||
| @@ -1982,7 +1982,7 @@ required_matrix_height (w) | |||
| 1982 | int ch_height = FRAME_SMALLEST_FONT_HEIGHT (f); | 1982 | int ch_height = FRAME_SMALLEST_FONT_HEIGHT (f); |
| 1983 | int window_pixel_height = window_box_height (w) + abs (w->vscroll); | 1983 | int window_pixel_height = window_box_height (w) + abs (w->vscroll); |
| 1984 | return (((window_pixel_height + ch_height - 1) | 1984 | return (((window_pixel_height + ch_height - 1) |
| 1985 | / ch_height) | 1985 | / ch_height) * w->nrows_scale_factor |
| 1986 | /* One partially visible line at the top and | 1986 | /* One partially visible line at the top and |
| 1987 | bottom of the window. */ | 1987 | bottom of the window. */ |
| 1988 | + 2 | 1988 | + 2 |
| @@ -2010,7 +2010,7 @@ required_matrix_width (w) | |||
| 2010 | 2010 | ||
| 2011 | /* Compute number of glyphs needed in a glyph row. */ | 2011 | /* Compute number of glyphs needed in a glyph row. */ |
| 2012 | return (((window_pixel_width + ch_width - 1) | 2012 | return (((window_pixel_width + ch_width - 1) |
| 2013 | / ch_width) | 2013 | / ch_width) * w->ncols_scale_factor |
| 2014 | /* 2 partially visible columns in the text area. */ | 2014 | /* 2 partially visible columns in the text area. */ |
| 2015 | + 2 | 2015 | + 2 |
| 2016 | /* One partially visible column at the right | 2016 | /* One partially visible column at the right |
diff --git a/src/eval.c b/src/eval.c index d7cfe959158..f28105ac987 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -2145,9 +2145,6 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0, | |||
| 2145 | val = call_debugger (Fcons (Qexit, Fcons (val, Qnil))); | 2145 | val = call_debugger (Fcons (Qexit, Fcons (val, Qnil))); |
| 2146 | backtrace_list = backtrace.next; | 2146 | backtrace_list = backtrace.next; |
| 2147 | 2147 | ||
| 2148 | #ifdef HAVE_CARBON | ||
| 2149 | mac_check_for_quit_char(); | ||
| 2150 | #endif | ||
| 2151 | return val; | 2148 | return val; |
| 2152 | } | 2149 | } |
| 2153 | 2150 | ||
diff --git a/src/frame.c b/src/frame.c index c515b565670..41b92e75dbb 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -1327,6 +1327,36 @@ The functions are run with one arg, the frame to be deleted. */) | |||
| 1327 | } | 1327 | } |
| 1328 | } | 1328 | } |
| 1329 | 1329 | ||
| 1330 | /* If there's no other frame on the same kboard, get out of | ||
| 1331 | single-kboard state if we're in it for this kboard. */ | ||
| 1332 | { | ||
| 1333 | Lisp_Object frames; | ||
| 1334 | /* Some frame we found on the same kboard, or nil if there are none. */ | ||
| 1335 | Lisp_Object frame_on_same_kboard; | ||
| 1336 | |||
| 1337 | frame_on_same_kboard = Qnil; | ||
| 1338 | |||
| 1339 | for (frames = Vframe_list; | ||
| 1340 | CONSP (frames); | ||
| 1341 | frames = XCDR (frames)) | ||
| 1342 | { | ||
| 1343 | Lisp_Object this; | ||
| 1344 | struct frame *f1; | ||
| 1345 | |||
| 1346 | this = XCAR (frames); | ||
| 1347 | if (!FRAMEP (this)) | ||
| 1348 | abort (); | ||
| 1349 | f1 = XFRAME (this); | ||
| 1350 | |||
| 1351 | if (FRAME_KBOARD (f) == FRAME_KBOARD (f1)) | ||
| 1352 | frame_on_same_kboard = this; | ||
| 1353 | } | ||
| 1354 | |||
| 1355 | if (NILP (frame_on_same_kboard)) | ||
| 1356 | not_single_kboard_state (FRAME_KBOARD (f)); | ||
| 1357 | } | ||
| 1358 | |||
| 1359 | |||
| 1330 | /* If we've deleted this keyboard's default_minibuffer_frame, try to | 1360 | /* If we've deleted this keyboard's default_minibuffer_frame, try to |
| 1331 | find another one. Prefer minibuffer-only frames, but also notice | 1361 | find another one. Prefer minibuffer-only frames, but also notice |
| 1332 | frames with other windows. */ | 1362 | frames with other windows. */ |
diff --git a/src/keyboard.c b/src/keyboard.c index eb8c0c43fe6..a6cc2836315 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -607,7 +607,7 @@ int flow_control; | |||
| 607 | 607 | ||
| 608 | /* We are unable to use interrupts if FIONREAD is not available, | 608 | /* We are unable to use interrupts if FIONREAD is not available, |
| 609 | so flush SIGIO so we won't try. */ | 609 | so flush SIGIO so we won't try. */ |
| 610 | #ifndef FIONREAD | 610 | #if !defined (FIONREAD) || defined(HAVE_CARBON) |
| 611 | #ifdef SIGIO | 611 | #ifdef SIGIO |
| 612 | #undef SIGIO | 612 | #undef SIGIO |
| 613 | #endif | 613 | #endif |
| @@ -1089,6 +1089,19 @@ single_kboard_state () | |||
| 1089 | #endif | 1089 | #endif |
| 1090 | } | 1090 | } |
| 1091 | 1091 | ||
| 1092 | /* If we're in single_kboard state for kboard KBOARD, | ||
| 1093 | get out of it. */ | ||
| 1094 | |||
| 1095 | void | ||
| 1096 | not_single_kboard_state (kboard) | ||
| 1097 | KBOARD *kboard; | ||
| 1098 | { | ||
| 1099 | #ifdef MULTI_KBOARD | ||
| 1100 | if (kboard == current_kboard) | ||
| 1101 | single_kboard = 0; | ||
| 1102 | #endif | ||
| 1103 | } | ||
| 1104 | |||
| 1092 | /* Maintain a stack of kboards, so other parts of Emacs | 1105 | /* Maintain a stack of kboards, so other parts of Emacs |
| 1093 | can switch temporarily to the kboard of a given frame | 1106 | can switch temporarily to the kboard of a given frame |
| 1094 | and then revert to the previous status. */ | 1107 | and then revert to the previous status. */ |
| @@ -10173,9 +10186,7 @@ void | |||
| 10173 | stuff_buffered_input (stuffstring) | 10186 | stuff_buffered_input (stuffstring) |
| 10174 | Lisp_Object stuffstring; | 10187 | Lisp_Object stuffstring; |
| 10175 | { | 10188 | { |
| 10176 | /* stuff_char works only in BSD, versions 4.2 and up. */ | 10189 | #ifdef SIGTSTP /* stuff_char is defined if SIGTSTP. */ |
| 10177 | #ifdef BSD_SYSTEM | ||
| 10178 | #ifndef BSD4_1 | ||
| 10179 | register unsigned char *p; | 10190 | register unsigned char *p; |
| 10180 | 10191 | ||
| 10181 | if (STRINGP (stuffstring)) | 10192 | if (STRINGP (stuffstring)) |
| @@ -10191,7 +10202,10 @@ stuff_buffered_input (stuffstring) | |||
| 10191 | 10202 | ||
| 10192 | /* Anything we have read ahead, put back for the shell to read. */ | 10203 | /* Anything we have read ahead, put back for the shell to read. */ |
| 10193 | /* ?? What should this do when we have multiple keyboards?? | 10204 | /* ?? What should this do when we have multiple keyboards?? |
| 10194 | Should we ignore anything that was typed in at the "wrong" kboard? */ | 10205 | Should we ignore anything that was typed in at the "wrong" kboard? |
| 10206 | |||
| 10207 | rms: we should stuff everything back into the kboard | ||
| 10208 | it came from. */ | ||
| 10195 | for (; kbd_fetch_ptr != kbd_store_ptr; kbd_fetch_ptr++) | 10209 | for (; kbd_fetch_ptr != kbd_store_ptr; kbd_fetch_ptr++) |
| 10196 | { | 10210 | { |
| 10197 | 10211 | ||
| @@ -10204,8 +10218,7 @@ stuff_buffered_input (stuffstring) | |||
| 10204 | } | 10218 | } |
| 10205 | 10219 | ||
| 10206 | input_pending = 0; | 10220 | input_pending = 0; |
| 10207 | #endif | 10221 | #endif /* SIGTSTP */ |
| 10208 | #endif /* BSD_SYSTEM and not BSD4_1 */ | ||
| 10209 | } | 10222 | } |
| 10210 | 10223 | ||
| 10211 | void | 10224 | void |
| @@ -2769,6 +2769,8 @@ and t is the same as `SECONDARY'. */) | |||
| 2769 | extern int inhibit_window_system; | 2769 | extern int inhibit_window_system; |
| 2770 | extern int noninteractive; | 2770 | extern int noninteractive; |
| 2771 | 2771 | ||
| 2772 | #include "blockinput.h" | ||
| 2773 | |||
| 2772 | /* When Emacs is started from the Finder, SELECT always immediately | 2774 | /* When Emacs is started from the Finder, SELECT always immediately |
| 2773 | returns as if input is present when file descriptor 0 is polled for | 2775 | returns as if input is present when file descriptor 0 is polled for |
| 2774 | input. Strangely, when Emacs is run as a GUI application from the | 2776 | input. Strangely, when Emacs is run as a GUI application from the |
| @@ -2776,85 +2778,100 @@ extern int noninteractive; | |||
| 2776 | the system call SELECT corrects this discrepancy. */ | 2778 | the system call SELECT corrects this discrepancy. */ |
| 2777 | int | 2779 | int |
| 2778 | sys_select (n, rfds, wfds, efds, timeout) | 2780 | sys_select (n, rfds, wfds, efds, timeout) |
| 2779 | int n; | 2781 | int n; |
| 2780 | SELECT_TYPE *rfds; | 2782 | SELECT_TYPE *rfds; |
| 2781 | SELECT_TYPE *wfds; | 2783 | SELECT_TYPE *wfds; |
| 2782 | SELECT_TYPE *efds; | 2784 | SELECT_TYPE *efds; |
| 2783 | struct timeval *timeout; | 2785 | struct timeval *timeout; |
| 2784 | { | 2786 | { |
| 2785 | if (!inhibit_window_system && rfds && FD_ISSET (0, rfds)) | 2787 | OSErr err; |
| 2786 | return 1; | 2788 | EMACS_TIME end_time, now, remaining_time; |
| 2787 | else if (inhibit_window_system || noninteractive || | 2789 | |
| 2788 | (timeout && (EMACS_SECS(*timeout)==0) && | 2790 | if (inhibit_window_system || noninteractive |
| 2789 | (EMACS_USECS(*timeout)==0))) | 2791 | || rfds == NULL || !FD_ISSET (0, rfds)) |
| 2790 | return select(n, rfds, wfds, efds, timeout); | 2792 | return select (n, rfds, wfds, efds, timeout); |
| 2791 | else | 2793 | |
| 2792 | { | 2794 | if (wfds == NULL && efds == NULL) |
| 2793 | EMACS_TIME end_time, now; | 2795 | { |
| 2794 | 2796 | int i; | |
| 2795 | EMACS_GET_TIME (end_time); | 2797 | |
| 2796 | if (timeout) | 2798 | for (i = 1; i < n; i++) |
| 2797 | EMACS_ADD_TIME (end_time, end_time, *timeout); | 2799 | if (FD_ISSET (i, rfds)) |
| 2798 | 2800 | break; | |
| 2799 | do | 2801 | if (i == n) |
| 2800 | { | 2802 | { |
| 2801 | int r; | 2803 | EventTimeout timeout_sec = |
| 2802 | EMACS_TIME one_second; | 2804 | (timeout |
| 2803 | SELECT_TYPE orfds; | 2805 | ? (EMACS_SECS (*timeout) * kEventDurationSecond |
| 2804 | 2806 | + EMACS_USECS (*timeout) * kEventDurationMicrosecond) | |
| 2805 | FD_ZERO (&orfds); | 2807 | : kEventDurationForever); |
| 2806 | if (rfds) | 2808 | |
| 2809 | BLOCK_INPUT; | ||
| 2810 | err = ReceiveNextEvent (0, NULL, timeout_sec, | ||
| 2811 | kEventLeaveInQueue, NULL); | ||
| 2812 | UNBLOCK_INPUT; | ||
| 2813 | if (err == noErr) | ||
| 2807 | { | 2814 | { |
| 2808 | orfds = *rfds; | 2815 | FD_ZERO (rfds); |
| 2816 | FD_SET (0, rfds); | ||
| 2817 | return 1; | ||
| 2809 | } | 2818 | } |
| 2819 | else | ||
| 2820 | return 0; | ||
| 2821 | } | ||
| 2822 | } | ||
| 2810 | 2823 | ||
| 2811 | EMACS_SET_SECS (one_second, 1); | 2824 | if (timeout) |
| 2812 | EMACS_SET_USECS (one_second, 0); | 2825 | { |
| 2826 | remaining_time = *timeout; | ||
| 2827 | EMACS_GET_TIME (now); | ||
| 2828 | EMACS_ADD_TIME (end_time, now, remaining_time); | ||
| 2829 | } | ||
| 2830 | FD_CLR (0, rfds); | ||
| 2831 | do | ||
| 2832 | { | ||
| 2833 | EMACS_TIME select_timeout; | ||
| 2834 | SELECT_TYPE orfds = *rfds; | ||
| 2835 | int r; | ||
| 2813 | 2836 | ||
| 2814 | if (timeout && EMACS_TIME_LT(*timeout, one_second)) | 2837 | EMACS_SET_SECS_USECS (select_timeout, 0, 20000); |
| 2815 | one_second = *timeout; | ||
| 2816 | 2838 | ||
| 2817 | if ((r = select (n, &orfds, wfds, efds, &one_second)) > 0) | 2839 | if (timeout && EMACS_TIME_LT (remaining_time, select_timeout)) |
| 2840 | select_timeout = remaining_time; | ||
| 2841 | |||
| 2842 | r = select (n, &orfds, wfds, efds, &select_timeout); | ||
| 2843 | BLOCK_INPUT; | ||
| 2844 | err = ReceiveNextEvent (0, NULL, kEventDurationNoWait, | ||
| 2845 | kEventLeaveInQueue, NULL); | ||
| 2846 | UNBLOCK_INPUT; | ||
| 2847 | if (r > 0) | ||
| 2848 | { | ||
| 2849 | *rfds = orfds; | ||
| 2850 | if (err == noErr) | ||
| 2818 | { | 2851 | { |
| 2819 | *rfds = orfds; | 2852 | FD_SET (0, rfds); |
| 2820 | return r; | 2853 | r++; |
| 2821 | } | 2854 | } |
| 2855 | return r; | ||
| 2856 | } | ||
| 2857 | else if (err == noErr) | ||
| 2858 | { | ||
| 2859 | FD_ZERO (rfds); | ||
| 2860 | FD_SET (0, rfds); | ||
| 2861 | return 1; | ||
| 2862 | } | ||
| 2822 | 2863 | ||
| 2823 | mac_check_for_quit_char(); | 2864 | if (timeout) |
| 2824 | 2865 | { | |
| 2825 | EMACS_GET_TIME (now); | 2866 | EMACS_GET_TIME (now); |
| 2826 | EMACS_SUB_TIME (now, end_time, now); | 2867 | EMACS_SUB_TIME (remaining_time, end_time, now); |
| 2827 | } | 2868 | } |
| 2828 | while (!timeout || !EMACS_TIME_NEG_P (now)); | ||
| 2829 | |||
| 2830 | return 0; | ||
| 2831 | } | ||
| 2832 | } | ||
| 2833 | |||
| 2834 | #undef read | ||
| 2835 | int sys_read (fds, buf, nbyte) | ||
| 2836 | int fds; | ||
| 2837 | char *buf; | ||
| 2838 | unsigned int nbyte; | ||
| 2839 | { | ||
| 2840 | SELECT_TYPE rfds; | ||
| 2841 | EMACS_TIME one_second; | ||
| 2842 | int r; | ||
| 2843 | |||
| 2844 | /* Use select to block on IO while still checking for quit_char */ | ||
| 2845 | if (!inhibit_window_system && !noninteractive && | ||
| 2846 | ! (fcntl(fds, F_GETFL, 0) & O_NONBLOCK)) | ||
| 2847 | { | ||
| 2848 | FD_ZERO (&rfds); | ||
| 2849 | FD_SET (fds, &rfds); | ||
| 2850 | if (sys_select (fds+1, &rfds, 0, 0, NULL) < 0) | ||
| 2851 | return -1; | ||
| 2852 | } | 2869 | } |
| 2870 | while (!timeout || EMACS_TIME_LT (now, end_time)); | ||
| 2853 | 2871 | ||
| 2854 | return read (fds, buf, nbyte); | 2872 | return 0; |
| 2855 | } | 2873 | } |
| 2856 | 2874 | ||
| 2857 | |||
| 2858 | /* Set up environment variables so that Emacs can correctly find its | 2875 | /* Set up environment variables so that Emacs can correctly find its |
| 2859 | support files when packaged as an application bundle. Directories | 2876 | support files when packaged as an application bundle. Directories |
| 2860 | placed in /usr/local/share/emacs/<emacs-version>/, /usr/local/bin, | 2877 | placed in /usr/local/share/emacs/<emacs-version>/, /usr/local/bin, |
diff --git a/src/macterm.c b/src/macterm.c index 149e37741bc..d9655dab3c3 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -5321,7 +5321,6 @@ x_make_frame_visible (f) | |||
| 5321 | 5321 | ||
| 5322 | XFlush (FRAME_MAC_DISPLAY (f)); | 5322 | XFlush (FRAME_MAC_DISPLAY (f)); |
| 5323 | 5323 | ||
| 5324 | #if 0 /* MAC_TODO */ | ||
| 5325 | /* Synchronize to ensure Emacs knows the frame is visible | 5324 | /* Synchronize to ensure Emacs knows the frame is visible |
| 5326 | before we do anything else. We do this loop with input not blocked | 5325 | before we do anything else. We do this loop with input not blocked |
| 5327 | so that incoming events are handled. */ | 5326 | so that incoming events are handled. */ |
| @@ -5365,9 +5364,6 @@ x_make_frame_visible (f) | |||
| 5365 | FRAME_SAMPLE_VISIBILITY (f); | 5364 | FRAME_SAMPLE_VISIBILITY (f); |
| 5366 | } | 5365 | } |
| 5367 | } | 5366 | } |
| 5368 | #else | ||
| 5369 | UNBLOCK_INPUT; | ||
| 5370 | #endif /* MAC_TODO */ | ||
| 5371 | } | 5367 | } |
| 5372 | 5368 | ||
| 5373 | /* Change from mapped state to withdrawn state. */ | 5369 | /* Change from mapped state to withdrawn state. */ |
diff --git a/src/print.c b/src/print.c index 287e77edad1..6576b387005 100644 --- a/src/print.c +++ b/src/print.c | |||
| @@ -1284,6 +1284,11 @@ print_preprocess (obj) | |||
| 1284 | int loop_count = 0; | 1284 | int loop_count = 0; |
| 1285 | Lisp_Object halftail; | 1285 | Lisp_Object halftail; |
| 1286 | 1286 | ||
| 1287 | /* Give up if we go so deep that print_object will get an error. */ | ||
| 1288 | /* See similar code in print_object. */ | ||
| 1289 | if (print_depth >= PRINT_CIRCLE) | ||
| 1290 | return; | ||
| 1291 | |||
| 1287 | /* Avoid infinite recursion for circular nested structure | 1292 | /* Avoid infinite recursion for circular nested structure |
| 1288 | in the case where Vprint_circle is nil. */ | 1293 | in the case where Vprint_circle is nil. */ |
| 1289 | if (NILP (Vprint_circle)) | 1294 | if (NILP (Vprint_circle)) |
| @@ -1294,11 +1299,6 @@ print_preprocess (obj) | |||
| 1294 | being_printed[print_depth] = obj; | 1299 | being_printed[print_depth] = obj; |
| 1295 | } | 1300 | } |
| 1296 | 1301 | ||
| 1297 | /* Give up if we go so deep that print_object will get an error. */ | ||
| 1298 | /* See similar code in print_object. */ | ||
| 1299 | if (print_depth >= PRINT_CIRCLE) | ||
| 1300 | return; | ||
| 1301 | |||
| 1302 | print_depth++; | 1302 | print_depth++; |
| 1303 | halftail = obj; | 1303 | halftail = obj; |
| 1304 | 1304 | ||
diff --git a/src/process.c b/src/process.c index b810b027737..0b3f6bfbbd2 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -4191,12 +4191,13 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 4191 | SELECT_TYPE Atemp, Ctemp; | 4191 | SELECT_TYPE Atemp, Ctemp; |
| 4192 | 4192 | ||
| 4193 | Atemp = input_wait_mask; | 4193 | Atemp = input_wait_mask; |
| 4194 | #ifdef MAC_OSX | 4194 | #if 0 |
| 4195 | /* On Mac OS X, the SELECT system call always says input is | 4195 | /* On Mac OS X 10.0, the SELECT system call always says input is |
| 4196 | present (for reading) at stdin, even when none is. This | 4196 | present (for reading) at stdin, even when none is. This |
| 4197 | causes the call to SELECT below to return 1 and | 4197 | causes the call to SELECT below to return 1 and |
| 4198 | status_notify not to be called. As a result output of | 4198 | status_notify not to be called. As a result output of |
| 4199 | subprocesses are incorrectly discarded. */ | 4199 | subprocesses are incorrectly discarded. |
| 4200 | */ | ||
| 4200 | FD_CLR (0, &Atemp); | 4201 | FD_CLR (0, &Atemp); |
| 4201 | #endif | 4202 | #endif |
| 4202 | Ctemp = connect_wait_mask; | 4203 | Ctemp = connect_wait_mask; |
diff --git a/src/s/gnu-linux.h b/src/s/gnu-linux.h index efdc2bc00ef..033ce49293a 100644 --- a/src/s/gnu-linux.h +++ b/src/s/gnu-linux.h | |||
| @@ -355,7 +355,7 @@ Boston, MA 02111-1307, USA. */ | |||
| 355 | 355 | ||
| 356 | #if defined __i386__ || defined __sparc__ || defined __mc68000__ \ | 356 | #if defined __i386__ || defined __sparc__ || defined __mc68000__ \ |
| 357 | || defined __alpha__ || defined __mips__ || defined __s390__ \ | 357 | || defined __alpha__ || defined __mips__ || defined __s390__ \ |
| 358 | || defined __arm__ || defined __powerpc__ | 358 | || defined __arm__ || defined __powerpc__ || defined __amd64__ |
| 359 | #define GC_SETJMP_WORKS 1 | 359 | #define GC_SETJMP_WORKS 1 |
| 360 | #define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS | 360 | #define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS |
| 361 | #ifdef __mc68000__ | 361 | #ifdef __mc68000__ |
diff --git a/src/sysdep.c b/src/sysdep.c index 5ede3d27208..d5236a3f88a 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -70,10 +70,6 @@ static int delete_exited_processes; | |||
| 70 | #endif | 70 | #endif |
| 71 | #endif /* not WINDOWSNT */ | 71 | #endif /* not WINDOWSNT */ |
| 72 | 72 | ||
| 73 | #ifdef HAVE_CARBON | ||
| 74 | #define read sys_read | ||
| 75 | #endif | ||
| 76 | |||
| 77 | /* Does anyone other than VMS need this? */ | 73 | /* Does anyone other than VMS need this? */ |
| 78 | #ifndef fwrite | 74 | #ifndef fwrite |
| 79 | #define sys_fwrite fwrite | 75 | #define sys_fwrite fwrite |
diff --git a/src/w32fns.c b/src/w32fns.c index 5dfdab1390c..ed0ab2e89f6 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -7798,14 +7798,14 @@ specified. Ensure that file exists if MUSTMATCH is non-nil. */) | |||
| 7798 | /* Create the dialog with PROMPT as title, using DIR as initial | 7798 | /* Create the dialog with PROMPT as title, using DIR as initial |
| 7799 | directory and using "*" as pattern. */ | 7799 | directory and using "*" as pattern. */ |
| 7800 | dir = Fexpand_file_name (dir, Qnil); | 7800 | dir = Fexpand_file_name (dir, Qnil); |
| 7801 | strncpy (init_dir, SDATA (ENCODE_SYSTEM (dir)), MAX_PATH); | 7801 | strncpy (init_dir, SDATA (ENCODE_FILE (dir)), MAX_PATH); |
| 7802 | init_dir[MAX_PATH] = '\0'; | 7802 | init_dir[MAX_PATH] = '\0'; |
| 7803 | unixtodos_filename (init_dir); | 7803 | unixtodos_filename (init_dir); |
| 7804 | 7804 | ||
| 7805 | if (STRINGP (default_filename)) | 7805 | if (STRINGP (default_filename)) |
| 7806 | { | 7806 | { |
| 7807 | char *file_name_only; | 7807 | char *file_name_only; |
| 7808 | char *full_path_name = SDATA (ENCODE_SYSTEM (default_filename)); | 7808 | char *full_path_name = SDATA (ENCODE_FILE (default_filename)); |
| 7809 | 7809 | ||
| 7810 | unixtodos_filename (full_path_name); | 7810 | unixtodos_filename (full_path_name); |
| 7811 | 7811 | ||
diff --git a/src/widget.c b/src/widget.c index dbf55a34d9c..57eef4059e6 100644 --- a/src/widget.c +++ b/src/widget.c | |||
| @@ -758,7 +758,6 @@ EmacsFrameDestroy (widget) | |||
| 758 | 758 | ||
| 759 | if (! s) abort (); | 759 | if (! s) abort (); |
| 760 | if (! s->output_data.x) abort (); | 760 | if (! s->output_data.x) abort (); |
| 761 | if (! s->output_data.x->normal_gc) abort (); | ||
| 762 | 761 | ||
| 763 | BLOCK_INPUT; | 762 | BLOCK_INPUT; |
| 764 | x_free_gcs (s); | 763 | x_free_gcs (s); |
diff --git a/src/window.c b/src/window.c index 62ce399e95c..1b1cab13e7a 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -260,6 +260,7 @@ make_window () | |||
| 260 | bzero (&p->last_cursor, sizeof (p->last_cursor)); | 260 | bzero (&p->last_cursor, sizeof (p->last_cursor)); |
| 261 | bzero (&p->phys_cursor, sizeof (p->phys_cursor)); | 261 | bzero (&p->phys_cursor, sizeof (p->phys_cursor)); |
| 262 | p->desired_matrix = p->current_matrix = 0; | 262 | p->desired_matrix = p->current_matrix = 0; |
| 263 | p->nrows_scale_factor = p->ncols_scale_factor = 1; | ||
| 263 | p->phys_cursor_type = -1; | 264 | p->phys_cursor_type = -1; |
| 264 | p->phys_cursor_width = -1; | 265 | p->phys_cursor_width = -1; |
| 265 | p->must_be_updated_p = 0; | 266 | p->must_be_updated_p = 0; |
| @@ -318,15 +319,17 @@ WINDOW defaults to the selected window. */) | |||
| 318 | 319 | ||
| 319 | DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p, | 320 | DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p, |
| 320 | Spos_visible_in_window_p, 0, 3, 0, | 321 | Spos_visible_in_window_p, 0, 3, 0, |
| 321 | doc: /* Return t if position POS is currently on the frame in WINDOW. | 322 | doc: /* Return non-nil if position POS is currently on the frame in WINDOW. |
| 322 | Return nil if that position is scrolled vertically out of view. | 323 | Return nil if that position is scrolled vertically out of view. |
| 323 | If a character is only partially visible, nil is returned, unless the | 324 | If a character is only partially visible, nil is returned, unless the |
| 324 | optional argument PARTIALLY is non-nil. | 325 | optional argument PARTIALLY is non-nil. |
| 326 | If POS is only out of view because of horizontal scrolling, return non-nil. | ||
| 325 | POS defaults to point in WINDOW; WINDOW defaults to the selected window. | 327 | POS defaults to point in WINDOW; WINDOW defaults to the selected window. |
| 326 | 328 | ||
| 327 | If POS is visible, return t if PARTIALLY is nil; if PARTIALLY is non-nil, | 329 | If POS is visible, return t if PARTIALLY is nil; if PARTIALLY is non-nil, |
| 328 | return value is a list (X Y PARTIAL) where X and Y are the pixel relative | 330 | return value is a list (X Y FULLY) where X and Y are the pixel coordinates |
| 329 | coordinate */) | 331 | relative to the top left corner of the window, and FULLY is t if the |
| 332 | character after POS is fully visible and nil otherwise. */) | ||
| 330 | (pos, window, partially) | 333 | (pos, window, partially) |
| 331 | Lisp_Object pos, window, partially; | 334 | Lisp_Object pos, window, partially; |
| 332 | { | 335 | { |
| @@ -430,7 +433,7 @@ DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0, | |||
| 430 | 433 | ||
| 431 | DEFUN ("set-window-hscroll", Fset_window_hscroll, Sset_window_hscroll, 2, 2, 0, | 434 | DEFUN ("set-window-hscroll", Fset_window_hscroll, Sset_window_hscroll, 2, 2, 0, |
| 432 | doc: /* Set number of columns WINDOW is scrolled from left margin to NCOL. | 435 | doc: /* Set number of columns WINDOW is scrolled from left margin to NCOL. |
| 433 | NCOL should be zero or positive. | 436 | Return NCOL. NCOL should be zero or positive. |
| 434 | 437 | ||
| 435 | Note that if `automatic-hscrolling' is non-nil, you cannot scroll the | 438 | Note that if `automatic-hscrolling' is non-nil, you cannot scroll the |
| 436 | window so that the location of point becomes invisible. */) | 439 | window so that the location of point becomes invisible. */) |
| @@ -544,7 +547,7 @@ display margins, fringes, header line, and/or mode line. */) | |||
| 544 | } | 547 | } |
| 545 | 548 | ||
| 546 | DEFUN ("window-inside-pixel-edges", Fwindow_inside_pixel_edges, Swindow_inside_pixel_edges, 0, 1, 0, | 549 | DEFUN ("window-inside-pixel-edges", Fwindow_inside_pixel_edges, Swindow_inside_pixel_edges, 0, 1, 0, |
| 547 | doc: /* Return a list of the edge coordinates of WINDOW. | 550 | doc: /* Return a list of the edge pixel coordinates of WINDOW. |
| 548 | \(LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at top left corner of frame. | 551 | \(LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at top left corner of frame. |
| 549 | RIGHT is one more than the rightmost x position used by text in WINDOW, | 552 | RIGHT is one more than the rightmost x position used by text in WINDOW, |
| 550 | and BOTTOM is one more than the bottommost y position used by text in WINDOW. | 553 | and BOTTOM is one more than the bottommost y position used by text in WINDOW. |
| @@ -670,7 +673,7 @@ coordinates_in_window (w, x, y) | |||
| 670 | 673 | ||
| 671 | /* Outside any interesting column? */ | 674 | /* Outside any interesting column? */ |
| 672 | if (*x < left_x || *x > right_x) | 675 | if (*x < left_x || *x > right_x) |
| 673 | return ON_NOTHING; | 676 | return ON_VERTICAL_BORDER; |
| 674 | 677 | ||
| 675 | lmargin_width = window_box_width (w, LEFT_MARGIN_AREA); | 678 | lmargin_width = window_box_width (w, LEFT_MARGIN_AREA); |
| 676 | rmargin_width = window_box_width (w, RIGHT_MARGIN_AREA); | 679 | rmargin_width = window_box_width (w, RIGHT_MARGIN_AREA); |
| @@ -986,6 +989,8 @@ DEFUN ("window-end", Fwindow_end, Swindow_end, 0, 2, 0, | |||
| 986 | This is updated by redisplay, when it runs to completion. | 989 | This is updated by redisplay, when it runs to completion. |
| 987 | Simply changing the buffer text or setting `window-start' | 990 | Simply changing the buffer text or setting `window-start' |
| 988 | does not update this value. | 991 | does not update this value. |
| 992 | Return nil if there is no recorded value. \(This can happen if the | ||
| 993 | last redisplay of WINDOW was preempted, and did not finish.) | ||
| 989 | If UPDATE is non-nil, compute the up-to-date position | 994 | If UPDATE is non-nil, compute the up-to-date position |
| 990 | if it isn't already recorded. */) | 995 | if it isn't already recorded. */) |
| 991 | (window, update) | 996 | (window, update) |
| @@ -1051,7 +1056,8 @@ if it isn't already recorded. */) | |||
| 1051 | } | 1056 | } |
| 1052 | 1057 | ||
| 1053 | DEFUN ("set-window-point", Fset_window_point, Sset_window_point, 2, 2, 0, | 1058 | DEFUN ("set-window-point", Fset_window_point, Sset_window_point, 2, 2, 0, |
| 1054 | doc: /* Make point value in WINDOW be at position POS in WINDOW's buffer. */) | 1059 | doc: /* Make point value in WINDOW be at position POS in WINDOW's buffer. |
| 1060 | Return POS. */) | ||
| 1055 | (window, pos) | 1061 | (window, pos) |
| 1056 | Lisp_Object window, pos; | 1062 | Lisp_Object window, pos; |
| 1057 | { | 1063 | { |
| @@ -1074,6 +1080,7 @@ DEFUN ("set-window-point", Fset_window_point, Sset_window_point, 2, 2, 0, | |||
| 1074 | 1080 | ||
| 1075 | DEFUN ("set-window-start", Fset_window_start, Sset_window_start, 2, 3, 0, | 1081 | DEFUN ("set-window-start", Fset_window_start, Sset_window_start, 2, 3, 0, |
| 1076 | doc: /* Make display in WINDOW start at position POS in WINDOW's buffer. | 1082 | doc: /* Make display in WINDOW start at position POS in WINDOW's buffer. |
| 1083 | Return POS. | ||
| 1077 | Optional third arg NOFORCE non-nil inhibits next redisplay | 1084 | Optional third arg NOFORCE non-nil inhibits next redisplay |
| 1078 | from overriding motion of point in order to display at this exact start. */) | 1085 | from overriding motion of point in order to display at this exact start. */) |
| 1079 | (window, pos, noforce) | 1086 | (window, pos, noforce) |
| @@ -1799,7 +1806,7 @@ static Lisp_Object | |||
| 1799 | window_list_1 (window, minibuf, all_frames) | 1806 | window_list_1 (window, minibuf, all_frames) |
| 1800 | Lisp_Object window, minibuf, all_frames; | 1807 | Lisp_Object window, minibuf, all_frames; |
| 1801 | { | 1808 | { |
| 1802 | Lisp_Object tail, list; | 1809 | Lisp_Object tail, list, rest; |
| 1803 | 1810 | ||
| 1804 | decode_next_window_args (&window, &minibuf, &all_frames); | 1811 | decode_next_window_args (&window, &minibuf, &all_frames); |
| 1805 | list = Qnil; | 1812 | list = Qnil; |
| @@ -1808,7 +1815,17 @@ window_list_1 (window, minibuf, all_frames) | |||
| 1808 | if (candidate_window_p (XCAR (tail), window, minibuf, all_frames)) | 1815 | if (candidate_window_p (XCAR (tail), window, minibuf, all_frames)) |
| 1809 | list = Fcons (XCAR (tail), list); | 1816 | list = Fcons (XCAR (tail), list); |
| 1810 | 1817 | ||
| 1811 | return Fnreverse (list); | 1818 | /* Rotate the list to start with WINDOW. */ |
| 1819 | list = Fnreverse (list); | ||
| 1820 | rest = Fmemq (window, list); | ||
| 1821 | if (!NILP (rest) && !EQ (rest, list)) | ||
| 1822 | { | ||
| 1823 | for (tail = list; XCDR (tail) != rest; tail = XCDR (tail)) | ||
| 1824 | ; | ||
| 1825 | XSETCDR (tail, Qnil); | ||
| 1826 | list = nconc2 (rest, list); | ||
| 1827 | } | ||
| 1828 | return list; | ||
| 1812 | } | 1829 | } |
| 1813 | 1830 | ||
| 1814 | 1831 | ||
| @@ -4838,7 +4855,8 @@ scroll_command (n, direction) | |||
| 4838 | } | 4855 | } |
| 4839 | 4856 | ||
| 4840 | DEFUN ("scroll-up", Fscroll_up, Sscroll_up, 0, 1, "P", | 4857 | DEFUN ("scroll-up", Fscroll_up, Sscroll_up, 0, 1, "P", |
| 4841 | doc: /* Scroll text of current window upward ARG lines; or near full screen if no ARG. | 4858 | doc: /* Scroll text of current window upward ARG lines. |
| 4859 | If ARG is omitted or nil, scroll upward by a near full screen. | ||
| 4842 | A near full screen is `next-screen-context-lines' less than a full screen. | 4860 | A near full screen is `next-screen-context-lines' less than a full screen. |
| 4843 | Negative ARG means scroll downward. | 4861 | Negative ARG means scroll downward. |
| 4844 | If ARG is the atom `-', scroll downward by nearly full screen. | 4862 | If ARG is the atom `-', scroll downward by nearly full screen. |
| @@ -4851,7 +4869,8 @@ When calling from a program, supply as argument a number, nil, or `-'. */) | |||
| 4851 | } | 4869 | } |
| 4852 | 4870 | ||
| 4853 | DEFUN ("scroll-down", Fscroll_down, Sscroll_down, 0, 1, "P", | 4871 | DEFUN ("scroll-down", Fscroll_down, Sscroll_down, 0, 1, "P", |
| 4854 | doc: /* Scroll text of current window down ARG lines; or near full screen if no ARG. | 4872 | doc: /* Scroll text of current window down ARG lines. |
| 4873 | If ARG is omitted or nil, scroll down by a near full screen. | ||
| 4855 | A near full screen is `next-screen-context-lines' less than a full screen. | 4874 | A near full screen is `next-screen-context-lines' less than a full screen. |
| 4856 | Negative ARG means scroll upward. | 4875 | Negative ARG means scroll upward. |
| 4857 | If ARG is the atom `-', scroll upward by nearly full screen. | 4876 | If ARG is the atom `-', scroll upward by nearly full screen. |
| @@ -4865,10 +4884,11 @@ When calling from a program, supply as argument a number, nil, or `-'. */) | |||
| 4865 | 4884 | ||
| 4866 | DEFUN ("other-window-for-scrolling", Fother_window_for_scrolling, Sother_window_for_scrolling, 0, 0, 0, | 4885 | DEFUN ("other-window-for-scrolling", Fother_window_for_scrolling, Sother_window_for_scrolling, 0, 0, 0, |
| 4867 | doc: /* Return the other window for \"other window scroll\" commands. | 4886 | doc: /* Return the other window for \"other window scroll\" commands. |
| 4868 | If in the minibuffer, `minibuffer-scroll-window' if non-nil | ||
| 4869 | specifies the window. | ||
| 4870 | If `other-window-scroll-buffer' is non-nil, a window | 4887 | If `other-window-scroll-buffer' is non-nil, a window |
| 4871 | showing that buffer is used. */) | 4888 | showing that buffer is used. |
| 4889 | If in the minibuffer, `minibuffer-scroll-window' if non-nil | ||
| 4890 | specifies the window. This takes precedence over | ||
| 4891 | `other-window-scroll-buffer'. */) | ||
| 4872 | () | 4892 | () |
| 4873 | { | 4893 | { |
| 4874 | Lisp_Object window; | 4894 | Lisp_Object window; |
| @@ -4914,10 +4934,11 @@ if the current one is at the bottom. Negative ARG means scroll downward. | |||
| 4914 | If ARG is the atom `-', scroll downward by nearly full screen. | 4934 | If ARG is the atom `-', scroll downward by nearly full screen. |
| 4915 | When calling from a program, supply as argument a number, nil, or `-'. | 4935 | When calling from a program, supply as argument a number, nil, or `-'. |
| 4916 | 4936 | ||
| 4917 | If in the minibuffer, `minibuffer-scroll-window' if non-nil | ||
| 4918 | specifies the window to scroll. | ||
| 4919 | If `other-window-scroll-buffer' is non-nil, scroll the window | 4937 | If `other-window-scroll-buffer' is non-nil, scroll the window |
| 4920 | showing that buffer, popping the buffer up if necessary. */) | 4938 | showing that buffer, popping the buffer up if necessary. |
| 4939 | If in the minibuffer, `minibuffer-scroll-window' if non-nil | ||
| 4940 | specifies the window to scroll. This takes precedence over | ||
| 4941 | `other-window-scroll-buffer'. */) | ||
| 4921 | (arg) | 4942 | (arg) |
| 4922 | Lisp_Object arg; | 4943 | Lisp_Object arg; |
| 4923 | { | 4944 | { |
| @@ -5893,7 +5914,8 @@ redirection (see `redirect-frame-focus'). */) | |||
| 5893 | 5914 | ||
| 5894 | DEFUN ("save-window-excursion", Fsave_window_excursion, Ssave_window_excursion, | 5915 | DEFUN ("save-window-excursion", Fsave_window_excursion, Ssave_window_excursion, |
| 5895 | 0, UNEVALLED, 0, | 5916 | 0, UNEVALLED, 0, |
| 5896 | doc: /* Execute body, preserving window sizes and contents. | 5917 | doc: /* Execute BODY, preserving window sizes and contents. |
| 5918 | Return the value of the last form in BODY. | ||
| 5897 | Restore which buffer appears in which window, where display starts, | 5919 | Restore which buffer appears in which window, where display starts, |
| 5898 | and the value of point and mark for each window. | 5920 | and the value of point and mark for each window. |
| 5899 | Also restore the choice of selected window. | 5921 | Also restore the choice of selected window. |
| @@ -6153,7 +6175,11 @@ DEFUN ("set-window-vscroll", Fset_window_vscroll, Sset_window_vscroll, | |||
| 6153 | doc: /* Set amount by which WINDOW should be scrolled vertically to VSCROLL. | 6175 | doc: /* Set amount by which WINDOW should be scrolled vertically to VSCROLL. |
| 6154 | WINDOW nil means use the selected window. Normally, VSCROLL is a | 6176 | WINDOW nil means use the selected window. Normally, VSCROLL is a |
| 6155 | non-negative multiple of the canonical character height of WINDOW; | 6177 | non-negative multiple of the canonical character height of WINDOW; |
| 6156 | optional third arg PIXELS_P non-nil means that VSCROLL is in pixels. */) | 6178 | optional third arg PIXELS_P non-nil means that VSCROLL is in pixels. |
| 6179 | If PIXELS-P is nil, VSCROLL may have to be rounded so that it | ||
| 6180 | corresponds to an integral number of pixels. The return value is the | ||
| 6181 | result of this rounding. | ||
| 6182 | If PIXELS-P is non-nil, the return value is VSCROLL. */) | ||
| 6157 | (window, vscroll, pixels_p) | 6183 | (window, vscroll, pixels_p) |
| 6158 | Lisp_Object window, vscroll, pixels_p; | 6184 | Lisp_Object window, vscroll, pixels_p; |
| 6159 | { | 6185 | { |
| @@ -6637,9 +6663,11 @@ The selected frame is the one whose configuration has changed. */); | |||
| 6637 | 6663 | ||
| 6638 | DEFVAR_BOOL ("window-size-fixed", &window_size_fixed, | 6664 | DEFVAR_BOOL ("window-size-fixed", &window_size_fixed, |
| 6639 | doc: /* Non-nil in a buffer means windows displaying the buffer are fixed-size. | 6665 | doc: /* Non-nil in a buffer means windows displaying the buffer are fixed-size. |
| 6666 | If the value is`height', then only the window's height is fixed. | ||
| 6667 | If the value is `width', then only the window's width is fixed. | ||
| 6668 | Any other non-nil value fixes both the width and the height. | ||
| 6640 | Emacs won't change the size of any window displaying that buffer, | 6669 | Emacs won't change the size of any window displaying that buffer, |
| 6641 | unless you explicitly change the size, or Emacs has no other choice. | 6670 | unless you explicitly change the size, or Emacs has no other choice. */); |
| 6642 | This variable automatically becomes buffer-local when set. */); | ||
| 6643 | Fmake_variable_buffer_local (Qwindow_size_fixed); | 6671 | Fmake_variable_buffer_local (Qwindow_size_fixed); |
| 6644 | window_size_fixed = 0; | 6672 | window_size_fixed = 0; |
| 6645 | 6673 | ||
diff --git a/src/window.h b/src/window.h index 1e53ae659cb..d8f98444ae9 100644 --- a/src/window.h +++ b/src/window.h | |||
| @@ -236,6 +236,11 @@ struct window | |||
| 236 | struct glyph_matrix *current_matrix; | 236 | struct glyph_matrix *current_matrix; |
| 237 | struct glyph_matrix *desired_matrix; | 237 | struct glyph_matrix *desired_matrix; |
| 238 | 238 | ||
| 239 | /* Scaling factor for the glyph_matrix size calculation in this window. | ||
| 240 | Used if window contains many small images or uses proportional fonts, | ||
| 241 | as the normal may yield a matrix which is too small. */ | ||
| 242 | int nrows_scale_factor, ncols_scale_factor; | ||
| 243 | |||
| 239 | /* Cursor position as of last update that completed without | 244 | /* Cursor position as of last update that completed without |
| 240 | pause. This is the position of last_point. */ | 245 | pause. This is the position of last_point. */ |
| 241 | struct cursor_pos last_cursor; | 246 | struct cursor_pos last_cursor; |
diff --git a/src/xdisp.c b/src/xdisp.c index c95493d5aa3..3a4ff4d2ac0 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -14562,9 +14562,13 @@ display_line (it) | |||
| 14562 | /* We always start displaying at hpos zero even if hscrolled. */ | 14562 | /* We always start displaying at hpos zero even if hscrolled. */ |
| 14563 | xassert (it->hpos == 0 && it->current_x == 0); | 14563 | xassert (it->hpos == 0 && it->current_x == 0); |
| 14564 | 14564 | ||
| 14565 | /* We must not display in a row that's not a text row. */ | 14565 | if (MATRIX_ROW_VPOS (row, it->w->desired_matrix) |
| 14566 | xassert (MATRIX_ROW_VPOS (row, it->w->desired_matrix) | 14566 | >= it->w->desired_matrix->nrows) |
| 14567 | < it->w->desired_matrix->nrows); | 14567 | { |
| 14568 | it->w->nrows_scale_factor++; | ||
| 14569 | fonts_changed_p = 1; | ||
| 14570 | return 0; | ||
| 14571 | } | ||
| 14568 | 14572 | ||
| 14569 | /* Is IT->w showing the region? */ | 14573 | /* Is IT->w showing the region? */ |
| 14570 | it->w->region_showing = it->region_beg_charpos > 0 ? Qt : Qnil; | 14574 | it->w->region_showing = it->region_beg_charpos > 0 ? Qt : Qnil; |
| @@ -18241,6 +18245,11 @@ append_glyph (it) | |||
| 18241 | glyph->font_type = FONT_TYPE_UNKNOWN; | 18245 | glyph->font_type = FONT_TYPE_UNKNOWN; |
| 18242 | ++it->glyph_row->used[area]; | 18246 | ++it->glyph_row->used[area]; |
| 18243 | } | 18247 | } |
| 18248 | else if (!fonts_changed_p) | ||
| 18249 | { | ||
| 18250 | it->w->ncols_scale_factor++; | ||
| 18251 | fonts_changed_p = 1; | ||
| 18252 | } | ||
| 18244 | } | 18253 | } |
| 18245 | 18254 | ||
| 18246 | /* Store one glyph for the composition IT->cmp_id in IT->glyph_row. | 18255 | /* Store one glyph for the composition IT->cmp_id in IT->glyph_row. |
| @@ -18278,6 +18287,11 @@ append_composite_glyph (it) | |||
| 18278 | glyph->font_type = FONT_TYPE_UNKNOWN; | 18287 | glyph->font_type = FONT_TYPE_UNKNOWN; |
| 18279 | ++it->glyph_row->used[area]; | 18288 | ++it->glyph_row->used[area]; |
| 18280 | } | 18289 | } |
| 18290 | else if (!fonts_changed_p) | ||
| 18291 | { | ||
| 18292 | it->w->ncols_scale_factor++; | ||
| 18293 | fonts_changed_p = 1; | ||
| 18294 | } | ||
| 18281 | } | 18295 | } |
| 18282 | 18296 | ||
| 18283 | 18297 | ||
| @@ -18447,6 +18461,11 @@ produce_image_glyph (it) | |||
| 18447 | glyph->font_type = FONT_TYPE_UNKNOWN; | 18461 | glyph->font_type = FONT_TYPE_UNKNOWN; |
| 18448 | ++it->glyph_row->used[area]; | 18462 | ++it->glyph_row->used[area]; |
| 18449 | } | 18463 | } |
| 18464 | else if (!fonts_changed_p) | ||
| 18465 | { | ||
| 18466 | it->w->ncols_scale_factor++; | ||
| 18467 | fonts_changed_p = 1; | ||
| 18468 | } | ||
| 18450 | } | 18469 | } |
| 18451 | } | 18470 | } |
| 18452 | 18471 | ||
| @@ -18490,6 +18509,11 @@ append_stretch_glyph (it, object, width, height, ascent) | |||
| 18490 | glyph->font_type = FONT_TYPE_UNKNOWN; | 18509 | glyph->font_type = FONT_TYPE_UNKNOWN; |
| 18491 | ++it->glyph_row->used[area]; | 18510 | ++it->glyph_row->used[area]; |
| 18492 | } | 18511 | } |
| 18512 | else if (!fonts_changed_p) | ||
| 18513 | { | ||
| 18514 | it->w->ncols_scale_factor++; | ||
| 18515 | fonts_changed_p = 1; | ||
| 18516 | } | ||
| 18493 | } | 18517 | } |
| 18494 | 18518 | ||
| 18495 | 18519 | ||
| @@ -22324,7 +22348,7 @@ all the functions in the list are called, with the frame as argument. */); | |||
| 22324 | Vwindow_size_change_functions = Qnil; | 22348 | Vwindow_size_change_functions = Qnil; |
| 22325 | 22349 | ||
| 22326 | DEFVAR_LISP ("window-scroll-functions", &Vwindow_scroll_functions, | 22350 | DEFVAR_LISP ("window-scroll-functions", &Vwindow_scroll_functions, |
| 22327 | doc: /* List of Functions to call before redisplaying a window with scrolling. | 22351 | doc: /* List of functions to call before redisplaying a window with scrolling. |
| 22328 | Each function is called with two arguments, the window | 22352 | Each function is called with two arguments, the window |
| 22329 | and its new display-start position. Note that the value of `window-end' | 22353 | and its new display-start position. Note that the value of `window-end' |
| 22330 | is not valid when these functions are called. */); | 22354 | is not valid when these functions are called. */); |