diff options
| author | Karoly Lorentey | 2004-01-25 01:17:40 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2004-01-25 01:17:40 +0000 |
| commit | c3b4957fff207e1b7c92ddc8a1b0401892574fce (patch) | |
| tree | 2742f5d458436c9eb52084e4139101e570306957 /src | |
| parent | 017bbc62df93de9f88171fc8ffb92c2e616d238b (diff) | |
| download | emacs-c3b4957fff207e1b7c92ddc8a1b0401892574fce.tar.gz emacs-c3b4957fff207e1b7c92ddc8a1b0401892574fce.zip | |
Cosmetic changes.
src/cm.c (calccost, cmgoto): Cosmetic changes.
src/keyboard.c (kbd_buffer_get_event, Fcurrent_input_mode): Ditto.
src/term.c: Cosmetic changes.
src/termchar.h (top_frame): Removed obsolete TODO comment.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-67
Diffstat (limited to 'src')
| -rw-r--r-- | src/cm.c | 10 | ||||
| -rw-r--r-- | src/keyboard.c | 13 | ||||
| -rw-r--r-- | src/term.c | 80 | ||||
| -rw-r--r-- | src/termchar.h | 1 |
4 files changed, 33 insertions, 71 deletions
| @@ -264,11 +264,11 @@ x: | |||
| 264 | * for using n2tabs, then pick the minimum. | 264 | * for using n2tabs, then pick the minimum. |
| 265 | */ | 265 | */ |
| 266 | 266 | ||
| 267 | /* cost for ntabs + cost for right motion */ | 267 | /* cost for ntabs + cost for right motion */ |
| 268 | tabcost = ntabs ? ntabs * tty->Wcm->cc_tab + (dstx - tabx) * tty->Wcm->cc_right | 268 | tabcost = ntabs ? ntabs * tty->Wcm->cc_tab + (dstx - tabx) * tty->Wcm->cc_right |
| 269 | : BIG; | 269 | : BIG; |
| 270 | 270 | ||
| 271 | /* cost for n2tabs + cost for left motion */ | 271 | /* cost for n2tabs + cost for left motion */ |
| 272 | c = n2tabs ? n2tabs * tty->Wcm->cc_tab + (tab2x - dstx) * tty->Wcm->cc_left | 272 | c = n2tabs ? n2tabs * tty->Wcm->cc_tab + (tab2x - dstx) * tty->Wcm->cc_left |
| 273 | : BIG; | 273 | : BIG; |
| 274 | 274 | ||
| @@ -396,9 +396,9 @@ cmgoto (tty, row, col) | |||
| 396 | { | 396 | { |
| 397 | /* compute REAL direct cost */ | 397 | /* compute REAL direct cost */ |
| 398 | cost = 0; | 398 | cost = 0; |
| 399 | p = dcm == tty->Wcm->cm_habs | 399 | p = (dcm == tty->Wcm->cm_habs |
| 400 | ? tgoto (dcm, row, col) | 400 | ? tgoto (dcm, row, col) |
| 401 | : tgoto (dcm, col, row); | 401 | : tgoto (dcm, col, row)); |
| 402 | emacs_tputs (tty, p, 1, evalcost); | 402 | emacs_tputs (tty, p, 1, evalcost); |
| 403 | if (cost <= relcost) | 403 | if (cost <= relcost) |
| 404 | { /* really is cheaper */ | 404 | { /* really is cheaper */ |
diff --git a/src/keyboard.c b/src/keyboard.c index 4e0786ec1c9..11e1d18c7d5 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -4050,8 +4050,11 @@ kbd_buffer_get_event (kbp, used_mouse_menu) | |||
| 4050 | If there is no valid info, it does not store anything | 4050 | If there is no valid info, it does not store anything |
| 4051 | so x remains nil. */ | 4051 | so x remains nil. */ |
| 4052 | x = Qnil; | 4052 | x = Qnil; |
| 4053 | if (f && FRAME_DISPLAY (f)->mouse_position_hook) /* XXX Can f or mouse_position_hook be NULL here? */ | 4053 | |
| 4054 | (*FRAME_DISPLAY (f)->mouse_position_hook) (&f, 0, &bar_window, &part, &x, &y, &time); | 4054 | /* XXX Can f or mouse_position_hook be NULL here? */ |
| 4055 | if (f && FRAME_DISPLAY (f)->mouse_position_hook) | ||
| 4056 | (*FRAME_DISPLAY (f)->mouse_position_hook) (&f, 0, &bar_window, | ||
| 4057 | &part, &x, &y, &time); | ||
| 4055 | 4058 | ||
| 4056 | obj = Qnil; | 4059 | obj = Qnil; |
| 4057 | 4060 | ||
| @@ -10550,9 +10553,9 @@ The elements of this list correspond to the arguments of | |||
| 10550 | if (FRAME_TERMCAP_P (sf)) | 10553 | if (FRAME_TERMCAP_P (sf)) |
| 10551 | { | 10554 | { |
| 10552 | val[1] = FRAME_TTY (sf)->flow_control ? Qt : Qnil; | 10555 | val[1] = FRAME_TTY (sf)->flow_control ? Qt : Qnil; |
| 10553 | val[2] = FRAME_TTY (sf)->meta_key == 2 | 10556 | val[2] = (FRAME_TTY (sf)->meta_key == 2 |
| 10554 | ? make_number (0) | 10557 | ? make_number (0) |
| 10555 | : CURTTY ()->meta_key == 1 ? Qt : Qnil; | 10558 | : (CURTTY ()->meta_key == 1 ? Qt : Qnil)); |
| 10556 | } | 10559 | } |
| 10557 | else | 10560 | else |
| 10558 | { | 10561 | { |
diff --git a/src/term.c b/src/term.c index 65b6c158c33..f5e0256e0f1 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -285,9 +285,7 @@ void | |||
| 285 | set_terminal_window (size) | 285 | set_terminal_window (size) |
| 286 | int size; | 286 | int size; |
| 287 | { | 287 | { |
| 288 | struct frame *f = (updating_frame | 288 | struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame)); |
| 289 | ? updating_frame | ||
| 290 | : XFRAME (selected_frame)); | ||
| 291 | 289 | ||
| 292 | if (FRAME_DISPLAY (f)->set_terminal_window_hook) | 290 | if (FRAME_DISPLAY (f)->set_terminal_window_hook) |
| 293 | (*FRAME_DISPLAY (f)->set_terminal_window_hook) (size); | 291 | (*FRAME_DISPLAY (f)->set_terminal_window_hook) (size); |
| @@ -298,9 +296,7 @@ set_terminal_window (size) | |||
| 298 | void | 296 | void |
| 299 | tty_set_terminal_window (int size) | 297 | tty_set_terminal_window (int size) |
| 300 | { | 298 | { |
| 301 | struct frame *f = (updating_frame | 299 | struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame)); |
| 302 | ? updating_frame | ||
| 303 | : XFRAME (selected_frame)); | ||
| 304 | 300 | ||
| 305 | struct tty_display_info *tty = FRAME_TTY (f); | 301 | struct tty_display_info *tty = FRAME_TTY (f); |
| 306 | 302 | ||
| @@ -314,9 +310,7 @@ set_scroll_region (start, stop) | |||
| 314 | int start, stop; | 310 | int start, stop; |
| 315 | { | 311 | { |
| 316 | char *buf; | 312 | char *buf; |
| 317 | struct frame *f = (updating_frame | 313 | struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame)); |
| 318 | ? updating_frame | ||
| 319 | : XFRAME (selected_frame)); | ||
| 320 | 314 | ||
| 321 | struct tty_display_info *tty = FRAME_TTY (f); | 315 | struct tty_display_info *tty = FRAME_TTY (f); |
| 322 | 316 | ||
| @@ -439,9 +433,7 @@ void | |||
| 439 | cursor_to (vpos, hpos) | 433 | cursor_to (vpos, hpos) |
| 440 | int vpos, hpos; | 434 | int vpos, hpos; |
| 441 | { | 435 | { |
| 442 | struct frame *f = (updating_frame | 436 | struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame)); |
| 443 | ? updating_frame | ||
| 444 | : XFRAME (selected_frame)); | ||
| 445 | 437 | ||
| 446 | if (FRAME_DISPLAY (f)->cursor_to_hook) | 438 | if (FRAME_DISPLAY (f)->cursor_to_hook) |
| 447 | (*FRAME_DISPLAY (f)->cursor_to_hook) (vpos, hpos); | 439 | (*FRAME_DISPLAY (f)->cursor_to_hook) (vpos, hpos); |
| @@ -450,9 +442,7 @@ cursor_to (vpos, hpos) | |||
| 450 | void | 442 | void |
| 451 | tty_cursor_to (int vpos, int hpos) | 443 | tty_cursor_to (int vpos, int hpos) |
| 452 | { | 444 | { |
| 453 | struct frame *f = (updating_frame | 445 | struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame)); |
| 454 | ? updating_frame | ||
| 455 | : XFRAME (selected_frame)); | ||
| 456 | 446 | ||
| 457 | struct tty_display_info *tty = FRAME_TTY (f); | 447 | struct tty_display_info *tty = FRAME_TTY (f); |
| 458 | 448 | ||
| @@ -477,9 +467,7 @@ void | |||
| 477 | raw_cursor_to (row, col) | 467 | raw_cursor_to (row, col) |
| 478 | int row, col; | 468 | int row, col; |
| 479 | { | 469 | { |
| 480 | struct frame *f = (updating_frame | 470 | struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame)); |
| 481 | ? updating_frame | ||
| 482 | : XFRAME (selected_frame)); | ||
| 483 | 471 | ||
| 484 | if (FRAME_DISPLAY (f)->raw_cursor_to_hook) | 472 | if (FRAME_DISPLAY (f)->raw_cursor_to_hook) |
| 485 | (*FRAME_DISPLAY (f)->raw_cursor_to_hook) (row, col); | 473 | (*FRAME_DISPLAY (f)->raw_cursor_to_hook) (row, col); |
| @@ -488,9 +476,7 @@ raw_cursor_to (row, col) | |||
| 488 | void | 476 | void |
| 489 | tty_raw_cursor_to (int row, int col) | 477 | tty_raw_cursor_to (int row, int col) |
| 490 | { | 478 | { |
| 491 | struct frame *f = (updating_frame | 479 | struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame)); |
| 492 | ? updating_frame | ||
| 493 | : XFRAME (selected_frame)); | ||
| 494 | 480 | ||
| 495 | struct tty_display_info *tty = FRAME_TTY (f); | 481 | struct tty_display_info *tty = FRAME_TTY (f); |
| 496 | 482 | ||
| @@ -510,9 +496,7 @@ tty_raw_cursor_to (int row, int col) | |||
| 510 | void | 496 | void |
| 511 | clear_to_end () | 497 | clear_to_end () |
| 512 | { | 498 | { |
| 513 | struct frame *f = (updating_frame | 499 | struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame)); |
| 514 | ? updating_frame | ||
| 515 | : XFRAME (selected_frame)); | ||
| 516 | 500 | ||
| 517 | if (FRAME_DISPLAY (f)->clear_to_end_hook) | 501 | if (FRAME_DISPLAY (f)->clear_to_end_hook) |
| 518 | (*FRAME_DISPLAY (f)->clear_to_end_hook) (); | 502 | (*FRAME_DISPLAY (f)->clear_to_end_hook) (); |
| @@ -524,9 +508,7 @@ void | |||
| 524 | tty_clear_to_end (void) | 508 | tty_clear_to_end (void) |
| 525 | { | 509 | { |
| 526 | register int i; | 510 | register int i; |
| 527 | struct frame *f = (updating_frame | 511 | struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame)); |
| 528 | ? updating_frame | ||
| 529 | : XFRAME (selected_frame)); | ||
| 530 | struct tty_display_info *tty = FRAME_TTY (f); | 512 | struct tty_display_info *tty = FRAME_TTY (f); |
| 531 | 513 | ||
| 532 | if (tty->TS_clr_to_bottom) | 514 | if (tty->TS_clr_to_bottom) |
| @@ -560,9 +542,7 @@ clear_frame () | |||
| 560 | void | 542 | void |
| 561 | tty_clear_frame () | 543 | tty_clear_frame () |
| 562 | { | 544 | { |
| 563 | struct frame *f = (updating_frame | 545 | struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame)); |
| 564 | ? updating_frame | ||
| 565 | : XFRAME (selected_frame)); | ||
| 566 | 546 | ||
| 567 | struct tty_display_info *tty = FRAME_TTY (f); | 547 | struct tty_display_info *tty = FRAME_TTY (f); |
| 568 | 548 | ||
| @@ -588,9 +568,7 @@ void | |||
| 588 | clear_end_of_line (first_unused_hpos) | 568 | clear_end_of_line (first_unused_hpos) |
| 589 | int first_unused_hpos; | 569 | int first_unused_hpos; |
| 590 | { | 570 | { |
| 591 | struct frame *f = (updating_frame | 571 | struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame)); |
| 592 | ? updating_frame | ||
| 593 | : XFRAME (selected_frame)); | ||
| 594 | 572 | ||
| 595 | if (FRAME_DISPLAY (f)->clear_end_of_line_hook) | 573 | if (FRAME_DISPLAY (f)->clear_end_of_line_hook) |
| 596 | (*FRAME_DISPLAY (f)->clear_end_of_line_hook) (first_unused_hpos); | 574 | (*FRAME_DISPLAY (f)->clear_end_of_line_hook) (first_unused_hpos); |
| @@ -604,9 +582,7 @@ void | |||
| 604 | tty_clear_end_of_line (int first_unused_hpos) | 582 | tty_clear_end_of_line (int first_unused_hpos) |
| 605 | { | 583 | { |
| 606 | register int i; | 584 | register int i; |
| 607 | struct frame *f = (updating_frame | 585 | struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame)); |
| 608 | ? updating_frame | ||
| 609 | : XFRAME (selected_frame)); | ||
| 610 | struct tty_display_info *tty = FRAME_TTY (f); | 586 | struct tty_display_info *tty = FRAME_TTY (f); |
| 611 | 587 | ||
| 612 | /* Detect the case where we are called from reset_sys_modes | 588 | /* Detect the case where we are called from reset_sys_modes |
| @@ -758,9 +734,7 @@ write_glyphs (string, len) | |||
| 758 | register struct glyph *string; | 734 | register struct glyph *string; |
| 759 | register int len; | 735 | register int len; |
| 760 | { | 736 | { |
| 761 | struct frame *f = (updating_frame | 737 | struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame)); |
| 762 | ? updating_frame | ||
| 763 | : XFRAME (selected_frame)); | ||
| 764 | 738 | ||
| 765 | if (FRAME_DISPLAY (f)->write_glyphs_hook) | 739 | if (FRAME_DISPLAY (f)->write_glyphs_hook) |
| 766 | (*FRAME_DISPLAY (f)->write_glyphs_hook) (string, len); | 740 | (*FRAME_DISPLAY (f)->write_glyphs_hook) (string, len); |
| @@ -775,9 +749,7 @@ tty_write_glyphs (struct glyph *string, int len) | |||
| 775 | unsigned char conversion_buffer[1024]; | 749 | unsigned char conversion_buffer[1024]; |
| 776 | int conversion_buffer_size = sizeof conversion_buffer; | 750 | int conversion_buffer_size = sizeof conversion_buffer; |
| 777 | 751 | ||
| 778 | struct frame *f = (updating_frame | 752 | struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame)); |
| 779 | ? updating_frame | ||
| 780 | : XFRAME (selected_frame)); | ||
| 781 | 753 | ||
| 782 | struct tty_display_info *tty = FRAME_TTY (f); | 754 | struct tty_display_info *tty = FRAME_TTY (f); |
| 783 | 755 | ||
| @@ -872,9 +844,7 @@ insert_glyphs (start, len) | |||
| 872 | register struct glyph *start; | 844 | register struct glyph *start; |
| 873 | register int len; | 845 | register int len; |
| 874 | { | 846 | { |
| 875 | struct frame *f = (updating_frame | 847 | struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame)); |
| 876 | ? updating_frame | ||
| 877 | : XFRAME (selected_frame)); | ||
| 878 | 848 | ||
| 879 | if (len <= 0) | 849 | if (len <= 0) |
| 880 | return; | 850 | return; |
| @@ -890,9 +860,7 @@ tty_insert_glyphs (struct glyph *start, int len) | |||
| 890 | { | 860 | { |
| 891 | char *buf; | 861 | char *buf; |
| 892 | struct glyph *glyph = NULL; | 862 | struct glyph *glyph = NULL; |
| 893 | struct frame *f = (updating_frame | 863 | struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame)); |
| 894 | ? updating_frame | ||
| 895 | : XFRAME (selected_frame)); | ||
| 896 | 864 | ||
| 897 | struct tty_display_info *tty = FRAME_TTY (f); | 865 | struct tty_display_info *tty = FRAME_TTY (f); |
| 898 | 866 | ||
| @@ -974,9 +942,7 @@ void | |||
| 974 | delete_glyphs (n) | 942 | delete_glyphs (n) |
| 975 | register int n; | 943 | register int n; |
| 976 | { | 944 | { |
| 977 | struct frame *f = (updating_frame | 945 | struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame)); |
| 978 | ? updating_frame | ||
| 979 | : XFRAME (selected_frame)); | ||
| 980 | 946 | ||
| 981 | if (FRAME_DISPLAY (f)->delete_glyphs_hook) | 947 | if (FRAME_DISPLAY (f)->delete_glyphs_hook) |
| 982 | (*FRAME_DISPLAY (f)->delete_glyphs_hook) (n); | 948 | (*FRAME_DISPLAY (f)->delete_glyphs_hook) (n); |
| @@ -989,9 +955,7 @@ tty_delete_glyphs (int n) | |||
| 989 | { | 955 | { |
| 990 | char *buf; | 956 | char *buf; |
| 991 | register int i; | 957 | register int i; |
| 992 | struct frame *f = (updating_frame | 958 | struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame)); |
| 993 | ? updating_frame | ||
| 994 | : XFRAME (selected_frame)); | ||
| 995 | 959 | ||
| 996 | struct tty_display_info *tty = FRAME_TTY (f); | 960 | struct tty_display_info *tty = FRAME_TTY (f); |
| 997 | 961 | ||
| @@ -1024,9 +988,7 @@ void | |||
| 1024 | ins_del_lines (vpos, n) | 988 | ins_del_lines (vpos, n) |
| 1025 | int vpos, n; | 989 | int vpos, n; |
| 1026 | { | 990 | { |
| 1027 | struct frame *f = (updating_frame | 991 | struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame)); |
| 1028 | ? updating_frame | ||
| 1029 | : XFRAME (selected_frame)); | ||
| 1030 | 992 | ||
| 1031 | if (FRAME_DISPLAY (f)->ins_del_lines_hook) | 993 | if (FRAME_DISPLAY (f)->ins_del_lines_hook) |
| 1032 | (*FRAME_DISPLAY (f)->ins_del_lines_hook) (vpos, n); | 994 | (*FRAME_DISPLAY (f)->ins_del_lines_hook) (vpos, n); |
| @@ -1037,9 +999,7 @@ ins_del_lines (vpos, n) | |||
| 1037 | void | 999 | void |
| 1038 | tty_ins_del_lines (int vpos, int n) | 1000 | tty_ins_del_lines (int vpos, int n) |
| 1039 | { | 1001 | { |
| 1040 | struct frame *f = (updating_frame | 1002 | struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame)); |
| 1041 | ? updating_frame | ||
| 1042 | : XFRAME (selected_frame)); | ||
| 1043 | 1003 | ||
| 1044 | struct tty_display_info *tty = FRAME_TTY (f); | 1004 | struct tty_display_info *tty = FRAME_TTY (f); |
| 1045 | char *multi = n > 0 ? tty->TS_ins_multi_lines : tty->TS_del_multi_lines; | 1005 | char *multi = n > 0 ? tty->TS_ins_multi_lines : tty->TS_del_multi_lines; |
diff --git a/src/termchar.h b/src/termchar.h index e9efbc21fe4..fbf91f2458f 100644 --- a/src/termchar.h +++ b/src/termchar.h | |||
| @@ -63,7 +63,6 @@ struct tty_display_info | |||
| 63 | 63 | ||
| 64 | /* Redisplay. */ | 64 | /* Redisplay. */ |
| 65 | 65 | ||
| 66 | /* XXX GC does not know about this; is this a problem? */ | ||
| 67 | Lisp_Object top_frame; /* The topmost frame on this tty. */ | 66 | Lisp_Object top_frame; /* The topmost frame on this tty. */ |
| 68 | 67 | ||
| 69 | /* The previous terminal frame we displayed on this tty. */ | 68 | /* The previous terminal frame we displayed on this tty. */ |