Removed %T in mode-line-format. Trivial documentation changes.
authorKaroly Lorentey <lorentey@elte.hu>
Sun, 25 Jan 2004 00:43:38 +0000 (00:43 +0000)
committerKaroly Lorentey <lorentey@elte.hu>
Sun, 25 Jan 2004 00:43:38 +0000 (00:43 +0000)
lisp/bindings.el (mode-line-buffer-identification): Use the
conditional formatting feature instead of builtin support.

src/buffer.c (Vmode_line_format): Removed %T documentation.

src/xdisp.c (decode_mode_spec): Removed %T processing.

lib-src/emacsclient.c (pass_signal_to_emacs, init_signals): Added
comment.

src/cm.c: Cosmetic changes.
src/termchar.h: Ditto.

src/keyboard.c (interrupt_signal, handle_interrupt): Updated
documentation.

src/process.c (add_keyboard_wait_descriptor): Added docs.

src/sysdep.c (init_all_sys_modes, init_sys_modes)
(reset_all_sys_modes): Added docs.

src/term.c (tty_ring_bell, tty_set_terminal_modes)
(tty_reset_terminal_modes, tty_update_end, set_terminal_window)
(tty_set_terminal_window, clear_to_end, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, write_glyphs)
(tty_write_glyphs, insert_glyphs, tty_insert_glyphs, delete_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, get_named_tty_display)
(init_initial_display, delete_tty): Added docs.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-65

lib-src/emacsclient.c
lisp/bindings.el
lisp/loadup.el
src/buffer.c
src/cm.c
src/keyboard.c
src/process.c
src/sysdep.c
src/term.c
src/termchar.h
src/xdisp.c

index 6cf07d3..9ab9dc3 100644 (file)
@@ -282,6 +282,9 @@ char _sobuf[BUFSIZ];
 #endif
 #endif
 
+/* A signal handler that passes the signal to the Emacs process.
+   Useful for SIGWINCH.  */
+
 SIGTYPE
 pass_signal_to_emacs (int signalnum)
 {
@@ -294,6 +297,8 @@ pass_signal_to_emacs (int signalnum)
   errno = old_errno;
 }
 
+/* Set up signal handlers before opening a frame on the current tty.  */
+   
 void
 init_signals (void)
 {
index ee3a23c..280ca02 100644 (file)
@@ -214,7 +214,7 @@ Major modes that edit things other than ordinary files may change this
 
 (make-variable-buffer-local 'mode-line-buffer-identification)
 
-(defvar mode-line-frame-identification '("-%T  ")
+(defvar mode-line-frame-identification '(window-system "  " "-%F  ")
   "Mode-line control to describe the current frame.")
 
 (defvar mode-line-process nil "\
index c64df54..07ed6e8 100644 (file)
       (load "emacs-lisp/float-sup")))
 (message "%s" (garbage-collect))
 
+;; Load auxiliary settings for X displays if we support them.
 (when (fboundp 'x-create-frame)
   (load "mouse")
   (load "international/fontset")
index d14db61..fa5a9c8 100644 (file)
@@ -5372,7 +5372,7 @@ A string is printed verbatim in the mode line except for %-constructs:
   (%-constructs are allowed when the string is the entire mode-line-format
    or when it is found in a cons-cell or a list)
   %b -- print buffer name.      %f -- print visited file name.
-  %F -- print frame name.       %T -- print frame name if on tty.
+  %F -- print frame name.
   %* -- print %, * or hyphen.   %+ -- print *, % or hyphen.
        %& is like %*, but ignore read-only-ness.
        % means buffer is read-only and * means it is modified.
index 9073813..24c5ecb 100644 (file)
--- a/src/cm.c
+++ b/src/cm.c
@@ -23,10 +23,8 @@ Boston, MA 02111-1307, USA.  */
 #include <config.h>
 #include <stdio.h>
 
-/* For CURTTY */
 #include "lisp.h"
 #include "frame.h"
-
 #include "cm.h"
 #include "termhooks.h"
 #include "termchar.h"
@@ -48,7 +46,6 @@ extern char *tgoto P_ ((const char *, int, int));
 
 extern char *BC, *UP;
 
-
 int cost;              /* sums up costs */
 
 /* ARGSUSED */
index dae54ad..b6f1dfa 100644 (file)
@@ -10231,20 +10231,11 @@ clear_waiting_for_input ()
   input_available_clear_time = 0;
 }
 
-/* This routine is called at interrupt level in response to C-g.
-
-   If interrupt_input, this is the handler for SIGINT.  Otherwise, it
-   is called from kbd_buffer_store_event, in handling SIGIO or
-   SIGTINT.
-
-   If `waiting_for_input' is non zero, then unless `echoing' is
-   nonzero, immediately throw back to read_char.
-
-   Otherwise it sets the Lisp variable quit-flag not-nil.  This causes
-   eval to throw, when it gets a chance.  If quit-flag is already
-   non-nil, it stops the job right away.
+/* The SIGINT handler.
 
-   XXX This comment needs to be updated.  */
+   If we have a frame on the controlling tty, the SIGINT was generated
+   by C-g, so we call handle_interrupt.  Otherwise, the handler kills
+   Emacs.  */
 
 static SIGTYPE
 interrupt_signal (signalnum)   /* If we don't have an argument, */
@@ -10280,15 +10271,22 @@ interrupt_signal (signalnum)  /* If we don't have an argument, */
       internal_last_event_frame = display->display_info.tty->top_frame;
 
       handle_interrupt ();
-
     }
 
   errno = old_errno;
 }
 
-/* C-g processing, signal independent code.
+/* This routine is called at interrupt level in response to C-g.
+   
+   It is called from the SIGINT handler or kbd_buffer_store_event.
+
+   If `waiting_for_input' is non zero, then unless `echoing' is
+   nonzero, immediately throw back to read_char.
+
+   Otherwise it sets the Lisp variable quit-flag not-nil.  This causes
+   eval to throw, when it gets a chance.  If quit-flag is already
+   non-nil, it stops the job right away. */
 
-   XXX Expand this comment.  */
 static void
 handle_interrupt ()
 {
index 22f4824..2114d33 100644 (file)
@@ -6544,6 +6544,8 @@ DEFUN ("process-filter-multibyte-p", Fprocess_filter_multibyte_p,
 
 
 \f
+/* Add DESC to the set of keyboard input descriptors.  */
+
 void
 add_keyboard_wait_descriptor (desc)
      int desc;
index d57fe14..d8422b8 100644 (file)
@@ -1322,6 +1322,9 @@ static struct ltchars new_ltchars = {-1,-1,-1,-1,-1,-1};
 static struct tchars new_tchars = {-1,-1,-1,-1,-1,-1};
 #endif
 
+/* Initialize the terminal mode on all tty devices that are currently
+   open. */
+
 void
 init_all_sys_modes (void)
 {
@@ -1330,6 +1333,8 @@ init_all_sys_modes (void)
     init_sys_modes (tty);
 }
 
+/* Initialize the terminal mode on the given tty device. */
+
 void
 init_sys_modes (tty_out)
      struct tty_display_info *tty_out;
@@ -1833,6 +1838,9 @@ set_window_size (fd, height, width)
 }
 
 \f
+
+/* Prepare all terminal devices for exiting Emacs. */
+
 void
 reset_all_sys_modes (void)
 {
@@ -1843,6 +1851,7 @@ reset_all_sys_modes (void)
 
 /* Prepare the terminal for closing it; move the cursor to the
    bottom of the frame, turn off interrupt-driven I/O, etc.  */
+
 void
 reset_sys_modes (tty_out)
      struct tty_display_info *tty_out;
@@ -1854,11 +1863,27 @@ reset_sys_modes (tty_out)
     }
   if (!tty_out->term_initted)
     return;
-  
+
+  /* Go to and clear the last line of the terminal. */
+
   cmgoto (tty_out, FrameRows (tty_out) - 1, 0);
-#if 0  /* XXX This doesn't work anymore, the signature has changed. */
-  tty_clear_end_of_line (tty_out, FrameCols (tty_out));
-#endif
+
+  /* Code adapted from tty_clear_end_of_line. */
+  if (tty_out->TS_clr_line)
+    {
+      emacs_tputs (tty_out, tty_out->TS_clr_line, 1, cmputc);
+    }
+  else
+    {                  /* have to do it the hard way */
+      int i;
+      turn_off_insert (tty_out);
+
+      for (i = curX (tty_out); i < FrameCols (tty_out) - 1; i++)
+       {
+         fputc (' ', TTY_OUTPUT (tty_out));
+       }
+    }
+
   cmgoto (tty_out, FrameRows (tty_out) - 1, 0);
   fflush (tty_out->output);
   
index f63c6c6..65b6c15 100644 (file)
@@ -201,6 +201,8 @@ ring_bell ()
     (*FRAME_DISPLAY (f)->ring_bell_hook) ();
 }
 
+/* Ring the bell on a tty. */
+
 void
 tty_ring_bell ()
 {
@@ -212,7 +214,10 @@ tty_ring_bell ()
                 : tty->TS_bell));
 }
 
-void tty_set_terminal_modes (struct display *display)
+/* Set up termcap modes for Emacs. */
+
+void
+tty_set_terminal_modes (struct display *display)
 {
   struct tty_display_info *tty = display->display_info.tty;
   
@@ -222,7 +227,10 @@ void tty_set_terminal_modes (struct display *display)
   losecursor (tty);
 }
 
-void tty_reset_terminal_modes (struct display *display)
+/* Reset termcap modes before exiting Emacs. */
+
+void
+tty_reset_terminal_modes (struct display *display)
 {
   struct tty_display_info *tty = display->display_info.tty;
   
@@ -255,6 +263,8 @@ update_end (f)
   updating_frame = NULL;
 }
 
+/* Flag the end of a display update on a termcap display. */
+
 void
 tty_update_end (struct frame *f)
 {
@@ -266,6 +276,11 @@ tty_update_end (struct frame *f)
   background_highlight (tty);
 }
 
+/* Specify how many text lines, from the top of the window,
+   should be affected by insert-lines and delete-lines operations.
+   This, and those operations, are used only within an update
+   that is bounded by calls to update_begin and update_end.  */
+
 void
 set_terminal_window (size)
      int size;
@@ -278,6 +293,8 @@ set_terminal_window (size)
     (*FRAME_DISPLAY (f)->set_terminal_window_hook) (size);
 }
 
+/* The implementation of set_terminal_window for termcap frames. */
+
 void
 tty_set_terminal_window (int size)
 {
@@ -489,7 +506,7 @@ tty_raw_cursor_to (int row, int col)
 \f
 /* Erase operations */
 
-/* clear from cursor to end of frame */
+/* Clear from cursor to end of frame. */
 void
 clear_to_end ()
 {
@@ -501,6 +518,8 @@ clear_to_end ()
     (*FRAME_DISPLAY (f)->clear_to_end_hook) ();
 }
 
+/* Clear from cursor to end of frame on a termcap device. */
+
 void
 tty_clear_to_end (void)
 {
@@ -536,6 +555,8 @@ clear_frame ()
     (*FRAME_DISPLAY (f)->clear_frame_hook) ();
 }
 
+/* Clear an entire termcap frame. */
+
 void
 tty_clear_frame ()
 {
@@ -575,6 +596,10 @@ clear_end_of_line (first_unused_hpos)
     (*FRAME_DISPLAY (f)->clear_end_of_line_hook) (first_unused_hpos);
 }
 
+/* An implementation of clear_end_of_line for termcap frames.
+
+   Note that the cursor may be moved, on terminals lacking a `ce' string.  */
+
 void
 tty_clear_end_of_line (int first_unused_hpos)
 {
@@ -725,6 +750,9 @@ encode_terminal_code (src, dst, src_len, dst_len, consumed)
 }
 
 
+/* Output LEN glyphs starting at STRING at the nominal cursor position.
+   Advance the nominal cursor over the text.  */
+
 void
 write_glyphs (string, len)
      register struct glyph *string;
@@ -738,6 +766,8 @@ write_glyphs (string, len)
     (*FRAME_DISPLAY (f)->write_glyphs_hook) (string, len);
 }
 
+/* An implementation of write_glyphs for termcap frames. */
+
 void
 tty_write_glyphs (struct glyph *string, int len)
 {
@@ -833,7 +863,9 @@ tty_write_glyphs (struct glyph *string, int len)
   cmcheckmagic (tty);
 }
 
-/* If start is zero, insert blanks instead of a string at start */
+/* Insert LEN glyphs from START at the nominal cursor position.
+
+   If start is zero, insert blanks instead of a string at start */
 
 void
 insert_glyphs (start, len)
@@ -851,6 +883,8 @@ insert_glyphs (start, len)
     (*FRAME_DISPLAY (f)->insert_glyphs_hook) (start, len);
 }
 
+/* An implementation of insert_glyphs for termcap frames. */
+
 void
 tty_insert_glyphs (struct glyph *start, int len)
 {
@@ -934,6 +968,8 @@ tty_insert_glyphs (struct glyph *start, int len)
   cmcheckmagic (tty);
 }
 
+/* Delete N glyphs at the nominal cursor position. */
+
 void
 delete_glyphs (n)
      register int n;
@@ -946,6 +982,8 @@ delete_glyphs (n)
     (*FRAME_DISPLAY (f)->delete_glyphs_hook) (n);
 }
 
+/* An implementation of delete_glyphs for termcap frames. */
+
 void
 tty_delete_glyphs (int n)
 {
@@ -994,6 +1032,8 @@ ins_del_lines (vpos, n)
     (*FRAME_DISPLAY (f)->ins_del_lines_hook) (vpos, n);
 }
 
+/* An implementation of ins_del_lines for termcap frames. */
+
 void
 tty_ins_del_lines (int vpos, int n)
 {
@@ -2082,6 +2122,11 @@ set_tty_color_mode (f, val)
 
 \f
 
+/* Return the termcap display with the given name.  If NAME is null,
+   return the display corresponding to our controlling terminal.
+
+   Returns NULL if the named terminal device is not opened.  */
 struct display *
 get_named_tty_display (name)
      char *name;
@@ -2159,8 +2204,8 @@ DEFUN ("frame-tty-type", Fframe_tty_type, Sframe_tty_type, 0, 1, 0,
  ***********************************************************************/
 
 /* Create the bootstrap display device for the initial frame.
+   Returns a display of type output_initial. */
 
-Returns a display of type output_initial. */
 struct display *
 init_initial_display (void)
 {
@@ -2180,6 +2225,7 @@ init_initial_display (void)
 
 /* Deletes the bootstrap display device.
    Called through delete_display_hook. */
+
 void
 delete_initial_display (struct display *display)
 {
@@ -2200,6 +2246,7 @@ delete_initial_display (struct display *display)
    TERMINAL_TYPE is the termcap type of the device, e.g. "vt100".
 
    If MUST_SUCCEED is true, then all errors are fatal. */
+
 struct display *
 term_init (char *name, char *terminal_type, int must_succeed)
 {
@@ -2734,8 +2781,8 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.",
 
 /* Auxiliary error-handling function for term_init.
    Free BUFFER and delete DISPLAY, then call error or fatal
-   with str1 or str2, respectively, according to MUST_SUCCEED.
-*/
+   with str1 or str2, respectively, according to MUST_SUCCEED.  */
+
 static void
 maybe_fatal (must_succeed, buffer, display, str1, str2, arg1, arg2)
      int must_succeed;
@@ -2802,6 +2849,9 @@ tty.  The functions are run with one arg, the frame to be deleted.  */)
 
 static int deleting_tty = 0;
 
+
+/* Delete the given terminal device, closing all frames on it. */
+
 void
 delete_tty (struct display *display)
 {
@@ -2904,6 +2954,7 @@ delete_tty (struct display *display)
 
 /* Initialize the tty-dependent part of frame F.  The frame must
    already have its display initialized. */
+
 void
 create_tty_output (struct frame *f)
 {
@@ -2921,6 +2972,7 @@ create_tty_output (struct frame *f)
 }
 
 /* Delete the tty-dependent part of frame F. */
+
 void
 delete_tty_output (struct frame *f)
 {
@@ -2935,6 +2987,7 @@ delete_tty_output (struct frame *f)
 
 /* Mark the pointers in the tty_display_info objects.
    Called by the Fgarbage_collector.  */
+
 void
 mark_ttys ()
 {
@@ -2950,6 +3003,7 @@ mark_ttys ()
 \f
 
 /* Create a new display object and add it to the display list. */
+
 struct display *
 create_display (void)
 {
@@ -2963,6 +3017,7 @@ create_display (void)
 }
 
 /* Remove a display from the display list and free its memory. */
+
 void
 delete_display (struct display *dev)
 {
index ff5bd7b..e9efbc2 100644 (file)
@@ -21,6 +21,7 @@ Boston, MA 02111-1307, USA.  */
 /* Each termcap frame points to its own struct tty_output object in
    the output_data.tty field.  The tty_output structure contains the
    information that is specific to termcap frames. */
+
 struct tty_output
 {
   /* The Emacs structure for the tty device this frame is on. */
@@ -30,6 +31,7 @@ struct tty_output
 };
 
 /* Parameters that are shared between frames on the same tty device. */
+
 struct tty_display_info
 {
   struct tty_display_info *next; /* Chain of all tty devices. */
index 4b49472..0e678b3 100644 (file)
@@ -16675,14 +16675,6 @@ decode_mode_spec (w, c, field_width, precision, multibyte)
       return "T";
 #endif
 
-    case 'T':
-      /* %T is the frame name on a termcap frame, the empty string otherwise. */
-      if (! FRAME_TERMCAP_P (f))
-        return "";
-      if (!NILP (f->title))
-       return (char *) SDATA (f->title);
-      return (char *) SDATA (f->name);
-
     case 'z':
       /* coding-system (not including end-of-line format) */
     case 'Z':