changeset 83027:5b06ac722eb1

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
author Karoly Lorentey <lorentey@elte.hu>
date Sun, 25 Jan 2004 01:17:40 +0000
parents 77cfe20c109c
children bf5b5fb49420
files src/cm.c src/keyboard.c src/term.c src/termchar.h
diffstat 4 files changed, 33 insertions(+), 71 deletions(-) [+]
line wrap: on
line diff
--- a/src/cm.c	Sun Jan 25 00:48:47 2004 +0000
+++ b/src/cm.c	Sun Jan 25 01:17:40 2004 +0000
@@ -264,11 +264,11 @@
      * for using n2tabs, then pick the minimum.
      */
 
-		   /* cost for ntabs     +    cost for right motion */
+		   /* cost for ntabs           +    cost for right motion */
     tabcost = ntabs ? ntabs * tty->Wcm->cc_tab + (dstx - tabx) * tty->Wcm->cc_right
 		    : BIG;
 
-		   /* cost for n2tabs    +    cost for left motion */
+		   /* cost for n2tabs          +    cost for left motion */
     c = n2tabs  ?    n2tabs * tty->Wcm->cc_tab + (tab2x - dstx) * tty->Wcm->cc_left
 		: BIG;
 
@@ -396,9 +396,9 @@
     {
       /* compute REAL direct cost */
       cost = 0;
-      p = dcm == tty->Wcm->cm_habs
-        ? tgoto (dcm, row, col)
-        : tgoto (dcm, col, row);
+      p = (dcm == tty->Wcm->cm_habs
+           ? tgoto (dcm, row, col)
+           : tgoto (dcm, col, row));
       emacs_tputs (tty, p, 1, evalcost);
       if (cost <= relcost)
 	{	/* really is cheaper */
--- a/src/keyboard.c	Sun Jan 25 00:48:47 2004 +0000
+++ b/src/keyboard.c	Sun Jan 25 01:17:40 2004 +0000
@@ -4050,8 +4050,11 @@
 	 If there is no valid info, it does not store anything
 	 so x remains nil.  */
       x = Qnil;
-      if (f && FRAME_DISPLAY (f)->mouse_position_hook) /* XXX Can f or mouse_position_hook be NULL here? */
-        (*FRAME_DISPLAY (f)->mouse_position_hook) (&f, 0, &bar_window, &part, &x, &y, &time);
+      
+      /* XXX Can f or mouse_position_hook be NULL here? */
+      if (f && FRAME_DISPLAY (f)->mouse_position_hook) 
+        (*FRAME_DISPLAY (f)->mouse_position_hook) (&f, 0, &bar_window,
+                                                   &part, &x, &y, &time);
 
       obj = Qnil;
 
@@ -10550,9 +10553,9 @@
   if (FRAME_TERMCAP_P (sf))
     {
       val[1] = FRAME_TTY (sf)->flow_control ? Qt : Qnil;
-      val[2] = FRAME_TTY (sf)->meta_key == 2
-        ? make_number (0)
-        : CURTTY ()->meta_key == 1 ? Qt : Qnil;
+      val[2] = (FRAME_TTY (sf)->meta_key == 2
+                ? make_number (0)
+                : (CURTTY ()->meta_key == 1 ? Qt : Qnil));
     }
   else
     {
--- a/src/term.c	Sun Jan 25 00:48:47 2004 +0000
+++ b/src/term.c	Sun Jan 25 01:17:40 2004 +0000
@@ -285,9 +285,7 @@
 set_terminal_window (size)
      int size;
 {
-  struct frame *f = (updating_frame
-                     ? updating_frame
-                     : XFRAME (selected_frame));
+  struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
 
   if (FRAME_DISPLAY (f)->set_terminal_window_hook)
     (*FRAME_DISPLAY (f)->set_terminal_window_hook) (size);
@@ -298,9 +296,7 @@
 void
 tty_set_terminal_window (int size)
 {
-  struct frame *f = (updating_frame
-                     ? updating_frame
-                     : XFRAME (selected_frame));
+  struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
 
   struct tty_display_info *tty = FRAME_TTY (f);
 
@@ -314,9 +310,7 @@
      int start, stop;
 {
   char *buf;
-  struct frame *f = (updating_frame
-                     ? updating_frame
-                     : XFRAME (selected_frame));
+  struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
 
   struct tty_display_info *tty = FRAME_TTY (f);
 
@@ -439,9 +433,7 @@
 cursor_to (vpos, hpos)
      int vpos, hpos;
 {
-  struct frame *f = (updating_frame
-                     ? updating_frame
-                     : XFRAME (selected_frame));
+  struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
 
   if (FRAME_DISPLAY (f)->cursor_to_hook)
     (*FRAME_DISPLAY (f)->cursor_to_hook) (vpos, hpos);
@@ -450,9 +442,7 @@
 void
 tty_cursor_to (int vpos, int hpos)
 {
-  struct frame *f = (updating_frame
-                     ? updating_frame
-                     : XFRAME (selected_frame));
+  struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
   
   struct tty_display_info *tty = FRAME_TTY (f);
 
@@ -477,9 +467,7 @@
 raw_cursor_to (row, col)
      int row, col;
 {
-  struct frame *f = (updating_frame
-                     ? updating_frame
-                     : XFRAME (selected_frame));
+  struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
 
   if (FRAME_DISPLAY (f)->raw_cursor_to_hook)
     (*FRAME_DISPLAY (f)->raw_cursor_to_hook) (row, col);  
@@ -488,9 +476,7 @@
 void
 tty_raw_cursor_to (int row, int col)
 {
-  struct frame *f = (updating_frame
-                     ? updating_frame
-                     : XFRAME (selected_frame));
+  struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
 
   struct tty_display_info *tty = FRAME_TTY (f);
 
@@ -510,9 +496,7 @@
 void
 clear_to_end ()
 {
-  struct frame *f = (updating_frame
-                     ? updating_frame
-                     : XFRAME (selected_frame));
+  struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
 
   if (FRAME_DISPLAY (f)->clear_to_end_hook)
     (*FRAME_DISPLAY (f)->clear_to_end_hook) ();
@@ -524,9 +508,7 @@
 tty_clear_to_end (void)
 {
   register int i;
-  struct frame *f = (updating_frame
-                     ? updating_frame
-                     : XFRAME (selected_frame));
+  struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
   struct tty_display_info *tty = FRAME_TTY (f);
 
   if (tty->TS_clr_to_bottom)
@@ -560,9 +542,7 @@
 void
 tty_clear_frame ()
 {
-  struct frame *f = (updating_frame
-                     ? updating_frame
-                     : XFRAME (selected_frame));
+  struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
 
   struct tty_display_info *tty = FRAME_TTY (f);
 
@@ -588,9 +568,7 @@
 clear_end_of_line (first_unused_hpos)
      int first_unused_hpos;
 {
-  struct frame *f = (updating_frame
-                     ? updating_frame
-                     : XFRAME (selected_frame));
+  struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
 
   if (FRAME_DISPLAY (f)->clear_end_of_line_hook)
     (*FRAME_DISPLAY (f)->clear_end_of_line_hook) (first_unused_hpos);
@@ -604,9 +582,7 @@
 tty_clear_end_of_line (int first_unused_hpos)
 {
   register int i;
-  struct frame *f = (updating_frame
-                     ? updating_frame
-                     : XFRAME (selected_frame));
+  struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
   struct tty_display_info *tty = FRAME_TTY (f);
 
   /* Detect the case where we are called from reset_sys_modes
@@ -758,9 +734,7 @@
      register struct glyph *string;
      register int len;
 {
-  struct frame *f = (updating_frame
-                     ? updating_frame
-                     : XFRAME (selected_frame));
+  struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
 
   if (FRAME_DISPLAY (f)->write_glyphs_hook)
     (*FRAME_DISPLAY (f)->write_glyphs_hook) (string, len);
@@ -775,9 +749,7 @@
   unsigned char conversion_buffer[1024];
   int conversion_buffer_size = sizeof conversion_buffer;
 
-  struct frame *f = (updating_frame
-                     ? updating_frame
-                     : XFRAME (selected_frame));
+  struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
 
   struct tty_display_info *tty = FRAME_TTY (f);
 
@@ -872,9 +844,7 @@
      register struct glyph *start;
      register int len;
 {
-  struct frame *f = (updating_frame
-                     ? updating_frame
-                     : XFRAME (selected_frame));
+  struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
 
   if (len <= 0)
     return;
@@ -890,9 +860,7 @@
 {
   char *buf;
   struct glyph *glyph = NULL;
-  struct frame *f = (updating_frame
-                     ? updating_frame
-                     : XFRAME (selected_frame));
+  struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
 
   struct tty_display_info *tty = FRAME_TTY (f);
 
@@ -974,9 +942,7 @@
 delete_glyphs (n)
      register int n;
 {
-  struct frame *f = (updating_frame
-                     ? updating_frame
-                     : XFRAME (selected_frame));
+  struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
 
   if (FRAME_DISPLAY (f)->delete_glyphs_hook)
     (*FRAME_DISPLAY (f)->delete_glyphs_hook) (n);
@@ -989,9 +955,7 @@
 {
   char *buf;
   register int i;
-  struct frame *f = (updating_frame
-                     ? updating_frame
-                     : XFRAME (selected_frame));
+  struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
 
   struct tty_display_info *tty = FRAME_TTY (f);
 
@@ -1024,9 +988,7 @@
 ins_del_lines (vpos, n)
      int vpos, n;
 {
-  struct frame *f = (updating_frame
-                     ? updating_frame
-                     : XFRAME (selected_frame));
+  struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
   
   if (FRAME_DISPLAY (f)->ins_del_lines_hook)
     (*FRAME_DISPLAY (f)->ins_del_lines_hook) (vpos, n);
@@ -1037,9 +999,7 @@
 void
 tty_ins_del_lines (int vpos, int n)
 {
-  struct frame *f = (updating_frame
-                     ? updating_frame
-                     : XFRAME (selected_frame));
+  struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
 
   struct tty_display_info *tty = FRAME_TTY (f);
   char *multi = n > 0 ? tty->TS_ins_multi_lines : tty->TS_del_multi_lines;
--- a/src/termchar.h	Sun Jan 25 00:48:47 2004 +0000
+++ b/src/termchar.h	Sun Jan 25 01:17:40 2004 +0000
@@ -63,7 +63,6 @@
 
   /* Redisplay. */
 
-  /* XXX GC does not know about this; is this a problem? */
   Lisp_Object top_frame;        /* The topmost frame on this tty. */
   
   /* The previous terminal frame we displayed on this tty.  */