Mercurial > hg > xemacs-beta
annotate src/console-tty.c @ 5492:e82f5b7010fe
Merge some stuff in man, fix up Makefile
-------------------- ChangeLog entries follow: --------------------
man/ChangeLog addition:
2010-02-19 Ben Wing <ben@xemacs.org>
* widget.texi:
* widget.texi (Top):
* widget.texi (Introduction):
* widget.texi (User Interface):
* widget.texi (Programming Example):
* widget.texi (Setting Up the Buffer):
* widget.texi (Basic Types):
* widget.texi (link):
* widget.texi (url-link):
* widget.texi (info-link):
* widget.texi (push-button):
* widget.texi (editable-field):
* widget.texi (text):
* widget.texi (menu-choice):
* widget.texi (radio-button-choice):
* widget.texi (item):
* widget.texi (choice-item):
* widget.texi (toggle):
* widget.texi (checkbox):
* widget.texi (checklist):
* widget.texi (editable-list):
* widget.texi (group):
* widget.texi (Sexp Types):
* widget.texi (constants):
* widget.texi (generic):
* widget.texi (atoms):
* widget.texi (composite):
* widget.texi (Widget Properties):
* widget.texi (Defining New Widgets):
* widget.texi (Widget Browser):
* widget.texi (Widget Minor Mode):
* widget.texi (Utilities):
* widget.texi (Widget Wishlist):
* widget.texi (Widget Internals):
* widget.texi (GNU Free Documentation License):
* widget.texi (Index):
Sync with FSF 23.1.92.
2010-02-19 Ben Wing <ben@xemacs.org>
* texinfo/fdl.texi: New file.
* texinfo/texinfo.texi:
* texinfo/texinfo.texi (Top):
* texinfo/texinfo.texi (Copying Conditions):
* texinfo/texinfo.texi (Overview):
* texinfo/texinfo.texi (Reporting Bugs):
* texinfo/texinfo.texi (Using Texinfo):
* texinfo/texinfo.texi (Output Formats):
* texinfo/texinfo.texi (Info Files):
* texinfo/texinfo.texi (Printed Books):
* texinfo/texinfo.texi (Formatting Commands):
* texinfo/texinfo.texi (Conventions):
* texinfo/texinfo.texi (Comments):
* texinfo/texinfo.texi (Minimum):
* texinfo/texinfo.texi (Six Parts):
* texinfo/texinfo.texi (Short Sample):
* texinfo/texinfo.texi (History):
* texinfo/texinfo.texi (Texinfo Mode):
* texinfo/texinfo.texi (Texinfo Mode Overview):
* texinfo/texinfo.texi (XEmacs Editing):
* texinfo/texinfo.texi (Inserting):
* texinfo/texinfo.texi (Showing the Structure):
* texinfo/texinfo.texi (Updating Nodes and Menus):
* texinfo/texinfo.texi (Updating Commands):
* texinfo/texinfo.texi (Updating Requirements):
* texinfo/texinfo.texi (Other Updating Commands):
* texinfo/texinfo.texi (Info Formatting):
* texinfo/texinfo.texi (Printing):
* texinfo/texinfo.texi (Texinfo Mode Summary):
* texinfo/texinfo.texi (Beginning a File):
* texinfo/texinfo.texi (Sample Beginning):
* texinfo/texinfo.texi (Texinfo File Header):
* texinfo/texinfo.texi (First Line):
* texinfo/texinfo.texi (Start of Header):
* texinfo/texinfo.texi (setfilename):
* texinfo/texinfo.texi (settitle):
* texinfo/texinfo.texi (End of Header):
* texinfo/texinfo.texi (Document Permissions):
* texinfo/texinfo.texi (copying):
* texinfo/texinfo.texi (insertcopying):
* texinfo/texinfo.texi (Titlepage & Copyright Page):
* texinfo/texinfo.texi (titlepage):
* texinfo/texinfo.texi (titlefont center sp):
* texinfo/texinfo.texi (title subtitle author):
* texinfo/texinfo.texi (Copyright):
* texinfo/texinfo.texi (end titlepage):
* texinfo/texinfo.texi (headings on off):
* texinfo/texinfo.texi (Contents):
* texinfo/texinfo.texi (The Top Node):
* texinfo/texinfo.texi (Top Node Example):
* texinfo/texinfo.texi (Master Menu Parts):
* texinfo/texinfo.texi (Global Document Commands):
* texinfo/texinfo.texi (documentdescription):
* texinfo/texinfo.texi (setchapternewpage):
* texinfo/texinfo.texi (paragraphindent):
* texinfo/texinfo.texi (firstparagraphindent):
* texinfo/texinfo.texi (exampleindent):
* texinfo/texinfo.texi (Software Copying Permissions):
* texinfo/texinfo.texi (Ending a File):
* texinfo/texinfo.texi (Printing Indices & Menus):
* texinfo/texinfo.texi (File End):
* texinfo/texinfo.texi (Structuring):
* texinfo/texinfo.texi (Tree Structuring):
* texinfo/texinfo.texi (Structuring Command Types):
* texinfo/texinfo.texi (makeinfo top):
* texinfo/texinfo.texi (chapter):
* texinfo/texinfo.texi (unnumbered & appendix):
* texinfo/texinfo.texi (majorheading & chapheading):
* texinfo/texinfo.texi (section):
* texinfo/texinfo.texi (unnumberedsec appendixsec heading):
* texinfo/texinfo.texi (subsection):
* texinfo/texinfo.texi (unnumberedsubsec appendixsubsec subheading):
* texinfo/texinfo.texi (subsubsection):
* texinfo/texinfo.texi (Raise/lower sections):
* texinfo/texinfo.texi (Nodes):
* texinfo/texinfo.texi (Two Paths):
* texinfo/texinfo.texi (Node Menu Illustration):
* texinfo/texinfo.texi (node):
* texinfo/texinfo.texi (Node Names):
* texinfo/texinfo.texi (Writing a Node):
* texinfo/texinfo.texi (Node Line Tips):
* texinfo/texinfo.texi (Node Line Requirements):
* texinfo/texinfo.texi (First Node):
* texinfo/texinfo.texi (makeinfo top command):
* texinfo/texinfo.texi (makeinfo Pointer Creation):
* texinfo/texinfo.texi (anchor):
* texinfo/texinfo.texi (Menus):
* texinfo/texinfo.texi (Menu Location):
* texinfo/texinfo.texi (Writing a Menu):
* texinfo/texinfo.texi (Menu Parts):
* texinfo/texinfo.texi (Less Cluttered Menu Entry):
* texinfo/texinfo.texi (Menu Example):
* texinfo/texinfo.texi (Other Info Files):
* texinfo/texinfo.texi (Cross References):
* texinfo/texinfo.texi (References):
* texinfo/texinfo.texi (Cross Reference Commands):
* texinfo/texinfo.texi (Cross Reference Parts):
* texinfo/texinfo.texi (xref):
* texinfo/texinfo.texi (Reference Syntax):
* texinfo/texinfo.texi (One Argument):
* texinfo/texinfo.texi (Two Arguments):
* texinfo/texinfo.texi (Three Arguments):
* texinfo/texinfo.texi (Four and Five Arguments):
* texinfo/texinfo.texi (Top Node Naming):
* texinfo/texinfo.texi (ref):
* texinfo/texinfo.texi (pxref):
* texinfo/texinfo.texi (inforef):
* texinfo/texinfo.texi (uref):
* texinfo/texinfo.texi (cite):
* texinfo/texinfo.texi (Marking Text):
* texinfo/texinfo.texi (Indicating):
* texinfo/texinfo.texi (Useful Highlighting):
* texinfo/texinfo.texi (code):
* texinfo/texinfo.texi (kbd):
* texinfo/texinfo.texi (key):
* texinfo/texinfo.texi (samp):
* texinfo/texinfo.texi (verb):
* texinfo/texinfo.texi (var):
* texinfo/texinfo.texi (env):
* texinfo/texinfo.texi (file):
* texinfo/texinfo.texi (command):
* texinfo/texinfo.texi (option):
* texinfo/texinfo.texi (dfn):
* texinfo/texinfo.texi (abbr):
* texinfo/texinfo.texi (acronym):
* texinfo/texinfo.texi (indicateurl):
* texinfo/texinfo.texi (email):
* texinfo/texinfo.texi (Emphasis):
* texinfo/texinfo.texi (emph & strong):
* texinfo/texinfo.texi (Smallcaps):
* texinfo/texinfo.texi (Fonts):
* texinfo/texinfo.texi (Quotations and Examples):
* texinfo/texinfo.texi (Block Enclosing Commands):
* texinfo/texinfo.texi (quotation):
* texinfo/texinfo.texi (example):
* texinfo/texinfo.texi (verbatim):
* texinfo/texinfo.texi (verbatiminclude):
* texinfo/texinfo.texi (lisp):
* texinfo/texinfo.texi (small):
* texinfo/texinfo.texi (display):
* texinfo/texinfo.texi (format):
* texinfo/texinfo.texi (exdent):
* texinfo/texinfo.texi (flushleft & flushright):
* texinfo/texinfo.texi (noindent):
* texinfo/texinfo.texi (indent):
* texinfo/texinfo.texi (cartouche):
* texinfo/texinfo.texi (Lists and Tables):
* texinfo/texinfo.texi (Introducing Lists):
* texinfo/texinfo.texi (itemize):
* texinfo/texinfo.texi (enumerate):
* texinfo/texinfo.texi (Two-column Tables):
* texinfo/texinfo.texi (table):
* texinfo/texinfo.texi (ftable vtable):
* texinfo/texinfo.texi (itemx):
* texinfo/texinfo.texi (Multi-column Tables):
* texinfo/texinfo.texi (Multitable Column Widths):
* texinfo/texinfo.texi (Multitable Rows):
* texinfo/texinfo.texi (Special Displays):
* texinfo/texinfo.texi (Floats):
* texinfo/texinfo.texi (float):
* texinfo/texinfo.texi (caption shortcaption):
* texinfo/texinfo.texi (listoffloats):
* texinfo/texinfo.texi (Images):
* texinfo/texinfo.texi (Image Syntax):
* texinfo/texinfo.texi (Image Scaling):
* texinfo/texinfo.texi (Footnotes):
* texinfo/texinfo.texi (Footnote Commands):
* texinfo/texinfo.texi (Footnote Styles):
* texinfo/texinfo.texi (Indices):
* texinfo/texinfo.texi (Index Entries):
* texinfo/texinfo.texi (Predefined Indices):
* texinfo/texinfo.texi (Indexing Commands):
* texinfo/texinfo.texi (Combining Indices):
* texinfo/texinfo.texi (syncodeindex):
* texinfo/texinfo.texi (synindex):
* texinfo/texinfo.texi (New Indices):
* texinfo/texinfo.texi (Insertions):
* texinfo/texinfo.texi (Atsign Braces Comma):
* texinfo/texinfo.texi (Inserting an Atsign):
* texinfo/texinfo.texi (Inserting Braces):
* texinfo/texinfo.texi (Inserting a Comma):
* texinfo/texinfo.texi (Inserting Quote Characters):
* texinfo/texinfo.texi (Inserting Space):
* texinfo/texinfo.texi (Not Ending a Sentence):
* texinfo/texinfo.texi (Ending a Sentence):
* texinfo/texinfo.texi (Multiple Spaces):
* texinfo/texinfo.texi (frenchspacing):
* texinfo/texinfo.texi (dmn):
* texinfo/texinfo.texi (Inserting Accents):
* texinfo/texinfo.texi (Inserting Quotation Marks):
* texinfo/texinfo.texi (Dots Bullets):
* texinfo/texinfo.texi (dots):
* texinfo/texinfo.texi (bullet):
* texinfo/texinfo.texi (TeX and copyright):
* texinfo/texinfo.texi (tex):
* texinfo/texinfo.texi (copyright symbol):
* texinfo/texinfo.texi (registered symbol):
* texinfo/texinfo.texi (euro):
* texinfo/texinfo.texi (pounds):
* texinfo/texinfo.texi (textdegree):
* texinfo/texinfo.texi (minus):
* texinfo/texinfo.texi (geq leq):
* texinfo/texinfo.texi (math):
* texinfo/texinfo.texi (Click Sequences):
* texinfo/texinfo.texi (Glyphs):
* texinfo/texinfo.texi (Glyphs Summary):
* texinfo/texinfo.texi (result):
* texinfo/texinfo.texi (expansion):
* texinfo/texinfo.texi (Print Glyph):
* texinfo/texinfo.texi (Error Glyph):
* texinfo/texinfo.texi (Equivalence):
* texinfo/texinfo.texi (Point Glyph):
* texinfo/texinfo.texi (Breaks):
* texinfo/texinfo.texi (Break Commands):
* texinfo/texinfo.texi (Line Breaks):
* texinfo/texinfo.texi (- and hyphenation):
* texinfo/texinfo.texi (allowcodebreaks):
* texinfo/texinfo.texi (w):
* texinfo/texinfo.texi (tie):
* texinfo/texinfo.texi (sp):
* texinfo/texinfo.texi (page):
* texinfo/texinfo.texi (group):
* texinfo/texinfo.texi (need):
* texinfo/texinfo.texi (Definition Commands):
* texinfo/texinfo.texi (Def Cmd Template):
* texinfo/texinfo.texi (Def Cmd Continuation Lines):
* texinfo/texinfo.texi (Optional Arguments):
* texinfo/texinfo.texi (deffnx):
* texinfo/texinfo.texi (Def Cmds in Detail):
* texinfo/texinfo.texi (Functions Commands):
* texinfo/texinfo.texi (Variables Commands):
* texinfo/texinfo.texi (Typed Functions):
* texinfo/texinfo.texi (Typed Variables):
* texinfo/texinfo.texi (Data Types):
* texinfo/texinfo.texi (Abstract Objects):
* texinfo/texinfo.texi (Object-Oriented Variables):
* texinfo/texinfo.texi (Object-Oriented Methods):
* texinfo/texinfo.texi (Defining Macros):
* texinfo/texinfo.texi (Invoking Macros):
* texinfo/texinfo.texi (Macro Details):
* texinfo/texinfo.texi (alias):
* texinfo/texinfo.texi (definfoenclose):
* texinfo/texinfo.texi (Hardcopy):
* texinfo/texinfo.texi (Use TeX):
* texinfo/texinfo.texi (Format with tex/texindex):
* texinfo/texinfo.texi (Format with texi2dvi):
* texinfo/texinfo.texi (Print with lpr):
* texinfo/texinfo.texi (Within XEmacs):
* texinfo/texinfo.texi (Texinfo Mode Printing):
* texinfo/texinfo.texi (Compile-Command):
* texinfo/texinfo.texi (Requirements Summary):
* texinfo/texinfo.texi (Preparing for TeX):
* texinfo/texinfo.texi (Overfull hboxes):
* texinfo/texinfo.texi (smallbook):
* texinfo/texinfo.texi (A4 Paper):
* texinfo/texinfo.texi (pagesizes):
* texinfo/texinfo.texi (Cropmarks and Magnification):
* texinfo/texinfo.texi (PDF Output):
* texinfo/texinfo.texi (Obtaining TeX):
* texinfo/texinfo.texi (Creating and Installing Info Files):
* texinfo/texinfo.texi (Creating an Info File):
* texinfo/texinfo.texi (makeinfo advantages):
* texinfo/texinfo.texi (Invoking makeinfo):
* texinfo/texinfo.texi (makeinfo options):
* texinfo/texinfo.texi (Pointer Validation):
* texinfo/texinfo.texi (makeinfo in XEmacs):
* texinfo/texinfo.texi (texinfo-format commands):
* texinfo/texinfo.texi (Batch Formatting):
* texinfo/texinfo.texi (Tag and Split Files):
* texinfo/texinfo.texi (Installing an Info File):
* texinfo/texinfo.texi (Directory File):
* texinfo/texinfo.texi (New Info File):
* texinfo/texinfo.texi (Other Info Directories):
* texinfo/texinfo.texi (Installing Dir Entries):
* texinfo/texinfo.texi (Invoking install-info):
* texinfo/texinfo.texi (Generating HTML):
* texinfo/texinfo.texi (HTML Translation):
* texinfo/texinfo.texi (HTML Splitting):
* texinfo/texinfo.texi (HTML CSS):
* texinfo/texinfo.texi (HTML Xref):
* texinfo/texinfo.texi (HTML Xref Link Basics):
* texinfo/texinfo.texi (HTML Xref Node Name Expansion):
* texinfo/texinfo.texi (HTML Xref Command Expansion):
* texinfo/texinfo.texi (HTML Xref 8-bit Character Expansion):
* texinfo/texinfo.texi (HTML Xref Mismatch):
* texinfo/texinfo.texi (Command List):
* texinfo/texinfo.texi (Command Syntax):
* texinfo/texinfo.texi (Tips):
* texinfo/texinfo.texi (Sample Texinfo Files):
* texinfo/texinfo.texi (Short Sample Texinfo File):
* texinfo/texinfo.texi (GNU Sample Texts):
* texinfo/texinfo.texi (Invoking sample):
* texinfo/texinfo.texi (GNU Free Documentation License):
* texinfo/texinfo.texi (Index):
* texinfo/texinfo.texi (Verbatim Copying License):
* texinfo/texinfo.texi (All-permissive Copying License):
* texinfo/texinfo.texi (Include Files):
* texinfo/texinfo.texi (Using Include Files):
* texinfo/texinfo.texi (texinfo-multiple-files-update):
* texinfo/texinfo.texi (Include Files Requirements):
* texinfo/texinfo.texi (Sample Include File):
* texinfo/texinfo.texi (Include Files Evolution):
* texinfo/texinfo.texi (Headings):
* texinfo/texinfo.texi (Headings Introduced):
* texinfo/texinfo.texi (Heading Format):
* texinfo/texinfo.texi (Heading Choice):
* texinfo/texinfo.texi (Custom Headings):
* texinfo/texinfo.texi (Catching Mistakes):
* texinfo/texinfo.texi (makeinfo Preferred):
* texinfo/texinfo.texi (Debugging with Info):
* texinfo/texinfo.texi (Debugging with TeX):
* texinfo/texinfo.texi (Using texinfo-show-structure):
* texinfo/texinfo.texi (Using occur):
* texinfo/texinfo.texi (Running Info-Validate):
* texinfo/texinfo.texi (Using Info-validate):
* texinfo/texinfo.texi (Unsplit):
* texinfo/texinfo.texi (Tagifying):
* texinfo/texinfo.texi (Splitting):
* texinfo/texinfo.texi (Refilling Paragraphs):
* texinfo/texinfo.texi (Command and Variable Index):
* texinfo/texinfo.texi (General Index):
* texinfo/version.texi: New file.
Sync with FSF 23.1.92. Make new directory to hold the files needed
to generate texinfo.info, since there are three such files now.
2010-02-19 Ben Wing <ben@xemacs.org>
* Makefile:
* Makefile (src_files1):
* Makefile (DIR):
* Makefile (texinfo-srcs):
* Makefile ($(INFODIR)/widget.info):
* Makefile ($(INFODIR)/texinfo.info):
* Makefile (.PHONY):
* Makefile (texinfo.dvi):
* Makefile (texinfo.pdf):
* Makefile ($(HTMLDIR)/widget.html):
* Makefile ($(HTMLDIR)/texinfo.html):
Incorporate texinfo.texi moving to a subdirectory texinfo/.
Do some tricks to reduce the amount of duplication while still
maintaining compatible with non-GNU make (at least, with
Solaris make).
* doclicense.texi: New file.
* info.texi:
* info.texi (Top):
* info.texi (Getting Started):
* info.texi (Help-Small-Screen):
* info.texi (Help):
* info.texi (Help-P):
* info.texi (Help-^L):
* info.texi (Help-Inv):
* info.texi (Help-]):
* info.texi (Help-M):
* info.texi (Help-FOO):
* info.texi (Help-Xref):
* info.texi (Help-Int):
* info.texi (Help-Q):
* info.texi (Advanced):
* info.texi (Search Text):
* info.texi (Search Index):
* info.texi (Go to node):
* info.texi (Choose menu subtopic):
* info.texi (Create Info buffer):
* info.texi (XEmacs Info Variables):
* info.texi (Expert Info):
* info.texi (Add):
* info.texi (Menus):
* info.texi (Cross-refs):
* info.texi (Help-Cross):
* info.texi (Tags):
* info.texi (Checking):
* info.texi (Index):
* texinfo.tex:
* texinfo.tex (paragraphindent{%):
* texinfo.tex (sectionheading will have):
* texinfo.tex (chapterzzz{#3}%):
* texinfo.tex (subsubsection = \numberedsubsubsec):
* texinfo.tex (subsubsection = \appendixsubsubsec):
* texinfo.tex (subsubsection = \unnumberedsubsubsec):
* texinfo.tex (sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%):
* texinfo.tex (sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%):
* texinfo.tex (sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%):
* texinfo.tex (sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%):
* texinfo.tex (sectionheading{#1}{subsec}{Yappendix}%):
* texinfo.tex (sectionheading{#1}{subsec}{Ynothing}%):
* texinfo.tex (sectionheading{#1}{subsubsec}{Ynumbered}%):
* texinfo.tex (sectionheading{#1}{subsubsec}{Yappendix}%):
* texinfo.tex (sectionheading{#1}{subsubsec}{Ynothing}%):
* texinfo.tex (sectionheading{#1}{subsubsec}{Yomitfromtoc}{}):
* texinfo.tex (sectionheading to do the printing.):
* texinfo.tex (sectionlevel}{#1}{#4}%):
* texinfo.tex (sectionheading, q.v.):
Sync with FSF 23.1.92.
| author | Ben Wing <ben@xemacs.org> |
|---|---|
| date | Fri, 19 Feb 2010 22:39:19 -0600 |
| parents | 16112448d484 |
| children | b5df3737028a |
| rev | line source |
|---|---|
| 428 | 1 /* TTY console functions. |
| 2 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. | |
| 3 Copyright (C) 1994, 1995 Free Software Foundation, Inc. | |
| 800 | 4 Copyright (C) 1996, 2001, 2002 Ben Wing. |
| 428 | 5 |
| 6 This file is part of XEmacs. | |
| 7 | |
| 8 XEmacs is free software; you can redistribute it and/or modify it | |
| 9 under the terms of the GNU General Public License as published by the | |
| 10 Free Software Foundation; either version 2, or (at your option) any | |
| 11 later version. | |
| 12 | |
| 13 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
| 14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 16 for more details. | |
| 17 | |
| 18 You should have received a copy of the GNU General Public License | |
| 19 along with XEmacs; see the file COPYING. If not, write to | |
| 20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
| 21 Boston, MA 02111-1307, USA. */ | |
| 22 | |
| 23 /* Synched up with: Not in FSF. */ | |
| 24 | |
| 25 /* Authors: Ben Wing and Chuck Thompson. */ | |
| 26 | |
| 27 #include <config.h> | |
| 28 #include "lisp.h" | |
| 29 | |
| 872 | 30 #include "console-tty-impl.h" |
| 428 | 31 #include "console-stream.h" |
| 872 | 32 |
| 2828 | 33 #include "elhash.h" |
| 428 | 34 #include "faces.h" |
| 872 | 35 #include "file-coding.h" |
| 428 | 36 #include "frame.h" |
| 872 | 37 #include "glyphs.h" |
| 428 | 38 #include "lstream.h" |
| 872 | 39 #include "process.h" |
| 40 | |
| 428 | 41 #include "sysdep.h" |
| 42 #include "sysfile.h" | |
| 43 | |
| 44 DEFINE_CONSOLE_TYPE (tty); | |
| 45 DECLARE_IMAGE_INSTANTIATOR_FORMAT (nothing); | |
| 46 DECLARE_IMAGE_INSTANTIATOR_FORMAT (string); | |
| 47 DECLARE_IMAGE_INSTANTIATOR_FORMAT (formatted_string); | |
| 48 DECLARE_IMAGE_INSTANTIATOR_FORMAT (inherit); | |
| 49 | |
| 50 Lisp_Object Qterminal_type; | |
| 51 Lisp_Object Qcontrolling_process; | |
| 52 | |
| 2850 | 53 Lisp_Object Vtty_seen_characters; |
| 2828 | 54 |
| 1204 | 55 static const struct memory_description tty_console_data_description_1 [] = { |
| 56 { XD_LISP_OBJECT, offsetof (struct tty_console, terminal_type) }, | |
| 57 { XD_LISP_OBJECT, offsetof (struct tty_console, instream) }, | |
| 58 { XD_LISP_OBJECT, offsetof (struct tty_console, outstream) }, | |
| 59 { XD_END } | |
| 60 }; | |
| 61 | |
| 3092 | 62 #ifdef NEW_GC |
| 63 DEFINE_LRECORD_IMPLEMENTATION ("tty-console", tty_console, | |
| 64 1, /*dumpable-flag*/ | |
| 65 0, 0, 0, 0, 0, | |
| 66 tty_console_data_description_1, | |
| 67 Lisp_Tty_Console); | |
| 68 #else /* not NEW_GC */ | |
| 1204 | 69 const struct sized_memory_description tty_console_data_description = { |
| 70 sizeof (struct tty_console), tty_console_data_description_1 | |
| 71 }; | |
| 3092 | 72 #endif /* not NEW_GC */ |
| 1204 | 73 |
| 428 | 74 |
| 75 static void | |
| 76 allocate_tty_console_struct (struct console *con) | |
| 77 { | |
| 78 /* zero out all slots except the lisp ones ... */ | |
| 3092 | 79 #ifdef NEW_GC |
| 80 CONSOLE_TTY_DATA (con) = alloc_lrecord_type (struct tty_console, | |
| 81 &lrecord_tty_console); | |
| 82 #else /* not NEW_GC */ | |
| 428 | 83 CONSOLE_TTY_DATA (con) = xnew_and_zero (struct tty_console); |
| 3092 | 84 #endif /* not NEW_GC */ |
| 428 | 85 CONSOLE_TTY_DATA (con)->terminal_type = Qnil; |
| 86 CONSOLE_TTY_DATA (con)->instream = Qnil; | |
| 87 CONSOLE_TTY_DATA (con)->outstream = Qnil; | |
| 88 } | |
| 89 | |
| 90 static void | |
| 91 tty_init_console (struct console *con, Lisp_Object props) | |
| 92 { | |
| 93 Lisp_Object tty = CONSOLE_CONNECTION (con); | |
| 94 Lisp_Object terminal_type = Qnil; | |
| 95 Lisp_Object controlling_process = Qnil; | |
| 96 struct tty_console *tty_con; | |
| 97 struct gcpro gcpro1, gcpro2; | |
| 98 | |
| 99 GCPRO2 (terminal_type, controlling_process); | |
| 100 | |
| 101 terminal_type = Fplist_get (props, Qterminal_type, Qnil); | |
| 102 controlling_process = Fplist_get (props, Qcontrolling_process, Qnil); | |
| 103 | |
| 104 /* Determine the terminal type */ | |
| 105 | |
| 106 if (!NILP (terminal_type)) | |
| 107 CHECK_STRING (terminal_type); | |
| 108 else | |
| 109 { | |
| 867 | 110 Ibyte *temp_type = egetenv ("TERM"); |
| 428 | 111 |
| 112 if (!temp_type) | |
| 113 { | |
| 563 | 114 invalid_state ("Cannot determine terminal type", Qunbound); |
| 428 | 115 } |
| 116 else | |
|
4953
304aebb79cd3
function renamings to track names of char typedefs
Ben Wing <ben@xemacs.org>
parents:
4117
diff
changeset
|
117 terminal_type = build_istring (temp_type); |
| 428 | 118 } |
| 119 | |
| 120 /* Determine the controlling process */ | |
| 121 if (!NILP (controlling_process)) | |
| 122 CHECK_INT (controlling_process); | |
| 123 | |
| 124 /* Open the specified console */ | |
| 125 | |
| 126 allocate_tty_console_struct (con); | |
| 127 tty_con = CONSOLE_TTY_DATA (con); | |
| 128 | |
| 129 if (internal_equal (tty, Vstdio_str, 0)) | |
| 130 { | |
| 131 tty_con->infd = fileno (stdin); | |
| 132 tty_con->outfd = fileno (stdout); | |
| 133 tty_con->is_stdio = 1; | |
| 134 } | |
| 135 else | |
| 136 { | |
| 137 tty_con->infd = tty_con->outfd = | |
| 771 | 138 qxe_open (XSTRING_DATA (tty), O_RDWR); |
| 428 | 139 if (tty_con->infd < 0) |
| 563 | 140 signal_error (Qio_error, "Unable to open tty", tty); |
| 428 | 141 tty_con->is_stdio = 0; |
| 142 } | |
| 143 | |
| 802 | 144 /* set_descriptor_non_blocking (tty_con->infd); */ |
| 428 | 145 tty_con->instream = make_filedesc_input_stream (tty_con->infd, 0, -1, 0); |
| 771 | 146 Lstream_set_buffering (XLSTREAM (tty_con->instream), LSTREAM_UNBUFFERED, 0); |
| 428 | 147 tty_con->instream = |
| 771 | 148 make_coding_input_stream (XLSTREAM (tty_con->instream), |
| 149 get_coding_system_for_text_file (Qkeyboard, 0), | |
| 814 | 150 CODING_DECODE, |
| 151 LSTREAM_FL_READ_ONE_BYTE_AT_A_TIME); | |
| 771 | 152 Lstream_set_buffering (XLSTREAM (tty_con->instream), LSTREAM_UNBUFFERED, 0); |
| 153 tty_con->outstream = make_filedesc_output_stream (tty_con->outfd, 0, -1, 0); | |
| 428 | 154 tty_con->outstream = |
| 771 | 155 make_coding_output_stream (XLSTREAM (tty_con->outstream), |
| 156 get_coding_system_for_text_file (Qterminal, 0), | |
| 800 | 157 CODING_ENCODE, 0); |
| 428 | 158 tty_con->terminal_type = terminal_type; |
| 159 tty_con->controlling_process = controlling_process; | |
| 160 | |
| 3571 | 161 /* Defaults to 1 with Mule, 0 without. In the latter case the attribute is |
| 162 read-only from Lisp. */ | |
| 163 tty_con->multiple_width = CONSOLE_TTY_SUPPORTS_MULTIPLE_WIDTH(c); | |
| 164 | |
| 428 | 165 if (NILP (CONSOLE_NAME (con))) |
| 166 CONSOLE_NAME (con) = Ffile_name_nondirectory (tty); | |
| 167 { | |
| 442 | 168 pid_t tty_pg; |
| 169 pid_t controlling_tty_pg; | |
| 428 | 170 int cfd; |
| 171 | |
| 172 /* OK, the only sure-fire way I can think of to determine | |
| 173 whether a particular TTY is our controlling TTY is to check | |
| 174 if it has the same foreground process group as our controlling | |
| 175 TTY. This is OK because a process group can never simultaneously | |
| 176 be the foreground process group of two TTY's (in that case it | |
| 177 would have two controlling TTY's, which is not allowed). */ | |
| 178 | |
| 179 EMACS_GET_TTY_PROCESS_GROUP (tty_con->infd, &tty_pg); | |
| 867 | 180 cfd = qxe_open ((Ibyte *) "/dev/tty", O_RDWR, 0); |
| 428 | 181 EMACS_GET_TTY_PROCESS_GROUP (cfd, &controlling_tty_pg); |
| 771 | 182 retry_close (cfd); |
| 428 | 183 if (tty_pg == controlling_tty_pg) |
| 184 { | |
| 185 tty_con->controlling_terminal = 1; | |
| 793 | 186 Vcontrolling_terminal = wrap_console (con); |
| 428 | 187 munge_tty_process_group (); |
| 188 } | |
| 189 else | |
| 190 tty_con->controlling_terminal = 0; | |
| 191 } | |
| 192 | |
| 193 UNGCPRO; | |
| 194 } | |
| 195 | |
| 196 static void | |
| 197 tty_mark_console (struct console *con) | |
| 198 { | |
| 199 struct tty_console *tty_con = CONSOLE_TTY_DATA (con); | |
| 200 mark_object (tty_con->terminal_type); | |
| 201 mark_object (tty_con->instream); | |
| 202 mark_object (tty_con->outstream); | |
| 203 } | |
| 204 | |
| 205 static int | |
| 2286 | 206 tty_initially_selected_for_input (struct console *UNUSED (con)) |
| 428 | 207 { |
| 208 return 1; | |
| 209 } | |
| 210 | |
| 211 static void | |
| 212 free_tty_console_struct (struct console *con) | |
| 213 { | |
| 214 struct tty_console *tty_con = CONSOLE_TTY_DATA (con); | |
| 215 if (tty_con) | |
| 216 { | |
| 217 if (tty_con->term_entry_buffer) /* allocated in term_init () */ | |
| 218 { | |
|
4976
16112448d484
Rename xfree(FOO, TYPE) -> xfree(FOO)
Ben Wing <ben@xemacs.org>
parents:
4953
diff
changeset
|
219 xfree (tty_con->term_entry_buffer); |
| 428 | 220 tty_con->term_entry_buffer = NULL; |
| 221 } | |
| 4117 | 222 #ifndef NEW_GC |
|
4976
16112448d484
Rename xfree(FOO, TYPE) -> xfree(FOO)
Ben Wing <ben@xemacs.org>
parents:
4953
diff
changeset
|
223 xfree (tty_con); |
| 3092 | 224 #endif /* not NEW_GC */ |
| 428 | 225 CONSOLE_TTY_DATA (con) = NULL; |
| 226 } | |
| 227 } | |
| 228 | |
| 229 static void | |
| 230 tty_delete_console (struct console *con) | |
| 231 { | |
| 232 Lstream_close (XLSTREAM (CONSOLE_TTY_DATA (con)->instream)); | |
| 233 Lstream_close (XLSTREAM (CONSOLE_TTY_DATA (con)->outstream)); | |
| 234 if (!CONSOLE_TTY_DATA (con)->is_stdio) | |
| 771 | 235 retry_close (CONSOLE_TTY_DATA (con)->infd); |
| 428 | 236 if (CONSOLE_TTY_DATA (con)->controlling_terminal) |
| 237 { | |
| 238 Vcontrolling_terminal = Qnil; | |
| 239 unmunge_tty_process_group (); | |
| 240 } | |
| 241 free_tty_console_struct (con); | |
| 242 } | |
| 243 | |
| 244 | |
| 245 static struct console * | |
| 246 decode_tty_console (Lisp_Object console) | |
| 247 { | |
| 793 | 248 console = wrap_console (decode_console (console)); |
| 428 | 249 CHECK_TTY_CONSOLE (console); |
| 250 return XCONSOLE (console); | |
| 251 } | |
| 252 | |
| 253 DEFUN ("console-tty-terminal-type", Fconsole_tty_terminal_type, | |
| 254 0, 1, 0, /* | |
| 255 Return the terminal type of TTY console CONSOLE. | |
| 256 */ | |
| 257 (console)) | |
| 258 { | |
| 259 return CONSOLE_TTY_DATA (decode_tty_console (console))->terminal_type; | |
| 260 } | |
| 261 | |
| 262 DEFUN ("console-tty-controlling-process", Fconsole_tty_controlling_process, | |
| 263 0, 1, 0, /* | |
| 264 Return the controlling process of tty console CONSOLE. | |
| 265 */ | |
| 266 (console)) | |
| 267 { | |
| 268 return CONSOLE_TTY_DATA (decode_tty_console (console))->controlling_process; | |
| 269 } | |
| 270 | |
| 271 | |
| 272 DEFUN ("console-tty-input-coding-system", Fconsole_tty_input_coding_system, | |
| 273 0, 1, 0, /* | |
| 274 Return the input coding system of tty console CONSOLE. | |
| 275 */ | |
| 276 (console)) | |
| 277 { | |
| 771 | 278 return coding_stream_detected_coding_system |
| 428 | 279 (XLSTREAM (CONSOLE_TTY_DATA (decode_tty_console (console))->instream)); |
| 280 } | |
| 281 | |
| 282 DEFUN ("set-console-tty-input-coding-system", Fset_console_tty_input_coding_system, | |
| 283 0, 2, 0, /* | |
| 284 Set the input coding system of tty console CONSOLE to CODESYS. | |
| 285 CONSOLE defaults to the selected console. | |
| 286 CODESYS defaults to the value of `keyboard-coding-system'. | |
| 287 */ | |
| 288 (console, codesys)) | |
| 289 { | |
| 771 | 290 set_coding_stream_coding_system |
| 428 | 291 (XLSTREAM (CONSOLE_TTY_DATA (decode_tty_console (console))->instream), |
| 771 | 292 get_coding_system_for_text_file (NILP (codesys) ? Qkeyboard : codesys, |
| 293 0)); | |
| 428 | 294 return Qnil; |
| 295 } | |
| 296 | |
| 297 DEFUN ("console-tty-output-coding-system", Fconsole_tty_output_coding_system, | |
| 298 0, 1, 0, /* | |
| 299 Return TTY CONSOLE's output coding system. | |
| 300 */ | |
| 301 (console)) | |
| 302 { | |
| 771 | 303 return coding_stream_coding_system |
| 428 | 304 (XLSTREAM (CONSOLE_TTY_DATA (decode_tty_console (console))->outstream)); |
| 305 } | |
| 306 | |
| 307 DEFUN ("set-console-tty-output-coding-system", Fset_console_tty_output_coding_system, | |
| 308 0, 2, 0, /* | |
| 309 Set the coding system of tty output of console CONSOLE to CODESYS. | |
| 310 CONSOLE defaults to the selected console. | |
| 311 CODESYS defaults to the value of `terminal-coding-system'. | |
| 312 */ | |
| 313 (console, codesys)) | |
| 314 { | |
| 771 | 315 set_coding_stream_coding_system |
| 428 | 316 (XLSTREAM (CONSOLE_TTY_DATA (decode_tty_console (console))->outstream), |
| 771 | 317 get_coding_system_for_text_file (NILP (codesys) ? Qterminal : codesys, |
| 318 0)); | |
| 438 | 319 /* Redraw tty */ |
| 320 face_property_was_changed (Vdefault_face, Qfont, Qtty); | |
| 428 | 321 return Qnil; |
| 322 } | |
| 323 | |
| 3571 | 324 DEFUN ("console-tty-multiple-width", Fconsole_tty_multiple_width, |
| 325 0, 1, 0, /* | |
| 326 Return whether CONSOLE treats East Asian double-width chars as such. | |
| 327 | |
| 328 CONSOLE defaults to the selected console. Without XEmacs support for | |
| 329 double-width characters, this always gives nil. | |
| 330 */ | |
| 331 (console)) | |
| 332 { | |
| 333 return CONSOLE_TTY_MULTIPLE_WIDTH (decode_tty_console(console)) | |
| 334 ? Qt : Qnil; | |
| 335 } | |
| 336 | |
| 337 DEFUN ("set-console-tty-multiple-width", Fset_console_tty_multiple_width, | |
| 338 0, 2, 0, /* | |
| 339 Set whether CONSOLE treats East Asian double-width characters as such. | |
| 340 | |
| 341 CONSOLE defaults to the selected console, and VALUE defaults to nil. | |
| 342 Without XEmacs support for double-width characters, this throws an error if | |
| 343 VALUE is non-nil. | |
| 344 */ | |
| 345 (console, value)) | |
| 346 { | |
| 347 struct console *c = decode_tty_console (console); | |
| 348 | |
| 349 /* So people outside of East Asia can put (set-console-tty-multiple-width | |
| 350 (selected-console) nil) in their init files, independent of whether | |
| 351 Mule is enabled. */ | |
| 352 if (!CONSOLE_TTY_MULTIPLE_WIDTH (c) && NILP(value)) | |
| 353 { | |
| 354 return Qnil; | |
| 355 } | |
| 356 | |
| 357 if (!CONSOLE_TTY_SUPPORTS_MULTIPLE_WIDTH (c)) | |
| 358 { | |
| 359 invalid_change | |
| 360 ("No console support for double-width chars", | |
| 361 Fmake_symbol(CONSOLE_NAME(c))); | |
| 362 } | |
| 363 | |
| 364 CONSOLE_TTY_DATA(c)->multiple_width = NILP(value) ? 0 : 1; | |
| 365 | |
| 366 return Qnil; | |
| 367 } | |
| 368 | |
| 440 | 369 /* #### Move this function to lisp */ |
| 428 | 370 DEFUN ("set-console-tty-coding-system", Fset_console_tty_coding_system, |
| 371 0, 2, 0, /* | |
| 372 Set the input and output coding systems of tty console CONSOLE to CODESYS. | |
| 373 CONSOLE defaults to the selected console. | |
| 374 If CODESYS is nil, the values of `keyboard-coding-system' and | |
| 375 `terminal-coding-system' will be used for the input and | |
| 376 output coding systems of CONSOLE. | |
| 377 */ | |
| 378 (console, codesys)) | |
| 379 { | |
| 380 Fset_console_tty_input_coding_system (console, codesys); | |
| 381 Fset_console_tty_output_coding_system (console, codesys); | |
| 382 return Qnil; | |
| 383 } | |
| 384 | |
| 385 | |
| 386 Lisp_Object | |
| 387 tty_semi_canonicalize_console_connection (Lisp_Object connection, | |
| 578 | 388 Error_Behavior errb) |
| 428 | 389 { |
| 390 return stream_semi_canonicalize_console_connection (connection, errb); | |
| 391 } | |
| 392 | |
| 393 Lisp_Object | |
| 394 tty_canonicalize_console_connection (Lisp_Object connection, | |
| 578 | 395 Error_Behavior errb) |
| 428 | 396 { |
| 397 return stream_canonicalize_console_connection (connection, errb); | |
| 398 } | |
| 399 | |
| 400 Lisp_Object | |
| 401 tty_semi_canonicalize_device_connection (Lisp_Object connection, | |
| 578 | 402 Error_Behavior errb) |
| 428 | 403 { |
| 404 return stream_semi_canonicalize_console_connection (connection, errb); | |
| 405 } | |
| 406 | |
| 407 Lisp_Object | |
| 408 tty_canonicalize_device_connection (Lisp_Object connection, | |
| 578 | 409 Error_Behavior errb) |
| 428 | 410 { |
| 411 return stream_canonicalize_console_connection (connection, errb); | |
| 412 } | |
| 413 | |
| 2828 | 414 static Lisp_Object |
| 415 tty_perhaps_init_unseen_key_defaults (struct console *UNUSED(con), | |
| 416 Lisp_Object key) | |
| 417 { | |
| 418 Ichar val; | |
| 419 extern Lisp_Object Vcurrent_global_map; | |
| 420 | |
| 421 if (SYMBOLP(key)) | |
| 422 { | |
| 423 /* We've no idea what to default an unknown symbol to on the TTY. */ | |
| 424 return Qnil; | |
| 425 } | |
| 426 | |
| 427 CHECK_CHAR(key); | |
| 428 | |
| 2850 | 429 if (!(HASH_TABLEP(Vtty_seen_characters))) |
| 2828 | 430 { |
| 431 /* All the keysyms we deal with are character objects; therefore, we | |
| 432 can use eq as the test without worrying. */ | |
| 2850 | 433 Vtty_seen_characters = make_lisp_hash_table (128, HASH_TABLE_NON_WEAK, |
| 2828 | 434 HASH_TABLE_EQ); |
| 435 } | |
| 436 | |
| 437 /* Might give the user an opaque error if make_lisp_hash_table fails, | |
| 438 but it won't crash. */ | |
| 2850 | 439 CHECK_HASH_TABLE(Vtty_seen_characters); |
| 2828 | 440 |
| 441 val = XCHAR(key); | |
| 442 | |
| 443 /* Same logic as in x_has_keysym; I'm not convinced it's always sane. */ | |
| 444 if (val < 0x80) | |
| 445 { | |
| 446 return Qnil; | |
| 447 } | |
| 448 | |
| 2850 | 449 if (!NILP(Fgethash(key, Vtty_seen_characters, Qnil))) |
| 2828 | 450 { |
| 451 return Qnil; | |
| 452 } | |
| 453 | |
| 454 if (NILP (Flookup_key (Vcurrent_global_map, key, Qnil))) | |
| 455 { | |
| 2850 | 456 Fputhash(key, Qt, Vtty_seen_characters); |
| 2828 | 457 Fdefine_key (Vcurrent_global_map, key, Qself_insert_command); |
| 458 return Qt; | |
| 459 } | |
| 460 | |
| 461 return Qnil; | |
| 462 } | |
| 463 | |
| 428 | 464 |
| 465 /************************************************************************/ | |
| 466 /* initialization */ | |
| 467 /************************************************************************/ | |
| 468 | |
| 469 void | |
| 470 syms_of_console_tty (void) | |
| 471 { | |
| 472 DEFSUBR (Fconsole_tty_terminal_type); | |
| 473 DEFSUBR (Fconsole_tty_controlling_process); | |
| 563 | 474 DEFSYMBOL (Qterminal_type); |
| 475 DEFSYMBOL (Qcontrolling_process); | |
| 428 | 476 DEFSUBR (Fconsole_tty_output_coding_system); |
| 477 DEFSUBR (Fset_console_tty_output_coding_system); | |
| 478 DEFSUBR (Fconsole_tty_input_coding_system); | |
| 479 DEFSUBR (Fset_console_tty_input_coding_system); | |
| 480 DEFSUBR (Fset_console_tty_coding_system); | |
| 3571 | 481 DEFSUBR (Fconsole_tty_multiple_width); |
| 482 DEFSUBR (Fset_console_tty_multiple_width); | |
| 428 | 483 } |
| 484 | |
| 485 void | |
| 486 console_type_create_tty (void) | |
| 487 { | |
| 488 INITIALIZE_CONSOLE_TYPE (tty, "tty", "console-tty-p"); | |
| 489 | |
| 490 /* console methods */ | |
| 491 CONSOLE_HAS_METHOD (tty, init_console); | |
| 492 CONSOLE_HAS_METHOD (tty, mark_console); | |
| 493 CONSOLE_HAS_METHOD (tty, initially_selected_for_input); | |
| 494 CONSOLE_HAS_METHOD (tty, delete_console); | |
| 495 CONSOLE_HAS_METHOD (tty, canonicalize_console_connection); | |
| 496 CONSOLE_HAS_METHOD (tty, canonicalize_device_connection); | |
| 497 CONSOLE_HAS_METHOD (tty, semi_canonicalize_console_connection); | |
| 498 CONSOLE_HAS_METHOD (tty, semi_canonicalize_device_connection); | |
| 2828 | 499 CONSOLE_HAS_METHOD (tty, perhaps_init_unseen_key_defaults); |
| 428 | 500 } |
| 501 | |
| 502 void | |
| 503 reinit_console_type_create_tty (void) | |
| 504 { | |
| 505 REINITIALIZE_CONSOLE_TYPE (tty); | |
| 506 } | |
| 507 | |
| 508 void | |
| 509 image_instantiator_format_create_glyphs_tty (void) | |
| 510 { | |
| 511 IIFORMAT_VALID_CONSOLE (tty, nothing); | |
| 512 IIFORMAT_VALID_CONSOLE (tty, string); | |
| 513 IIFORMAT_VALID_CONSOLE (tty, formatted_string); | |
| 514 IIFORMAT_VALID_CONSOLE (tty, inherit); | |
| 515 } | |
| 516 | |
| 517 void | |
| 518 vars_of_console_tty (void) | |
| 519 { | |
| 2850 | 520 DEFVAR_LISP ("tty-seen-characters", &Vtty_seen_characters /* |
| 521 Hash table of non-ASCII characters the TTY subsystem has seen. | |
| 522 */ ); | |
| 523 Vtty_seen_characters = Qnil; | |
| 428 | 524 Fprovide (Qtty); |
| 525 } |
