diff options
| author | Karoly Lorentey | 2005-07-10 19:23:59 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2005-07-10 19:23:59 +0000 |
| commit | cc7d6d6f6d422efeba9934486bdf7b418391660f (patch) | |
| tree | 695ceaedc1ae0410347235eac9119f8bca382e2b /src | |
| parent | e519a50bf7b0d7074f07ce492abb3cd544f79f59 (diff) | |
| parent | 43b557d50704df1dc45cc201a5596c05b62a6178 (diff) | |
| download | emacs-cc7d6d6f6d422efeba9934486bdf7b418391660f.tar.gz emacs-cc7d6d6f6d422efeba9934486bdf7b418391660f.zip | |
Merged from miles@gnu.org--gnu-2005 (patch 470-473)
Patches applied:
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-470
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-471
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-472
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-473
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-376
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 26 | ||||
| -rw-r--r-- | src/macterm.c | 48 | ||||
| -rw-r--r-- | src/w32console.c | 21 | ||||
| -rw-r--r-- | src/window.c | 62 |
4 files changed, 128 insertions, 29 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 3753d88a0e8..e13ffe8fc66 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,29 @@ | |||
| 1 | 2005-07-06 Richard M. Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * window.c (Frecenter): When arg is inside the scroll margin, | ||
| 4 | move it out of the margin. | ||
| 5 | |||
| 6 | 2005-07-06 Jason Rumney <jasonr@gnu.org> | ||
| 7 | |||
| 8 | * w32console.c (initialize_w32_display): Detect when the console | ||
| 9 | dimensions are insane, and default to 80x25 instead. | ||
| 10 | (w32_use_full_screen_buffer): default to NIL. | ||
| 11 | |||
| 12 | 2005-07-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 13 | |||
| 14 | * macterm.c (mac_draw_vertical_window_border): Use foreground of | ||
| 15 | VERTICAL_BORDER_FACE_ID for vertical border line. | ||
| 16 | (mac_encode_char): Call check_ccl_update in advance. | ||
| 17 | (mac_to_x_fontname, x_font_name_to_mac_font_name) | ||
| 18 | (init_font_name_table, mac_do_list_fonts, XLoadQueryFont): Don't | ||
| 19 | assume that font family length is less than 32. | ||
| 20 | (x_compute_min_glyph_bounds): Make static. | ||
| 21 | (x_load_font): Never set fonts_changed_p to zero. | ||
| 22 | |||
| 23 | 2005-07-04 Lute Kamstra <lute@gnu.org> | ||
| 24 | |||
| 25 | * Update FSF's address in GPL notices. | ||
| 26 | |||
| 1 | 2005-07-03 Richard M. Stallman <rms@gnu.org> | 27 | 2005-07-03 Richard M. Stallman <rms@gnu.org> |
| 2 | 28 | ||
| 3 | * xdisp.c (try_window): Fix previous change in how it handles | 29 | * xdisp.c (try_window): Fix previous change in how it handles |
diff --git a/src/macterm.c b/src/macterm.c index ab43a7bda43..303557daca1 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -1334,6 +1334,12 @@ mac_draw_vertical_window_border (w, x, y0, y1) | |||
| 1334 | int x, y0, y1; | 1334 | int x, y0, y1; |
| 1335 | { | 1335 | { |
| 1336 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 1336 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 1337 | struct face *face; | ||
| 1338 | |||
| 1339 | face = FACE_FROM_ID (f, VERTICAL_BORDER_FACE_ID); | ||
| 1340 | if (face) | ||
| 1341 | XSetForeground (FRAME_MAC_DISPLAY (f), f->output_data.mac->normal_gc, | ||
| 1342 | face->foreground); | ||
| 1337 | 1343 | ||
| 1338 | XDrawLine (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), | 1344 | XDrawLine (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), |
| 1339 | f->output_data.mac->normal_gc, x, y0, x, y1); | 1345 | f->output_data.mac->normal_gc, x, y0, x, y1); |
| @@ -1721,10 +1727,12 @@ mac_encode_char (c, char2b, font_info, two_byte_p) | |||
| 1721 | /* It's a program. */ | 1727 | /* It's a program. */ |
| 1722 | struct ccl_program *ccl = font_info->font_encoder; | 1728 | struct ccl_program *ccl = font_info->font_encoder; |
| 1723 | 1729 | ||
| 1730 | check_ccl_update (ccl); | ||
| 1724 | if (CHARSET_DIMENSION (charset) == 1) | 1731 | if (CHARSET_DIMENSION (charset) == 1) |
| 1725 | { | 1732 | { |
| 1726 | ccl->reg[0] = charset; | 1733 | ccl->reg[0] = charset; |
| 1727 | ccl->reg[1] = char2b->byte2; | 1734 | ccl->reg[1] = char2b->byte2; |
| 1735 | ccl->reg[2] = -1; | ||
| 1728 | } | 1736 | } |
| 1729 | else | 1737 | else |
| 1730 | { | 1738 | { |
| @@ -6249,10 +6257,11 @@ mac_to_x_fontname (name, size, style, charset) | |||
| 6249 | Style style; | 6257 | Style style; |
| 6250 | char *charset; | 6258 | char *charset; |
| 6251 | { | 6259 | { |
| 6252 | char foundry[32], family[32], cs[32]; | 6260 | Str31 foundry, cs; |
| 6261 | Str255 family; | ||
| 6253 | char xf[256], *result, *p; | 6262 | char xf[256], *result, *p; |
| 6254 | 6263 | ||
| 6255 | if (sscanf (name, "%31[^-]-%31[^-]-%31s", foundry, family, cs) == 3) | 6264 | if (sscanf (name, "%31[^-]-%255[^-]-%31s", foundry, family, cs) == 3) |
| 6256 | charset = cs; | 6265 | charset = cs; |
| 6257 | else | 6266 | else |
| 6258 | { | 6267 | { |
| @@ -6260,13 +6269,12 @@ mac_to_x_fontname (name, size, style, charset) | |||
| 6260 | strcpy(family, name); | 6269 | strcpy(family, name); |
| 6261 | } | 6270 | } |
| 6262 | 6271 | ||
| 6263 | sprintf(xf, "-%s-%s-%s-%c-normal--%d-%d-%d-%d-m-%d-%s", | 6272 | sprintf (xf, "%s-%c-normal--%d-%d-%d-%d-m-%d-%s", |
| 6264 | foundry, family, style & bold ? "bold" : "medium", | 6273 | style & bold ? "bold" : "medium", style & italic ? 'i' : 'r', |
| 6265 | style & italic ? 'i' : 'r', size, size * 10, | 6274 | size, size * 10, size ? 75 : 0, size ? 75 : 0, size * 10, charset); |
| 6266 | size ? 75 : 0, size ? 75 : 0, size * 10, charset); | ||
| 6267 | 6275 | ||
| 6268 | result = (char *) xmalloc (strlen (xf) + 1); | 6276 | result = xmalloc (strlen (foundry) + strlen (family) + strlen (xf) + 3 + 1); |
| 6269 | strcpy (result, xf); | 6277 | sprintf (result, "-%s-%s-%s", foundry, family, xf); |
| 6270 | for (p = result; *p; p++) | 6278 | for (p = result; *p; p++) |
| 6271 | *p = tolower(*p); | 6279 | *p = tolower(*p); |
| 6272 | return result; | 6280 | return result; |
| @@ -6286,15 +6294,17 @@ x_font_name_to_mac_font_name (xf, mf, mf_decoded, style, cs) | |||
| 6286 | Style *style; | 6294 | Style *style; |
| 6287 | char *cs; | 6295 | char *cs; |
| 6288 | { | 6296 | { |
| 6289 | char foundry[32], family[32], weight[20], slant[2], *p; | 6297 | Str31 foundry; |
| 6298 | Str255 family; | ||
| 6299 | char weight[20], slant[2], *p; | ||
| 6290 | Lisp_Object charset_info, coding_system = Qnil; | 6300 | Lisp_Object charset_info, coding_system = Qnil; |
| 6291 | struct coding_system coding; | 6301 | struct coding_system coding; |
| 6292 | 6302 | ||
| 6293 | strcpy (mf, ""); | 6303 | strcpy (mf, ""); |
| 6294 | 6304 | ||
| 6295 | if (sscanf (xf, "-%31[^-]-%31[^-]-%19[^-]-%1[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%31s", | 6305 | if (sscanf (xf, "-%31[^-]-%255[^-]-%19[^-]-%1[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%31s", |
| 6296 | foundry, family, weight, slant, cs) != 5 && | 6306 | foundry, family, weight, slant, cs) != 5 && |
| 6297 | sscanf (xf, "-%31[^-]-%31[^-]-%19[^-]-%1[^-]-%*[^-]--%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%31s", | 6307 | sscanf (xf, "-%31[^-]-%255[^-]-%19[^-]-%1[^-]-%*[^-]--%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%31s", |
| 6298 | foundry, family, weight, slant, cs) != 5) | 6308 | foundry, family, weight, slant, cs) != 5) |
| 6299 | return; | 6309 | return; |
| 6300 | 6310 | ||
| @@ -6327,7 +6337,7 @@ x_font_name_to_mac_font_name (xf, mf, mf_decoded, style, cs) | |||
| 6327 | coding.dst_multibyte = 1; | 6337 | coding.dst_multibyte = 1; |
| 6328 | coding.mode |= CODING_MODE_LAST_BLOCK; | 6338 | coding.mode |= CODING_MODE_LAST_BLOCK; |
| 6329 | encode_coding (&coding, mf_decoded, mf, | 6339 | encode_coding (&coding, mf_decoded, mf, |
| 6330 | strlen (mf_decoded), sizeof (Str32) - 1); | 6340 | strlen (mf_decoded), sizeof (Str255) - 1); |
| 6331 | mf[coding.produced] = '\0'; | 6341 | mf[coding.produced] = '\0'; |
| 6332 | } | 6342 | } |
| 6333 | } | 6343 | } |
| @@ -6459,7 +6469,7 @@ init_font_name_table () | |||
| 6459 | Handle font_handle, font_handle_2; | 6469 | Handle font_handle, font_handle_2; |
| 6460 | short id, scriptcode; | 6470 | short id, scriptcode; |
| 6461 | ResType type; | 6471 | ResType type; |
| 6462 | Str32 name; | 6472 | Str255 name; |
| 6463 | struct FontAssoc *fat; | 6473 | struct FontAssoc *fat; |
| 6464 | struct AsscEntry *assc_entry; | 6474 | struct AsscEntry *assc_entry; |
| 6465 | Lisp_Object text_encoding_info_alist, text_encoding_info; | 6475 | Lisp_Object text_encoding_info_alist, text_encoding_info; |
| @@ -6598,8 +6608,7 @@ mac_do_list_fonts (pattern, maxnames) | |||
| 6598 | int i, n_fonts = 0; | 6608 | int i, n_fonts = 0; |
| 6599 | Lisp_Object font_list = Qnil, pattern_regex, fontname; | 6609 | Lisp_Object font_list = Qnil, pattern_regex, fontname; |
| 6600 | char *regex = (char *) alloca (strlen (pattern) * 2 + 3); | 6610 | char *regex = (char *) alloca (strlen (pattern) * 2 + 3); |
| 6601 | char scaled[256]; | 6611 | char *scaled, *ptr; |
| 6602 | char *ptr; | ||
| 6603 | int scl_val[XLFD_SCL_LAST], *field, *val; | 6612 | int scl_val[XLFD_SCL_LAST], *field, *val; |
| 6604 | char *longest_start, *cur_start, *nonspecial; | 6613 | char *longest_start, *cur_start, *nonspecial; |
| 6605 | int longest_len, exact; | 6614 | int longest_len, exact; |
| @@ -6723,6 +6732,7 @@ mac_do_list_fonts (pattern, maxnames) | |||
| 6723 | { | 6732 | { |
| 6724 | int former_len = ptr - font_name_table[i]; | 6733 | int former_len = ptr - font_name_table[i]; |
| 6725 | 6734 | ||
| 6735 | scaled = xmalloc (strlen (font_name_table[i]) + 20 + 1); | ||
| 6726 | memcpy (scaled, font_name_table[i], former_len); | 6736 | memcpy (scaled, font_name_table[i], former_len); |
| 6727 | sprintf (scaled + former_len, | 6737 | sprintf (scaled + former_len, |
| 6728 | "-%d-%d-75-75-m-%d-%s", | 6738 | "-%d-%d-75-75-m-%d-%s", |
| @@ -6732,6 +6742,7 @@ mac_do_list_fonts (pattern, maxnames) | |||
| 6732 | ptr + sizeof ("-0-0-0-0-m-0-") - 1); | 6742 | ptr + sizeof ("-0-0-0-0-m-0-") - 1); |
| 6733 | fontname = mac_c_string_match (pattern_regex, scaled, | 6743 | fontname = mac_c_string_match (pattern_regex, scaled, |
| 6734 | nonspecial, exact); | 6744 | nonspecial, exact); |
| 6745 | xfree (scaled); | ||
| 6735 | if (!NILP (fontname)) | 6746 | if (!NILP (fontname)) |
| 6736 | { | 6747 | { |
| 6737 | font_list = Fcons (fontname, font_list); | 6748 | font_list = Fcons (fontname, font_list); |
| @@ -6852,7 +6863,7 @@ x_font_min_bounds (font, w, h) | |||
| 6852 | the values computed. Value is non-zero if smallest_font_height or | 6863 | the values computed. Value is non-zero if smallest_font_height or |
| 6853 | smallest_char_width become smaller than they were before. */ | 6864 | smallest_char_width become smaller than they were before. */ |
| 6854 | 6865 | ||
| 6855 | int | 6866 | static int |
| 6856 | x_compute_min_glyph_bounds (f) | 6867 | x_compute_min_glyph_bounds (f) |
| 6857 | struct frame *f; | 6868 | struct frame *f; |
| 6858 | { | 6869 | { |
| @@ -6937,7 +6948,8 @@ XLoadQueryFont (Display *dpy, char *fontname) | |||
| 6937 | GrafPtr port; | 6948 | GrafPtr port; |
| 6938 | SInt16 old_fontnum, old_fontsize; | 6949 | SInt16 old_fontnum, old_fontsize; |
| 6939 | Style old_fontface; | 6950 | Style old_fontface; |
| 6940 | Str32 mfontname, mfontname_decoded, charset; | 6951 | Str255 mfontname, mfontname_decoded; |
| 6952 | Str31 charset; | ||
| 6941 | SInt16 fontnum; | 6953 | SInt16 fontnum; |
| 6942 | Style fontface; | 6954 | Style fontface; |
| 6943 | #if TARGET_API_MAC_CARBON | 6955 | #if TARGET_API_MAC_CARBON |
| @@ -7329,7 +7341,7 @@ x_load_font (f, fontname, size) | |||
| 7329 | before, or if the font loaded has a smalle>r height than any | 7341 | before, or if the font loaded has a smalle>r height than any |
| 7330 | other font loaded before. If this happens, it will make a | 7342 | other font loaded before. If this happens, it will make a |
| 7331 | glyph matrix reallocation necessary. */ | 7343 | glyph matrix reallocation necessary. */ |
| 7332 | fonts_changed_p = x_compute_min_glyph_bounds (f); | 7344 | fonts_changed_p |= x_compute_min_glyph_bounds (f); |
| 7333 | UNBLOCK_INPUT; | 7345 | UNBLOCK_INPUT; |
| 7334 | return fontp; | 7346 | return fontp; |
| 7335 | } | 7347 | } |
diff --git a/src/w32console.c b/src/w32console.c index 70578f58c6b..0ebda179667 100644 --- a/src/w32console.c +++ b/src/w32console.c | |||
| @@ -635,7 +635,24 @@ initialize_w32_display (void) | |||
| 635 | meta_key = 1; | 635 | meta_key = 1; |
| 636 | char_attr_normal = info.wAttributes; | 636 | char_attr_normal = info.wAttributes; |
| 637 | 637 | ||
| 638 | if (w32_use_full_screen_buffer) | 638 | /* Determine if the info returned by GetConsoleScreenBufferInfo |
| 639 | is realistic. Old MS Telnet servers used to only fill out | ||
| 640 | the dwSize portion, even modern one fill the whole struct with | ||
| 641 | garbage when using non-MS telnet clients. */ | ||
| 642 | if ((w32_use_full_screen_buffer | ||
| 643 | && (info.dwSize.Y < 20 || info.dwSize.Y > 100 | ||
| 644 | || info.dwSize.X < 40 || info.dwSize.X > 200)) | ||
| 645 | || (!w32_use_full_screen_buffer | ||
| 646 | && (info.srWindow.Bottom - info.srWindow.Top < 20 | ||
| 647 | || info.srWindow.Bottom - info.srWindow.Top > 100 | ||
| 648 | || info.srWindow.Right - info.srWindow.Left < 40 | ||
| 649 | || info.srWindow.Right - info.srWindow.Left > 100))) | ||
| 650 | { | ||
| 651 | FRAME_LINES (SELECTED_FRAME ()) = 25; | ||
| 652 | SET_FRAME_COLS (SELECTED_FRAME (), 80); | ||
| 653 | } | ||
| 654 | |||
| 655 | else if (w32_use_full_screen_buffer) | ||
| 639 | { | 656 | { |
| 640 | FRAME_LINES (SELECTED_FRAME ()) = info.dwSize.Y; /* lines per page */ | 657 | FRAME_LINES (SELECTED_FRAME ()) = info.dwSize.Y; /* lines per page */ |
| 641 | SET_FRAME_COLS (SELECTED_FRAME (), info.dwSize.X); /* characters per line */ | 658 | SET_FRAME_COLS (SELECTED_FRAME (), info.dwSize.X); /* characters per line */ |
| @@ -691,7 +708,7 @@ This is desirable when running Emacs over telnet, and is the default. | |||
| 691 | A value of nil means use the current console window dimensions; this | 708 | A value of nil means use the current console window dimensions; this |
| 692 | may be preferrable when working directly at the console with a large | 709 | may be preferrable when working directly at the console with a large |
| 693 | scroll-back buffer. */); | 710 | scroll-back buffer. */); |
| 694 | w32_use_full_screen_buffer = 1; | 711 | w32_use_full_screen_buffer = 0; |
| 695 | 712 | ||
| 696 | defsubr (&Sset_screen_color); | 713 | defsubr (&Sset_screen_color); |
| 697 | defsubr (&Sset_cursor_size); | 714 | defsubr (&Sset_cursor_size); |
diff --git a/src/window.c b/src/window.c index 68b2d4f89c7..d9af9ba72ac 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -5335,6 +5335,8 @@ and redisplay normally--don't erase and redraw the frame. */) | |||
| 5335 | struct buffer *obuf = current_buffer; | 5335 | struct buffer *obuf = current_buffer; |
| 5336 | int center_p = 0; | 5336 | int center_p = 0; |
| 5337 | int charpos, bytepos; | 5337 | int charpos, bytepos; |
| 5338 | int iarg; | ||
| 5339 | int this_scroll_margin; | ||
| 5338 | 5340 | ||
| 5339 | /* If redisplay is suppressed due to an error, try again. */ | 5341 | /* If redisplay is suppressed due to an error, try again. */ |
| 5340 | obuf->display_error_modiff = 0; | 5342 | obuf->display_error_modiff = 0; |
| @@ -5361,6 +5363,12 @@ and redisplay normally--don't erase and redraw the frame. */) | |||
| 5361 | 5363 | ||
| 5362 | set_buffer_internal (buf); | 5364 | set_buffer_internal (buf); |
| 5363 | 5365 | ||
| 5366 | /* Do this after making BUF current | ||
| 5367 | in case scroll_margin is buffer-local. */ | ||
| 5368 | this_scroll_margin = max (0, scroll_margin); | ||
| 5369 | this_scroll_margin = min (this_scroll_margin, | ||
| 5370 | XFASTINT (w->total_lines) / 4); | ||
| 5371 | |||
| 5364 | /* Handle centering on a graphical frame specially. Such frames can | 5372 | /* Handle centering on a graphical frame specially. Such frames can |
| 5365 | have variable-height lines and centering point on the basis of | 5373 | have variable-height lines and centering point on the basis of |
| 5366 | line counts would lead to strange effects. */ | 5374 | line counts would lead to strange effects. */ |
| @@ -5377,14 +5385,17 @@ and redisplay normally--don't erase and redraw the frame. */) | |||
| 5377 | charpos = IT_CHARPOS (it); | 5385 | charpos = IT_CHARPOS (it); |
| 5378 | bytepos = IT_BYTEPOS (it); | 5386 | bytepos = IT_BYTEPOS (it); |
| 5379 | } | 5387 | } |
| 5380 | else if (XINT (arg) < 0) | 5388 | else if (iarg < 0) |
| 5381 | { | 5389 | { |
| 5382 | struct it it; | 5390 | struct it it; |
| 5383 | struct text_pos pt; | 5391 | struct text_pos pt; |
| 5384 | int nlines = - XINT (arg); | 5392 | int nlines = -iarg; |
| 5385 | int extra_line_spacing; | 5393 | int extra_line_spacing; |
| 5386 | int h = window_box_height (w); | 5394 | int h = window_box_height (w); |
| 5387 | 5395 | ||
| 5396 | iarg = XINT (arg); | ||
| 5397 | iarg = - max (-iarg, this_scroll_margin); | ||
| 5398 | |||
| 5388 | SET_TEXT_POS (pt, PT, PT_BYTE); | 5399 | SET_TEXT_POS (pt, PT, PT_BYTE); |
| 5389 | start_display (&it, w, pt); | 5400 | start_display (&it, w, pt); |
| 5390 | 5401 | ||
| @@ -5443,7 +5454,11 @@ and redisplay normally--don't erase and redraw the frame. */) | |||
| 5443 | else | 5454 | else |
| 5444 | { | 5455 | { |
| 5445 | struct position pos; | 5456 | struct position pos; |
| 5446 | pos = *vmotion (PT, - XINT (arg), w); | 5457 | |
| 5458 | iarg = XINT (arg); | ||
| 5459 | iarg = max (iarg, this_scroll_margin); | ||
| 5460 | |||
| 5461 | pos = *vmotion (PT, -iarg, w); | ||
| 5447 | charpos = pos.bufpos; | 5462 | charpos = pos.bufpos; |
| 5448 | bytepos = pos.bytepos; | 5463 | bytepos = pos.bytepos; |
| 5449 | } | 5464 | } |
| @@ -5454,11 +5469,17 @@ and redisplay normally--don't erase and redraw the frame. */) | |||
| 5454 | int ht = window_internal_height (w); | 5469 | int ht = window_internal_height (w); |
| 5455 | 5470 | ||
| 5456 | if (center_p) | 5471 | if (center_p) |
| 5457 | arg = make_number (ht / 2); | 5472 | iarg = make_number (ht / 2); |
| 5458 | else if (XINT (arg) < 0) | 5473 | else if (XINT (arg) < 0) |
| 5459 | arg = make_number (XINT (arg) + ht); | 5474 | iarg = XINT (arg) + ht; |
| 5475 | else | ||
| 5476 | iarg = XINT (arg); | ||
| 5477 | |||
| 5478 | /* Don't let it get into the margin at either top or bottom. */ | ||
| 5479 | iarg = max (iarg, this_scroll_margin); | ||
| 5480 | iarg = min (iarg, ht - this_scroll_margin - 1); | ||
| 5460 | 5481 | ||
| 5461 | pos = *vmotion (PT, - XINT (arg), w); | 5482 | pos = *vmotion (PT, - iarg, w); |
| 5462 | charpos = pos.bufpos; | 5483 | charpos = pos.bufpos; |
| 5463 | bytepos = pos.bytepos; | 5484 | bytepos = pos.bytepos; |
| 5464 | } | 5485 | } |
| @@ -5507,6 +5528,9 @@ zero means top of window, negative means relative to bottom of window. */) | |||
| 5507 | struct window *w = XWINDOW (selected_window); | 5528 | struct window *w = XWINDOW (selected_window); |
| 5508 | int lines, start; | 5529 | int lines, start; |
| 5509 | Lisp_Object window; | 5530 | Lisp_Object window; |
| 5531 | #if 0 | ||
| 5532 | int this_scroll_margin; | ||
| 5533 | #endif | ||
| 5510 | 5534 | ||
| 5511 | window = selected_window; | 5535 | window = selected_window; |
| 5512 | start = marker_position (w->start); | 5536 | start = marker_position (w->start); |
| @@ -5522,13 +5546,33 @@ zero means top of window, negative means relative to bottom of window. */) | |||
| 5522 | Fgoto_char (w->start); | 5546 | Fgoto_char (w->start); |
| 5523 | 5547 | ||
| 5524 | lines = displayed_window_lines (w); | 5548 | lines = displayed_window_lines (w); |
| 5549 | |||
| 5550 | #if 0 | ||
| 5551 | this_scroll_margin = max (0, scroll_margin); | ||
| 5552 | this_scroll_margin = min (this_scroll_margin, lines / 4); | ||
| 5553 | #endif | ||
| 5554 | |||
| 5525 | if (NILP (arg)) | 5555 | if (NILP (arg)) |
| 5526 | XSETFASTINT (arg, lines / 2); | 5556 | XSETFASTINT (arg, lines / 2); |
| 5527 | else | 5557 | else |
| 5528 | { | 5558 | { |
| 5529 | arg = Fprefix_numeric_value (arg); | 5559 | int iarg = XINT (Fprefix_numeric_value (arg)); |
| 5530 | if (XINT (arg) < 0) | 5560 | |
| 5531 | XSETINT (arg, XINT (arg) + lines); | 5561 | if (iarg < 0) |
| 5562 | iarg = iarg + lines; | ||
| 5563 | |||
| 5564 | #if 0 /* This code would prevent move-to-window-line from moving point | ||
| 5565 | to a place inside the scroll margins (which would cause the | ||
| 5566 | next redisplay to scroll). I wrote this code, but then concluded | ||
| 5567 | it is probably better not to install it. However, it is here | ||
| 5568 | inside #if 0 so as not to lose it. -- rms. */ | ||
| 5569 | |||
| 5570 | /* Don't let it get into the margin at either top or bottom. */ | ||
| 5571 | iarg = max (iarg, this_scroll_margin); | ||
| 5572 | iarg = min (iarg, lines - this_scroll_margin - 1); | ||
| 5573 | #endif | ||
| 5574 | |||
| 5575 | arg = make_number (iarg); | ||
| 5532 | } | 5576 | } |
| 5533 | 5577 | ||
| 5534 | /* Skip past a partially visible first line. */ | 5578 | /* Skip past a partially visible first line. */ |