From sam-fans-owner Sun Jan 8 13:17:47 1995 Received: from emory.mathcs.emory.edu ([128.140.2.1]) by hawkwind.utcs.utoronto.ca with SMTP id <24158>; Sun, 8 Jan 1995 13:15:27 -0500 Received: from skeeve.UUCP by emory.mathcs.emory.edu (5.65/Emory_mathcs.4.0.11) via UUCP id AA28959 ; Sun, 8 Jan 95 13:15:22 -0500 Return-Path: arnold@skeeve.atl.ga.us Received: by skeeve.atl.ga.us (/\==/\ Smail3.1.22.1 #22.1) id ; Sun, 8 Jan 95 12:51 EST Message-Id: From: arnold@skeeve.atl.ga.us Date: Sun, 8 Jan 1995 12:51:55 -0500 X-Ultrix: Just Say NO! X-Important-Saying: Premature Optimization Is The Root Of All Evil. X-Mailer: Mail User's Shell (7.2.5 10/14/92) To: sam-fans@hawkwind.utcs.toronto.edu Subject: latest 9menu 9menu 1.3 is available in ftp.cc.gatech.edu:/people/arnold/9menu-1.3.shar.gz. It fixes some portability problems with SIGCHLD (At least, I hope it fixes them). Enjoy, Arnold From sam-fans-owner Sat Jan 14 01:56:44 1995 Received: from lore.plan9.cs.su.oz.au ([129.78.96.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24001>; Sat, 14 Jan 1995 01:55:47 -0500 Date: Sat, 14 Jan 1995 16:41:56 -0500 From: dhog@plan9.cs.su.oz.au (David Hogan) To: plan9-fans@cse.psu.edu, sam-fans@hawkwind.utcs.toronto.edu Subject: 9wm: version 1.1 now available Message-Id: <95Jan14.015547est.24001@hawkwind.utcs.utoronto.ca> A new version of 9wm is now available. This fixes most of the bugs that have been reported. (The major exception is that multi-screen displays are still unsupported). The problem with popups of Open Look clients not appearing has been resolved. The new version may be obtained by anonymous ftp from ftp.cs.su.oz.au, in directory /usr/ftp/dhog/9wm. Get patch1.Z if you already have version 1.0, otherwise get 9wm-1.1.shar.Z. Thanks to all the people who contributed bug reports and fixes. From sam-fans-owner Thu Jan 19 01:46:45 1995 Received: from emory.mathcs.emory.edu ([128.140.2.1]) by hawkwind.utcs.utoronto.ca with SMTP id <24004>; Thu, 19 Jan 1995 01:45:23 -0500 Received: from skeeve.UUCP by emory.mathcs.emory.edu (5.65/Emory_mathcs.4.0.11) via UUCP id AA01336 ; Thu, 19 Jan 95 01:45:11 -0500 Return-Path: arnold@skeeve.atl.ga.us Received: by skeeve.atl.ga.us (/\==/\ Smail3.1.22.1 #22.1) id ; Wed, 18 Jan 95 22:02 EST Message-Id: From: arnold@skeeve.atl.ga.us Date: Wed, 18 Jan 1995 22:02:21 -0500 X-Ultrix: Just Say NO! X-Important-Saying: Premature Optimization Is The Root Of All Evil. X-Mailer: Mail User's Shell (7.2.5 10/14/92) To: sam-fans@hawkwind.utcs.toronto.edu Subject: X11R6? Greetings. I've been wondering if X11R6 has enough new stuff / performance enhancements to be worth the switch? I have a Sun IPC (low end sparc) at home with X11R5 fully patched (NOT OpenWindoze), and the performance is OK. Is R6 worth the trouble to get, compile overnight, rebuild sam/9term/9wm, and in general switch? I have the latest gcc, if that makes a difference in the performance. Thanks, Arnold From sam-fans-owner Thu Jan 19 02:31:21 1995 Received: from galapagos.cse.psu.edu ([130.203.2.12]) by hawkwind.utcs.utoronto.ca with SMTP id <24005>; Thu, 19 Jan 1995 02:31:01 -0500 Received: from localhost by galapagos.cse.psu.edu with SMTP id <12685>; Thu, 19 Jan 1995 02:30:34 -0500 To: arnold@skeeve.atl.ga.us cc: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: X11R6? In-reply-to: Your message of "Wed, 18 Jan 1995 22:02:21 EST." Date: Thu, 19 Jan 1995 02:30:21 -0500 From: Scott Schwartz Message-Id: <95Jan19.023034est.12685@galapagos.cse.psu.edu> | Greetings. I've been wondering if X11R6 has enough new stuff / performance | enhancements to be worth the switch? It's definately bigger and not noticably faster. The most concrete advantages are that the fonts are somewhat nicer and the font server works a little better, and it supports the Sun type 5 keyboard properly. (Properly means all the keys have keysyms bound, and there are keysyms like SunXK_VideoLowerBrightness to go with the new keys.) | Is R6 worth the trouble to get, compile overnight, rebuild sam/9term/9wm, | and in general switch? How bored are you feeling? :-) From sam-fans-owner Thu Jan 19 18:37:54 1995 Received: from ugw.utcc.utoronto.ca ([128.100.102.3]) by hawkwind.utcs.utoronto.ca with SMTP id <24005>; Thu, 19 Jan 1995 18:36:43 -0500 Received: from AWIUNI11.EDVZ.UNIVIE.AC.AT by ugw.utcc.utoronto.ca with SMTP id <8903>; Thu, 19 Jan 1995 18:36:14 -0500 Received: from AWIUNI11.EDVZ.UNIVIE.AC.AT (NJE origin A7621GAC@AWIUNI11) by AWIUNI11.EDVZ.UNIVIE.AC.AT (LMail V1.2a/1.8a) with BSMTP id 8059; Fri, 20 Jan 1995 00:35:27 +0100 Date: Thu, 19 Jan 1995 18:32:40 -0500 From: Werner Lemberg Subject: Announcing CJK 2.5 (Chin/Jap/Kor for LaTeX2e) To: unicode@unicode.org, soft-authors@ifcss.org, ctan-ann@shsu.edu, linux-asia@orac.iinet.com.au, sam-fans@hawkwind.utcs.toronto.edu Message-Id: <95Jan19.183614est.8903@ugw.utcc.utoronto.ca> This is the LaTeX2e style package CJK Version 2.4 (3-Jan-1995) =============================================================== It contains the following files: history.txt Package history CJK.txt This file CJK.sty A LaTeX2e style file to enable CJK (Chinese/Japanese/Korean) logographs (i.e. Hanzi/Kanji/Hangul) with LaTeX2e CJK.enc Master Encoding File standard.enc Bg5.enc Bg5pp.enc KS.enc utf8.enc pmCsmall.enc pmCsmpp.enc pmCbig.enc Encoding scheme files Bg5.chr standard.chr hangul.chr utf8.chr pmC.chr Character encoding files Bg5conv.tex preprocessor for Big 5 encoded text files bg5latex.bat a batch file (for DOS) to demonstrate use of Bg5conv.tex CNS.sty CNS.enc CNS.chr CNS encoding to be used together with a different CJK encoding following Christian Wittern's CEF (Chinese Encoding Framework) UBg5.fd UGBs.fd UGBt.fd Font definition files for Chinese (examples only!) UJIS.fd Font definition file for Japanese (example only!) Uhangul.fd Font definition file for standard Hangul fonts Uhanja.fd Font definition file for Hanja font (example only!) Uutf8.fd Font definition file for Unicode font (example only!) UpmC-Bg5.fd UpmC-GBs.fd UpmC-GBt.fd UpmC-JIS.fd UpmC-KS.fd Font definition files for (old) pmC-fonts UCNS-1.fd UCNS-2.fd UCNS-3.fd UCNS-4.fd UCNS-5.fd UCNS-6.fd UCNS-7.fd Font definition files for CNS fonts (examples only!) vf/*.vf tfm/*.tfm virtual fonts and metric files for hangul standard fonts to use in combination with the font libraries lj_han and lj_han1 (available at the CTAN hosts) utils/hbf2gf.w CWEB source file for hbf2gf utils/hbf2gf.c C code file extracted from the CWEB source files utils/hbf2gf.dvi Documentation extracted from the CWEB source files utils/hbf2gf.cfg Configuration file example utils/hbf2gf.exe Bound executable for DOS and OS/2 utils/hbf.h utils/hbf.c Ross Paterson's HBF API (with small extensions) utils/Makefile Makefile for hbf2gf utils/emx.exe utils/emx.dll utils/rsx.exe Runtime binaries for DOS and OS/2 (must be in the path) This is freely distributable under the GNU Public License. Use --- Use CJK.sty as a package, e.g. \documentclass{article} \usepackage{CJK} . Two new environments \begin{CJK}{encoding}{shape} ... \end{CJK} and \begin{CJK*}{encoding}{shape} ... \end{CJK*} are defined: encoding the following encodings are currently implemented in CJK.enc (for CNS encoding see below): Bg5 (Big 5) GBs (GuoBiao with simplified characters, G1 = GB 2312-80) GBt (GuoBiao with traditional characters, G1 = GB 12345-90) JIS (Japanese Industry Standard, G1 = JIS X0208-1990) KS (hangul and hanja, G1 = KSC 5601-1987) utf8 (UTF 8 (Unicode Transformation format 8), also called UTF 2 or FSS-UTF) The encodings (except Big 5 and UTF 8) are simplified EUC (Extended UNIX Code) character sets without single shifts. The character set slot G1 stands for two byte encodings with byte values taken from the GR (Graphic Right) character range 0xA1-0xFE (as defined in ISO 2022). For compatibility with the pmC package these additional encodings are defined: pmC-Bg5, pmC-GBs, pmC-GBt, pmC-JIS, and pmC-KS. It's not encouraged to use these encodings because of wasting fonts. If possible, convert your original CJK-bitmaps with hbf2gf (see below) to CJK-encodings. shape It is impossible to know what fonts are available at your site; look at the example .fd-files how to create appropriate .fd-files suiting your needs. If you use the KS environment, this parameter is unused (see below). The CJK* environment will swallow unprotected spaces and newlines after a CJK character, whereas CJK will not. This is a very realistic example: \begin{CJK*}{GBs}{kai} ... Text in GuoBiao encoding ... \end{CJK*} How it works ------------ Asiatic logographs can't be represented with one byte per character. (At least) two bytes are needed, and the most common encoding schemes (GB, Big 5, JIS, KS etc.) have a certain range for the first byte (usually 0xA1-OxFE or a part of it) which signales that this and the next byte represents an Asiatic logograph. This means that plain ASCII-text (i.e. characters between 0x00 and 0x7F) will be left undisturbed, and most characters of the extended ASCII character set (0x80-0xFF) will be assigned to a CJK encoding. Due to the internal architecture of TeX it is impossible to support ISO 2022 escape sequences as used with MULE (Multi Language Emacs). MULE is a common extension of GNU-Emacs to support many non-English scripts, including Chinese, Japanese, Korean, Hebrew etc. CJK.sty will make the characters 0xA1-OxFE active inside of an environment and assigns the macros \CJK@char and \CJK@charx to the active characters which select the proper font. The real mechanism is a bit more complicated to assure robustness (it was borrowed and modified from german.sty) and correct handling of punctuation characters. The encodings ------------- CJK.sty defines internally \CJK@standardEncoding, \CJK@Bg5Encoding, \CJK@KSEncoding, \CJK@utf8Encoding, and for compatibility with pmC, \CJK@pmCsmallEncoding and \CJK@pmCbigEncoding. \CJK@standardEncoding will be used for encodings with the second byte in the range 0xA0-0xFE (GB, JIS). \CJK@Bg5Encoding will be used for Big 5 encoding (e.g. NTU fonts) with the second byte in the range 0x40-0xFE. \CJK@KSEncoding will be used for KS encoding. Two sets of subfonts are defined, one for Hangul syllables and elements, and a second for Hanja. For more details see below. \CJK@utf8Encoding will be used for Unicode in UTF 8. The first byte is in the range 0xC0-0xDF for two byte values and in the range 0xE0-0xEF for three byte values. The other bytes are in the range 0x80-0xBF. Note that CJK expects two hexadecimal digits as a running number in the font name instead of two decimal digits. Use the option `unicode on' if you use hbf2gf to transform bitmap fonts in HBF format to .pk fonts as used by CJK.sty . \CJK@pmCsmallEncoding and \CJK@pmCbigEncoding can be activated with \pmCsmall (this is the default) and \pmCbig inside the CJK environment. Note that the original pmC fonts have two character sizes per font (the bigger ones with an offset of -128); pmC-Big 5 encoded fonts cannot contain big characters. The names of the fonts in the UpmC-xxx.fd files reflect the modifications added by Marc Leisher to the original poor man's Chinese (pmC) package written by Thomas Ridgeway . The fonts --------- CJK.sty uses NFSS (New Font Selection Scheme, now part of LaTeX2e) which has some advantages over the font selection offered with pmC (for plain TeX and LaTeX 2.09): o TeX fonts are loaded only on demand. This is especially useful with Asiatic logographs. If you have e.g. three Chinese characters in your text, pmC must load the whole Chinese font (about 85 TeX fonts), whereas LaTeX2e loads only three fonts normally. o As long as the limit of 256 TeX fonts will not be exceeded, you can use as many CJK fonts as you like (e.g. simplified and traditional Chinese characters together with Japanese fonts in different sizes) --- pmC is limited to two sizes and can only have two CJK fonts at the same time. In the web2c-TeX package (for UNIX) you will find a patch which allows the use of more than 256 TeX fonts. o You need not to care about the right size of CJK fonts in footnotes etc. They will obey the NFSS (although changing other attributes except font series and size will be done with \CJKenc and \CJKshape). For Hangul font selection see below. Of course you must have access to bitmap CJK fonts --- use hbf2gf to convert them to .pk-fonts. See the last section for availability of precompiled fonts. If you chose one font per active character as with the pmC macros, you would waste character space (256 characters per font are possible with TeX 3). Therefore CJK.sty expects the whole Asiatic font splitted in TeX subfonts with 256 characters each. An example: GuoBiao-encoded simplified characters in song style at 12pt: ^ ^ ^^ ^^ first byte second byte TeX font offset ---------------------------------------------- 0xA1 0xA1-OxFE gsso1201 0 0xA2 0xA1-0xFE gsso1201 94 0xA3 0xA1-0xE4 gsso1201 188 0xA3 0xE5-0xFE gsso1202 0 0xA4 0xA1-0xFE gsso1202 26 0xA5 0xA1-0xFE gsso1202 120 . . . 0xFE 0xA1-OxFE gsso1235 38 For converting to .pk-files with hbf2gf, you must get the appropriate HBF (Hanzi Bitmap Font) header files from ifcss.org (or create if you can't find the right one); almost all Chinese bitmap fonts in the public domain together with their HBF headers are collected there. These HBF files document CJK fonts completely. Using hbf2gf ------------- hbf2gf converts CJK bitmaps with an HBF header file into .gf-files (and consequently into .pk fonts). Syntax: hbf2gf configuration_file Keywords in the configuration file must start a line, the appropriate values being on the same line separated with one or more blanks or tabs. Here is an example configuration file jfs56.cfg (please refer to hbf2gf.dvi for a description of the keywords): hbf_header jfs56.hbf mag_x 1.482 x_offset 3 y_offset -8 comment jianti fansongti 56x56 pixel font magnified and adapted for 10pt nmb_files -1 output_name gsfs10 checksum 123456789 dpi_x 600 dpi_y 600 coding codingscheme GB 2312-80 encoded TeX text pk_directory d:\china\pixel.ljh\600dpi\ tfm_directory d:\china\tfm\ rm_command del cp_command copy long_extension off job_extension .cmd And here the results: input files: jfs56.a - jfs56.e, jfs56.hbf program call: hbf2gf jfs56.cfg intermediate files: gsfs10.cmd, gsfs1001.gf - gsfs1032.gf, gsfs10.pl batch file call: gsfs10.cmd output files: d:\china\pixel.ljh\600dpi\gsfs1001.pk - gsfs1032.pk, d:\china\tfm\gsfs1001.tfm - gsfs1032.tfm [gsfs: GuoBiao simple encoded FanSong style ^ ^ ^ ^ It's hard to overcome the DOS restriction of 8 characters in a file name if you need two characters as a running number...] This would be a correct entry in UGBs.fd: \DeclareFontShape{U}{GBs}{m}{fansong}{ <-10> CJKfixed * gsfs10 <10> sCJKfixed * gsfs10 <10.95> sCJKfixed * gsfs12 <12> sCJKfixed * gsfs12 <14.4> sCJKfixed * gsfs14 <17.28> sCJKfixed * gsfs17 <20.74-> CJKfixed * gsfs17}{} assuming that you have created fonts for 10, 12, 14.4, and 17.28pt. Korean input ------------ (The status of this feature is experimental. I can't speak Korean and would be glad to hear comments from people who have any idea what is happening here :-) There are already different packages handling Hangul: hlatex, htex etc.; there is one package which also can handle hanja: jhtex. The great difference of the packages just mentioned compared to CJK is the use of a preprocessor which converts text files containing KS encoded text into a TeX file. To do so has some advantages, but the output is completely unreadable. Additionally the output lines become rather lengthy (a two byte character code will be converted into a string up to 11 characters long), which may confuse some editors; and if you have a text which contains Chinese or Japanese also, you can't use KS to TeX converters because the code ranges overlap and converters are not able to recognize which is Korean and which is not. In contrast, CJK does not need a preprocessor and the problems mentioned above are nonexistent, but you get nothing for free: CJK uses the virtual font mechanism to map the hangul syllables onto Hangul Elements (11 virtual fonts map to 2 real fonts), whereas preprocessors directly use the real fonts. If you want a complete Korean environment, I recommend jhtex. There you will also find a hangul.sty which modifies (among others) the sectioning commands to enable Korean chapter counting and Korean headers. To use KS encoding, say \begin{CJK}{KS}{} ... \end{CJK} . These font switches are available inside the environment: fonts from hLaTeX: * \mj MyoungJo (default) \gt Gothic \gs BootGulssi \gr Graphic \dr Dinaru fonts from jhTeX: * \hgt Hangul Gothic * \hmj Hangul MyoungJo (MunHwaBu fonts) * \hpg Hangul Pilgi \hol Hangul Outline (MyoungJo) If a font is marked with a star, bold series are available. You will find the hangul fonts in the lj_han and lj_han1 packages. These are emTeX libraries for 300 dpi resolution which can be easily converted back to .pk fonts using the fontlib package of emTeX. If you need different resolutions, you must obtain the original metafont sources of the hlatex_mf.tar.gz and the jhtex packages. Note that the shapes of Hangul elements are not satisfactory. You find the needed virtual fonts and virtual metric files in the vf and tfm directories. Move the .tfm files into a directory TeX will scan. You need a dvi driver which understands virtual fonts -- move the .vf files into a directory your dvi driver will scan. For non-hangul characters inside the KS environment (i.e. the first byte in the ranges 0xA1-0xAF except 0xA4 and 0xC9-0xFD), fonts are taken from Uhanja.fd . This enables the use of many hangul fonts and perhaps only one or two different hanja fonts. If you don't want the overlay of hangul fonts from Uhangul.fd, say \CJKhanja. The opposite command is \CJKhangul. Archaic hangul elements (KS 0xA4D5-0xA4FE) and the character KS 0xA4D4 are only accessible if \CJKhanja is active. You should convert your KS hanja fonts using hbf2gf as described above. Bg5conv.tex ----------- Using the Bg5text environment is a mess. Having an external preprocessor needs access to a compiler, which is not always the case. Thus I wrote Bg5conv.tex, a preprocessor for Big 5 characters to overcome the restrictions of the Bg5text environment. Each Big 5 character `XY' will be converted into the form `XZZZ.'; ZZZ is a decimal number followed by a dot. The use of Bg5conv.tex is completely transparent, no changes to your document are necessary. The use is simple: before calling Bg5text you must define \CJKin (and optionally \CJKout); after conversion the output file will be processed like a normal input file. Bg5conv.tex inserts additionally the (empty) macro \CJKpreproc as the first line of the output. Here is an example batch file (bg5latex.bat) for DOS which demonstrates the use of Bg5conv.tex . Note that you must not use an extension for the input file here (I am too lazy to write a sophisticated shell program - any volunteers are welcome) (default names for \CJKin and \CJKout are `Bg5input.tex' and `Bg5input.cjk' respectively): call latex \def\CJKin{%1} \def\CJKout{%1.cjk} \input Bg5conv.tex call latex %1.cjk You say bg5latex mytext to get mytext.tex processed. It's not possible to mix Big 5 encoding with different encodings (except CNS) if Bg5conv.tex is used (and I doubt whether this should be ever necessary). CNS.sty ------- (The status of this feature is experimental.) Christian Wittern develops CEF, the Chinese Encoding Framework. This will enable the use of Big 5 as the primary encoding with CNS 11643-1992 as a secondary character set for characters not included in Big 5. Inputting CNS characters into a text will be done with a data base. To facilitate this, the first bytes of the three byte CNS encoding are mapped onto the characters 0x81-0x87. Say \usepackage[options]{CNS} to use CNS (CJK.sty will be loaded automatically). If you need to specify options for CJK, say \usepackage[options]{CJK} \usepackage[options]{CNS} The possible options for CNS.sty are `compressed' and `uncompressed' to indicate the use of compressed (256 characters per font a la CJK.sty) or uncompressed fonts (94 characters per plane as in pmC). Default is compressed. CNS encoding is available only in CJK environments; the commands \CNSchar (of course with three parameters for byte 1 to 3) and \CNSshape are similar to their CJK counterparts. Default value of \CNSshape is `song'. Uncompressed fonts should be named equal to pmC fonts (font names ending with hex numbers). The .fd-files ------------- CJK fonts can be installed as easy as normal TeX fonts! CJK.sty defines four new size commands: CJK corresponds to `' (empty) sCJK corresponds to `s' CJKfixed corresponds to `fixed' sCJKfixed corresponds to `sfixed' . The difference between these size functions and the original commands defined by LaTeX2e is that a CJK size function defines a class of fonts. If you say as an example \DeclareFontShape{U}{Bg5}{m}{song}{<6> <7> <8> sCJKfixed * b5so07}{} , LaTeX2e searches for fonts named b5so0701 - b5so0758 if the font size is 6, 7 or 8 pt; with other words, the CJK size functions append two digits to select the proper subfonts. These digits are defined in the \CJK@...Encoding macros; the macro \CJK@plane holds the current value (in pmC compatibility mode, \CJK@plane holds hexadecimal numbers). See the example .fd files how to define font substitutions additionally. Caveats ------- o You can of course use CJK-environments inside of a CJK-environment, but it is possible that you must increase the so called save size (with emTeX you can adjust this with -ms=...). The CJK package has optional arguments which controls the scope of CJK environments: lowercase If you want to use \lowercase with encodings inside CJK environments. You need less save size using the `encapsulated' option if `lowercase' is not set. You must use Bg5conv.tex to use Big 5 characters with this option. global \lccode (if `lowercase' set), \uccode, \catcode and the activation of the characters 0xA1-0xFE will be globally modified (\lccode and \uccode reset to 0). This is the most economical mode concerning save size, but you can't have CJK environments inside of CJK environments or other environments which manipulate the character range 0xA1-0xFE. Packages which change some of the above values only once (e.g. in the preamble) will also not work after the first use of a CJK environment. local Only \lccode (if `lowercase' set) and \uccode will be modified globally. This is the default. You can stack environments. encapsulated If you want to use DC fonts outside of the CJK environment with \uppercase and \lowercase working correctly, you must use this option. All values mentioned above will be local, so you can stack environments. This option probably causes an overflow of the save size. Say \usepackage[option]{CJK} to activate `option'. o There is an other way to overcome the problem of stacked environments. CJK implements two low level CJK attribute switches: \CJKenc and \CJKshape, which take the same arguments as the corresponding values of the CJK environment. If you need two different encodings/shapes at the same output line, you must use these macros. An example: \begin{CJK}{GBs}{song} ... Text in GBs song ... \CJKenc{GBt} ... Text in GBt song ... \CJKshape{kai} ... Text in GBt kai ... \end{CJK} Contrary to \begin{CJK}{...}{...} it's not necessary to start a new line after \CJKenc. o The characters \, {, and } are used as second bytes in the Big 5 encoding. If you write Big 5 text mixed with other encodings, you should use the Bg5text environment which changes the category codes of these characters. The command prefix is now the forward slash `/', and the grouping characters are `(' and `)' respectively. An example: \begin{CJK}{Bg5}{song} \begin{Bg5text} .... /begin(center) .... /end(center) .... /end(Bg5text) \end{CJK} To get the `/', `(', and `)' characters, write `//', `/(', and `/)' inside the Bg5text environment. This environment is ugly, and some commands like \newcommand will not work in it. o Instead of using the Bg5text environment you can protect the offending second bytes with a backslash, i.e. \{, \}, \\ (using a non- Chinese editor). This will not increase the readability of the Chinese text, but for short texts it's perhaps more comfortable. Alas, it doesn't work in page header commands because the macros \{ etc. will not be expanded. o Be careful not to use any commands inside the Bg5text environment which write something into an external file (commands like \chapter etc.). o If it's not possible to avoid Big 5 character codes with \, {, or } outside of the Bg5text environment (e.g. having Big 5-text in a \chapter or \section command), you can replace them with the \CJKchar macro manually: \section{This is a problematic Big 5 character: \CJKchar{169}{92}} The parameters are the first and second byte of the Big 5 character code. You can also use hexadecimal or octal notation. o A similar command is \Unicode{byte1}{byte2} to access Unicode characters (not in UTF 8) directly; the parameters are the first and second byte of the Unicode. o CJK will disable \uppercase (preserving the command as \CJKuppercase) if you select Big 5 encoding without using Bg5conv.tex . This affects the headers of the standard classes and \Roman only in standard LaTeX2e. Be aware that some packages and style files may use \uppercase for dirty tricks (e.g. to define macros for active characters). o \uppercase and \lowercase will work with NONE of the CJK encoding schemes if you use DC fonts because these 8-bit fonts have most \lccode's and \uccode's set in the range 0x80-0xFF. o You should define for each TeX font size a CJK font (as an example, use sCJKfixed for good sizes and CJKfixed for bad sizes, and LaTeX2e will complain loudly about wrong sizes on the screen). LaTeX2e will also do the job if some size definitions are missing (using defined sizes), but expect a font warning for each (!) CJK character affected under certain circumstances. Possible errors --------------- o If you write Chinese (or Japanese) text, don't forget to suppress the linefeed character with a trailing `%' in the CJK environment, otherwise you get unwanted spaces in the output. On the other side, say `\ ' or something similar inside the CJK* environment to get a space after a CJK character. o To prevent a line break before a CJK character (e.g. between an opening (non-CJK) parenthesis and a CJK character), say \CJKkern. This command prevents the insertion of \CJKglue before the CJK character. You may wonder about the curious name: a small kern (1 sp) between two CJK characters signales that the first one is a punctuation character. o If you get the error message: "\CJK@min (or \CJK@max) undefined", you should insert \newpage before saying \end{CJK}. This can happen if LaTeX writes the headers (or footers) of a page containing CJK characters after closing the CJK environment. o If you get overfull hboxes caused by CJK characters, try to increase \CJKglue. It defines the glue between CJK characters; the default definition is \newcommand{\CJKglue}{\hskip 0pt plus 0.08\baselineskip} . \CJKglue will be inserted by CJK before each Chinese character (except punctuation characters as defined in the punctuation tables; see CJK.enc), and none after. You should separate non-Chinese text from CJK characters with spaces to enable hyphenation. o If you get overfull hboxes caused by Hangul syllables, try to increase \CJKtolerance. The default definition is \newcommand{\CJKtolerance}{400} . o If you encounter a TeX stack overflow caused by {\CJKenc{new_encoding} ....}, you should write \CJKenc{new_encoding} ... \CJKenc{old_encoding} instead. Or (better) increase the stack size as discussed above. How to get CJK and related software ----------------------------------- o You will find CJK and software related to TeX at the CTAN hosts (Comprehensive TeX Archive Network). These completely identical ftp servers (concerning TeX software) are ftp.shsu.edu Sam Houston University Texas (USA) ftp.dante.de DANTE (Deutsche Anwendervereinigung fuer TeX) Heidelberg (Germany) ftp.tex.ac.uk Cambridge University Cambridge (England) You should use the nearest one, or even better, a local mirror of a CTAN host. CJK will be found unpacked. To receive the complete package, go to the parent directory of CJK and say get CJK.zip or (whichever is appropriate for your system) get CJK.tar.gz The CJK directory and all subdirectories will be sent to you in compressed form. Be aware that not all mirrors of CTAN sites support compression of directories. o The main site for Chinese related software is ifcss.org (USA). Mirrors are ftp.edu.tw (Taiwan), cnd.org (USA) and kth.se (Sweden). Here you find free Chinese fonts, Text editors etc. Note that while updating this text (3-Jan-1994) ifcss.org has still stopped ftp access due to networking problems. o The main site for Korean related software is cair-archive.kaist.ac.kr (Korea). I don't know any mirror sites of this host. At ifcss.org you will find a 24x24 hanja font with HBF header in /software/fonts/misc/hbf. o Sam Chiu compiled the fonts jfs56 (GBs encoded) and ntu_kai48 (Big 5 encoded) for various sizes with 600dpi resolution. You will find them (about 22 MByte uncompressed!) at the CTAN hosts in /tex-archive/fonts/chinese Author ------ Werner Lemberg Goldschlagstr. 52/14 A-1150 Vienna Austria/Europe Please report any errors or suggestions to this email-address. From sam-fans-owner Thu Jan 19 18:56:49 1995 Received: from ugw.utcc.utoronto.ca ([128.100.102.3]) by hawkwind.utcs.utoronto.ca with SMTP id <24005>; Thu, 19 Jan 1995 18:55:40 -0500 Received: from AWIUNI11.EDVZ.UNIVIE.AC.AT by ugw.utcc.utoronto.ca with SMTP id <8801>; Thu, 19 Jan 1995 18:55:24 -0500 Received: from AWIUNI11.EDVZ.UNIVIE.AC.AT (NJE origin A7621GAC@AWIUNI11) by AWIUNI11.EDVZ.UNIVIE.AC.AT (LMail V1.2a/1.8a) with BSMTP id 8555; Fri, 20 Jan 1995 00:54:59 +0100 Date: Thu, 19 Jan 1995 18:53:59 -0500 From: Werner Lemberg Subject: Addendum to CJK 2.4 (!) To: unicode@ifcss.org, linux-asia@orac.iinet.com.au, ctan-ann@shsu.edu, sam-fans@hawkwind.utcs.toronto.edu Message-Id: <95Jan19.185524est.8801@ugw.utcc.utoronto.ca> I just have uploaded the newest version of CJK to ftp.tex.ac.uk . It should be available soon in tex-archive/languages/chinese/CJK on all CTAN hosts (ftp.dante.de, pip.shsu.edu, ftp.tex.ac.uk) and its mirrors. In a separate posting you will find a complete description of CJK. Happy TeXing! Werner ============================================================================== Version 2.4: new: 3-Jan-1995 UTF 8 (Unicode) scheme added. option `unicode' to hbf2gf added: if `on', a two-digit hexadecimal number will be used as a running number starting with the value of the first byte of the first code range. Bg5conv.tex added: this is a small preprocessor which converts Big 5 encoded characters `XY' into the form `XZZZ.' . Now you can use Big 5 encoding without the annoying Bg5text environment. Auxiliary files: Bg5pp.enc, pmCsmpp.enc, and bg5latex.bat . changed: new versions of emx.exe, emx.dll (ver. 0.9a) and rsx.exe (rel. 5) errors: hbf2gf sometimes drew one pixel too much (You Rey-Jer ). pmC encodings didn't work (Zhang Zhengyou ). \CJK@charToHex and \CJK@numbToHex could erroneously change page counter (Li Yu-Ray ). From sam-fans-owner Tue Feb 7 08:18:26 1995 Received: from cegelecproj.co.uk ([159.245.72.6]) by hawkwind.utcs.utoronto.ca with SMTP id <24011>; Tue, 7 Feb 1995 08:14:44 -0500 Received: from vampire.cegelecproj.co.uk (cerberus.cegelecproj.co.uk) by cegelecproj.co.uk (4.1/SMI-4.1) id AA01143; Tue, 7 Feb 95 13:15:24 GMT Received: from spirit.cegelecproj.co.uk (spirit.limbo.cegelecproj.co.uk) by vampire.cegelecproj.co.uk (5.0/SMI-SVR4) id AA27750; Tue, 7 Feb 1995 13:18:09 +0000 Received: by spirit.cegelecproj.co.uk (5.0/SMI-SVR4) id AA06143; Tue, 7 Feb 1995 12:59:20 +0000 Date: Tue, 7 Feb 1995 07:59:20 -0500 From: Steve_Kilbane@cegelecproj.co.uk (Steve_Kilbane) Message-Id: <9502071259.AA06143@spirit.cegelecproj.co.uk> X-Planation: X-Faces images can be viewed with the XFaces program To: sam-fans@hawkwind.utcs.toronto.edu Subject: 9term/9wm hacks Content-Length: 2274 X-Face: Iqsa(US9p?)Y^W+6Ff[Z]rM"uFE) lFDjag1e]\/#2 I've been playing with some small hacks to 9term and 9wm which I thought I'd mention to the list, since they might be of interest. Basically, I was wondering how some of the characteristics of 8½ and Help could be implemented using the existing arrangement. Basically I was after some level of programmability without having to change the tools much (or do much work:-)). In 9term, I've implemented command inputs via a pipe, similar to the command pipe sam uses. Each 9term creates a named pipe with the name /tmp/.9terms.$USER.$DISPLAY/$WINDOWID. Characters read from this pipe get sent to the shell, and also appear on the screen. The directory that the pipes are created in is mode 700, as a nod towards security, but how safe this is, I don't know. In 9wm, each time a window is made current the file /tmp/.9wm-windows is re-written, containing a line for each window. Each line contains . The lines are written in the same order as the window focus list, so the current window is the first line, the previous current window is the second line, and so on. >From here on in, it's just script writing. The most common script determines which 9term was the most recently used, and sends its arguments to that 9term's pipe. Another script is similar, but uses xv_get_sel to determine text that was last snarfed, and uses that in the command. Scripts are normally run from 9menu popped up from the main 9menu. One contains the commands used while producing a document with latex, another has commands often used while building an instance of the current program I'm working on, and a third pops up the last 15 commands from $history, for re-execution. Although I haven't done this, 9menus could be created which send commonly-used commands to the current instance of sam (personally, I don't have many sam commands I use a lot). It's not a perfect system. Security is bound to be a problem, the 9wm file should have a more unique name, and if you send text to a 9term pipe it doesn't currently set dot first, so the text appears in the wrong place. The command still works, though. Finally, the hacks aren't to the most recent version of 9term (they're to 1.3.2, and I know that matty's up to at least 1.5). Comments are welcome. steve From sam-fans-owner Sun Feb 19 11:09:08 1995 Received: from burdell.cc.gatech.edu ([130.207.3.207]) by hawkwind.utcs.utoronto.ca with SMTP id <24014>; Sun, 19 Feb 1995 11:04:37 -0500 Received: from penfold.cc.gatech.edu (arnold@penfold.cc.gatech.edu [130.207.3.249]) by burdell.cc.gatech.edu (8.6.9/8.6.9) with ESMTP id LAA16942 for ; Sun, 19 Feb 1995 11:04:34 -0500 Received: (from arnold@localhost) by penfold.cc.gatech.edu (8.6.9/8.6.9) id LAA03834 for sam-fans@hawkwind.utcs.toronto.edu; Sun, 19 Feb 1995 11:04:32 -0500 Date: Sun, 19 Feb 1995 11:04:32 -0500 From: arnold@cc.gatech.edu (Arnold Robbins) Message-Id: <199502191604.LAA03834@penfold.cc.gatech.edu> To: sam-fans@hawkwind.utcs.toronto.edu Subject: article on Plan 9 interface for Unix Greetings. I have placed the original ascii of a two part article I wrote on sam, 9term, 9wm, 9menu, rc and es up for ftp. This article is for Linux Journal. The first part was just published, the second part will come out next month. Most people on the list know all about what's in the article already, but it may be useful to give to others whom you wish to proselytize, er, "help be more productive." (:-) It's available from ftp.cc.gatech.edu in /pub/people/arnold, in the file plan9.interface.for.unix. Enjoy, Arnold From sam-fans-owner Tue Feb 21 14:14:34 1995 Received: from relay3.UU.NET ([192.48.96.8]) by hawkwind.utcs.utoronto.ca with SMTP id <24025>; Tue, 21 Feb 1995 14:08:32 -0500 Received: from uucp1.UU.NET by relay3.UU.NET with SMTP id QQyebs26133; Tue, 21 Feb 1995 14:08:26 -0500 Received: from rexago8.UUCP by uucp1.UU.NET with UUCP/RMAIL ; Tue, 21 Feb 1995 14:08:12 -0500 Received: by summitis.com (smail2.5) id AA04687; 21 Feb 95 13:57:31 EST (Tue) Received: from summitis.com by rserv1.summitis.com; Tue, 21 Feb 1995 13:55 EST Received: from cheetah by rexsrvr2.summitis.com (AIX 3.2/UCB 5.64/4.03) id AA183124; Tue, 21 Feb 1995 13:52:56 -0500 Received: by cheetah (AIX 3.2/UCB 5.64/4.03) id AA17856; Tue, 21 Feb 1995 13:52:54 -0500 From: hc05@summitis.com Message-Id: <9502211852.AA17856@cheetah> Subject: 9menu and sam To: sam-fans@hawkwind.utcs.toronto.edu (Sam mailing list) X-Mailer: ELM [version 2.4 PL23] Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Content-Length: 2208 Date: Tue, 21 Feb 1995 14:08:25 -0500 I read the excellent article on the UNIX Plan 9 tools this weekend and realized that I can extend sam. I understand why basic sam doesn't have macro capability, but there are some things that I do a lot that would be nice to do with the mouse. I use samx2, and wouldn't use sam without it, but while it has macro capability, I'm not big on learning lots of arbitrary key sequences, even my own. For these reasons I've put together a 9menu containing some basic sam commands that I need. When I want one, I go out to the 9wm menu, bring up 9menu, and make my choice. It has made things much easier. I include the script here in case anyone is interested. Some of the specific macros may be useful to others, and some will only be meaningful to me, but I figured I would include some examples. I wrote this in perl because I haven't gotten far enough into the 9 tools to use rc. Beirne ---------------------------------------------------------------------- #!/usr/local/perl ($name) = getpwuid($>); $pipe = '/tmp/.sam.'.$name.'.'.$ENV{'DISPLAY'}; $pipe =~ s/:0$/:0\.0/; $pipe =~ s/\.0$// if (! -r $pipe); exit if ($pipe =~ /^\s*$/); $ENV{'SAMPIPE'} = $pipe; exec "9menu", "-label", "sam menu", "-popdown", "-iconic", "-geometry", "+0+0", 'dashed line:echo "i/----------------------------------------------------------------------\\\\\n" >'.$ENV{'SAMPIPE'}, 'eroff memo template:echo "r $T/ermemo\n,x/Your_name/c/B. Konarski" >'.$ENV{'SAMPIPE'}, 'eroff preview:echo ",>preview" >'.$ENV{'SAMPIPE'}, 'eroff print:echo ",>tbl -D | eroff -mm -mr" >'.$ENV{'SAMPIPE'}, 'format:echo "|fmt" >'.$ENV{'SAMPIPE'}, 'shift left:echo "x/^ /d" >'.$ENV{'SAMPIPE'}, 'shift right:echo "x/^/a/ /" >'.$ENV{'SAMPIPE'}, 'spell:echo ",|cspell" >'.$ENV{'SAMPIPE'}, "exit" ---------------------------------------------------------------------- -- ------------------------------------------------------------------------------- Beirne Konarski | Reading maketh a full man, conference a beirnek@summitis.com | ready man, and writing an exact man. "Untouched by Scandal" | -- Francis Bacon ------------------------------------------------------------------------------- From sam-fans-owner Wed Mar 8 12:33:34 1995 Received: from drizzle.Stanford.EDU ([36.59.0.16]) by hawkwind.utcs.utoronto.ca with SMTP id <24048>; Wed, 8 Mar 1995 12:27:00 -0500 Received: (castor@localhost) by drizzle.Stanford.EDU (8.6.8/8.6.4) id JAA18686 for sam-fans@hawkwind.utcs.toronto.edu; Wed, 8 Mar 1995 09:30:40 -0800 From: Castor Fu Message-Id: <199503081730.JAA18686@drizzle.Stanford.EDU> Subject: sam or tk bug? To: sam-fans@hawkwind.utcs.toronto.edu Date: Wed, 8 Mar 1995 12:30:40 -0500 X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 983 I've started using sam on RS 6000's recently and have been getting the following error relatively often (3 times in the past two days): Xlib: sequence lost (0x10006 > 0xfcb) in reply type 0x0! X Error of failed request: 0 Major opcode of failed request: 0 () Serial number of failed request: 6 Current serial number in output stream: 4043 Then samterm exits. Has anyone seen this before? I think this might be connected with a Tk tool which I hacked together. It provides some of the functionality of emacs's M-x compile, by searching the results of a 'make' for errors, and sending in sam commands through the named pipe. It also has hooks for the AT&T Toolchest 'cscope' program, to provide source browsing capability. To make it more useful, it would be nice to have easier X selection features in 'sam'. I think there were some chording patches a while back. Maybe those would be most appropriate? I guess I'll have to dig through the archives. -castor From sam-fans-owner Wed Mar 8 13:23:32 1995 Received: from ssec.ssec.wisc.edu ([144.92.108.61]) by hawkwind.utcs.utoronto.ca with SMTP id <24048>; Wed, 8 Mar 1995 13:22:33 -0500 Received: from localhost by ssec.ssec.wisc.edu; id AA84430; AIX 3.2/UCB 5.64/42; Wed, 8 Mar 1995 12:22:00 -0600 Message-Id: <9503081822.AA84430@ssec.ssec.wisc.edu> To: Castor Fu Cc: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: sam or tk bug? In-Reply-To: Your message of "Wed, 08 Mar 1995 12:30:40 EST." <199503081730.JAA18686@drizzle.Stanford.EDU> Date: Wed, 8 Mar 1995 13:21:51 -0500 From: "DaviD W. Sanderson" Castor Fu wrote: # I've started using sam on RS 6000's recently and have been getting # the following error relatively often (3 times in the past two days): # # Xlib: sequence lost (0x10006 > 0xfcb) in reply type 0x0! This is probably a bug in your X server. We encountered it when we upgraded to AIX 3.2.5. There is a patch available from IBM. Here is an extract of some instructions we sent our customers: McIDAS-X sites using IBM RISC System/6000 workstations running AIX version 3.2.5 may elect to apply the IBM Program Temporary Fix (PTF) U425811 or U424375 to lpp package X11rte.obj.1.2.3. The lpp correction package U425811 replaces package U424375. [...] Users may see the problem at random intervals. When it occurs, an error message similar to the one shown below is displayed. Xlib: sequence lost (0x10000 > 0x103) in reply type 0x0! You can tell if you have the U425811 or U424375 PTF installed by doing lslpp -h -c | egrep 'U425811|U424375' It should print out something like /usr/lib/objrepos:X11rte.obj:U425811:01.02.0003.0000:COMPLETE:APPLY:07/14/94:08;31;11:root /etc/objrepos:X11rte.obj:U425811:01.02.0003.0000:COMPLETE:APPLY:07/14/94:08;37;37:root DaviD W. Sanderson dws@ssec.wisc.edu Space Science and Engineering Center University of Wisconsin-Madison "The Noah Webster of smileys" - The Wall Street Journal, 15 Sep 1992 From sam-fans-owner Wed Mar 8 14:13:10 1995 Received: from relay3.UU.NET ([192.48.96.8]) by hawkwind.utcs.utoronto.ca with SMTP id <24048>; Wed, 8 Mar 1995 14:12:30 -0500 Received: from uucp4.UU.NET by relay3.UU.NET with SMTP id QQygfc12677; Wed, 8 Mar 1995 14:12:24 -0500 Received: from rexago8.UUCP by uucp4.UU.NET with UUCP/RMAIL ; Wed, 8 Mar 1995 14:12:09 -0500 Received: by summitis.com (smail2.5) id AA13908; 8 Mar 95 13:43:07 EST (Wed) Received: from summitis.com by rserv1.summitis.com; Wed, 8 Mar 1995 13:40 EST Received: from cheetah by rexsrvr2.summitis.com (AIX 3.2/UCB 5.64/4.03) id AA62610; Wed, 8 Mar 1995 13:40:28 -0500 Received: by cheetah (AIX 3.2/UCB 5.64/4.03) id AA20542; Wed, 8 Mar 1995 13:40:27 -0500 From: hc05@summitis.com Message-Id: <9503081840.AA20542@cheetah> Subject: sam or tk bug? To: sam-fans@hawkwind.utcs.toronto.edu (Sam mailing list) X-Mailer: ELM [version 2.4 PL23] Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Content-Length: 1233 Date: Wed, 8 Mar 1995 14:12:20 -0500 > >I've started using sam on RS 6000's recently and have been getting >the following error relatively often (3 times in the past two days): > > Xlib: sequence lost (0x10006 > 0xfcb) in reply type 0x0! > X Error of failed request: 0 > Major opcode of failed request: 0 () > Serial number of failed request: 6 > Current serial number in output stream: 4043 > >Then samterm exits. Has anyone seen this before? I used to get a lot of X errors like this in sam on the RS/6000, but I don' anymore. I never figured out for sure why, but I think getting X11R5 helped me (we were on X11 R4 for a long time). In any case, I can't remember the last time it died on me. It could be a sam version issue too. Unfortunately I don't know how to tell what version I have. I think it is the one before the recent release, with the samx2 patches added in. Beirne -- ------------------------------------------------------------------------------- Beirne Konarski | Reading maketh a full man, conference a beirnek@summitis.com | ready man, and writing an exact man. "Untouched by Scandal" | -- Francis Bacon ------------------------------------------------------------------------------- From sam-fans-owner Wed Mar 8 19:51:13 1995 Received: from email.nla.gov.au ([192.102.239.3]) by hawkwind.utcs.utoronto.ca with SMTP id <24048>; Wed, 8 Mar 1995 19:50:20 -0500 Received: by email.nla.gov.au id AA105571 (5.65c/IDA-1.4.4); Thu, 9 Mar 1995 10:45:44 +1000 From: "Michael F. Ledwidge" Subject: Re: sam or tk bug? To: hc05@summitis.com Cc: Sam mailing list In-Reply-To: <9503081840.AA20542@cheetah> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Date: Wed, 8 Mar 1995 19:50:08 -0500 On Wed, 8 Mar 1995 hc05@summitis.com wrote: > > > >Then samterm exits. Has anyone seen this before? > > I used to get a lot of X errors like this in sam on the RS/6000, but I > don' anymore. I never figured out for sure why, but I think getting > X11R5 helped me (we were on X11 R4 for a long time). In any case, I > can't remember the last time it died on me. It could be a sam version > issue too. Unfortunately I don't know how to tell what version I have. I > think it is the one before the recent release, with the samx2 patches added > in. > Where is the latest release kept? Our RS6000 binary has always being shaky and it has a lot of trouble with spurious control characters. Actually, just checking, we're still using Version 3. Pointers please! Thanx, .M. *********************************************************************** Michael Ledwidge National Library of Australia From sam-fans-owner Fri Mar 10 16:33:05 1995 Received: from halon.sybase.com ([192.138.151.33]) by hawkwind.utcs.utoronto.ca with SMTP id <24051>; Fri, 10 Mar 1995 16:27:38 -0500 Received: from sybase.com (sybgate.sybase.com) by halon.sybase.com (5.0/SMI-SVR4/SybFW4.0) id AA04090; Fri, 10 Mar 1995 07:27:09 -0800 Received: from constantine.sybgate.sybase.com by sybase.com (4.1/SMI-4.1/SybH3.4) id AA13313; Fri, 10 Mar 95 07:25:02 PST Received: by constantine.sybgate.sybase.com (4.1/SMI-4.1/SybEC3.2) id AA20483; Fri, 10 Mar 95 15:25:00 GMT Date: Fri, 10 Mar 1995 10:25:00 -0500 From: mgm@sybase.com (Mike McKenna) Message-Id: <9503101525.AA20483@constantine.sybgate.sybase.com> To: sam-fans@hawkwind.utcs.toronto.edu Subject: Printing postscript? content-length: 0 Does anyone know how to take a plain-text FSS-UTF file created with sam and print it out to a postscript printer? I can't seem to be able to get the non-ASCII characters to print out correctly. I'm running on Sun/OS 4.1.x. I need to be able to print the accented roman characters used in Eastern Europe, as well as Russian and Greek. I even tried converting them to raw Unicode via tcs, then sending them over to a Windows/NT box, but that didn't work either :-( Thanx for any suggestions! Mike____ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Michael G. McKenna mgm@sybase.com Globalisation Architect Global Products Group Mike.McKenna@Sybase.Com Sybase (UK) Limited (+)44 (0)628 597125 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From sam-fans-owner Sun Mar 12 01:20:47 1995 Received: from emory.mathcs.emory.edu ([128.140.2.1]) by hawkwind.utcs.utoronto.ca with SMTP id <24053>; Sun, 12 Mar 1995 01:19:14 -0500 Received: from skeeve.UUCP by emory.mathcs.emory.edu (5.65/Emory_mathcs.4.0.12) via UUCP id AA15114 ; Sun, 12 Mar 95 01:19:00 -0500 Return-Path: arnold@skeeve.atl.ga.us Received: by skeeve.atl.ga.us (/\==/\ Smail3.1.22.1 #22.1) id ; Sat, 11 Mar 95 23:14 EST Message-Id: From: arnold@skeeve.atl.ga.us Date: Sat, 11 Mar 1995 23:14:27 -0500 X-Ultrix: Just Say NO! X-Important-Saying: Premature Optimization Is The Root Of All Evil. X-Mailer: Mail User's Shell (7.2.5 10/14/92) To: sam-fans@hawkwind.utcs.toronto.edu Subject: handlebar streamers Does anyone have a good idea as to how hard it would be to get sam/samterm to change the icon name to the current file? That way if I have several samterms running (from, say, different machines) and hidden with 9wm, I can tell by looking at the 9wm menu which one I want to restore. Yet Another Random Thought, Arnold From sam-fans-owner Mon Mar 13 04:23:31 1995 Received: from cegelecproj.co.uk ([159.245.72.6]) by hawkwind.utcs.utoronto.ca with SMTP id <24054>; Mon, 13 Mar 1995 04:09:22 -0500 Received: from vampire.cegelecproj.co.uk (cerberus.cegelecproj.co.uk) by cegelecproj.co.uk (4.1/SMI-4.1) id AA12315; Mon, 13 Mar 95 08:43:34 GMT Received: from spirit.cegelecproj.co.uk (spirit.limbo.cegelecproj.co.uk) by vampire.cegelecproj.co.uk (5.0/SMI-SVR4) id AA01416; Mon, 13 Mar 1995 08:49:32 +0000 Received: by spirit.cegelecproj.co.uk (5.0/SMI-SVR4) id AA08311; Mon, 13 Mar 1995 08:29:08 +0000 Date: Mon, 13 Mar 1995 03:29:08 -0500 From: Steve_Kilbane@cegelecproj.co.uk (Steve_Kilbane) Message-Id: <9503130829.AA08311@spirit.cegelecproj.co.uk> X-Planation: X-Faces images can be viewed with the XFaces program To: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: handlebar streamers Content-Length: 843 X-Face: Iqsa(US9p?)Y^W+6Ff[Z]rM"uFE) lFDjag1e]\/#2 *What* is this subject about? Arnold writes: > Does anyone have a good idea as to how hard it would be to get sam/samterm > to change the icon name to the current file? Hmm. Shouldn't be *too* difficult - if you want a *really* easy hack, put a call to the icon-setting function in the menu-line creation function. After all, it has to know the name and whether the file is current (ugh!). > That way if I have several > samterms running (from, say, different machines) and hidden with 9wm, I can > tell by looking at the 9wm menu which one I want to restore. Ah, in that case, there's a simpler way - you could do it from outside sam. I don't mean having the icon name changed automatically, but you could use 9term's "label" to change the icon name of samterm. If you wanted, you could also have it send a "b" to sam's pipe. :-) steve From sam-fans-owner Wed Mar 15 02:47:22 1995 Received: from galapagos.cse.psu.edu ([130.203.2.12]) by hawkwind.utcs.utoronto.ca with SMTP id <24062>; Wed, 15 Mar 1995 02:45:32 -0500 Received: from localhost by galapagos.cse.psu.edu with SMTP id <12684>; Wed, 15 Mar 1995 02:45:17 -0500 To: Sam Fans Subject: MAXFILES, ouch! Date: Wed, 15 Mar 1995 02:45:16 -0500 From: Scott Schwartz Message-Id: <95Mar15.024517est.12684@galapagos.cse.psu.edu> void menuins(int n, uchar *s, Text *t, int m, int tg) { int i; if(nname == MAXFILES) panic("menuins"); Panic? Ouch! That's a pretty harsh penalty for a software tool to exact for exceeding arbitrary limits. (perror then gets to say "Not a tty", or the local equivalent, just before samterm stops being a tty. ☺) From sam-fans-owner Fri Mar 17 08:09:05 1995 Received: from cegelecproj.co.uk ([159.245.72.6]) by hawkwind.utcs.utoronto.ca with SMTP id <24065>; Fri, 17 Mar 1995 08:07:20 -0500 Received: from vampire.cegelecproj.co.uk (cerberus.cegelecproj.co.uk) by cegelecproj.co.uk (4.1/SMI-4.1) id AA01327; Fri, 17 Mar 95 13:07:01 GMT Received: from spirit.cegelecproj.co.uk (spirit.limbo.cegelecproj.co.uk) by vampire.cegelecproj.co.uk (5.0/SMI-SVR4) id AA09852; Fri, 17 Mar 1995 12:03:49 +0000 Received: by spirit.cegelecproj.co.uk (5.0/SMI-SVR4) id AA03171; Fri, 17 Mar 1995 11:43:12 +0000 Date: Fri, 17 Mar 1995 06:43:12 -0500 From: Steve_Kilbane@cegelecproj.co.uk (Steve_Kilbane) Message-Id: <9503171143.AA03171@spirit.cegelecproj.co.uk> X-Planation: X-Faces images can be viewed with the XFaces program To: sam-fans@hawkwind.utcs.toronto.edu Subject: Subject: fixed bug? Content-Length: 530 X-Face: Iqsa(US9p?)Y^W+6Ff[Z]rM"uFE) lFDjag1e]\/#2 In the version of sam that I'm using, if I do the following: - sam * - think, "hmm, that includes a binary - i'll delete it" - D then sam attempts to open a window on a file. Not only is this not necessarily what I want, but on occasion, it's done this on the file I'm deleting. It's irritating enough, but last night I did this on a 10MB file, and it took *ages*. So, since I consider this a bug, has it been fixed in the latest release? I haven't upgraded yet, since everything else works fine... steve From sam-fans-owner Fri Mar 17 09:11:56 1995 Received: from emory.mathcs.emory.edu ([128.140.2.1]) by hawkwind.utcs.utoronto.ca with SMTP id <24065>; Fri, 17 Mar 1995 09:11:33 -0500 Received: from skeeve.UUCP by emory.mathcs.emory.edu (5.65/Emory_mathcs.4.0.12) via UUCP id AA26856 ; Fri, 17 Mar 95 09:11:08 -0500 Return-Path: arnold@skeeve.atl.ga.us Received: by skeeve.atl.ga.us (/\==/\ Smail3.1.22.1 #22.1) id ; Tue, 14 Mar 95 09:31 EST Message-Id: From: arnold@skeeve.atl.ga.us Date: Tue, 14 Mar 1995 09:31:21 -0500 X-Ultrix: Just Say NO! X-Important-Saying: Premature Optimization Is The Root Of All Evil. X-Mailer: Mail User's Shell (7.2.5 10/14/92) To: sam-fans@hawkwind.utcs.toronto.edu Subject: samx patches? Hi. I just tried uxc.cso.uiuc.edu, the alleged home of the samx patches, anddd could not anonymous ftp login. Can someone mail me the patches, or point me to the location? Thanks, Arnold From sam-fans-owner Fri Mar 17 09:26:36 1995 Received: from cegelecproj.co.uk ([159.245.72.6]) by hawkwind.utcs.utoronto.ca with SMTP id <24065>; Fri, 17 Mar 1995 09:26:08 -0500 Received: from vampire.cegelecproj.co.uk (cerberus.cegelecproj.co.uk) by cegelecproj.co.uk (4.1/SMI-4.1) id AA02467; Fri, 17 Mar 95 14:25:44 GMT Received: from spirit.cegelecproj.co.uk (spirit.limbo.cegelecproj.co.uk) by vampire.cegelecproj.co.uk (5.0/SMI-SVR4) id AA12088; Fri, 17 Mar 1995 14:32:17 +0000 Received: by spirit.cegelecproj.co.uk (5.0/SMI-SVR4) id AA03277; Fri, 17 Mar 1995 14:11:39 +0000 Date: Fri, 17 Mar 1995 09:11:39 -0500 From: Steve_Kilbane@cegelecproj.co.uk (Steve_Kilbane) Message-Id: <9503171411.AA03277@spirit.cegelecproj.co.uk> X-Planation: X-Faces images can be viewed with the XFaces program To: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: Subject: fixed bug? Content-Length: 1079 X-Face: Iqsa(US9p?)Y^W+6Ff[Z]rM"uFE) lFDjag1e]\/#2 rob replied with the following, and asked me to forward it. steve > From rob@plan9.research.att.com Fri Mar 17 14:21 GMT 1995 > From: rob@plan9.research.att.com > To: Steve_Kilbane@cegelecproj.co.uk > Date: Fri, 17 Mar 1995 09:14:41 EST > Subject: Re: Subject: fixed bug? > > when you type a command, it must be to an open file, but not an open window. > i tried what you said and it made no attempt to open a window on the file. > it did, however, load it in. is that a bug? maybe. but not the one you think. > sam needs just *some* file to talk to; give it one, and > D file > will just delete that file. the problem you're having is that sam is grabbing > the first file on your list when you type that command because it wants some > file to be attached to the command (that is very hard to fix, i think); it just > happened to be a big ugly one in your case. find another file first, or make > one with "new", and things will behave well. > > there's talk of mapping acme's buffer management stuff into sam, which > will make sam much faster at loading files. > From sam-fans-owner Fri Mar 17 09:29:30 1995 Received: from ux2.cso.uiuc.edu ([128.174.5.3]) by hawkwind.utcs.utoronto.ca with SMTP id <24066>; Fri, 17 Mar 1995 09:29:13 -0500 Received: by ux2.cso.uiuc.edu id AA75514 (5.67a/IDA-1.5 for sam-fans@hawkwind.utcs.toronto.edu); Fri, 17 Mar 1995 08:29:24 -0600 Date: Fri, 17 Mar 1995 09:29:24 -0500 From: Ed Kubaitis - CCSO Message-Id: <199503171429.AA75514@ux2.cso.uiuc.edu> To: arnold@skeeve.atl.ga.us, sam-fans@hawkwind.utcs.toronto.edu Subject: Re: samx patches? |Hi. I just tried uxc.cso.uiuc.edu, the alleged home of the samx patches, |anddd could not anonymous ftp login. Can someone mail me the patches, or |point me to the location? Hi. They are in ftp://vixen.cso.uiuc.edu/pub/sam/ You'll get a few rejected hunks in libXg in the latest sam distribution. But the rejected pieces are no longer needed with Matty Farrow's libXg, so ignore the rejections and do the build. Ed From sam-fans-owner Fri Mar 17 09:57:07 1995 Received: from relay1.UU.NET ([192.48.96.5]) by hawkwind.utcs.utoronto.ca with SMTP id <24065>; Fri, 17 Mar 1995 09:56:44 -0500 Received: from sco.sco.COM by relay1.UU.NET with SMTP id QQyhlr28210; Fri, 17 Mar 1995 09:56:20 -0500 Received: from scocan.scocan.sco.COM by sco.sco.COM id ac20171; Fri, 17 Mar 95 6:42:57 PST Received: from bluenote.scocan.sco.COM by scocan.scocan.sco.COM id aa13065; 17 Mar 95 9:51 EST Received: from localhost by bluenote.scocan.sco.COM id aa01558; 17 Mar 95 9:51 EST To: Ed Kubaitis - CCSO Cc: arnold@skeeve.atl.ga.us, sam-fans@hawkwind.utcs.toronto.edu Subject: Re: samx patches? Date: Fri, 17 Mar 1995 09:51:51 -0500 From: Bob Gibson Message-ID: <9503170951.aa01558@bluenote.scocan.sco.COM> | Hi. They are in | | ftp://vixen.cso.uiuc.edu/pub/sam/ | | You'll get a few rejected hunks in libXg in the latest sam distribution. | But the rejected pieces are no longer needed with Matty Farrow's libXg, | so ignore the rejections and do the build. I also found that patch was confused by the fact that libg.h has moved from ~sam/libXg to ~sam/include. From sam-fans-owner Fri Mar 17 11:24:11 1995 Received: from minster.york.ac.uk ([144.32.128.41]) by hawkwind.utcs.utoronto.ca with SMTP id <24065>; Fri, 17 Mar 1995 11:23:24 -0500 From: pete@minster.york.ac.uk Date: Fri, 17 Mar 1995 09:16:01 -0500 Message-ID: To: arnold@skeeve.atl.ga.us, sam-fans@hawkwind.utcs.toronto.edu Subject: Re: samx patches? I've got a copy. I'll mail them to Arnold. pete From sam-fans-owner Mon Mar 27 11:21:59 1995 Received: from relay3.UU.NET ([192.48.96.8]) by hawkwind.utcs.utoronto.ca with SMTP id <24071>; Mon, 27 Mar 1995 11:13:05 -0500 Received: from uucp1.UU.NET by relay3.UU.NET with SMTP id QQyiwu25327; Mon, 27 Mar 1995 11:12:47 -0500 Received: from rexago8.UUCP by uucp1.UU.NET with UUCP/RMAIL ; Mon, 27 Mar 1995 11:12:46 -0500 Received: by summitis.com (smail2.5) id AA04909; 27 Mar 95 10:56:36 EST (Mon) Received: from summitis.com by rserv1.summitis.com; Mon, 27 Mar 1995 10:54 EST Received: from cheetah by rexsrvr2.summitis.com (AIX 3.2/UCB 5.64/4.03) id AA57516; Mon, 27 Mar 1995 10:54:26 -0500 Received: by cheetah (AIX 3.2/UCB 5.64/4.03) id AA16463; Mon, 27 Mar 1995 10:54:24 -0500 From: hc05@summitis.com Message-Id: <9503271554.AA16463@cheetah> Subject: Editors compendium & sam To: sam-fans@hawkwind.utcs.toronto.edu (Sam mailing list) X-Mailer: ELM [version 2.4 PL23] Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Content-Length: 4232 Date: Mon, 27 Mar 1995 11:12:53 -0500 I just read the editors compendium in comp.editors, which is a tabular comparison of lots of editors, and saw a lot of holes in the sam column. I was going to write to the guy and fill them in, but figured I'd post my views here first to make sure I'm not missing something. I list the items below that were blank in the compendium, with my opinion on the correct answer. I welcome any corrections. I also list a few where I think the compendium is wrong. I added descriptions where I thought they were needed for because the title wasn't clear enough. If anyone wants to see the whole compendium I can send it to them or post it to the list. It is of course also available in comp.editors. Beirne ---------------------------------------------------------------------- Enter ASCII codes by #: Use command '; Mon, 27 Mar 1995 11:46:02 -0500 From: rob@plan9.att.com To: sam-fans@hawkwind.utcs.toronto.edu Date: Mon, 27 Mar 1995 11:45:07 -0500 Subject: Re: Editors compendium & sam Message-Id: <95Mar27.114602est.24072@hawkwind.utcs.utoronto.ca> it seems that sam doesn't fit their model very well, which doesn't surprise me. one thing they can't encompass is that the mouse language and command language solve different sets of problems. general comments: there is no such thing (in sam as i wrote it, at least) as a sam macro, so i'm not sure what you mean by the word 'macro'. details: Goto column number: It says you can do this, but I don't know how. I know I can put the cursor anywhere I want with the mouse, but don't know how to go to the nth column on a line. sam has no notion of column, only characters. Goto begin next line: ? + Goto begin prev line: ? - Prog lang senstive mode: This says yes, but I don't know of any direct features for this. no Tag search: Yes, with the help of an external program. if the program's not there, does that count? Interactive debugging: No. with acid, the external B command does a nice job. Syntax highlighting: No. it's really 'no', but i don't miss it in C because of the double-clicking rules Binary editor: They give three categories. I think this one is closest: "displays binary characters doesn't do CR/LF conversion on binary files" sam throws away nuls; it can't be used on binary files. Invertcase curr word: A macro could be written to do this. Uppercase curr word: A macro could be written to do this. Lowercase curr word: A macro could be written to do this. command, not macro. Indent selected region: Yes, using a macro. command Srch select region: No. x/pattern/p List all occurances: Yes. occurrences. tell me this is your typo. Internationalization: No. although it works with any character set and is supported with Unicode. Printing: This means "Many editors allow you to print selected text directly to a printer". Yes, with a macro. command From sam-fans-owner Mon Mar 27 12:02:47 1995 Received: from sartre.minerva.bah.com ([156.80.175.13]) by hawkwind.utcs.utoronto.ca with SMTP id <24076>; Mon, 27 Mar 1995 12:00:15 -0500 Received: from pigsnose by sartre.minerva.bah.com (NX5.67d/NX3.0M) id AA05655; Mon, 27 Mar 95 12:01:06 -0500 Date: Mon, 27 Mar 1995 12:01:06 -0500 From: Erik Quanstrom To: Message-Id: <9503271701.AA05655@sartre.minerva.bah.com> Apparently-To: Apparently-To: >Enter ASCII codes by #: Use command ' location. also 0Xnnnn will insert any the utf-8 character of number nnnn at the current location. this is a superset of ascii, so the answer is yes. >Goto column number: It says you can do this, but I don't know how. I know > I can put the cursor anywhere I want with the mouse, but don't know > how to go to the nth column on a line. -/^/+#10 go to 10th column >Goto begin next line: ? +,/^/ (0th postion on next line) but for god sakes, use the mouse. >Goto begin prev line: ? - -,/^/ >Move cursor up by page: yes, using the mouse on the scrollbar. using up on keyboard, too >Move cursor dn by page: yes, using the mouse on the scrollbar. using down on keyboard, too >Scroll curr line to TOS/MOS/BOS: Yes/No/No. use the mouse >Binary editor: They give three categories. I think this one is closest: > "displays binary characters doesn't do CR/LF conversion on binary files" elides \0. From sam-fans-owner Mon Mar 27 12:05:04 1995 Received: from sartre.minerva.bah.com ([156.80.175.13]) by hawkwind.utcs.utoronto.ca with SMTP id <24077>; Mon, 27 Mar 1995 12:02:42 -0500 Received: from pigsnose by sartre.minerva.bah.com (NX5.67d/NX3.0M) id AA05659; Mon, 27 Mar 95 12:01:14 -0500 Date: Mon, 27 Mar 1995 12:01:14 -0500 From: Erik Quanstrom Message-Id: <9503271701.AA05659@sartre.minerva.bah.com> To: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: Editors compendium & sam >Enter ASCII codes by #: Use command ' location. also 0Xnnnn will insert any the utf-8 character of number nnnn at the current location. this is a superset of ascii, so the answer is yes. >Goto column number: It says you can do this, but I don't know how. I know > I can put the cursor anywhere I want with the mouse, but don't know > how to go to the nth column on a line. -/^/+#10 go to 10th column >Goto begin next line: ? +,/^/ (0th postion on next line) but for god sakes, use the mouse. >Goto begin prev line: ? - -,/^/ >Move cursor up by page: yes, using the mouse on the scrollbar. using up on keyboard, too >Move cursor dn by page: yes, using the mouse on the scrollbar. using down on keyboard, too >Scroll curr line to TOS/MOS/BOS: Yes/No/No. use the mouse >Binary editor: They give three categories. I think this one is closest: > "displays binary characters doesn't do CR/LF conversion on binary files" elides \0. From sam-fans-owner Mon Mar 27 12:15:22 1995 Received: from plan9.att.com ([192.20.225.252]) by hawkwind.utcs.utoronto.ca with SMTP id <24078>; Mon, 27 Mar 1995 12:12:49 -0500 From: rob@plan9.att.com To: sam-fans@hawkwind.utcs.toronto.edu Date: Mon, 27 Mar 1995 12:12:19 -0500 Message-Id: <95Mar27.121249est.24078@hawkwind.utcs.utoronto.ca> oh yes, i missed the 'begin' : >Goto begin next line: ? +0+#0 >Goto begin prev line: ? -0-#0 From sam-fans-owner Mon Mar 27 15:43:40 1995 Received: from relay3.UU.NET ([192.48.96.8]) by hawkwind.utcs.utoronto.ca with SMTP id <24079>; Mon, 27 Mar 1995 15:40:56 -0500 Received: from uucp3.UU.NET by relay3.UU.NET with SMTP id QQyixm06084; Mon, 27 Mar 1995 15:40:42 -0500 Received: from rexago8.UUCP by uucp3.UU.NET with UUCP/RMAIL ; Mon, 27 Mar 1995 15:40:41 -0500 Received: by summitis.com (smail2.5) id AA07733; 27 Mar 95 15:16:03 EST (Mon) Received: from summitis.com by rserv1.summitis.com; Mon, 27 Mar 1995 15:14 EST Received: from cheetah by rexsrvr2.summitis.com (AIX 3.2/UCB 5.64/4.03) id AA113230; Mon, 27 Mar 1995 15:13:48 -0500 Received: by cheetah (AIX 3.2/UCB 5.64/4.03) id AA21809; Mon, 27 Mar 1995 15:13:46 -0500 From: hc05@summitis.com Message-Id: <9503272013.AA21809@cheetah> Subject: Re: Editors compendium & sam To: sam-fans@hawkwind.utcs.toronto.edu (Sam mailing list) X-Mailer: ELM [version 2.4 PL23] Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Content-Length: 4611 Date: Mon, 27 Mar 1995 15:40:47 -0500 Thanks for the replies so far on the editor compendium. I'll respond to both Erik & Rob here. A few of the suggestions don't work in all situations, so we'll have to decide how to state them. Beirne From: Erik Quanstrom >>Goto column number: It says you can do this, but I don't know how. I know >> I can put the cursor anywhere I want with the mouse, but don't know >> how to go to the nth column on a line. >-/^/+#10 > >go to 10th column Good, but it won't work on the first line, if this matters. >>Goto begin next line: ? >+,/^/ (0th postion on next line) This doesn't work if you are at the beginning of a line. How about just /^/ > >but for god sakes, use the mouse. Agreed. > >>Goto begin prev line: ? >- >-,/^/ This selects the previous and current lines. > >>Move cursor up by page: yes, using the mouse on the scrollbar. >using up on keyboard, too >>Move cursor dn by page: yes, using the mouse on the scrollbar. >using down on keyboard, too Of course! > >>Scroll curr line to TOS/MOS/BOS: Yes/No/No. >use the mouse You can use the mouse to move the current line to the top of the screen, but there is not a simple way to move the current line to the middle or bottom, short of a bunch of trial-and-error clicks, unless there is something I am missing. > >>Binary editor: They give three categories. I think this one is closest: >> "displays binary characters doesn't do CR/LF conversion on binary files" >elides \0. Good. I'll have to remember this. From: uunet!plan9.att.com!rob >it seems that sam doesn't fit their model very well, which doesn't surprise me. >one thing they can't encompass is that the mouse language and command >language solve different sets of problems. > I agree, since sam has almost no features and almost infinite capabilities. >general comments: there is no such thing (in sam as i wrote it, at least) as a >sam macro, so i'm not sure what you mean by the word 'macro'. I looked at the compendium again, and found a better choice than to say macros, which is to use the following, so I will substitute this wherever I said macro. ^ The editor does not have a specific command to do this, but it can be very easily done with a couple of keystrokes. I.e. Clear buffer may be implemented as: select buffer contents command, delete selection. The compendium does have one item as being implemented with a macro, which is "Spell check select text". I did this with an external script that I wrote that is a front end to ispell, but this should go in the filter category in the compendium rather than as a macro. > >details: > > Goto column number: It says you can do this, but I don't know how. I know > I can put the cursor anywhere I want with the mouse, but don't know > how to go to the nth column on a line. >sam has no notion of column, only characters. > Goto begin next line: ? This highlights the next line. >+ > Goto begin prev line: ? >- This highlights the previous line. > Tag search: Yes, with the help of an external program. >if the program's not there, does that count? Good question. I just looked, and I got the tag program with the samx extensions, which I am not counting here, although I couldn't live without them. > > Interactive debugging: No. >with acid, the external B command does a nice job. Is acid available for UNIX? This does make me realize that I should add Plan 9 to the OS list. > > Syntax highlighting: No. >it's really 'no', but i don't miss it in C because of the double-clicking rules Agreed. Also, I've found regular expressions to convey the C constructs I care about. > Srch select region: No. >x/pattern/p This one could be a yes. It depends on what they mean. This command selects the last occurrence in the selected region, which may be fine. > > List all occurances: Yes. >occurrences. tell me this is your typo. Its not my typo. I cut & pasted it from the compendium. oh yes, i missed the 'begin' : >Goto begin next line: ? +0+#0 Good, but it won't work if you are at the beginning of a line. >Goto begin prev line: ? -0-#0 Good, but it won't work if you are at the beginning of a line. -- ------------------------------------------------------------------------------- Beirne Konarski | Reading maketh a full man, conference a beirnek@summitis.com | ready man, and writing an exact man. "Untouched by Scandal" | -- Francis Bacon ------------------------------------------------------------------------------- From sam-fans-owner Mon Mar 27 16:15:46 1995 Received: from plan9.att.com ([192.20.225.252]) by hawkwind.utcs.utoronto.ca with SMTP id <24080>; Mon, 27 Mar 1995 16:13:05 -0500 From: rob@plan9.att.com To: sam-fans@hawkwind.utcs.toronto.edu Date: Mon, 27 Mar 1995 16:02:32 -0500 Subject: Re: Editors compendium & sam Message-Id: <95Mar27.161305est.24080@hawkwind.utcs.utoronto.ca> wait for them to characterize acme this way. From sam-fans-owner Tue Mar 28 02:06:56 1995 Received: from cegelecproj.co.uk ([159.245.72.6]) by hawkwind.utcs.utoronto.ca with SMTP id <24071>; Tue, 28 Mar 1995 02:05:05 -0500 Received: from vampire.cegelecproj.co.uk (cerberus.cegelecproj.co.uk) by cegelecproj.co.uk (4.1/SMI-4.1) id AA05082; Tue, 28 Mar 95 08:04:49 BST Received: from spirit.cegelecproj.co.uk (spirit.limbo.cegelecproj.co.uk) by vampire.cegelecproj.co.uk (5.0/SMI-SVR4) id AA18393; Tue, 28 Mar 1995 08:11:30 +0000 Received: by spirit.cegelecproj.co.uk (5.0/SMI-SVR4) id AA04125; Tue, 28 Mar 1995 07:50:23 +0000 Date: Tue, 28 Mar 1995 02:50:23 -0500 From: Steve_Kilbane@cegelecproj.co.uk (Steve_Kilbane) Message-Id: <9503280650.AA04125@spirit.cegelecproj.co.uk> X-Planation: X-Faces images can be viewed with the XFaces program To: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: Editors compendium & sam Content-Length: 188 X-Face: Iqsa(US9p?)Y^W+6Ff[Z]rM"uFE) lFDjag1e]\/#2 For going to the beginning of previous line, I find --#0 works better. however, it seems better to say "yes, but using the mouse is easier", because it saves misrepresenting sam... steve From sam-fans-owner Thu Mar 30 20:18:00 1995 Received: from galapagos.cse.psu.edu ([130.203.2.12]) by hawkwind.utcs.utoronto.ca with SMTP id <24071>; Thu, 30 Mar 1995 20:15:23 -0500 Received: by galapagos.cse.psu.edu id <12683>; Thu, 30 Mar 1995 20:14:57 -0500 From: Scott Schwartz To: sam-fans@hawkwind.utcs.toronto.edu Subject: umask Message-Id: <95Mar30.201457est.12683@galapagos.cse.psu.edu> Date: Thu, 30 Mar 1995 20:14:49 -0500 I run with 022, but some things I'd rather have tighter control over. Sam makes temp files at various times that don't really need to be group or world writable. Hence this suggestion: =================================================================== RCS file: RCS/mesg.c,v retrieving revision 1.1 diff -r1.1 mesg.c 83c83 < fd = create("/tmp/sam.out", 1, 0666L); --- > fd = create("/tmp/sam.out", 1, 0600L); =================================================================== RCS file: RCS/sam.c,v retrieving revision 1.1 diff -r1.1 sam.c 153c153 < io = create(buf, 1, 0777); --- > io = create(buf, 1, 0700); =================================================================== RCS file: RCS/shell.c,v retrieving revision 1.1 diff -r1.1 shell.c 37c37 < fd = create(errfile, 1, 0666L); --- > fd = create(errfile, 1, 0600L); From sam-fans-owner Wed Apr 5 05:55:23 1995 Received: from cegelecproj.co.uk ([159.245.72.6]) by hawkwind.utcs.utoronto.ca with SMTP id <24081>; Wed, 5 Apr 1995 05:53:30 -0400 Received: from vampire.cegelecproj.co.uk (cerberus.cegelecproj.co.uk) by cegelecproj.co.uk (4.1/SMI-4.1) id AA14982; Wed, 5 Apr 95 10:53:24 BST Received: from spirit.cegelecproj.co.uk (spirit.limbo.cegelecproj.co.uk) by vampire.cegelecproj.co.uk (5.0/SMI-SVR4) id AA09996; Wed, 5 Apr 1995 11:00:10 +0000 Received: by spirit.cegelecproj.co.uk (5.0/SMI-SVR4) id AA10913; Wed, 5 Apr 1995 10:38:38 +0000 Date: Wed, 5 Apr 1995 06:38:38 -0400 From: Steve_Kilbane@cegelecproj.co.uk (Steve_Kilbane) Message-Id: <9504050938.AA10913@spirit.cegelecproj.co.uk> X-Planation: X-Faces images can be viewed with the XFaces program To: sam-fans@hawkwind.utcs.toronto.edu Subject: sweeping sam? Content-Length: 273 X-Face: Iqsa(US9p?)Y^W+6Ff[Z]rM"uFE) lFDjag1e]\/#2 Is there any way to get sam to allow its window to be swept, when it starts up under 9wm? currently i specify dimensions in app-defaults/Sam, but if i remove these, I just get an error because the window is then zero width/height. This, btw, is under Solaris 2.3... steve From sam-fans-owner Fri Apr 7 03:51:52 1995 Received: from cegelecproj.co.uk ([159.245.72.6]) by hawkwind.utcs.utoronto.ca with SMTP id <24081>; Fri, 7 Apr 1995 03:50:04 -0400 Received: from vampire.cegelecproj.co.uk (cerberus.cegelecproj.co.uk) by cegelecproj.co.uk (4.1/SMI-4.1) id AA24866; Fri, 7 Apr 95 08:49:54 BST Received: from spirit.cegelecproj.co.uk (spirit.limbo.cegelecproj.co.uk) by vampire.cegelecproj.co.uk (5.0/SMI-SVR4) id AA05194; Fri, 7 Apr 1995 08:48:54 +0000 Received: by spirit.cegelecproj.co.uk (5.0/SMI-SVR4) id AA01265; Fri, 7 Apr 1995 08:49:42 +0000 Date: Fri, 7 Apr 1995 04:49:42 -0400 From: Steve_Kilbane@cegelecproj.co.uk (Steve_Kilbane) Message-Id: <9504070749.AA01265@spirit.cegelecproj.co.uk> X-Planation: X-Faces images can be viewed with the XFaces program To: sam-fans@hawkwind.utcs.toronto.edu Subject: 9term mark patch Content-Length: 1870 X-Face: Iqsa(US9p?)Y^W+6Ff[Z]rM"uFE) lFDjag1e]\/#2 This is a patch for 9term 1.6.3. It adds another toggled option to menu button 2, with the values "mark" and "select". The former records the current position of selected text, while the latter selects all text between the saved position and the current selection, inclusive. Enjoy, steve diff -c orig/9term.c hacked/9term.c *** orig/9term.c Fri Apr 7 08:39:32 1995 --- hacked/9term.c Fri Apr 7 08:42:08 1995 *************** *** 25,36 **** int waterquantum; int beepmask; int ninewm; ! static char *items[] = { "cut", "paste", "snarf", "send", "scroll", 0 }; static Menu edit = {items}; enum { mCUT, mPASTE, mSNARF, mSEND, mSCROLL }; --- 25,39 ---- int waterquantum; int beepmask; int ninewm; + static long mark0, mark1; + static int markset; ! static char *items[] = { "cut", "paste", "snarf", "mark", "send", "scroll", 0 }; static Menu edit = {items}; enum { mCUT, mPASTE, mSNARF, + mMARK, mSEND, mSCROLL }; *************** *** 398,403 **** --- 401,407 ---- static Rune nl[] = { '\n', 0 }; specialchars(slave_fd); + edit.item[mMARK] = markset?"select":"mark"; edit.item[mSCROLL] = text->scrolling?"noscroll":"scroll"; switch (menuhit(2, m, &edit)) { *************** *** 415,420 **** --- 419,440 ---- if (text->snarfed) { textdelete(text, text->p0, text->p1); inputrune(text, text->snarfed, text->snarflen); + } + break; + case mMARK: /* save point, or select to point */ + if (markset) { + ulong m0, m1; + + m0 = (mark0 < text->p0)? mark0 : text->p0; + m1 = (mark1 > text->p1)? mark1 : text->p1; + markset = 0; + if (m0 < text->base || text->end < m0) + textset(text, _backnl(text, m0, 3)); + texthighlight(text,m0,m1, F & ~D); + } else { + mark0 = text->p0; + mark1 = text->p1; + markset = 1; } break; case mSEND: From sam-fans-owner Fri Apr 7 05:23:04 1995 Received: from minster.york.ac.uk ([144.32.128.41]) by hawkwind.utcs.utoronto.ca with SMTP id <24081>; Fri, 7 Apr 1995 05:22:22 -0400 Message-ID: From: mhw@minster.york.ac.uk (Mark H. Wilkinson) Date: Fri, 7 Apr 1995 06:14:02 -0400 X-Face: Bsp[Ds(Y#/{==j:Cv'"IK4R^D0_z]{'OYtp2^EYqpG)88CsdBm&LJ{idLZWx}AKf}E4#|@4DT4cX3 ?!>aIVcxmd#1 X-Url: http://Dcpu1.cs.york.ac.uk:6666/mhw/ X-Mailer: Mail User's Shell (7.2.5 10/14/92) To: sam-fans@hawkwind.utcs.toronto.edu (sam mailing list) Subject: sam's memory allocator In the SP&E paper about sam it's mentioned that sam uses a custom memory allocator which allocates strings in a garbage-compacted heap. The version which is released these days uses just malloc() and realloc(). What was the reason for throwing the custom allocator away? -Mark. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Mark H. Wilkinson : Research student in user University of York, England : interface management systems From sam-fans-owner Fri Apr 7 11:42:31 1995 Received: from plan9.att.com ([192.20.225.252]) by hawkwind.utcs.utoronto.ca with SMTP id <24081>; Fri, 7 Apr 1995 11:40:57 -0400 From: rob@plan9.att.com To: sam-fans@hawkwind.utcs.toronto.edu Date: Fri, 7 Apr 1995 11:40:39 -0400 Subject: Re: sam's memory allocator Message-Id: <95Apr7.114057edt.24081@hawkwind.utcs.utoronto.ca> The original allocator was a residue of life on the Blit. When I moved the program to a Unicode character set and had to redo the allocation, it seemed superfluous. From sam-fans-owner Mon Apr 17 16:52:35 1995 Received: from noc.tor.hookup.net ([165.154.1.1]) by hawkwind.utcs.utoronto.ca with SMTP id <24101>; Mon, 17 Apr 1995 16:43:12 -0400 Received: (Upuka@localhost) by noc.tor.hookup.net (8.6.12/1.340) id QAA11834; Mon, 17 Apr 1995 16:43:02 -0400 Received: from jaguar.staveley.com by staveley.com (4.1/MSC-1.2 (SMI-4.1)) id AA19339; Mon, 17 Apr 95 16:12:32 EDT Received: by jaguar.staveley.com (5.x/SMI-SVR4) id AA08486; Mon, 17 Apr 1995 16:12:28 -0400 Date: Mon, 17 Apr 1995 16:12:28 -0400 From: marc@puka.staveley.com (Marc Staveley) Message-Id: <9504172012.AA08486@jaguar.staveley.com> To: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: help Reply-To: marc@staveley.com (Marc Staveley) X-Sun-Charset: US-ASCII please add ML-sam@staveley.com to the sam-fans mailing list. ...marc _______________ Marc Staveley marc@staveley.com Marc Staveley Consulting P.O Box 261 Buckhorn, Ontario (705) 657-3617 [voice] K0L 1J0 Canada (705) 657-2270 [fax] From sam-fans-owner Thu Apr 20 07:46:29 1995 Received: from sangam.ncst.ernet.in ([144.16.11.1]) by hawkwind.utcs.utoronto.ca with SMTP id <24104>; Thu, 20 Apr 1995 07:44:41 -0400 Received: from soochak.ncst.ernet.in (soochak.ncst.ernet.in [144.16.11.100]) by sangam.ncst.ernet.in (8.6.8.1/8.6.6) with ESMTP id RAA01933 for ; Thu, 20 Apr 1995 17:13:43 +0530 Received: from iisc.ernet.in (iisc.iisc.ernet.in [144.16.64.3]) by soochak.ncst.ernet.in (8.6.8.1/8.6.5) with SMTP id RAA07139 for ; Thu, 20 Apr 1995 17:13:31 +0530 Received: from sasi.ernet.in by iisc.ernet.in (ERNET-IISc/SMI-4.1) id AA15687; Thu, 20 Apr 95 17:18:12+0530 Received: from india29.sasi by sasi.ernet.in (4.1/SMI-4.1) id AA12095; Thu, 20 Apr 95 14:22:46+050 From: kp@sasi.ernet.in (Kiran Pamnany) Return-Receipt-To: Received: (kp@localhost) by india29.sasi (8.6.11/SMI-4.1) id OAA06624 for sam-fans@hawkwind.utcs.toronto.edu; Thu, 20 Apr 1995 14:20:35 +0500 Date: Thu, 20 Apr 1995 05:20:35 -0400 Message-Id: <199504200920.OAA06624@india29.sasi> To: sam-fans@hawkwind.utcs.toronto.edu Subject: any 9term patches? hi can someone point me at a location for patches for 9term? i'm particularly interested in a keyboard interface to the menu commands -- something like samx does for sam. so also for 9wm?? thanx kiran From sam-fans-owner Thu Apr 20 12:22:21 1995 Received: from cegelecproj.co.uk ([159.245.72.6]) by hawkwind.utcs.utoronto.ca with SMTP id <24104>; Thu, 20 Apr 1995 12:21:17 -0400 Received: from vampire.cegelecproj.co.uk (cerberus.cegelecproj.co.uk) by cegelecproj.co.uk (4.1/SMI-4.1) id AA03680; Thu, 20 Apr 95 17:20:54 BST Received: from spirit.cegelecproj.co.uk (spirit.limbo.cegelecproj.co.uk) by vampire.cegelecproj.co.uk (5.0/SMI-SVR4) id AA02918; Thu, 20 Apr 1995 17:20:51 +0000 Received: by spirit.cegelecproj.co.uk (5.0/SMI-SVR4) id AA02372; Thu, 20 Apr 1995 17:20:46 +0000 Date: Thu, 20 Apr 1995 13:20:46 -0400 From: Steve_Kilbane@cegelecproj.co.uk (Steve_Kilbane) Message-Id: <9504201620.AA02372@spirit.cegelecproj.co.uk> X-Planation: X-Faces images can be viewed with the XFaces program To: sam-fans@hawkwind.utcs.toronto.edu Subject: sam's pipe Content-Length: 1296 X-Face: Iqsa(US9p?)Y^W+6Ff[Z]rM"uFE) lFDjag1e]\/#2 Does anyone actually use sam's input pipe, apart from with the B command? Generally, I've hardly used it at all, but I was reading Rob's Acme paper the other day, and it mentioned sam interacting with the compiler and debugger, and I thought, why not? Took about five minutes to write a script for handling compiler errors: the script reads error messages to its stdin, and tells sam to go to the appropriate file/line. The input "make" is an exception; it does just that. feels quite nice. And no, I haven't done anything about debugger interaction.:-) So, I was just wondering if anyone else has written any other useful applications with sam's pipe.... steve #!/bin/rc # Script for going to lines with errors in. Usage: run with # no arguments, and the error lines to stdin. Sends # commands to sam's pipe. # First bit comes straight from 'B': if (~ $#USER 0) USER=$LOGNAME pipe=/tmp/.sam.$USER if (! ~ $#DISPLAY 0) pipe=$pipe.$DISPLAY if (! test -r $pipe) { echo `{basename $0}^': No pipe "'$pipe'" to sam.' >[1=2] exit 1 } while (cmd = `line) { if (~ $cmd '') { exit } if (~ $cmd (make exit)) { $cmd } else { cmd = `{echo $cmd | sed -ne 's/^"\([^"]*\)", line \([0-9]*\).*/f=''\1''; line=\2/p'} eval $cmd echo B $f >> $pipe echo $line >> $pipe } } From sam-fans-owner Thu Apr 20 15:43:16 1995 Received: from relay3.UU.NET ([192.48.96.8]) by hawkwind.utcs.utoronto.ca with SMTP id <24105>; Thu, 20 Apr 1995 15:42:03 -0400 Received: from uucp2.UU.NET by relay3.UU.NET with SMTP id QQymhy08175; Thu, 20 Apr 1995 15:41:47 -0400 Received: from rexago8.UUCP by uucp2.UU.NET with UUCP/RMAIL ; Thu, 20 Apr 1995 15:41:48 -0400 Received: by summitis.com (smail2.5) id AA10980; 20 Apr 95 15:39:45 EDT (Thu) Received: from summitis.com by rserv1.summitis.com; Thu, 20 Apr 1995 15:38 EDT Received: from cheetah by rexsrvr2.summitis.com (AIX 3.2/UCB 5.64/4.03) id AA11602; Thu, 20 Apr 1995 15:38:37 -0400 Received: by cheetah (AIX 3.2/UCB 5.64/4.03) id AA19245; Thu, 20 Apr 1995 15:38:34 -0400 From: hc05@summitis.com Message-Id: <9504201938.AA19245@cheetah> Subject: sam pipes To: sam-fans@hawkwind.utcs.toronto.edu (Sam mailing list) X-Mailer: ELM [version 2.4 PL23] Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Content-Length: 1002 Date: Thu, 20 Apr 1995 15:41:51 -0400 Forwarded message: >Does anyone actually use sam's input pipe, apart from with >the B command? Generally, I've hardly used it at all, but I >was reading Rob's Acme paper the other day, and it mentioned >sam interacting with the compiler and debugger, and I thought, >why not? I've used it to add a menu to sam that contains some common command sequences I use, like shifting left, or running text through a spell checker. None of it is especially tricky, but it helps me keep my hands off of the keyboard. I basically get the pipe name and build a 9menu. I like your script. I'll have to get rc, or rewrite it in perl. Beirne -- ------------------------------------------------------------------------------- Beirne Konarski | Reading maketh a full man, conference a beirnek@summitis.com | ready man, and writing an exact man. "Untouched by Scandal" | -- Francis Bacon ------------------------------------------------------------------------------- From sam-fans-owner Thu Apr 20 20:32:40 1995 Received: from minster.york.ac.uk ([144.32.128.41]) by hawkwind.utcs.utoronto.ca with SMTP id <24105>; Thu, 20 Apr 1995 20:31:54 -0400 Message-ID: From: mhw@minster.york.ac.uk (Mark H. Wilkinson) Date: Thu, 20 Apr 1995 18:09:35 -0400 In-Reply-To: Steve_Kilbane's message, dated Apr 20, 1:20pm X-Face: Bsp[Ds(Y#/{==j:Cv'"IK4R^D0_z]{'OYtp2^EYqpG)88CsdBm&LJ{idLZWx}AKf}E4#|@4DT4cX3 ?!>aIVcxmd#1 X-Url: http://Dcpu1.cs.york.ac.uk:6666/mhw/ X-Mailer: Mail User's Shell (7.2.5 10/14/92) To: Steve_Kilbane@cegelecproj.co.uk (Steve_Kilbane), sam-fans@hawkwind.utcs.toronto.edu Subject: Re: sam's pipe Steve_Kilbane wrote: > Subject: sam's pipe > > Does anyone actually use sam's input pipe, apart from with > the B command? I've been using this rc function for a while: fn mk { if (test -f Errors) { builtin mk $* |[2] tee Errors test -s Errors && { { echo b Errors ; echo e } | samsend } } else { builtin mk $* } } samsend is a stripped-down version of B which sends stdin to the pipe, rsh'ing to a remote machine if necessary to avoid NFS problems. I also have scripts to do B, D and cd operations from rc using samsend. -Mark. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Mark H. Wilkinson : Research student in user University of York, England : interface management systems From sam-fans-owner Fri Apr 21 04:35:41 1995 Received: from sartre.minerva.bah.com ([156.80.175.13]) by hawkwind.utcs.utoronto.ca with SMTP id <24104>; Fri, 21 Apr 1995 04:34:35 -0400 Received: from pigsnose by sartre.minerva.bah.com (NX5.67d/NX3.0M) id AA28559; Fri, 21 Apr 95 04:35:48 -0400 Date: Fri, 21 Apr 1995 04:35:48 -0400 From: Erik Quanstrom Message-Id: <9504210835.AA28559@sartre.minerva.bah.com> To: sam-fans@hawkwind.utcs.toronto.edu Subject: more funky things to do with sam's pipe this is a little, really unsophisticated mail reader that i cooked up using rc/sam/9menu. i had to do a few ugly things because 9menu doesn't look at $SHELL. (like create a directory $h/m with dummy files 0 D d h n p q rest s w) but what it does is use se's to split $MAIL into records. you can delete forward or delete backward. (FIFO or LIFO). in retrospect, i should have hacked 9term. also, running in unix, the sam pipe is a pain to use. it would be nice if 1] writes to sampipe would block until the command actually finished. 2] writes to sampipe would fail if the command didn't succede. this would allow one to deal correctly with the first and last message in the file. i just don't know how to do either of those with unix. ::$h/m/cmd:: #!/tmp/rc # get pipe if (~ $sampipe ()) { if (~ $#USER 0) { USER=$LOGNAME } sampipe=/tmp/.sam.$USER if (! ~ $#DISPLAY 0) { sampipe=$sampipe.$DISPLAY } if (! test -p $sampipe) { sam & sleep 1 # this is a timing problem } } # run command if (! echo $* >> $sampipe) { echo >[1=2] sam command failed exit 1 } ::$h/m/^(0 D d h n p q rest s w):: #!/tmp/rc $0 $* ::sam_mail:: #!/tmp/rc . $h/bin/sam_mail_ cd $h/m sleep 1 cmd '$' cmd '-/^From /;$' 9menu delete:d next:n previous:p delete:D rest:rest top:0 hee:h save:s write:'rc -c ''cmd w''' quit:q exit ::sam_mail-:: #!/tmp/rc pipe=`{sampipe} echo fu if (~ $USER ()){ USER=$LOGNAME } if (~ $MAIL ()) { B /usr/spool/mail/$USER }else{ B $MAIL } fn cmd { echo $* >> $pipe || echo 'write to sam failed' >[1=2]} fn mail_select {cmd '/^From /;/^From /-1' } fn mail_select_previous {cmd '-/^From [a-zA-Z]*/;/^From /-1' } fn rest {cmd '.,$'} fn debug {} fn 0 {cmd 0} fn d {cmd d;n} fn D {cmd d; cmd k ; cmd '-/^From [a-zA-Z]*/;''' } fn h {cmd '.,$ x/^From .*\n/ p'} fn q {cmd w ; cmd q} fn delay {cat /etc/motd > /dev/null} fn n { if (~ $#* 0) { mail_select return } for (i) { switch ($i) { case [1-9]* if (! echo -n $i | grep '[1-9][0=9]*'>/dev/null) { echo 'bad numeric argument' >[1=2] return 1 } # evil, i know. # if you've got better ideas go for it! eval `{yes mail_select';' | sed $i^q} case * mail_select $i } } } fn p { if (~ $#* 0) { mail_select_previous return } for (i) { switch ($i) { case [1-9]* if (! echo -n $i | grep '[1-9][0=9]*'>/dev/null) { echo 'bad numeric argument' >[1=2] return 1 } # evil, i know. # if you've got better ideas go for it! eval `{yes mail_select_previous';' | sed $i^q} case * mail_select_previous $i } } } fn s { if (! ~ $#* 0 1) { echo 's takes 0/1 argument' >[1=2] return 1 } else if (~ $#* 0) { file = /tmp/sammail$pid } else { file = $1 if (test -f $file) { echo >[1=2] $file 'exists; won''t overwrite.' return 1; } } debug $file cmd '> cat > ' $file delay test -f $file || { echo >[1=2] could not create temporary file $file^. return 1 } if (~ $#* 0) { file_sam_mail $file } } #!/tmp/rc # sam_mdisperse # object: file away all email carefully # erik quanstrom, 14. oct 94 # nl = ' ' xlate = ``$nl {cat $home/.mxlate | sed 's/#.*//g'} fn getdate { awk '/^From ./ {printf "%s-%s-%s\n", $5, $4, substr($7,3,2)}' < $1 | \ tr '[A-Z]' '[a-z]' } fn xl { n=() site=() name=() i =() j=() { n=``('@' $nl){echo $1} site=$n(2) # what's a ``host''? name=$n(1) for(i in $xlate){ if(~ $i *^$name^*^$site^*){ j=`{echo $i} echo $j(3) break } } } } #sed -n 's/^From \([A-Za-z][A-Za-z!]*@[A-Za-z.][A-Za-z.]*\).*/\1/p' fn parse_addr { sed 's/^From \([A-Za-z][A-Za-z]*@[A-Za-z.][A-Za-z.]*\).*/\1/'$nl'q' <$1 } fn file_sam_mail {folder = () which=() name=() date=() dest=(){ for (folder in $*) { which = from name = `{xl `{parse_addr $folder} } if (~ $name ()) { echo >[2=1] unrecognized name $name^. $folder not moved. return 1 } else { if (test -f $folder) { date = `{getdate $folder} dest = $home/e-letters/$which-$name/$which-$name-$date echo >[2=1] $folder $dest mv $folder $dest return $status } else { echo >[2=1] 'folder does not exist' return 1 } } } }} From sam-fans-owner Fri Apr 21 14:23:06 1995 Received: from minster.york.ac.uk ([144.32.128.41]) by hawkwind.utcs.utoronto.ca with SMTP id <24104>; Fri, 21 Apr 1995 14:16:37 -0400 Message-ID: From: mhw@minster.york.ac.uk (Mark H. Wilkinson) Date: Fri, 21 Apr 1995 15:00:33 -0400 X-Face: Bsp[Ds(Y#/{==j:Cv'"IK4R^D0_z]{'OYtp2^EYqpG)88CsdBm&LJ{idLZWx}AKf}E4#|@4DT4cX3 ?!>aIVcxmd#1 X-Url: http://Dcpu1.cs.york.ac.uk:6666/~mhw/ X-Mailer: Mail User's Shell (7.2.5 10/14/92) To: sam-fans@hawkwind.utcs.toronto.edu (sam mailing list) Subject: mailbox commands While we're on the subject of mail, here's a command I use fairly regularly to strip the Received: lines out of mail headers. Obviously you can apply it to all your mailing list archives using the X command, hence freeing up lots of disk space. ,y/^[ ]*\n/g/^From .*\n(^[a-zA-Z\-]+:.*\n(( | ).*\n)*)+/x/^Received: .*\n(( | ).*\n)*/d or in other words, , # select the whole file y/^[ ]*\n/ # loop over the bits between all the blank lines g/^From .*\n(^[a-zA-Z\-]+:.*\n(( | ).*\n)*)+/ # ensure the current bit matches this regexp which # describes a mail header (I think!) x/^Received: .*\n(( | ).*\n)*/ # loop over Received: header lines, handling continuation # to subsequent lines d # delete -Mark. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Mark H. Wilkinson : Research student in user University of York, England : interface management systems From sam-fans-owner Fri Apr 28 14:07:50 1995 Received: from cegelecproj.co.uk ([159.245.72.6]) by hawkwind.utcs.utoronto.ca with SMTP id <24107>; Fri, 28 Apr 1995 14:02:29 -0400 Received: from vampire.cegelecproj.co.uk (cerberus.cegelecproj.co.uk) by cegelecproj.co.uk (4.1/SMI-4.1) id AA03451; Fri, 28 Apr 95 18:50:19 BST Received: from spirit.cegelecproj.co.uk (spirit.limbo.cegelecproj.co.uk) by vampire.cegelecproj.co.uk (5.0/SMI-SVR4) id AA02331; Fri, 28 Apr 1995 18:50:02 +0000 Received: by spirit.cegelecproj.co.uk (5.0/SMI-SVR4) id AA01956; Fri, 28 Apr 1995 18:49:57 +0000 Date: Fri, 28 Apr 1995 14:49:57 -0400 From: Steve_Kilbane@cegelecproj.co.uk (Steve_Kilbane) Message-Id: <9504281749.AA01956@spirit.cegelecproj.co.uk> X-Planation: X-Faces images can be viewed with the XFaces program To: sam-fans@hawkwind.utcs.toronto.edu Subject: 9wm/9term cmdpipes Content-Length: 30278 X-Face: Iqsa(US9p?)Y^W+6Ff[Z]rM"uFE) lFDjag1e]\/#2 A while ago, I mentioned some hacks I'd done to 9term to add a command pipe, like sam's. Rich $alz commented that 9wm could do with something similar, and I couldn't resist. This is the result, including patches for both 9term and 9wm. There are probably bugs, but they work ok for me. :-) A README file is included. Steve PS Rich: I've made some improvements since I sent you the sample patches, so this lot is different. #!/bin/sh # to extract, remove the header and type "sh filename" if `test ! -s ./9term.patch` then echo "writing ./9term.patch" cat > ./9term.patch << '\Rogue\Monster\' *** orig/9term/9term.c Fri Jun 3 09:35:39 1994 --- hacked/9term/9term.c Fri Apr 21 08:14:28 1995 *************** *** 16,36 **** #include "9term.h" int flushing; int suspended; Event e; ulong Erc; int highwater = 50000; int lowwater = 40000; int waterquantum; int beepmask; int ninewm; ! static char *items[] = { "cut", "paste", "snarf", "send", "scroll", 0 }; static Menu edit = {items}; enum { mCUT, mPASTE, mSNARF, mSEND, mSCROLL }; --- 16,48 ---- #include "9term.h" + #define PIPEDIRENV "NINETERMPIPE" + #define PIPEDIRDEF "/tmp/.9terms." + int flushing; int suspended; Event e; ulong Erc; + ulong Epipe; + static char *exname; + static int exlen; int highwater = 50000; int lowwater = 40000; int waterquantum; int beepmask; int ninewm; + static long mark0, mark1; + static int markset; ! void removeextern(void); ! static void pipeinput(Event *e); ! ! static char *items[] = { "cut", "paste", "snarf", "mark", "send", "scroll", 0 }; static Menu edit = {items}; enum { mCUT, mPASTE, mSNARF, + mMARK, mSEND, mSCROLL }; *************** *** 167,173 **** --- 179,273 ---- run(); } + /* + * create a named pipe for this 9term to accept commands on. + * This function is mainly copied from samterm... + */ + + static + void init_ninepipe(void) + { + #ifndef NOFIFO + char *ninepipedir; + char *disp; + char *user; + int fd; + int flags; + extern ulong windowid; + + if ((ninepipedir = getenv(PIPEDIRENV)) == 0) { + /* user hasn't specified a directory - make up a name */ + /* exname is PIPEDIR.user.display/wid or PIPEDIR.user/wid */ + user = getuser(); + disp = getenv("DISPLAY"); + + if (disp) { + exlen = strlen(PIPEDIRDEF) + strlen(user) + 1 + strlen(disp); + if ((exname = (char *)malloc(exlen + 20)) == 0) + return; + sprintf(exname, "%s%s.%s", PIPEDIRDEF, user, disp); + } else { + exlen = strlen(PIPEDIRDEF) + strlen(user); + if ((exname = (char *)malloc(exlen + 20)) == 0) + return; + sprintf(exname, "%s%s", PIPEDIRDEF, user); + } + } else { + /* use user's specified directory */ + exlen = strlen(ninepipedir); + if ((exname = (char *)malloc(exlen + 20)) == 0) + return; + strcpy(exname,ninepipedir); + } + + /* Create a directory for the pipes to exist in, if necessary. */ + (void)mkdir(exname,0700); + + /* add the next level - the pid */ + sprintf(exname+exlen,"/%d",windowid); + + /* Make the named pipe */ + if (mkfifo(exname, 0600) == -1) { + removeextern(); + return; + } + + fd = open(exname, O_RDONLY | O_NONBLOCK); + if (fd == -1) { + removeextern(); + return; + } + + /* + * Turn off no-delay and provide ourselves as a lingering + * writer so as not to get end of file on read. + */ + flags = fcntl(fd, F_GETFL, 0); + if (flags == -1 || fcntl(fd, F_SETFL, flags & ~O_NONBLOCK) == -1 + || open(exname, O_WRONLY) == -1) { + (void)close(fd); + removeextern(); + return; + } + + Epipe = estart(0, fd, 8192); + atexit(removeextern); + return; + #endif + } + + void + removeextern(void) + { + if (exname) { + (void)unlink(exname); + exname[exlen] = 0; + (void)rmdir(exname); + } + } + + /* * Register command output stream and handle events */ #define MAXMSG 128 *************** *** 179,184 **** --- 279,285 ---- ulong type; Erc = estart(0, comm_fd, MAXMSG + MAXFDATA); + init_ninepipe(); for (;;) { /* disable shell output when more than one buffer ahead */ /* *************** *** 204,210 **** } #endif shelloutput(Erc, &e); ! } } } --- 305,312 ---- } #endif shelloutput(Erc, &e); ! } else if (type == Epipe) ! pipeinput(&e); } } *************** *** 234,239 **** --- 336,371 ---- } /* + * Handle command pipe event + */ + + static void + pipeinput(Event *e) + { + Rune r; + char *c; + Text *t = text; + + /* XXX - should do something like: + if (e->n) + t->p0 = t->p1 = t->end; + or whatever, to make sure we're inserting at the end. */ + + if (e->n) + t->p0 = t->p1 = t->length; + for (c = (char *)e->data; e->n--; c++) { + chartorune(&r, c); + /* ignore eof or eol */ + if (r == eofchar || r == eolchar) + continue; + textinsert(t, &r, (&r)+1, t->p0); + textshow(t, t->p0, 1); + sendrunes(&r,1); + } + texthighlight(text,t->p0,t->p1, F & ~D); + } + + /* * Handle command output event */ static void *************** *** 398,403 **** --- 530,536 ---- static Rune nl[] = { '\n', 0 }; specialchars(slave_fd); + edit.item[mMARK] = markset?"select":"mark"; edit.item[mSCROLL] = text->scrolling?"noscroll":"scroll"; switch (menuhit(2, m, &edit)) { *************** *** 428,433 **** --- 561,582 ---- inputrune(text, text->snarfed, text->snarflen); if (text->snarfed[text->snarflen-1] != '\n') inputrune(text, nl, 1); + } + break; + case mMARK: /* save point, or select to point */ + if (markset) { + ulong m0, m1; + + m0 = (mark0 < text->p0)? mark0 : text->p0; + m1 = (mark1 > text->p1)? mark1 : text->p1; + markset = 0; + /* if (m0 < text->base || text->end < m0) + textset(text, _backnl(text, m0, 3)); */ + texthighlight(text,m0,m1, F & ~D); + } else { + mark0 = text->p0; + mark1 = text->p1; + markset = 1; } break; case mSCROLL: /* toggle scroll state */ *** orig/9term/display.c Thu Dec 15 14:48:28 1994 --- hacked/9term/display.c Wed Mar 29 12:42:36 1995 *************** *** 52,57 **** --- 52,58 ---- static void delwin(Widget, XEvent*, String*, Cardinal*); Text *text; /* the main and only text buffer */ + ulong windowid; /* too many X options */ static XrmOptionDescRec optable[] = { *************** *** 229,235 **** XSetErrorHandler(abort); #endif /* export window id to environment */ ! sprintf(id, "%d", XtWindow(_toplevel)); setenv("WINDOWID", id, 1); /* register mouse and keyboard events */ --- 230,237 ---- XSetErrorHandler(abort); #endif /* export window id to environment */ ! windowid = XtWindow(_toplevel); ! sprintf(id, "%d", windowid); setenv("WINDOWID", id, 1); /* register mouse and keyboard events */ \Rogue\Monster\ else echo "will not over write ./9term.patch" fi if `test ! -s ./9wm.patch` then echo "writing ./9wm.patch" cat > ./9wm.patch << '\Rogue\Monster\' *** orig/9wm/9wm.c Tue Mar 28 16:37:51 1995 --- hacked/9wm/9wm.c Tue Apr 18 14:45:52 1995 *************** *** 14,20 **** char *version[] = { ! "9wm version 1.1, Copyright (c) 1994 David Hogan", 0, }; Display *dpy; --- 14,22 ---- char *version[] = { ! "9wm version 1.1, Copyright (c) 1994 David Hogan", ! "cmdpipe extensions by Steve Kilbane", ! 0, }; Display *dpy; *************** *** 51,57 **** --- 53,61 ---- Atom _9wm_hold_mode; void usage(), sighandler(), getevent(); + static int do_select(); + char *fontlist[] = { "lucm.latin1.9", "blit", *************** *** 221,226 **** --- 225,232 ---- nofocus(); scanwins(); + init_ninepipe(); /* smk */ + for (;;) { getevent(&ev); *************** *** 443,448 **** --- 449,455 ---- e->value_mask |= CWBorderWidth; XConfigureWindow(dpy, e->window, e->value_mask, &wc); + wins_changed |= wm_configurereq; } void *************** *** 479,484 **** --- 486,492 ---- unhidec(c, 1); break; } + wins_changed |= wm_mapreq; } void *************** *** 506,511 **** --- 514,520 ---- } c->reparenting = 0; } + wins_changed |= wm_unmap; } void *************** *** 532,537 **** --- 541,547 ---- c->dy = e->height; c->border = e->border_width; } + wins_changed |= wm_newwindow; } void *************** *** 551,556 **** --- 561,567 ---- ignore_badwindow = 1; XSync(dpy, False); ignore_badwindow = 0; + wins_changed |= wm_destroy; } void *************** *** 657,662 **** --- 668,674 ---- if (c == current) cmapfocus(c); } + wins_changed |= wm_property; } void *************** *** 684,689 **** --- 696,702 ---- if (c != 0 && (c->parent == root || withdrawn(c))) rmclient(c); } + wins_changed |= wm_reparent; } #ifdef SHAPE *************** *** 698,703 **** --- 711,717 ---- return; setshape(c); + wins_changed |= wm_shape; } #endif *************** *** 728,755 **** XEvent *e; { int fd; - fd_set rfds; - struct timeval t; if (!signalled) { ! if (QLength(dpy) > 0) { ! XNextEvent(dpy, e); return; } fd = ConnectionNumber(dpy); ! FD_ZERO(&rfds); ! FD_SET(fd, &rfds); ! t.tv_sec = t.tv_usec = 0; ! if (select(fd+1, &rfds, NULL, NULL, &t) == 1) { ! XNextEvent(dpy, e); return; - } XFlush(dpy); ! FD_SET(fd, &rfds); ! if (select(fd+1, &rfds, NULL, NULL, NULL) == 1) { ! XNextEvent(dpy, e); return; - } if (errno != EINTR || !signalled) { perror("9wm: select failed"); exit(1); --- 742,761 ---- XEvent *e; { int fd; if (!signalled) { ! if (QLength(dpy) > 0) { /* if there are X events, handle them */ ! XNextEvent(dpy, e); /* may mean pipe never gets a look in */ return; } + if (wins_changed) + update_windows_list(); fd = ConnectionNumber(dpy); ! if (do_select(fd,e,0)) return; XFlush(dpy); ! if (do_select(fd,e,1)) return; if (errno != EINTR || !signalled) { perror("9wm: select failed"); exit(1); *************** *** 758,761 **** --- 764,801 ---- cleanup(); fprintf(stderr, "9wm: exiting on signal\n"); exit(1); + } + + static int + do_select(fd, e, i) + int fd; + XEvent *e; + int i; + { + int nfds, r; + fd_set rfds; + struct timeval t; + + for (;;) { /* stay here until we get an X event */ + FD_ZERO(&rfds); + FD_SET(fd, &rfds); + if (ninepipefd != -1) { + FD_SET(ninepipefd, &rfds); + nfds = ninepipefd > fd? ninepipefd : fd; + } else { + nfds = fd; + } + t.tv_sec = t.tv_usec = 0; + if ((r = select(nfds+1, &rfds, NULL, NULL, i? NULL : &t)) < 1) { + return 0; + } + if (ninepipefd != -1 && FD_ISSET(ninepipefd,&rfds)) { + pipecmd(); + continue; + } + if (FD_ISSET(fd,&rfds)) { + XNextEvent(dpy, e); + return 1; + } + } } *** orig/9wm/client.c Tue Mar 28 16:37:53 1995 --- hacked/9wm/client.c Tue Apr 18 14:45:52 1995 *************** *** 68,73 **** --- 68,74 ---- } #endif + void active(c) Client *c; *************** *** 94,99 **** --- 95,101 ---- if (debug) dump_revert(); #endif + wins_changed |= wm_active; } void *************** *** 123,128 **** --- 125,131 ---- } XSetInputFocus(dpy, w, RevertToPointerRoot, timestamp()); cmapfocus(0); + wins_changed |= wm_nofocus; } Client * *** orig/9wm/dat.h Tue Mar 28 16:37:55 1995 --- hacked/9wm/dat.h Tue Apr 18 15:00:54 1995 *************** *** 115,117 **** --- 115,137 ---- /* error.c */ extern int ignore_badwindow; + + /* pipe.c - smk */ + extern int ninepipefd; + extern int wins_changed; + + #define wm_configurereq 0x1 + #define wm_mapreq 0x2 + #define wm_unmap 0x4 + #define wm_newwindow 0x8 + #define wm_destroy 0x10 + #define wm_property 0x20 + #define wm_reparent 0x40 + #define wm_shape 0x80 + #define wm_active 0x100 + #define wm_nofocus 0x200 + #define wm_hide 0x400 + #define wm_unhide 0x800 + #define wm_renamec 0x1000 + #define wm_creshape 0x2000 + #define wm_cmove 0x4000 *** orig/9wm/fns.h Tue Mar 28 16:37:55 1995 --- hacked/9wm/fns.h Tue Apr 18 14:15:42 1995 *************** *** 73,75 **** --- 73,81 ---- /* cursor.c */ void initcurs(); + + /* pipe.c - smk */ + void pipecmd(); + void init_ninepipe(); + void remove9pipe(); + void update_windows_list(); *** orig/9wm/manage.c Tue Mar 28 16:37:52 1995 --- hacked/9wm/manage.c Tue Apr 18 13:59:40 1995 *************** *** 88,94 **** /* Now do it!!! */ ! if (doreshape) { cmapfocus(0); if (!(fixsize ? drag(c) : sweep(c)) && c->is9term) { XDestroyWindow(dpy, c->window); --- 88,94 ---- /* Now do it!!! */ ! if (doreshape && (! dohide || ! fixsize)) { cmapfocus(0); if (!(fixsize ? drag(c) : sweep(c)) && c->is9term) { XDestroyWindow(dpy, c->window); *** orig/9wm/menu.c Tue Mar 28 16:37:52 1995 --- hacked/9wm/menu.c Tue Apr 18 15:10:18 1995 *************** *** 108,114 **** fprintf(stderr, "9wm: exec %s", shell); perror(" failed"); } ! execlp("9term", "9term", "-9wm", 0); execlp("xterm", "xterm", "-ut", 0); perror("9wm: exec 9term/xterm failed"); exit(1); --- 108,114 ---- fprintf(stderr, "9wm: exec %s", shell); perror(" failed"); } ! execlp("9term", "9term", "-unix", "-9wm", 0); execlp("xterm", "xterm", "-ut", 0); perror("9wm: exec 9term/xterm failed"); exit(1); *************** *** 186,191 **** --- 186,192 ---- b3items[B3FIXED+numhidden] = c->label; numhidden++; b3items[B3FIXED+numhidden] = 0; + wins_changed |= wm_hide; } void *************** *** 220,225 **** --- 221,227 ---- b3items[B3FIXED+i] = b3items[B3FIXED+i+1]; } b3items[B3FIXED+numhidden] = 0; + wins_changed |= wm_unhide; } void *************** *** 248,253 **** --- 250,256 ---- if (name == 0) name = "???"; c->label = name; + wins_changed |= wm_renamec; if (!hidden(c)) return; for (i = 0; i < numhidden; i++) \Rogue\Monster\ else echo "will not over write ./9wm.patch" fi if `test ! -s ./README` then echo "writing ./README" cat > ./README << '\Rogue\Monster\' This sharfile contains four files: README (this file) 9term.patch (cmdpipe support for 9term) 9wm.patch (first part of cmdpipe support for 9wm) pipe.c (second part) The 9term patch is against 1.6.3, while the 9wm patch is against 1.1. I've used these changes on Solaris 2.3 for quite a while now, and they seem stable as far as daily use goes. Mind you, they don't *much* use daily... incidentally, there's a bug in 9term 1.6.3 under solaris 2.3 - occasionally the cursor starts up in the wrong place (between two shell prompts), and input results in complaints about null characters. This is in the standard 9term release, and I haven't been able to track it down. 9term changes ============= Each 9term creates a pipe which can be used for input, in the manner of sam's pipe. The name of the pipe is given by $NINETERMPIPE, if set. If not, the pipes go into the directory /tmp/.9terms.$USER.$DISPLAY, if $DISPLAY is set, or /tmp/.9terms.$USER, if not. Within the directory, the pipe's name is $WINDOWID. The directory is created if required, and when 9term exits, the pipe is removed, and so is the directory, if empty. Text written to the pipe is inserted to 9term's window as though it had been typed by the user - it is sent to the shell, too. The cursor is moved to the end of the window first, if necessary. This patch also includes the mark/select toggle on the second menu: mark saves the current selection, and select selects all text between the saved and current selections, inclusive. Caveat: I don't bother to set $NINETERMPIPE, using the default pipe name. Therefore, I haven't actually got around to testing this bit of code. :-) Bug: Text set to the pipe is always sent straight to the shell, too. This means that if you've, say, typed "echo hello " so far, and you squirt "world\n" into the pipe, you'll get "world: no such file or directory", and then when you press return, you get "hello world" appear. This doesn't bother me too much, since I normally only send text to the pipe while I'm between commands anyway. 9wm changes =========== 9wm creates a file which contains the current state of the windows 9wm knows about. The name of the file is $NINEWINDOWS, or /tmp/.9wm-windows by default. Each line of the file contains wid s x y dx dy l where: wid is $WINDOWID s is the state of the window (n = normal, h = hidden) x y are the coords of the window's position dx dy are the window's dimensions l is the window's label The windows' details are added in the same order as the current window stack. Thus, the current window will always be the first line in the file, and so on. If a window's never been current, it'll be one of the last lines in the file. This file is updated whenever the details in it have changed. I've tried to catch all the cases, and have probably been a little eager - it can get updated an awful lot when some X events are going on, even though there's no visible change on the screen. However, 9wm is still a lot faster than olwm... 9wm also creates a pipe, name from $NINEPIPE, or /tmp/.9wm-pipe by default. This pipe is used for sending commands to 9wm itself. Commands are: none Just used for testing. reshape wid x y dx dy change position and size of window wid resize wid dx dy change size of window wid move wid x d change position of window wid front wid move window wid to the front, and make current hide wid hides window wid delete wid deletes window wid label wid str sets label of window wid to str This all seems to work on my system. I haven't tested the label command *too* much, and I suspect that there may be problems in the interaction between X's memory allocations and mine. I haven't seen any evidence of this, it's just that I've probably got it wrong somewhere. :-) Caveats: Again, I use the default names, so I haven't tested the $NINEWINDOWS/$NINEPIPE code. The update code for the windows file is a little eager. Label memory handling could be dodgy. What's the point? ================= I've used these changes, along with 9menu, for adding a few interesting things. Menu options for doing "front" and "back" commands are trivial, and since I use the es shell, other 9menus can repeat the last command or list my recent command history for occasional selection. The most extreme application is 9vwm, a virtual window manager for 9wm written in es. It mostly works, but since I don't have much of a tendency to have many windows anyway, there's no inclination to finish it off. But it was fun. Future directions ================= Sooner or later David Hogan's going to release 9wm 1.2, which has got some fairly extensive changes in it, so I'll have to upgrade to that. :-( I'm considering adding kill/unkill commands to 9wm, so that 9wm can be told of a list of daemons that are interested in being told when the windows file has changed (via a kill()). This might make it easier to write programs that follow manual changes to the window structure. It might be nice to have the windows file contain the arguments to the window, too. That way saving workspaces would be a doddle. It's probably a good idea for 9wm to have both "exit" and "exit!", or something similar - the latter is the current behaviour, while the former just complains to stderr if there are any windows currently hidden. It would probably have to ignore 9menu, though.... Steve Kilbane \Rogue\Monster\ else echo "will not over write ./README" fi if `test ! -s ./pipe.c` then echo "writing ./pipe.c" cat > ./pipe.c << '\Rogue\Monster\' /* Copyright (c) 1995 Steve Kilbane. See README for details */ #include #include #include #include #include #include #include #include "dat.h" #include "fns.h" #include #include #define NINEWINDOWSDEF "/tmp/.9wm-windows" #define NINEWINDOWSENV "NINEWINDOWS" #define PCMDMAX 80 #define PIPENAMEENV "NINEPIPE" #define PIPENAMEDEF "/tmp/.9wm-pipe" typedef enum { pNone, pReshape, pResize, pMove, pHide, pFront, pDelete, pLabel, pError } PipeCmd; #define XY 1 #define DXY 2 #define STR 4 static struct cmdinfo { PipeCmd cmd; char *name; char *fmt; int nconvs; unsigned short flags; } names[] = { { pNone, "none", "", 0, 0 }, { pReshape, "reshape", "%lu%d%d%d%d", 5, (XY|DXY) }, { pResize, "resize", "%lu%d%d", 3, DXY }, { pMove, "move", "%lu%d%d", 3, XY }, { pFront, "front", "%lu", 1, 0 }, { pHide, "hide", "%lu", 1, 0 }, { pDelete, "delete", "%lu", 1, 0 }, { pLabel, "label", "%lu%*[ \t]%n", 1, STR }, { pNone, 0, 0, 0, 0 } }; static struct LabelStr { char *s; struct LabelStr *n; int f; } *labelstrs = NULL; static Client *findc(); static Client *setsize(); static PipeCmd parsepipecmd(); static PipeCmd parse(); static Client *freelabelstr(); static char *getlabelstr(); static void creshape(); static void cmove(); static char *pipename; static pid_t serverpid; int ninepipefd = -1; int wins_changed = 0; static struct { int i; char *s; } reasons[] = { { wm_configurereq, "configurereq" }, { wm_mapreq, "mapreq" }, { wm_unmap, "unmap" }, { wm_newwindow, "newwindow" }, { wm_destroy, "destroy" }, { wm_property, "property" }, { wm_reparent, "reparent" }, { wm_shape, "shape" }, { wm_active, "active" }, { wm_nofocus, "nofocus" }, { wm_hide, "hide" }, { wm_unhide, "unhide" }, { wm_renamec, "renamec" }, { wm_cmove, "cmove" }, { wm_creshape, "creshape" }, { 0, 0 } }; static void print_reason() { int x; fprintf(stderr,"9wm: reason"); for (x = 0; reasons[x].s ; x++) if (wins_changed & reasons[x].i) fprintf(stderr," %s",reasons[x].s); fprintf(stderr,"\n"); } static int write_window_line(c,fd) Client *c; int fd; { static char *buffer; static int maxlen; int len; char state; if (c->label == 0) return 0; len = 45 + strlen(c->label); if (len >= maxlen) { maxlen = len + 1; buffer = buffer? realloc(buffer,maxlen) : malloc(maxlen); if (buffer == 0) { maxlen = 0; return 1; } } state = hidden(c)? 'h' : 'n'; /* ignore withdrawn */ sprintf(buffer,"%lu %c %d %d %d %d %s\n",c->window,state,c->x,c->y,c->dx,c->dy,c->label); (void)write(fd,buffer,strlen(buffer)); return 0; } void update_windows_list(void) { static char *ninewindows, *ninewindowstmp; Client *c, *cc; int fd; /* print_reason(); */ wins_changed = 0; if (ninewindowstmp == 0) { if ((ninewindows = getenv(NINEWINDOWSENV)) == 0) ninewindows = NINEWINDOWSDEF; if ((ninewindowstmp = malloc(strlen(ninewindows)+5)) == 0) { fprintf(stderr,"9wm: cannot alloc tmpfile name for %s\n",ninewindows); return; } sprintf(ninewindowstmp,"%s.tmp",ninewindows); } if ((fd = creat(ninewindowstmp, 0744)) < 0) { fprintf(stderr,"9wm: cannot create '%s'\n",ninewindowstmp); return; } /* write clients that have been selected first, in active order */ for (c = current; c; c = c->revert) if (write_window_line(c,fd)) { close(fd); (void)unlink(ninewindowstmp); return; } /* now do those that have never been selected, in any order */ for (c = clients; c; c = c->next) { for (cc = current; cc; cc = cc->revert) if (cc == c) break; if (cc == 0) if (write_window_line(c,fd)) { close(fd); (void)unlink(ninewindowstmp); return; } } close(fd); (void)rename(ninewindowstmp,ninewindows); return; } void pipecmd() { static char data[PCMDMAX]; int x, y, dx, dy; int len; Window winid; char *text; Client *c; char *ptr; if ((len = read(ninepipefd,data,PCMDMAX)) < 1) return; ptr = data; for (;;) { switch (parsepipecmd(&ptr,&len,&winid,&x,&y,&dx,&dy,&text)) { case pNone: return; case pReshape: creshape(setsize(findc(winid),x,y,dx,dy,1,1)); break; case pResize: creshape(setsize(findc(winid),0,0,x,y,1,0)); break; case pMove: cmove(setsize(findc(winid),x,y,0,0,0,1)); break; case pHide: hide(findc(winid)); break; case pFront: c = findc(winid); if (c == 0) break; if (hidden(c)) unhidec(c,1); else { XMapRaised(dpy, c->parent); active(c); } break; case pDelete: delete(findc(winid),1); break; case pLabel: c = findc(winid); if (c == 0) break; renamec(freelabelstr(c),getlabelstr(text)); break; default: fprintf(stderr,"9wm: unparsed command: %s\n",text); return; } XFlush(dpy); } } static Client * findc(w) Window w; { Client *c; for (c = clients; c; c = c->next) if (c->window == w) return c; fprintf(stderr,"9wm: invalid window id %lu\n",w); return 0; } static Client * setsize(c,x,y,dx,dy,resizing,moving) Client *c; int x, y, dx, dy, resizing, moving; { if (c == 0) return 0; if (resizing) { if (dx < 0) dx = -dx; if (dy < 0) dy = -dy; /* following nicked from grab.c:sweepcalc() */ dx -= 2*BORDER; dy -= 2*BORDER; if (!c->is9term) { if (dx < c->min_dx) dx = c->min_dx; if (dy < c->min_dy) dy = c->min_dy; } if (dx < 4) dx = 4; if (dy < 4) dy = 4; if (c->size.flags & PResizeInc) { dx = c->min_dx + (dx-c->min_dx)/c->size.width_inc*c->size.width_inc; dy = c->min_dy + (dy-c->min_dy)/c->size.height_inc*c->size.height_inc; } if (c->size.flags & PMaxSize) { if (dx > c->size.max_width) dx = c->size.max_width; if (dy > c->size.max_height) dy = c->size.max_height; } /* end of nicked code */ c->dx = dx + 2*BORDER; c->dy = dy + 2*BORDER; } if (moving) { if (x < 0) x = 0; if (y < 0) y = 0; c->x = x; c->y = y; } return c; } /* * this function's fun. the event is pretty much going to be a character * at a time, but we don't know this. Therefore, we're called each time * with the new additions to the buffer, and we read until we get a * newline. At this point, we check the line length is ok, and then * start parsing. If we haven't got a newline yet, we return pNone once * we've saved the characters. If we find an error, we set *text to point * to the buffer, so that we can display it in the error message. */ static PipeCmd parsepipecmd(data, n, w, x, y, dx, dy, text) char **data; int *n; Window *w; int *x, *y, *dx, *dy; char **text; { static char buff[PCMDMAX]; static int len; char c; if (*n == 0) return pNone; *text = buff; while ((*n)--) { c = *(*data)++; if (c == '\n' || c == '\r') { if (len < PCMDMAX) { buff[len] = 0; len = 0; return parse(buff,w,x,y,dx,dy,text); } else { len = 0; return pError; } } buff[len++] = c; } return pNone; } static PipeCmd parse(buff, w, x, y, dx, dy, text) char *buff; Window *w; int *x, *y, *dx, *dy; char **text; { struct cmdinfo *p; char *str; unsigned int len; int r; for (p = names; p->name; p++) { len = strlen(p->name); if (strncmp(buff,p->name,len) == 0 && isspace(buff[len])) { break; } else { } } if (p->name == 0) { return pError; } str = buff + len + 1; if (p->flags & STR) r = sscanf(str,p->fmt,w,&len); else r = sscanf(str,p->fmt,w,x,y,dx,dy); if (r < p->nconvs) return pError; if (p->flags & STR) *text = str + len; return p->cmd; } /* * following is largely nicked from my hacks to 9term.c, which * in turn were swiped from samterm. */ void init_ninepipe() { #ifndef NOFIFO int fd; int flags; extern char *getenv(); serverpid = getpid(); if ((pipename = getenv(PIPENAMEENV)) == 0) pipename = PIPENAMEDEF; if (mkfifo(pipename, 0600) == -1) return; if ((fd = open(pipename, O_RDONLY | O_NONBLOCK)) < 0) { remove9pipe(); return; } flags = fcntl(fd, F_GETFL, 0); if (flags == -1 || fcntl(fd,F_SETFL, flags & ~O_NONBLOCK) == -1 || open(pipename, O_WRONLY) == -1) { (void)close(fd); remove9pipe(); return; } ninepipefd = fd; atexit(remove9pipe); return; #endif } void remove9pipe() { if (pipename && serverpid == getpid()) { (void)unlink(pipename); pipename = 0; } return; } static char * getlabelstr(s) char *s; { struct LabelStr *l; if (s == 0) return s; if ((l = (struct LabelStr *)malloc(sizeof(*l))) == 0) return s; l->n = labelstrs; labelstrs = l; if ((l->s = strdup(s)) == 0) l->s = s; l->f = (l->s == s); return l->s; } static Client * freelabelstr(c) Client *c; { char *s = c->label; struct LabelStr *l, **p = &labelstrs; while (*p && (*p)->s != s) p = &((*p)->n); if (*p) { l = *p; *p = l->n; if (l->f) (void)free(l->s); (void)free(l); } return c; } static void cmove(c) Client *c; { if (c == 0) return; active(c); XRaiseWindow(dpy, c->parent); XMoveWindow(dpy, c->parent, c->x-BORDER, c->y-BORDER); sendconfig(c); wins_changed |= wm_cmove; } static void creshape(c) Client *c; { if (c == 0) return; active(c); XRaiseWindow(dpy, c->parent); XMoveResizeWindow(dpy, c->parent, c->x-BORDER, c->y-BORDER, c->dx+2*(BORDER-1), c->dy+2*(BORDER-1)); XMoveResizeWindow(dpy, c->window, BORDER-1, BORDER-1, c->dx, c->dy); wins_changed |= wm_creshape; } \Rogue\Monster\ else echo "will not over write ./pipe.c" fi echo "Finished archive 1 of 1" exit From sam-fans-owner Fri Apr 28 16:43:01 1995 Received: from relay3.UU.NET ([192.48.96.8]) by hawkwind.utcs.utoronto.ca with SMTP id <24107>; Fri, 28 Apr 1995 16:42:05 -0400 Received: from uucp2.UU.NET by relay3.UU.NET with SMTP id QQynlq15298; Fri, 28 Apr 1995 16:41:49 -0400 Received: from rexago8.UUCP by uucp2.UU.NET with UUCP/RMAIL ; Fri, 28 Apr 1995 16:41:50 -0400 Received: by summitis.com (smail2.5) id AA26104; 28 Apr 95 16:40:05 EDT (Fri) Received: from summitis.com by rserv1.summitis.com; Fri, 28 Apr 1995 16:38 EDT Received: from cheetah by rexsrvr2.summitis.com (AIX 3.2/UCB 5.64/4.03) id AA61842; Fri, 28 Apr 1995 16:38:44 -0400 Received: by cheetah (AIX 3.2/UCB 5.64/4.03) id AA13616; Fri, 28 Apr 1995 16:38:40 -0400 From: hc05@summitis.com Message-Id: <9504282038.AA13616@cheetah> Subject: 9term/9wm hacks To: sam-fans@hawkwind.utcs.toronto.edu (Sam mailing list) X-Mailer: ELM [version 2.4 PL23] Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Content-Length: 1560 Date: Fri, 28 Apr 1995 16:41:53 -0400 >Subject: 9wm/9term cmdpipes >X-Face: Iqsa(US9p?)Y^W+6Ff[Z] 8!$T`8QNfKrM"uFE) > lFDjag1e]\/#2 >Content-Type: text >Content-Length: 30278 > 8!$T`8QNfKrM"uFE) > lFDjag1e]\/#2 > >A while ago, I mentioned some hacks I'd done to 9term to add a >command pipe, like sam's. Rich $alz commented that 9wm could do >with something similar, and I couldn't resist. This is the >result, including patches for both 9term and 9wm. There are >probably bugs, but they work ok for me. :-) A README file >is included. > >Steve I've loaded the patches to both 9term & 9wm on an RS/6000 running AIX 3.2.5. 9term worked fine, but I had trouble with 9wm. I lost the ability to use the mouse to anything but bring up the root menu or a 9menu. The mouse would not work for scrolling, selecting text, or bringing up a window. I had to write to the pipe to bring up an xterm so I could exit. I otherwise like the idea, though, and am not complaining. I think I'll use the 9term pipe to see if I can work elm from a 9menu. Thanks, Beirne -- ------------------------------------------------------------------------------- Beirne Konarski | Reading maketh a full man, conference a beirnek@summitis.com | ready man, and writing an exact man. "Untouched by Scandal" | -- Francis Bacon ------------------------------------------------------------------------------- From sam-fans-owner Mon May 1 03:21:36 1995 Received: from cegelecproj.co.uk ([159.245.72.6]) by hawkwind.utcs.utoronto.ca with SMTP id <24108>; Mon, 1 May 1995 03:18:56 -0400 Received: from vampire.cegelecproj.co.uk (cerberus.cegelecproj.co.uk) by cegelecproj.co.uk (4.1/SMI-4.1) id AA22825; Mon, 1 May 95 08:18:48 BST Received: by vampire.cegelecproj.co.uk (5.0/SMI-SVR4) id AA17654; Mon, 1 May 1995 08:18:42 +0000 Date: Mon, 1 May 1995 04:18:42 -0400 From: Steve_Kilbane@cegelecproj.co.uk (Steve_Kilbane) Message-Id: <9505010718.AA17654@vampire.cegelecproj.co.uk> X-Planation: X-Faces images can be viewed with the XFaces program To: hc05@summitis.com Subject: Re: 9term/9wm hacks Cc: sam-fans@hawkwind.utcs.toronto.edu Content-Length: 659 X-Face: Iqsa(US9p?)Y^W+6Ff[Z]rM"uFE) lFDjag1e]\/#2 > From: hc05@summitis.com > I've loaded the patches to both 9term & 9wm on an RS/6000 running AIX > 3.2.5. 9term worked fine, but I had trouble with 9wm. I lost the > ability to use the mouse to anything but bring up the root menu or a > 9menu. The mouse would not work for scrolling, selecting text, or > bringing up a window. Interesting. I suspect the either the select() or FIFO handling, since they seem like areas AIX could be broken in, but since I've never used AIX I can't comment. select() seems the most likely, since if there was a FIFO problem it would probably hang completely. Does anyone with more AIX experience have any pointers? steve From sam-fans-owner Thu May 25 07:16:40 1995 Received: from sun2.nsfnet-relay.ac.uk ([128.86.8.45]) by hawkwind.utcs.utoronto.ca with SMTP id <24167>; Thu, 25 May 1995 07:14:37 -0400 Via: uk.ac.edinburgh.epcfta; Thu, 25 May 1995 12:12:28 +0100 From: Robert Raschke Date: Thu, 25 May 1995 06:33:06 -0400 Message-Id: <9250.9505251033@epcfta.ed.ac.uk> To: sam-fans@hawkwind.utcs.toronto.edu Subject: sam warning about files being aliased ??? Hi, I have just received a warning message from sam : ?warning: files might be aliased `file1' and `file2' Does anyone know what this might mean? Thanks, Robby -- robby@epc.ed.ac.uk From sam-fans-owner Thu May 25 07:22:40 1995 Received: from cegelecproj.co.uk ([159.245.72.6]) by hawkwind.utcs.utoronto.ca with SMTP id <24168>; Thu, 25 May 1995 07:22:20 -0400 Received: from vampire.cegelecproj.co.uk (cerberus.cegelecproj.co.uk) by cegelecproj.co.uk (4.1/SMI-4.1) id AA03302; Thu, 25 May 95 12:21:55 BST Received: from spirit.cegelecproj.co.uk (spirit.limbo.cegelecproj.co.uk) by vampire.cegelecproj.co.uk (5.0/SMI-SVR4) id AA11683; Thu, 25 May 1995 12:21:47 +0100 Received: by spirit.cegelecproj.co.uk (5.0/SMI-SVR4) id AA02610; Thu, 25 May 1995 12:21:42 +0100 Date: Thu, 25 May 1995 07:21:42 -0400 From: Steve_Kilbane@cegelecproj.co.uk (Steve_Kilbane) Message-Id: <9505251121.AA02610@spirit.cegelecproj.co.uk> X-Planation: X-Faces images can be viewed with the XFaces program To: robby@epcfta.edinburgh.ac.uk Subject: Re: sam warning about files being aliased ??? Cc: sam-fans@hawkwind.utcs.toronto.edu Content-Length: 160 X-Face: Iqsa(US9p?)Y^W+6Ff[Z]rM"uFE) lFDjag1e]\/#2 It means that you've opened file2, and sam thinks that it's the same file as file1, already open for editing. E.g. ; cd /etc ; sam passwd B /etc/passwd steve From sam-fans-owner Mon May 29 11:48:36 1995 Received: from irz301.inf.tu-dresden.de ([141.76.1.11]) by hawkwind.utcs.utoronto.ca with SMTP id <24171>; Mon, 29 May 1995 11:45:42 -0400 Received: from ibch10.inf.tu-dresden.de by irz301.inf.tu-dresden.de with SMTP (5.67b+/DEC-Ultrix/4.3) id AA21469; Mon, 29 May 1995 17:43:57 +0200 Received: by ibch10.inf.tu-dresden.de (5.67b+/DEC-Ultrix/4.3) id AA10449; Mon, 29 May 1995 17:43:55 +0200 Date: Mon, 29 May 1995 11:43:55 -0400 Message-Id: <199505291543.AA10449@ibch10.inf.tu-dresden.de> To: sam-fans@hawkwind.utcs.toronto.edu Subject: sam confused, Q: arrow keys From: Joerg Wittenberger Organisation: University of Technology Dresden X-Url: http://www.inf.tu-dresden.de/~jw6 X-Attribution: jfw Hello, I got sam a couple of days ago. I guess it's a nice thing. But I ran into two problems with it: 1) sometimes I end up in a situation when the whole editing menu (second mouse key) is displayed with parens around the topics and none of the commands typed into the ~sam~ window has any effect. I neither understand how I get into this situation nor how to escape from. All I can do is to terminate sam. Any help? 2) The arrow keys: I'm sitting in front of an AIX. When I try to move the cursor using the arrow keys they seem to have all the effect of page up/down. I can't move character or line wise. How can I get an usable key binding? 3) On different point (unrelated to sam): I attempt to compile 9term for the AIX, but I failed. I had to change some code to open a pty (as usual with AIX everything is a little different) into a mix of the two kinds already in the file pty.c. After doing so I ended up with an executable which opened a window. But the shell was obviewsly started on a complete different pty!! (After some tries starting and killing the 9term, I was left with a window where a couple of shells shared ONE pty. Fancy.) Any idea where to look? Did someone succed to compile 9term for the AIX (version 3)? One more Q: what I really can't understand: I promise that I got a executable one day. Since this day I can't link it any more. (Well, I changed something and didn't keep track of.) Whenever I try to link it now I end up with: cc -o 9term 9term.o command.o display.o pty.o ../libtext/libtext.a ../l ibframe/libframe.a ../libXg/libXg.a -lXt -lX11 -lm 0706-317 ERROR: Unresolved or undefined symbols detected: Symbols in error (followed by references) are dumped to the load map. The -bloadmap: option will create a load map. .XrmGetDatabase But I don't know where the XrmGetDatabase could come from (nor how it could ever have been resolved). Thanks /Jerry From sam-fans-owner Tue May 30 08:41:46 1995 Received: from relay3.UU.NET ([192.48.96.8]) by hawkwind.utcs.utoronto.ca with SMTP id <24171>; Tue, 30 May 1995 08:40:41 -0400 Received: from uucp6.UU.NET by relay3.UU.NET with SMTP id QQyryo18625; Tue, 30 May 1995 08:40:32 -0400 Received: from rexago8.UUCP by uucp6.UU.NET with UUCP/RMAIL ; Tue, 30 May 1995 08:40:32 -0400 Received: by summitis.com (smail2.5) id AA26604; 30 May 95 08:32:25 EDT (Tue) Received: from summitis.com by rserv1.summitis.com; Tue, 30 May 1995 08:30 EDT Received: from cheetah by rexsrvr2.summitis.com (AIX 3.2/UCB 5.64/4.03) id AA163109; Tue, 30 May 1995 08:29:58 -0400 Received: by cheetah (AIX 3.2/UCB 5.64/4.03) id AA12761; Tue, 30 May 1995 08:29:55 -0400 From: hc05@summitis.com Message-Id: <9505301229.AA12761@cheetah> X-Mailer: exmh version 1.6 4/21/95 To: sam-fans@hawkwind.utcs.toronto.edu Cc: hc05@summitis.com Subject: Re: sam confused, Q: arrow keys In-Reply-To: (Your message of Mon, 29 May 95 11:43:55 D.) <9505291641.AA71874@rexsrvr2.summitis.com> <199505291543.AA10449@ibch10.inf.tu-dresden.de> Mime-Version: 1.0 Date: Tue, 30 May 1995 09:29:53 -0400 Content-Type: text/plain Content-Length: 2273 > Hello, > > I got sam a couple of days ago. I guess it's a nice thing. But I ran > into two problems with it: > > 1) sometimes I end up in a situation when the whole editing menu > (second mouse key) is displayed with parens around the topics and none > of the commands typed into the ~sam~ window has any effect. I neither > understand how I get into this situation nor how to escape from. All I > can do is to terminate sam. Any help? This means that sam is trying to process a command and hasn't finished. The fact that you are stuck there is bad. > > 2) The arrow keys: I'm sitting in front of an AIX. When I try to move > the cursor using the arrow keys they seem to have all the effect of > page up/down. I can't move character or line wise. How can I get an > usable key binding? You should first understand how sam was designed. The idea is that you use the keyboard for entering text, and the mouse for control. You are supposed to use the mouse to move the cursor, not the keyboard. Having said that, you can get the samx patches for sam, which give you arrow keys like you expect, the ability to define macros, and autoindent. I use the package mainly for autoindent (I would have quit using sam without it), but the arrow keys are handy too. BTW, I don't know offhand where to get the samx patches, but others do. > > 3) On different point (unrelated to sam): I attempt to compile 9term > for the AIX, but I failed. I had to change some code to open a pty (as > usual with AIX everything is a little different) into a mix of the two > kinds already in the file pty.c. After doing so I ended up with an > executable which opened a window. But the shell was obviewsly started > on a complete different pty!! (After some tries starting and killing > the 9term, I was left with a window where a couple of shells shared > ONE pty. Fancy.) Any idea where to look? Did someone succed to compile > 9term for the AIX (version 3)? I have a mostly working 9term for AIX 3.2.5. I had to rewrite the pty logic. It works mostly. The things that need work are the special keys like INTR and job-control, and it dies occasionally. I can send it to you if you want to tinker more. I don't use 9term much, so I haven't gotten around to finishing it. Beirne From sam-fans-owner Tue May 30 10:13:06 1995 Received: from emory.mathcs.emory.edu ([128.140.2.1]) by hawkwind.utcs.utoronto.ca with SMTP id <24171>; Tue, 30 May 1995 10:12:40 -0400 Received: from skeeve.UUCP by emory.mathcs.emory.edu (5.65/Emory_mathcs.4.0.13) via UUCP id AA27507 ; Tue, 30 May 95 10:12:35 -0400 Return-Path: arnold@skeeve.atl.ga.us Received: by skeeve.atl.ga.us (/\==/\ Smail3.1.22.1 #22.1) id ; Tue, 30 May 95 10:00 EDT Message-Id: Date: Tue, 30 May 1995 10:00:00 -0400 From: arnold@skeeve.atl.ga.us (Arnold D. Robbins) To: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: sam confused, Q: arrow keys In-Reply-To: <199505291543.AA10449@ibch10.inf.tu-dresden.de> X-Mailer: [XMailTool v3.1.2] > I got sam a couple of days ago. I guess it's a nice thing. But I ran > into two problems with it: > > 1) sometimes I end up in a situation when the whole editing menu > (second mouse key) is displayed with parens around the topics and none > of the commands typed into the ~sam~ window has any effect. I neither > understand how I get into this situation nor how to escape from. All I > can do is to terminate sam. Any help? This is called a "protocol lock". There is a protocol between samterm, which controls the display you interact with, and sam, which actually does the editing. Occasionally, they get out of sync and there's nothing you can do. This usually happens to me after I've used the page-up or page-down keys and then started typing before samterm has finished updating the screen. I can usually switch to the sam window and send a 'w' and 'q' and then start a new session. Unfortunately, the Bell Labs guys can't seem to reproduce it... Sigh. Arnold Robbins -- The Basement Computer | Laundry increases Internet: arnold@skeeve.ATL.GA.US | exponentially in the UUCP: emory!skeeve!arnold | number of children. Bitnet: Forget it. Get on a real network. | -- Miriam Robbins From sam-fans-owner Thu Jun 1 10:14:53 1995 Received: from emory.mathcs.emory.edu ([128.140.2.1]) by hawkwind.utcs.utoronto.ca with SMTP id <24173>; Thu, 1 Jun 1995 10:12:28 -0400 Received: from skeeve.UUCP by emory.mathcs.emory.edu (5.65/Emory_mathcs.4.0.14) via UUCP id AA00153 ; Thu, 1 Jun 95 10:12:25 -0400 Return-Path: arnold@skeeve.atl.ga.us Received: by skeeve.atl.ga.us (/\==/\ Smail3.1.22.1 #22.1) id ; Thu, 1 Jun 95 09:42 EDT Message-Id: Date: Thu, 1 Jun 1995 09:42:00 -0400 From: arnold@skeeve.atl.ga.us (Arnold D. Robbins) To: sam-fans@hawkwind.utcs.utoronto.ca Subject: 9menu - advice sought X-Mailer: [XMailTool v3.1.2] Greetings. I have been sent code to have 9menu warp itself to wear the mouse is when it is de-iconified, the idea being that it "pops up" to where the mouse is. I'm trying to decide if I want to incorporate this behavior (probably under a `-warp' command line option), OR have the menu stay where it was originally placed, and instead have 9menu warp the mouse to where it is when it pops up. This second way is how I'm leaning at the moment, although the angle of my leaning is very slight. Anyway, I'd like to hear your opinion, particularly if you're using 9menu now. Thanks, Arnold From sam-fans-owner Thu Jun 1 17:43:18 1995 Received: from emory.mathcs.emory.edu ([128.140.2.1]) by hawkwind.utcs.utoronto.ca with SMTP id <24173>; Thu, 1 Jun 1995 17:42:34 -0400 Received: from skeeve.UUCP by emory.mathcs.emory.edu (5.65/Emory_mathcs.4.0.14) via UUCP id AA20213 ; Thu, 1 Jun 95 17:42:27 -0400 Return-Path: arnold@skeeve.atl.ga.us Received: by skeeve.atl.ga.us (/\==/\ Smail3.1.22.1 #22.1) id ; Thu, 1 Jun 95 17:35 EDT Message-Id: Date: Thu, 1 Jun 1995 17:35:00 -0400 From: arnold@skeeve.atl.ga.us (Arnold D. Robbins) To: sam-fans@hawkwind.utcs.utoronto.ca Subject: 9menu & mouse warping The sentiment so far is for 9menu not to warp the mouse. I'm half tempted to make the option such that it will warp the mouse, and then warp it back to where it was when done (a sort of mouse stack... :-), mainly 'cause I like to leave 9menu in one place. However, that probably wouldn't go over too well either. :-) OK, so is it possible under X to get a MapNotify event from the window manager but avoid the actual mapping of the window until after I've moved it to the new location? The current code blinks the menu at the old location before moving it to under the mouse; I thought I'd ask for advice about this before trying to do any hacking on it. (dhog?) Keep those cards and letters coming, folks. Thanks, Arnold From sam-fans-owner Fri Jun 2 16:57:34 1995 Received: from dam.CharlesView.COM ([199.103.137.242]) by hawkwind.utcs.utoronto.ca with SMTP id <24175>; Fri, 2 Jun 1995 16:51:07 -0400 Received: (from smap@localhost) by dam.CharlesView.COM (8.6.11/1.0ckc) id QAA31947 for ; Fri, 2 Jun 1995 16:50:13 -0400 Received: from ray(199.103.137.241) by dam via smap (V1.3) id sma031941; Fri Jun 2 16:49:48 1995 Received: (calvin@localhost) by ray.charlesview.com (8.6.11/8.6.10) id QAA01112; Fri, 2 Jun 1995 16:51:58 -0400 Date: Fri, 2 Jun 1995 16:51:58 -0400 Message-Id: <199506022051.QAA01112@ray.charlesview.com> From: Calvin Clark To: sam-fans@hawkwind.utcs.toronto.edu Subject: Where can get current version of UNIX sam port? What I have now dates back a couple of years (from research.att.com's ftp site.) Is there something more recent I should be running? -Calvin From sam-fans-owner Mon Jun 19 23:46:02 1995 Received: from emory.mathcs.emory.edu ([128.140.2.1]) by hawkwind.utcs.utoronto.ca with SMTP id <24181>; Mon, 19 Jun 1995 23:43:59 -0400 Received: from skeeve.UUCP by emory.mathcs.emory.edu (5.65/Emory_mathcs.4.0.14) via UUCP id AA02773 ; Mon, 19 Jun 95 23:43:43 -0400 Return-Path: arnold@skeeve.atl.ga.us Received: by skeeve.atl.ga.us (/\==/\ Smail3.1.22.1 #22.1) id ; Mon, 19 Jun 95 23:26 EDT Message-Id: Date: Mon, 19 Jun 1995 23:26:00 -0400 From: arnold@skeeve.atl.ga.us (Arnold D. Robbins) To: sam-fans@hawkwind.utcs.utoronto.ca Subject: new 9menu available I have updated 9menu to version 1.4. It's available from ftp.cc.gatech.edu in /pub/people/arnold/9menu-1.4.shar.gz. It does not unpack into a separate directory. Besides a bug fix or two, this version adds -teleport and -warp options. The -teleport option causes the menu to follow the mouse around, which is how everyone said they wanted it to work. The -warp option brings the mouse to the menu, and then puts it back, which is how I want it to work for me. (:-) Would the folks who are mirroring 9menu please pick it up and put it on their systems? I may not have the use of the Ga Tech system for much longer, and I'd like 9menu to survive. ("the software that men do lives after them" or some such nonsense) Enjoy, Arnold Robbins -- The Basement Computer | Laundry increases Internet: arnold@skeeve.ATL.GA.US | exponentially in the UUCP: emory!skeeve!arnold | number of children. Bitnet: Forget it. Get on a real network. | -- Miriam Robbins From sam-fans-owner Mon Jun 26 10:45:07 1995 Received: from sartre.minerva.bah.com ([156.80.175.13]) by hawkwind.utcs.utoronto.ca with SMTP id <24198>; Mon, 26 Jun 1995 10:42:04 -0400 Received: by sartre.minerva.bah.com (NX5.67d/NX3.0M) id AA05666; Mon, 26 Jun 95 10:37:36 -0400 Date: Mon, 26 Jun 1995 10:37:36 -0400 From: goon Message-Id: <9506261437.AA05666@sartre.minerva.bah.com> To: Subject: s cmd lossage Apparently-To: sam-fans@hawkwind.utcs.toronto.edu this s command lost with the latest (straight from at&t) version of sam. s:(([A-Z][a-z]*[ ]?)+)[ ]+([0-9]+):NAME \1\nPHONE 205 \2\n:g ^- space tab what happened was that \2 was set to \1. i rewrote the command without the nested parens (i really hadn't expected the command to work), and things were Happy. the working rewritten command is s:([A-Za-z ]+)[ ]+([0-9]+):NAME \1\nPHONE 205 \2\n:g From sam-fans-owner Fri Jun 30 16:21:25 1995 Received: from hermes.intel.com ([143.183.152.3]) by hawkwind.utcs.utoronto.ca with SMTP id <23978>; Fri, 30 Jun 1995 16:18:41 -0400 Received: from [134.134.50.200] by hermes.intel.com (5.65/10.0i); Fri, 30 Jun 95 13:18:33 -0700 Received: from pdx404 by ichips.intel.com (5.64+/10.0i); Fri, 30 Jun 95 13:18:05 -0700 Received: by pdx404.intel.com (AIX 3.2/UCB 5.64/10.0i); Fri, 30 Jun 1995 13:17:55 -0700 Date: Fri, 30 Jun 1995 16:17:55 -0400 From: haertel@ichips.intel.com Message-Id: <9506302017.AA28543@pdx404.intel.com> To: sam-fans@hawkwind.utcs.toronto.edu Subject: Sam crash Running sam under AIX 3.2, I get a samterm panic from the following sequence of commands typed in the command window: B /etc/termcap ,x/:am/ { /:am/ /:am/ c/FOO/ } Does anybody else observe this behavior? From sam-fans-owner Sat Jul 1 12:23:01 1995 Received: from minster.cs.york.ac.uk ([144.32.16.26]) by hawkwind.utcs.utoronto.ca with SMTP id <23978>; Sat, 1 Jul 1995 12:21:52 -0400 From: mhw@minster.york.ac.uk Message-ID: >From: mhw@minster.york.ac.uk (Mark H. Wilkinson) Date: Sat, 1 Jul 1995 13:18:59 -0400 In-Reply-To: haertel@ichips.intel.com's message, dated Jun 30, 4:17pm X-Face: Bsp[Ds(Y#/{==j:Cv'"IK4R^D0_z]{'OYtp2^EYqpG)88CsdBm&LJ{idLZWx}AKf}E4#|@4DT4cX3 ?!>aIVcxmd#1 X-Url: http://Dcpu1.cs.york.ac.uk:6666/~mhw/ X-Mailer: Mail User's Shell (7.2.5 10/14/92) To: haertel@ichips.intel.com, sam-fans@hawkwind.utcs.toronto.edu Subject: Re: Sam crash Cc: bobf@research.att.com haertel@ichips.intel.com wrote: > Subject: Sam crash > > Running sam under AIX 3.2, I get a samterm panic from the following > sequence of commands typed in the command window: > > B /etc/termcap > ,x/:am/ { > /:am/ > /:am/ > c/FOO/ > } > > Does anybody else observe this behavior? > [end of included message] Yes, I've seen this. What's probably happening is that sam core dumps and samterm panics because the pipe to sam dries up. The reason sam core dumps is that there's a bug in the execution of brace commands in cmdexec() in xec.c. It calls lookup() (in cmd.c) to get the command number of a command character then uses the returned value as an index into cmdtab (also in cmd.c). '{' isn't in cmdtab though so lookup() returns -1 and so the array access looks at a potentially bad address. A patch to fix this is attached. I've also had problems with sam core dumping in Fupdate() called from update() in sam.c. I think there's a dubious piece of code here which appears to delete() a file and then potentially perform operations on the free()d memory. A patch to fix this is also attached. I guess the occurence of these two bugs depends on the malloc implementation and the compiler you're using. I've been bitten by them though, and the fixes seem to work for me. -Mark. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Mark H. Wilkinson : Research student in user University of York, England : interface management systems Index: sam/sam.c diff -c sam/sam.c:1.3 sam/sam.c:1.4 *** sam/sam.c:1.3 Mon Apr 3 12:07:11 1995 --- sam/sam.c Wed Apr 12 16:34:40 1995 *************** *** 303,310 **** f = tempfile.filepptr[i]; if(f==cmd) /* cmd gets done in main() */ continue; ! if(f->deleted) delete(f); if(f->mod==modnum && Fupdate(f, FALSE, downloaded)) anymod++; if(f->rasp) --- 303,312 ---- f = tempfile.filepptr[i]; if(f==cmd) /* cmd gets done in main() */ continue; ! if(f->deleted){ delete(f); + continue; + } if(f->mod==modnum && Fupdate(f, FALSE, downloaded)) anymod++; if(f->rasp) Index: sam/xec.c diff -c sam/xec.c:1.1.1.1 sam/xec.c:1.2 *** sam/xec.c:1.1.1.1 Sun Jul 31 17:36:14 1994 --- sam/xec.c Wed Apr 12 16:36:33 1995 *************** *** 31,37 **** cp->cmdc!=('c'|0x100) && !(cp->cmdc=='D' && cp->ctext)) error(Enofile); i = lookup(cp->cmdc); ! if(cmdtab[i].defaddr != aNo){ if((ap=cp->addr)==0 && cp->cmdc!='\n'){ cp->addr = ap = newaddr(); ap->type = '.'; --- 31,37 ---- cp->cmdc!=('c'|0x100) && !(cp->cmdc=='D' && cp->ctext)) error(Enofile); i = lookup(cp->cmdc); ! if(i >= 0 && cmdtab[i].defaddr != aNo){ if((ap=cp->addr)==0 && cp->cmdc!='\n'){ cp->addr = ap = newaddr(); ap->type = '.'; From sam-fans-owner Tue Jul 11 03:59:13 1995 Received: from reef.cs.jcu.edu.au ([137.219.17.26]) by hawkwind.utcs.utoronto.ca with SMTP id <24080>; Tue, 11 Jul 1995 03:55:31 -0400 Received: by reef.cs.jcu.edu.au; id AA32380; Tue, 11 Jul 1995 17:55:10 +1000 Message-Id: <9507110755.AA32380@reef.cs.jcu.edu.au> To: sam-fans@hawkwind.utcs.toronto.edu Subject: Sam on alphas? Reply-To: tony@cs.jcu.edu.au Organisation: Dept. of Computer Science, James Cook University Date: Tue, 11 Jul 1995 03:55:09 -0400 From: tony@reef.cs.jcu.edu.au X-Mts: smtp Hi folks, I've just started using sam on a DEC Alpha running OSF1/3.0. I grabbed the latest distrib from AT&T but unfortunately it crashes periodically. Before I attempt to track down the problem, is anyone else using it successfully on this platform? Also, can someone point me to the Sam extension patches? I lost my record of the site. Thanks in advance, Tony Sloane Tony Sloane tony@cs.jcu.edu.au Department of Computer Science, James Cook University From sam-fans-owner Wed Jul 12 19:18:11 1995 Received: from reef.cs.jcu.edu.au ([137.219.17.26]) by hawkwind.utcs.utoronto.ca with SMTP id <24080>; Wed, 12 Jul 1995 19:13:03 -0400 Received: by reef.cs.jcu.edu.au; id AA26419; Thu, 13 Jul 1995 09:12:51 +1000 Message-Id: <9507122312.AA26419@reef.cs.jcu.edu.au> To: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: Sam on alphas? In-Reply-To: Your message of "Tue, 11 Jul 95 03:55:09 -0400." <9507110755.AA32380@reef.cs.jcu.edu.au> Reply-To: tony@cs.jcu.edu.au Organisation: Dept. of Computer Science, James Cook University Date: Wed, 12 Jul 1995 19:12:50 -0400 From: tony@reef.cs.jcu.edu.au X-Mts: smtp Hi, I guess it's bad form to answer my own mail, but oh well... > I've just started using sam on a DEC Alpha running OSF1/3.0. I > grabbed the latest distrib from AT&T but unfortunately it crashes > periodically. Before I attempt to track down the problem, is anyone > else using it successfully on this platform? It turns out that the compile on OSF1/3.0 has a different set of predefined processor symbols. Hence the line in sam/sam.h that says: #ifdef __alpha__ should be #if defined(__alpha__) || defined(__alpha) With this change made I haven't had a crash. > Also, can someone point me to the Sam extension patches? I lost my > record of the site. Still looking for these... Cheers, Tony From sam-fans-owner Wed Jul 26 11:36:16 1995 Received: from plan9.att.com ([192.20.225.252]) by hawkwind.utcs.utoronto.ca with SMTP id <24103>; Wed, 26 Jul 1995 11:31:50 -0400 From: rob@plan9.att.com To: sam-fans@hawkwind.utcs.toronto.edu Date: Wed, 26 Jul 1995 11:29:33 -0400 Subject: Re: s cmd lossage Message-Id: <95Jul26.113150edt.24103@hawkwind.utcs.utoronto.ca> some time ago - i'm catching up on old sam mail - quanstro@sartre.minerva.bah.com said: this s command lost with the latest (straight from at&t) version of sam. s:(([A-Z][a-z]*[ ]?)+)[ ]+([0-9]+):NAME \1\nPHONE 205 \2\n:g ^- space tab what happened was that \2 was set to \1. i've tried it here and it works as written. let me explain what's going on, because i think you're also seeing it work correctly but it's confusing you. i tried this source: ABCD 01234 and got NAME ABCD PHONE 205 D which is correct. as it says in the manual, the \digit operators on the right side of a substitution refer to the text matched by the subexpression beginning at the digit-th left parenthesis. here \1 would refer to the match of (([A-Z][a-z]*[ ]?)+) which would be ABCD and \2 would refer to the most recent match of ([A-Z][a-z]*[ ]?) which is D confusion comes because of the nesting -- whose meaning is defined by the manual -- and the repetition operator (+) -- whose meaning is not but should be clear from any thought about the implementation. referring to the implementation is the last refuge of the writer of incomplete documentation, but i believe the behavior is reasonable. you wrote a near-nonsense expression and got near-nonsense results. i see no bug here. now you may have some input text that shows other behavior, but if so please interpret the answer carefully before deciding there's a bug. i don't deny there could be one, but nested repeated regexps can be fertile sources of confusion as well as errors. -rob From sam-fans-owner Fri Aug 4 15:15:40 1995 Received: from relay3.UU.NET ([192.48.96.8]) by hawkwind.utcs.utoronto.ca with SMTP id <24107>; Fri, 4 Aug 1995 15:12:36 -0400 Received: from uucp3.UU.NET by relay3.UU.NET with SMTP id QQzbjg01864; Fri, 4 Aug 1995 15:12:27 -0400 Received: from rexago8.UUCP by uucp3.UU.NET with UUCP/RMAIL ; Fri, 4 Aug 1995 15:12:19 -0400 Received: by summitis.com (smail2.5) id AA18105; 4 Aug 95 14:56:23 EDT (Fri) Received: from summitis.com by rserv1.summitis.com; Fri, 4 Aug 1995 14:55 EDT Received: from cheetah by rexsrvr2.summitis.com (AIX 3.2/UCB 5.64/4.03) id AA08749; Fri, 4 Aug 1995 14:54:56 -0400 Received: by cheetah (AIX 3.2/UCB 5.64/4.03) id AA18826; Fri, 4 Aug 1995 14:54:55 -0400 From: hc05@summitis.com Message-Id: <9508041854.AA18826@cheetah> X-Mailer: exmh version 1.6 4/21/95 To: sam-fans@hawkwind.utcs.toronto.edu Subject: Matching shortest string in se's Date: Fri, 4 Aug 1995 15:54:54 -0400 Content-Type: text Content-Length: 467 Is there an easy way that I have missed to match blocks of code bounded by tags of multiple characters using sam? Examples would be C comments (/*..*/) or HTML tags (
...
). I've done the comments in the past by typing out the combinations of things that I don't want to match in between ,x#/\*([^*/]|\n|[^*]/|\*[^/]|\*\n)+\*/#d but the combinations expand rapidly as I try to match longer tags. Is there something else I should try? Thanks, Beirne From sam-fans-owner Thu Aug 10 15:40:12 1995 Received: from localhost by hawkwind.utcs.utoronto.ca with SMTP id <24109>; Thu, 10 Aug 1995 15:36:10 -0400 To: sam-fans Subject: Sun type 4 keyboards, X11R6, and 9term Date: Thu, 10 Aug 1995 15:36:06 -0400 From: Chris Siebenmann Message-Id: <95Aug10.153610edt.24109@hawkwind.utcs.utoronto.ca> I've recently had to move from a DEC LK201 keyboard to a Sun type 4 keyboard (on a Sparcstation 1+ running SunOS 4.1.4 and X11R6) and, while it has some virtues, I can't get the damn PageUp and PageDown keys to work in 9term (or sam, or xterm) -- which makes it much less nicer. Does anyone have the magic xmodmap or whatever incantations necessary to get them back? Many thanks in advance. - cks From sam-fans-owner Thu Aug 10 16:56:47 1995 Received: from cannon.ecf.toronto.edu ([128.100.8.5]) by hawkwind.utcs.utoronto.ca with SMTP id <24109>; Thu, 10 Aug 1995 16:55:55 -0400 Received: by cannon.ecf.toronto.edu id <3658>; Thu, 10 Aug 1995 16:55:41 -0400 From: Steve Kotsopoulos To: Chris Siebenmann Subject: Re: Sun type 4 keyboards, X11R6, and 9term Cc: sam-fans@hawkwind.utcs.toronto.edu Message-Id: <95Aug10.165541edt.3658@cannon.ecf.toronto.edu> Date: Thu, 10 Aug 1995 16:55:35 -0400 We added the following to xdm/Xsession under X11R6: # xmodmap -e "keycode 27 = Up" xmodmap -e "keycode 34 = Down" xmodmap -e "keycode 31 = Left" xmodmap -e "keycode 35 = Right" From sam-fans-owner Sun Aug 27 11:03:06 1995 Received: from staff.cs.su.OZ.AU ([129.78.8.1]) by hawkwind.utcs.utoronto.ca with SMTP id <24128>; Sun, 27 Aug 1995 10:59:40 -0400 Received: from staff.cs.su.oz.au by staff.cs.su.OZ.AU (mail from gary for sam-fans@hawkwind.utcs.toronto.edu) with MHSnet; Mon, 28 Aug 1995 00:59:26 +1000 Received: from staff.cs.su.OZ.AU. by staff.cs.su.OZ.AU.; Mon, 28 Aug 1995 00:59:22 +1000 To: sam-fans@hawkwind.utcs.toronto.edu cc: trost@cloud.rain.com Subject: Acme for X Date: Sun, 27 Aug 1995 10:59:21 -0400 From: Gary Capell Message-Id: <95Aug27.105940edt.24128@hawkwind.utcs.utoronto.ca> Bill Trost and myself have written a lot of an Acme workalike for X. It's called wily. It's not ready for general release, but hackers can grab what's there and have a play. Canned blurb follows: What is Wily? Wily is an program for Unix/X/C which attempts to provide the functionality of Acme (http://plan9.att.com/plan9/doc/acme.html), which is built on Plan9/Alef. Acme/Wily provide an integrated programming/editing environment which makes good use of a 3-button mouse, with several interesting features. What state is it in? Certainly far from plug'n'play. A few people here (Basser) are using it pretty heavily already, but there's still quite a lot of work remaining. Grab it if you want to have a look/play, but expect (and please mail me) bugs. Please mail me portability fixes (but not problems). It's being jointly written on a Solaris and a FreeBSD machine. Documentation? Check out http://www.cs.su.oz.au/~gary/hobby/wily/auug.html Where do you get it? ftp://www.cs.su.oz.au/gary/wily.tgz (tar'ed, gzip'ed file) From sam-fans-owner Tue Sep 5 06:46:52 1995 Received: from emory.mathcs.emory.edu ([128.140.2.1]) by hawkwind.utcs.utoronto.ca with SMTP id <24134>; Tue, 5 Sep 1995 06:44:06 -0400 Received: from skeeve.UUCP by emory.mathcs.emory.edu (5.65/Emory_mathcs.4.0.16) via UUCP id AA20066 ; Tue, 5 Sep 95 06:43:55 -0400 Return-Path: arnold@skeeve.atl.ga.us Received: by skeeve.atl.ga.us (/\==/\ Smail3.1.22.1 #22.1) id ; Tue, 5 Sep 95 06:02 EDT Message-Id: Date: Tue, 5 Sep 1995 06:02:00 -0400 From: arnold@skeeve.atl.ga.us (Arnold D. Robbins) To: 9fans@cse.purdue.edu, sam-fans@hawkwind.utcs.utoronto.ca Subject: wily under SunOS [Apologies to those of you who'll see this twice.] Here is what I had to do to get wily going under SunOS. Your mileage may vary, as a lot of this was done after initial compiles, and most of this is from memory. It should be enough though to get you going. Wily comes up and stays up, I didn't do any actual editing with it yet. First, make this change to include/u.h: *** u.h.orig Tue Sep 5 05:48:40 1995 --- u.h Mon Sep 4 23:13:54 1995 *************** *** 45,52 **** --- 45,55 ---- #endif /* UMIPS */ #ifdef SUNOS + #ifdef _POSIX_SOURCE typedef unsigned short ushort; + #endif typedef unsigned long ulong; + typedef unsigned int uint; extern char *strerror(int); extern void *memmove(void*, const void*, size_t); extern void *memcpy(void*, const void*, size_t); Second, cut this file out and put it in the top level directory as `sun.ed' and run it. ----------------------- cut here ------------------------- #!/bin/sh echo "patching libframe/frbox.c" cp -p libframe/frbox.c libframe/frbox.c.dist ed libframe/frbox.c << EOF /.*f->box.*=.*realloc/c f->box = f->box ? realloc(f->box, f->nalloc*sizeof(Frbox)) : malloc(f->nalloc*sizeof(Frbox)); From sam-fans-owner Thu Sep 14 08:55:09 1995 Received: from cegelecproj.co.uk ([159.245.72.6]) by hawkwind.utcs.utoronto.ca with SMTP id <24148>; Thu, 14 Sep 1995 08:52:36 -0400 Received: from vampire.cegelecproj.co.uk (cerberus.cegelecproj.co.uk) by cegelecproj.co.uk (4.1/SMI-4.1) id AA13224; Thu, 14 Sep 95 13:52:21 BST Received: from phantom.cegelecproj.co.uk (phantom.limbo.cegelecproj.co.uk) by vampire.cegelecproj.co.uk (5.0/SMI-SVR4) id AA16703; Thu, 14 Sep 1995 13:52:18 +0100 Received: from phantom (localhost) by phantom.cegelecproj.co.uk (5.0/SMI-SVR4) id AA29674; Thu, 14 Sep 1995 13:52:14 +0100 Message-Id: <9509141252.AA29674@phantom.cegelecproj.co.uk> X-Mailer: exmh version 1.6.1 5/23/95 To: sam-fans@hawkwind.utcs.toronto.edu Subject: @ X-Face: Iqsa(US9p?)Y^W+6Ff[Z]rM"uFE) lFDjag1e]\/#2 X-Planation: X-Faces can be viewed with Faces from cs.indiana.edu. Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 14 Sep 1995 08:52:13 -0400 From: Steve_Kilbane Content-Length: 205 The original sam paper says that '@' means "any character" in regexps, but this is not supported in the versions currently available (UNIX and Plan 9). I was just wondering why it was taken out... steve From sam-fans-owner Tue Oct 24 14:29:02 1995 Received: from minster.cs.york.ac.uk ([144.32.16.26]) by hawkwind.utcs.utoronto.ca with SMTP id <24226>; Tue, 24 Oct 1995 14:24:25 -0400 From: mhw@minster.york.ac.uk Message-ID: >From: mhw@minster.york.ac.uk (Mark H. Wilkinson) Date: Tue, 24 Oct 1995 14:02:16 -0400 X-Url: http://Dcpu1.cs.york.ac.uk:6666/~mhw/ X-PGP-Fingerprint: 8E 43 1E D7 85 42 E0 C5 D3 8C B6 B1 EE 06 95 64 X-Mailer: Mail User's Shell (7.2.6 alpha(2) 7/9/95) To: sam-fans@hawkwind.utcs.toronto.edu (sam mailing list) Subject: gcc -fno-builtin The Makefiles which come with sam have traditionally mandated the -fno-builtin flag for gcc to stop it creating special versions of some functions. Does anyone know the reason behind this? Does gcc generate bad code without the flag? Does anyone have a stable version of sam compiled by gcc without this flag set? -Mark. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Mark H. Wilkinson : Research student in user University of York, England : interface management systems From sam-fans-owner Sat Nov 25 14:22:22 1995 Received: from taurus.math.tau.ac.il ([132.67.64.4]) by hawkwind.utcs.utoronto.ca with SMTP id <24226>; Sat, 25 Nov 1995 14:01:54 -0500 Received: from scorpio.math.tau.ac.il (laden@scorpio.math.tau.ac.il [132.67.64.13]) by taurus.math.tau.ac.il (8.6.10/math) with ESMTP id UAA17068 for ; Sat, 25 Nov 1995 20:59:34 +0200 From: Guy Laden Received: (laden@localhost) by scorpio.math.tau.ac.il (8.6.9/8.6.9) id UAA18125 for sam-fans@hawkwind.utcs.toronto.edu; Sat, 25 Nov 1995 20:59:32 +0200 Message-Id: <199511251859.UAA18125@scorpio.math.tau.ac.il> Subject: Structural regular expressions To: sam-fans@hawkwind.utcs.toronto.edu Date: Sat, 25 Nov 1995 13:59:32 -0500 X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 280 People on this list might be interested in a new tool called 'cgrep'. Its a simple and very expressive grep-like tool which fans of sam-like regexps will enjoy. Its available from ftp://plg.uwaterloo.ca/pub/mt/cgrep. Browse around under .../mt/.. for some relevant papers. guy. From sam-fans-owner Tue Dec 5 10:27:06 1995 Received: from gateway.roadway.com ([198.83.130.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24238>; Tue, 5 Dec 1995 10:14:37 -0500 Received: by gateway.roadway.com id AA03713 (InterLock SMTP Gateway 3.0 for sam-fans@hawkwind.utcs.toronto.edu); Tue, 5 Dec 1995 10:14:01 -0500 Message-Id: <199512051514.AA03713@gateway.roadway.com> Received: by gateway.roadway.com (Internal Mail Agent-1); Tue, 5 Dec 1995 10:14:01 -0500 From: beirnek@roadway.com (Beirne Konarski) Subject: Where is samx2? To: sam-fans@hawkwind.utcs.toronto.edu (Sam mailing list) Date: Sat, 27 Jun 1970 10:28:01 -0400 X-Mailer: ELM [version 2.4 PL23] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 425 Someone asked me where the samx patches are, so I looked and couldn't find them at uiuc. Do they still exist somewhere? Thanks, Beirne -- ------------------------------------------------------------------------------- Beirne Konarski | Reading maketh a full man, conference a beirnek@summitis.com | ready man, and writing an exact man. "Untouched by Scandal" | -- Francis Bacon From sam-fans-owner Tue Dec 5 18:32:58 1995 Received: from mumrik.nada.kth.se ([130.237.226.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24239>; Tue, 5 Dec 1995 18:28:43 -0500 Received: from localhost (d92-dne@localhost) by mumrik.nada.kth.se (8.6.10/8.6.9) with ESMTP id AAA24845; Wed, 6 Dec 1995 00:28:30 +0100 Message-Id: <199512052328.AAA24845@mumrik.nada.kth.se> To: beirnek@roadway.com (Beirne Konarski) cc: sam-fans@hawkwind.utcs.toronto.edu (Sam mailing list) Subject: Re: Where is samx2? In-reply-to: Your message of "Sat, 27 Jun 1970 10:28:01 -0400." <199512051514.AA03713@gateway.roadway.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <24843.818206106.1@mumrik.nada.kth.se> Date: Tue, 5 Dec 1995 18:28:28 -0500 From: Daniel Neri I found them at ftp://ftp.funet.fi/pub/unix/editors/sam/samx2/ /Daniel -- Daniel Neri d92-dne@nada.kth.se (MIME) From sam-fans-owner Wed Jan 31 16:01:12 1996 Received: from alpha.xerox.com ([13.1.64.93]) by hawkwind.utcs.utoronto.ca with SMTP id <23978>; Wed, 31 Jan 1996 15:55:45 -0500 Received: from clam.Intran.Xerox.COM ([13.243.212.2]) by alpha.xerox.com with SMTP id <15099(5)>; Wed, 31 Jan 1996 12:54:47 PST Received: from mangrove.swamp (mangrove.Intran.Xerox.COM) by clam.Intran.Xerox.COM (4.1/SMI-4.1) id AA03028; Wed, 31 Jan 96 14:58:02 CST Date: Wed, 31 Jan 1996 15:58:02 -0500 From: seebs@intran.xerox.com (Peter Seebach) Message-Id: <9601312058.AA03028@clam.Intran.Xerox.COM> To: sam-fans@hawkwind.utcs.toronto.edu Subject: Help with libXg, sunos 4.1.4, X11R6... libXg, as distributed with my version-free sam.msg (shell archive) builds without complaints, but linked with my X11R6 libs, gets mysterious errors from the test program, and fatal coredumping ones from samterm. It appeared to work with openwin's libXt. Can anyone suggest a way to figure out whether this is a bug in libXg, or a bug in libXt? -s From sam-fans-owner Wed Feb 28 23:54:32 1996 Received: from oldp.nmsu.edu ([128.123.26.31]) by hawkwind.utcs.utoronto.ca with SMTP id <24028>; Wed, 28 Feb 1996 23:44:18 -0500 Received: by oldp.nmsu.edu; id AA26267; Wed, 28 Feb 1996 21:43:44 -0700 Date: Wed, 28 Feb 1996 23:43:44 -0500 From: Alan Watson Message-Id: <9602290443.AA26267@oldp.nmsu.edu> To: sam-fans@hawkwind.utcs.toronto.edu Subject: 9term & rlogin I've just compiled 9term v1.6.6 on a DEC Alpha OSF/1 v3.2. I used a Makefile identical Makefile.matty.alpha with the exception of BINDIR. I can't seem to get rlogin to work with it. The rc on the remote machine runs .rcrc, spits out a prompt, and then the connection gets closed. rlogin works fine from an xterm and telnet works fine from both an xterm and a 9term. The behaviour is the same connecting to both OSF/1 and Solaris machines. Bright ideas, anyone? Alan From sam-fans-owner Thu Feb 29 00:05:36 1996 Received: from solutions.solon.com ([192.129.84.3]) by hawkwind.utcs.utoronto.ca with SMTP id <24029>; Thu, 29 Feb 1996 00:01:45 -0500 Received: (from seebs@localhost) by solutions.solon.com (8.6.12/8.6.12) id XAA04791; Wed, 28 Feb 1996 23:02:21 -0600 Date: Thu, 29 Feb 1996 00:02:21 -0500 From: Peter Seebach Message-Id: <199602290502.XAA04791@solutions.solon.com> To: alan@oldp.nmsu.edu, sam-fans@hawkwind.utcs.toronto.edu Subject: Re: 9term & rlogin Hmm. That's better than I got; on SunOS 4.1.3, I couldn't even get it to run consistently. (Although I've since found that a lot of libXg apps were failing because of bugs in my X server, and this may apply to other stuff too.) What's the canonical site to pick up new versions of all these things from? -s From sam-fans-owner Sat Mar 2 02:41:55 1996 Received: from oldp.nmsu.edu ([128.123.26.31]) by hawkwind.utcs.utoronto.ca with SMTP id <24028>; Sat, 2 Mar 1996 02:34:57 -0500 Received: by oldp.nmsu.edu; id AA01907; Fri, 1 Mar 1996 23:22:56 -0700 Date: Sat, 2 Mar 1996 01:22:56 -0500 From: Alan Watson Message-Id: <9603020622.AA01907@oldp.nmsu.edu> To: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: 9term and rlogin Running rlogin 8-bit clean seems to have fixed the problem. I have no idea why. Alan From sam-fans-owner Mon Jun 24 14:55:44 1996 Received: from research.att.com ([192.20.225.4]) by hawkwind.utcs.utoronto.ca with SMTP id <35213>; Mon, 24 Jun 1996 14:43:40 -0400 Received: from slocum by ns; Wed Apr 3 01:07:30 EST 1996 Date: Wed, 3 Apr 1996 01:07:00 -0500 From: Russ Cox To: sam-fans@hawkwind.utcs.toronto.edu Subject: 8 1/2 for Unix? Message-Id: <96Jun24.144340edt.35213@hawkwind.utcs.utoronto.ca> In rob's paper on 8 1/2, he suggests that someone port it to Unix just to show that its not plan9 dependant. Has anyone seen such a port? (I know of 9wm, 9term, etc, but I mean an actual window system, not something that sits on X). If this is the wrong place, let me know. Thanks. Russ From sam-fans-owner Mon Jun 24 14:58:58 1996 Received: from lendal.york.ac.uk ([144.32.128.21]) by hawkwind.utcs.utoronto.ca with SMTP id <35215>; Mon, 24 Jun 1996 14:58:17 -0400 Received: from ebor.york.ac.uk by lendal.york.ac.uk with SMTP (PP); Thu, 4 Apr 1996 19:46:44 +0100 Received: by ebor.york.ac.uk (950511.SGI.8.6.12.PATCH526/940406.SGI) id TAA16029; Thu, 4 Apr 1996 19:48:09 +0100 To: sam-fans@hawkwind.utcs.toronto.edu Subject: samterm dumping core on {} From: stephen Date: Thu, 4 Apr 1996 13:44:24 -0500 Message-ID: <199604041944.15598.out.badel@york.ac.uk> X-Url: http://www.york.ac.uk/~sp106/ samterm seems to respond fairly badly to an input of {} if it has no files open. ; samterm: host mesg: count 4864 1x 0x 19x ...ignored 2 samterm: host mesg: count 4864 1x 0x 19x ...ignored 2 samterm: host mesg: count 4864 1x 0x 19x ...ignored 2 samterm: host mesg: count 4864 1x 0x 19x ...ignored 2 type 1 count 4864 samterm:panic: count>DATASIZE: Error 0 this doesn't occur if either you run sam -d, or sam has a file open. i don't know the samterm source well enough to track the problem down in a reasonable amount of time. any ideas? stephen ps. i havn't heard from this group for a long time, is it inactive or have i merly been unsubscribed somehow? From sam-fans-owner Mon Jun 24 14:59:20 1996 Received: from eurogate.bnr.co.uk ([192.100.101.3]) by hawkwind.utcs.utoronto.ca with SMTP id <35217>; Mon, 24 Jun 1996 14:59:04 -0400 Received: from hedera.bnr.co.uk (actually innergate.bnr.co.uk) by eurogate.bnr.co.uk with SMTP (PP); Thu, 25 Apr 1996 14:18:52 +0100 Received: from bhars54b.bnr.co.uk by hedera.bnr.co.uk with SMTP (PP); Thu, 25 Apr 1996 14:18:45 +0100 Sender: P.W.McMahon@bnr.co.uk Message-ID: <317F7BB2.7DE14518@nortel.co.uk> Date: Thu, 25 Apr 1996 09:18:42 -0400 From: Paul W McMahon Organization: Nortel Technology X-Mailer: Mozilla 2.0 (X11; I; SunOS 4.1.3_U1 sun4m) MIME-Version: 1.0 To: sam-fans@hawkwind.utcs.toronto.edu Subject: sam colours Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit How do I set the page colour of Sam. At the moment it is set to white but I prefer other colours. -- P.W.McMahon@nortel.co.uk From sam-fans-owner Mon Jun 24 15:19:21 1996 Received: from localhost by hawkwind.utcs.utoronto.ca with SMTP id <24391>; Mon, 24 Jun 1996 15:07:05 -0400 To: es, rc, sam-fans Subject: Status of the es/rc/sam-fans mailing lists Date: Mon, 24 Jun 1996 15:06:21 -0400 From: Chris Siebenmann Message-Id: <96Jun24.150705edt.24391@hawkwind.utcs.utoronto.ca> They're back (as you can see). I've resurrected all the messages for them from the time they were down. Unfortunately, they are still not being run under a mailing list manager, so there's no restriction on who can send messages; fortunately spam sent to them appears to have died down (AOL apparently obtained a fairly strong injuction against the major spammer). They will be converted to subscribers-only posting at some point in the future; I just thought it would be better to have them existing in the mean time. - cks From sam-fans-owner Mon Jun 24 17:03:29 1996 Received: from alpha.xerox.com ([13.1.64.93]) by hawkwind.utcs.utoronto.ca with SMTP id <24403>; Mon, 24 Jun 1996 16:58:05 -0400 Received: from moose.intran.xerox.com ([13.243.212.3]) by alpha.xerox.com with SMTP id <15446(6)>; Mon, 24 Jun 1996 13:23:10 PDT Received: from mangrove.swamp (mangrove.intran.xerox.com) by moose.intran.xerox.com (4.1/SMI-4.1) id AA03236; Mon, 24 Jun 96 14:21:55 CDT Date: Mon, 24 Jun 1996 15:21:55 -0400 From: seebs@intran.xerox.com (Peter Seebach) Message-Id: <9606241921.AA03236@moose.intran.xerox.com> To: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: 8 1/2 for Unix? I haven't seen one. You could implement one which sat on X, but which basically opened the root window and took it over. You would have a *very* hard time avoiding that dependancy, as graphics hardware varies. But if you wrote one which used a window, you could do pretty well. -s From sam-fans-owner Mon Jun 24 17:54:44 1996 Received: from galapagos.cse.psu.edu ([130.203.2.12]) by hawkwind.utcs.utoronto.ca with SMTP id <24392>; Mon, 24 Jun 1996 17:52:59 -0400 Received: from localhost by galapagos.cse.psu.edu with SMTP id <12684>; Mon, 24 Jun 1996 17:52:46 -0400 To: stephen cc: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: samterm dumping core on {} In-reply-to: Your message of "Thu, 04 Apr 1996 13:44:24 EST." <199604041944.15598.out.badel@york.ac.uk> Date: Mon, 24 Jun 1996 17:52:39 -0400 From: Scott Schwartz Message-Id: <96Jun24.175246edt.12684@galapagos.cse.psu.edu> Wasn't there a fix for this on the 9fans list? From sam-fans-owner Mon Jun 24 17:56:45 1996 Received: from lendal.york.ac.uk ([144.32.128.21]) by hawkwind.utcs.utoronto.ca with SMTP id <24395>; Mon, 24 Jun 1996 17:56:28 -0400 Received: from ebor.york.ac.uk by lendal.york.ac.uk with SMTP (PP); Mon, 24 Jun 1996 22:53:59 +0100 Received: by ebor.york.ac.uk (950511.SGI.8.6.12.PATCH526/940406.SGI) id WAA28643; Mon, 24 Jun 1996 22:55:53 +0100 To: Scott Schwartz Cc: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: samterm dumping core on {} From: stephen Date: Mon, 24 Jun 1996 17:54:03 -0400 In-Reply-To: <96Jun24.175246edt.12684@galapagos.cse.psu.edu> Message-ID: <199606242254.28447.out.bajey@york.ac.uk> X-Url: http://www.york.ac.uk/~sp106/ > Wasn't there a fix for this on the 9fans list? yes. the post to samfans was before the one to 9fans, but the one to samfans has only just surfaced. stephen From sam-fans-owner Tue Jun 25 12:44:44 1996 Received: from plan9.bell-labs.com ([204.178.16.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24393>; Tue, 25 Jun 1996 12:43:09 -0400 From: "bob flandrena" To: sam-fans@hawkwind.utcs.toronto.edu Date: Tue, 25 Jun 1996 12:21:17 -0400 Message-Id: <96Jun25.124309edt.24393@hawkwind.utcs.utoronto.ca> > samterm seems to respond fairly badly to an input of {} > if it has no files open. i posted a fix to this several months ago: % diff /n/dump/1995/0401/sys/src/cmd/sam/xec.c xec.c 29c29 < !utfrune("bBnqUXY!{", cp->cmdc) && --- > !utfrune("bBnqUXY!", cp->cmdc) && 33c33 < if(cmdtab[i].defaddr != aNo){ --- > if(i >= 0 && cmdtab[i].defaddr != aNo){ there are several other bug patches for sam in the boddle package available by anonymous ftp at plan9.att.com in plan9/update/cmd/sam/829146783.rc. the diff's are relative to the plan 9 version of sam and require rc to unpack, but are easy to extract by hand and apply to the unix version. From sam-fans-owner Thu Jul 11 12:45:35 1996 Received: from oldp.nmsu.edu ([128.123.26.31]) by hawkwind.utcs.utoronto.ca with SMTP id <24401>; Thu, 11 Jul 1996 12:38:02 -0400 Received: by oldp.nmsu.edu; id AA15151; Thu, 11 Jul 1996 10:37:33 -0600 Date: Thu, 11 Jul 1996 12:37:33 -0400 From: Alan Watson Message-Id: <9607111637.AA15151@oldp.nmsu.edu> To: sam-fans@hawkwind.utcs.toronto.edu, wilyfans@jli.com Subject: UTF support for mailx Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit I've hacked together support for UTF in mailx. It does the things you might expect: converting to and from 7-bit MIME encodings and the ISO-8859-X character sets where appropriate. See http://charon.nmsu.edu/~awatson/utf-mailx/ I've been using it for a few months now, so it should be fairly stable. If you find bugs, though, please let me know. Alan From sam-fans-owner Sat Aug 3 02:47:51 1996 Received: from comoro.yorku.ca ([130.63.236.55]) by hawkwind.utcs.utoronto.ca with SMTP id <24432>; Sat, 3 Aug 1996 02:40:17 -0400 Received: from nexus.yorku.ca (nexus.yorku.ca [130.63.236.20]) by comoro.yorku.ca (8.6.12/8.6.11) with ESMTP id CAA25487 for ; Sat, 3 Aug 1996 02:40:03 -0400 Received: from localhost (localhost.yorku.ca [127.0.0.1]) by nexus.yorku.ca (8.6.11/8.6.11) with SMTP id CAA11455 for ; Sat, 3 Aug 1996 02:40:00 -0400 Message-Id: <199608030640.CAA11455@nexus.yorku.ca> To: sam-fans@hawkwind.utcs.toronto.edu Date: Sat, 3 Aug 1996 02:40:00 -0400 From: "ozan s. yigit" > there are several other bug patches for sam in > the boddle package available by anonymous > ftp at plan9.att.com in plan9/update/cmd/sam/829146783.rc. here is a version that patch understands, so somewhat easier to extract and apply: *** cmd.c.orig Sat Aug 3 02:08:53 1996 --- cmd.c Sat Aug 3 02:09:23 1996 *************** *** 220,223 **** --- 220,226 ---- (ocurfile!=curfile || (!loaded && curfile->state!=Unread))) outTs(Hcurrent, curfile->tag); + /* don't allow type ahead on files that aren't bound */ + if(downloaded && curfile && curfile->rasp == 0) + terminp = termoutp; } } *** mesg.c.orig Sat Aug 3 02:08:52 1996 --- mesg.c Sat Aug 3 02:09:23 1996 *************** *** 257,260 **** --- 257,261 ---- case Tstartfile: + termlocked++; f = whichfile(inshort()); if(!f->rasp) /* this might be a duplicate message */ *************** *** 264,268 **** outTs(Hcurrent, f->tag); journaln(0, f->tag); - termlocked++; if(f->state == Unread) load(f); --- 265,268 ---- *************** *** 447,454 **** c = 0; i = 0; ! rp = malloc((snarfbuf->nrunes)*sizeof(Rune)); if(rp){ ! Bread(snarfbuf, rp, snarfbuf->nrunes, 0); ! c = Strtoc(tmprstr(rp, snarfbuf->nrunes)); free(rp); i = strlen(c); --- 447,459 ---- c = 0; i = 0; ! m = snarfbuf->nrunes; ! if(m > 32000) { /* tmprstr stores len in a short */ ! m = 32000; ! dprint("?warning: snarf buffer truncated\n"); ! } ! rp = malloc(m*sizeof(Rune)); if(rp){ ! Bread(snarfbuf, rp, m, 0); ! c = Strtoc(tmprstr(rp, m)); free(rp); i = strlen(c); *** sam.c.orig Sat Aug 3 02:08:50 1996 --- sam.c Sat Aug 3 02:09:24 1996 *************** *** 304,309 **** if(f==cmd) /* cmd gets done in main() */ continue; ! if(f->deleted) delete(f); if(f->mod==modnum && Fupdate(f, FALSE, downloaded)) anymod++; --- 304,311 ---- if(f==cmd) /* cmd gets done in main() */ continue; ! if(f->deleted) { delete(f); + continue; + } if(f->mod==modnum && Fupdate(f, FALSE, downloaded)) anymod++; *** xec.c.orig Sat Aug 3 02:08:50 1996 --- xec.c Sat Aug 3 02:09:24 1996 *************** *** 28,36 **** load(f); if(f==0 && (cp->addr==0 || cp->addr->type!='"') && ! !utfrune("bBnqUXY!{", cp->cmdc) && cp->cmdc!=('c'|0x100) && !(cp->cmdc=='D' && cp->ctext)) error(Enofile); i = lookup(cp->cmdc); ! if(cmdtab[i].defaddr != aNo){ if((ap=cp->addr)==0 && cp->cmdc!='\n'){ cp->addr = ap = newaddr(); --- 28,36 ---- load(f); if(f==0 && (cp->addr==0 || cp->addr->type!='"') && ! !utfrune("bBnqUXY!", cp->cmdc) && cp->cmdc!=('c'|0x100) && !(cp->cmdc=='D' && cp->ctext)) error(Enofile); i = lookup(cp->cmdc); ! if(i >= 0 && cmdtab[i].defaddr != aNo){ if((ap=cp->addr)==0 && cp->cmdc!='\n'){ cp->addr = ap = newaddr(); From sam-fans-owner Wed Aug 7 06:47:51 1996 Received: from emory.mathcs.emory.edu ([199.76.28.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24435>; Wed, 7 Aug 1996 06:45:42 -0400 Received: from skeeve.UUCP by emory.mathcs.emory.edu (5.65/Emory_mathcs.4.0.22) via UUCP id AA13341 ; Wed, 7 Aug 96 06:45:21 -0400 Return-Path: arnold@skeeve.atl.ga.us Received: by skeeve.atl.ga.us (/\==/\ Smail3.1.22.1 #22.1) id ; Wed, 7 Aug 96 06:31 EDT Message-Id: Date: Wed, 7 Aug 1996 06:31:00 -0400 From: arnold@skeeve.atl.ga.us (Arnold D. Robbins) To: sam-fans@hawkwind.utcs.toronto.edu In-Reply-To: <199608030640.CAA11455@nexus.yorku.ca> Subject: changes to sam X-Mailer: [XMailTool v3.1.2] > > there are several other bug patches for sam in > > the boddle package available by anonymous > > ftp at plan9.att.com in plan9/update/cmd/sam/829146783.rc. > > here is a version that patch understands, so somewhat easier > to extract and apply: Bobf has kindly packaged up a fresh distribution. It's at the usual place, ftp://netlib.bell-labs.com/research/dist/sam.shar.Z (or something close, that's from memory). I'm running it now. Arnold Robbins -- The Basement Computer | Laundry increases Internet: arnold@skeeve.ATL.GA.US | exponentially in the UUCP: emory!skeeve!arnold | number of children. Bitnet: Forget it. Get on a real network. | -- Miriam Robbins From sam-fans-owner Wed Aug 7 12:45:24 1996 Received: from orpheus.amdahl.com ([129.212.11.6]) by hawkwind.utcs.utoronto.ca with SMTP id <24436>; Wed, 7 Aug 1996 12:44:36 -0400 Received: from amdahl.uts.amdahl.com by orpheus.amdahl.com with smtp (Smail3.1.29.1 #3) id m0uoBhv-0001Z5C; Wed, 7 Aug 96 09:43 PDT Received: by amdahl.uts.amdahl.com (/\==/\ Smail #25.1) id ; Wed, 7 Aug 96 17:44 BST Message-Id: X-Mailer: exmh version 1.6.7 5/3/96 To: arnold@skeeve.atl.ga.us (Arnold D. Robbins) cc: sam-fans@hawkwind.utcs.utoronto.ca Subject: Re: changes to sam In-reply-to: Your message of "Wed, 07 Aug 1996 06:31:00 EDT." X-URL: http://www.ccc.amdahl.com/~azcb0/agc.html X-Face: #XtQ?n%i%L2\|+cxl=,udz?jb=ZdVifqKtWh\j%[t%SpPO/J;r0V7jB2Q4[YOM6-\GQJf1- \}3/^-jzZl.WT^3-W\?aB::;?9B:FE53y > Bobf has kindly packaged up a fresh distribution. It's at the > usual place, ftp://netlib.bell-labs.com/research/dist/sam.shar.Z > (or something close, that's from memory). At the risk of seeming retentive in the bottom department, the URL is ftp://netlib.bell-labs.com/netlib/research/sam.shar.Z Looks like there's also a fairly new awk bundle there too. Alistair From sam-fans-owner Wed Aug 7 13:14:12 1996 Received: from emory.mathcs.emory.edu ([199.76.28.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24437>; Wed, 7 Aug 1996 13:13:42 -0400 Received: from skeeve.UUCP by emory.mathcs.emory.edu (5.65/Emory_mathcs.4.0.22) via UUCP id AA21221 ; Wed, 7 Aug 96 13:13:13 -0400 Return-Path: arnold@skeeve.atl.ga.us Received: by skeeve.atl.ga.us (/\==/\ Smail3.1.22.1 #22.1) id ; Wed, 7 Aug 96 12:54 EDT Message-Id: Date: Wed, 7 Aug 1996 12:54:00 -0400 From: arnold@skeeve.atl.ga.us (Arnold D. Robbins) To: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: new sam dist > From: erik qunastrom > > >ftp://netlib.bell-labs.com/research/dist/sam.shar.Z > > it's not there. the newest sam i could find anywhere > was in /plan9/... /sam.unix. it was dated oct 1995. Ooops. It's /netlib/research/sam.shar.Z. Enjoy. Arnold From sam-fans-owner Wed Aug 7 23:41:57 1996 Received: from netra.soft.net ([164.164.128.17]) by hawkwind.utcs.utoronto.ca with SMTP id <24437>; Wed, 7 Aug 1996 23:40:01 -0400 Received: from samar.sas.soft.net (sas.sas.soft.net) by netra.soft.net (5.x/SMI-SVR4) id AA27475; Thu, 8 Aug 1996 09:06:11 +0500 Received: from sassun20.sas.soft.net (sassun20 [164.164.56.20]) by samar.sas.soft.net (8.7.5/8.7.5) with ESMTP id JAA13403 for ; Thu, 8 Aug 1996 09:09:34 +0500 Received: from sassun6.soft.net (sassun6 [164.164.56.6]) by sassun20.sas.soft.net (8.7.1/8.7.1) with SMTP id JAA19896 for ; Thu, 8 Aug 1996 09:11:22 +0500 (GMT+0500) Date: Thu, 8 Aug 1996 00:11:22 -0400 From: Kiran Pamnany Message-Id: <199608080411.JAA19896@sassun20.sas.soft.net> To: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: changes to sam | > Bobf has kindly packaged up a fresh distribution. It's at the | > usual place, ftp://netlib.bell-labs.com/research/dist/sam.shar.Z | > (or something close, that's from memory). | | At the risk of seeming retentive in the bottom department, the URL is | ftp://netlib.bell-labs.com/netlib/research/sam.shar.Z | Look what happened when I tried to get it: --- snip --- samar:~$ ftp netlib.bell-labs.com. Connected to netlib.bell-labs.com. 20 Plan 9 FTP server ready Name (netlib.bell-labs.com.:kp): anonymous 421 Service not available, remote server has closed connection Login failed. No control connection for command: No such file or directory ftp> quit samar:~$ --- snip --- This happened many times, yesterday and today. I'm trying to ftp from sas.sas.soft.net. What's wrong? --Kiran From sam-fans-owner Mon Aug 12 01:26:29 1996 Received: from emory.mathcs.emory.edu ([199.76.28.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24436>; Mon, 12 Aug 1996 01:24:40 -0400 Received: from skeeve.UUCP by emory.mathcs.emory.edu (5.65/Emory_mathcs.4.0.22) via UUCP id AA16112 ; Mon, 12 Aug 96 01:24:24 -0400 Return-Path: arnold@skeeve.atl.ga.us Received: by skeeve.atl.ga.us (/\==/\ Smail3.1.22.1 #22.1) id ; Sun, 11 Aug 96 22:53 EDT Message-Id: Date: Sun, 11 Aug 1996 22:53:00 -0400 From: arnold@skeeve.atl.ga.us (Arnold D. Robbins) Subject: Re: changes to sam In-Reply-To: To: sam-fans@hawkwind.utcs.toronto.edu X-Mailer: [XMailTool v3.1.2] > At the risk of seeming retentive in the bottom department, the URL is > ftp://netlib.bell-labs.com/netlib/research/sam.shar.Z > > Looks like there's also a fairly new awk bundle there too. Yes, the awk is bwk's latest. Has a number of minor but useful gawk extensions in it, many of which I motivated bwk to include. :-) Arnold Robbins -- The Basement Computer | Laundry increases Internet: arnold@skeeve.ATL.GA.US | exponentially in the UUCP: emory!skeeve!arnold | number of children. Bitnet: Forget it. Get on a real network. | -- Miriam Robbins From sam-fans-owner Mon Aug 19 19:55:40 1996 Received: from answerman.mindspring.com ([204.180.128.8]) by hawkwind.utcs.utoronto.ca with SMTP id <24445>; Mon, 19 Aug 1996 19:49:35 -0400 Received: from borg.mindspring.com (borg.mindspring.com [204.180.128.14]) by answerman.mindspring.com (8.6.12/8.6.12) with ESMTP id TAA24193 for ; Mon, 19 Aug 1996 19:49:20 -0400 Received: from infographix.com (mail.infographix.com [205.245.85.25]) by borg.mindspring.com (8.6.12/8.6.12) with SMTP id TAA14961 for ; Mon, 19 Aug 1996 19:49:16 -0400 Received: by infographix.com (5.x/SMI-SVR4) id AA20485; Mon, 19 Aug 1996 19:45:34 -0400 Date: Mon, 19 Aug 1996 19:45:34 -0400 From: arnold@infographix.com (Arnold D. Robbins) Message-Id: <9608192345.AA20485@infographix.com> To: sam-fans@hawkwind.utcs.toronto.edu Subject: 9term and $DISPLAY Should 9term be putting the current display (from -display) into the environment? I find it frustrating to start up a 9term from a remote machine to my local one (I have scripts and stuff from 9menu to do it) and have to set my DISPLAY each time so I can run sam or other things. Any reason not to? It seems that xterm does, for whatever that's worth. Arnold From sam-fans-owner Tue Aug 20 00:08:03 1996 Received: from galapagos.cse.psu.edu ([130.203.2.12]) by hawkwind.utcs.utoronto.ca with SMTP id <24447>; Tue, 20 Aug 1996 00:07:20 -0400 Received: from localhost by galapagos.cse.psu.edu with SMTP id <12690>; Tue, 20 Aug 1996 00:06:55 -0400 To: arnold@infographix.com (Arnold D. Robbins) cc: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: 9term and $DISPLAY In-reply-to: Your message of "Mon, 19 Aug 1996 19:45:34 EDT." <9608192345.AA20485@infographix.com> Date: Tue, 20 Aug 1996 00:06:43 -0400 From: Scott Schwartz Message-Id: <96Aug20.000655edt.12690@galapagos.cse.psu.edu> arnold@infographix.com (Arnold D. Robbins) writes: | Should 9term be putting the current display (from -display) into | the environment? I find it frustrating to start up a 9term from a remote | machine to my local one (I have scripts and stuff from 9menu to do it) | and have to set my DISPLAY each time so I can run sam or other things. | | Any reason not to? It seems that xterm does, for whatever that's worth. It definately should. I've been running with this (in display.c) for a long time now: setenv("DISPLAY", XDisplayString(_dpy), 1); I thought I sent out patches for that, but maybe I forgot. From sam-fans-owner Sun Aug 25 15:31:30 1996 Received: from itchy.mindspring.com ([204.180.128.6]) by hawkwind.utcs.utoronto.ca with SMTP id <24454>; Sun, 25 Aug 1996 15:29:00 -0400 Received: from borg.mindspring.com (borg.mindspring.com [204.180.128.14]) by itchy.mindspring.com (8.7.5/8.7.3) with ESMTP id PAA10488 for ; Sun, 25 Aug 1996 15:28:50 -0400 (EDT) Received: from infographix.com (mail.infographix.com [205.245.85.25]) by borg.mindspring.com (8.6.12/8.6.12) with SMTP id PAA16714 for ; Sun, 25 Aug 1996 15:28:48 -0400 Received: by infographix.com (5.x/SMI-SVR4) id AA25678; Sun, 25 Aug 1996 15:24:50 -0400 Date: Sun, 25 Aug 1996 15:24:50 -0400 From: arnold@infographix.com (Arnold D. Robbins) Message-Id: <9608251924.AA25678@infographix.com> To: sam-fans@hawkwind.utcs.toronto.edu Subject: 9term & solaris, interupt char Is it just me, or does the latest 9term (1.6.6) not do interupt characters on solaris? I would almost swear that it used to work just fine, then I switched recently to the latest version. I'm pretty sure it works ok at home under SunOS 4.1.3... Thanks, Arnold From sam-fans-owner Tue Oct 29 15:05:53 1996 Received: from itchy.mindspring.com ([204.180.128.6]) by hawkwind.utcs.utoronto.ca with SMTP id <24520>; Tue, 29 Oct 1996 14:58:04 -0500 Received: from colorstar.com. (borg.mindspring.com [204.180.128.14]) by itchy.mindspring.com (8.7.5/8.7.3) with SMTP id OAA04738 for ; Tue, 29 Oct 1996 14:57:22 -0500 (EST) Received: by colorstar.com. (5.x/SMI-SVR4) id AA18029; Tue, 29 Oct 1996 14:52:12 -0500 Date: Tue, 29 Oct 1996 14:52:12 -0500 From: arnold@colorstar.com (Arnold D. Robbins) Illegal-Object: Syntax error in Message-Id: value found on hawkwind.utcs.utoronto.ca: Message-Id: <9610291952.AA18029@colorstar.com.> ^-illegal subdomain in domain To: sam-fans@hawkwind.utcs.toronto.edu Subject: 9term on linux? I have sam compiled and running on SparcLinux. I'd like to get 9term going. Does anyone have any patches for 9term? Linux 2.0.22, Redhat 4.0. Thanks, Arnold Robbins Star Imaging L.L.C. Phone: +1-404-523-4944 250 Williams Street, Suite 1120, Atlanta, GA 30303 Fax: +1-404-523-4882 E-mail: arnold.robbins@colorstar.com "Oh! Look at all those zeros!" --- Chana Robbins, at age 3.5 From sam-fans-owner Tue Nov 26 14:42:27 1996 Received: from nbivms.nbi.dk ([130.225.212.16]) by hawkwind.utcs.utoronto.ca with SMTP id <24588>; Tue, 26 Nov 1996 14:37:21 -0500 Received: from felix.nbi.dk by nbivms.nbi.dk (PMDF V5.0-7 #14490) id <01ICAUH0FWFK8WZUJX@nbivms.nbi.dk> for sam-fans@hawkwind.utcs.toronto.edu; Tue, 26 Nov 1996 12:00:44 +0100 Received: by felix.nbi.dk (NX5.67d/NX3.0S) id AA00659; Tue, 26 Nov 1996 11:58:47 +0100 Received: by NeXT.Mailer (1.100) Received: by NeXT Mailer (1.100) Date: Tue, 26 Nov 1996 05:58:47 -0500 From: Ronnie Mainieri Subject: Sam on Alpha To: sam-fans@hawkwind.utcs.toronto.edu Reply-to: ronnie@nbi.dk Message-id: <9611261058.AA00659@felix.nbi.dk> Content-transfer-encoding: 7BIT Dear Sam Fans, I need help compiling sam on a Alpha machine. I am a new user to a DEC Alpha machine runing Digital UNIX V3.2D-1 and could use the Makefiles and any diffs. When I compile sam I run into a malloc(p, n) error. I changed the malloc to malloc(n) and compiled it. It seems to run OK until at one point I get a sam: panic: Bread samterm: host mesg: count 28514 65x 98x 111x rt process (core dumped) < stuff deleted> samterm:panic: count>DATASIZE: Error 0 The error occurs while a samterm runing on another machine is talking to the sam on the Alpha. Any suggestions appreciated. Ronnie From sam-fans-owner Fri Jan 3 14:49:47 1997 Received: from mule0.mindspring.com ([204.180.128.166]) by hawkwind.utcs.utoronto.ca with SMTP id <24607>; Fri, 3 Jan 1997 14:47:23 -0500 Received: from colorstar.com. (mail.infographix.com [205.245.85.25]) by mule0.mindspring.com (8.8.4/8.8.4) with SMTP id OAA24524 for ; Fri, 3 Jan 1997 14:47:18 -0500 Received: by colorstar.com. (5.x/SMI-SVR4) id AA19250; Fri, 3 Jan 1997 14:40:40 -0500 Date: Fri, 3 Jan 1997 14:40:40 -0500 From: arnold@colorstar.com (Arnold D. Robbins) Illegal-Object: Syntax error in Message-Id: value found on hawkwind.utcs.utoronto.ca: Message-Id: <9701031940.AA19250@colorstar.com.> ^-illegal subdomain in domain To: sam-fans@hawkwind.utcs.utoronto.ca Subject: sam for WinNT? I know this has been asked before, but I haven't paid attention. I expect to soon be working on WindozeNT, and would prefer to not have to leave sam behind. I would hope that a libg for NT would be enough to get the rest of sam going, but don't know. Does anyone know of a port of sam to NT? [ I probably won't reply for a while; heading to USENIX next week. ] Thanks, Arnold Robbins Star Imaging L.L.C. Phone: +1-404-523-4944 250 Williams Street, Suite 1120, Atlanta, GA 30303 Fax: +1-404-523-4882 E-mail: arnold.robbins@colorstar.com "Oh! Look at all those zeros!" --- Chana Robbins, at age 3.5 From sam-fans-owner Fri Jan 3 16:04:17 1997 Received: from ux2.cso.uiuc.edu ([128.174.5.3]) by hawkwind.utcs.utoronto.ca with SMTP id <24607>; Fri, 3 Jan 1997 16:03:43 -0500 Received: from 128.174.23.216 (canberra-10.slip.uiuc.edu) by ux2.cso.uiuc.edu with SMTP id AA11581 (5.67a/IDA-1.5 for ); Fri, 3 Jan 1997 15:03:30 -0600 Message-Id: <32CD749C.26F1@uiuc.edu> Date: Fri, 3 Jan 1997 16:05:42 -0500 From: Ed Kubaitis Reply-To: ejk@uiuc.edu Organization: University of Illinois - CCSO X-Mailer: Mozilla 3.01 (Macintosh; I; PPC) Mime-Version: 1.0 To: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: sam for WinNT? References: <199701031949.AA87304@ux2.cso.uiuc.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Arnold D. Robbins wrote: > > I know this has been asked before, but I haven't paid attention. I expect > to soon be working on WindozeNT, and would prefer to not have to leave > sam behind. > > I would hope that a libg for NT would be enough to get the rest of sam > going, but don't know. Does anyone know of a port of sam to NT? Boy, that would be great if someone did a port. But a couple weeks ago when an NT 4.0 box landed on my desk (for a port of some security related Perl CGI stuff), I figured 'a libg for NT' was one of those things much easier said than done, especially on a platform where a C compiler is the exception rather than the rule, and didn't bother to ask:-) FWIW, I'm told that a $27 shareware editor called TextPad is probably what I want. See http://www.textpad.com/ -------------------------- Ed Kubaitis - ejk@uiuc.edu University of Illinois - Urbana - CCSO From sam-fans-owner Fri Jan 10 16:21:25 1997 Received: from bungo.wago.de ([193.101.191.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24084>; Fri, 10 Jan 1997 16:12:56 -0500 Received: by bungo.wago.de (5.0/GEN-1.2.0) via EUnet for hawkwind.utcs.toronto.edu id AA02897; Fri, 10 Jan 1997 13:11:16 --100 >Received: from cc-smtp1.wago.de by donau.wago.de (SMI-8.6/SMI-SVR4) id MAA02401; Fri, 10 Jan 1997 12:50:10 +0100 Received: from cc-smtp1.wago.de by donau.wago.de (SMI-8.6/SMI-SVR4) id MAA02401; Fri, 10 Jan 1997 12:50:10 +0100 Received: from cc:Mail by cc-smtp1.wago.de id AA852897003; Fri, 10 Jan 97 12:50:03 CET Date: Fri, 10 Jan 1997 06:50:03 -0500 From: "Simon Turner" Message-Id: <9700108528.AA852897003@cc-smtp1.wago.de> To: sam-fans@hawkwind.utcs.toronto.edu, arnold@colorstar.com (Arnold D. Robbins) Subject: Re: sam for WinNT? Content-Type: text Content-Length: 1328 Hello, I have ported sam to W95 and I use this editor most of the time. This port may well be ok for WinNT. My port of sam has left the source files a little untidy. At some point I intend to revisit the source code, make it presentable and then make it available. How soon do you need sam? For other sam-fans: Is anybody else interested in a Win95/WinNT version? I would appreciate help in testing the ported editor as I've become blind to many of it's failings. Please let me know if you are interested. simon ______________________________ Reply Separator _________________________________ Subject: sam for WinNT? Author: arnold@colorstar.com (Arnold D. Robbins) at WG-ENI-SMTP Date: 03/01/97 21:15 I know this has been asked before, but I haven't paid attention. I expect to soon be working on WindozeNT, and would prefer to not have to leave sam behind. I would hope that a libg for NT would be enough to get the rest of sam going, but don't know. Does anyone know of a port of sam to NT? [ I probably won't reply for a while; heading to USENIX next week. ] Thanks, Arnold Robbins Star Imaging L.L.C. Phone: +1-404-523-4944 250 Williams Street, Suite 1120, Atlanta, GA 30303 Fax: +1-404-523-4882 E-mail: arnold.robbins@colorstar.com "Oh! Look at all those zeros!" --- Chana Robbins, at age 3.5 From sam-fans-owner Fri Jan 10 16:57:07 1997 Received: from plan9.cs.bell-labs.com ([204.178.16.2]) by hawkwind.utcs.utoronto.ca with SMTP id <23978>; Fri, 10 Jan 1997 16:56:11 -0500 From: bobf@plan9.bell-labs.com To: sam-fans@hawkwind.utcs.toronto.edu Date: Fri, 10 Jan 1997 16:41:40 -0500 Subject: Re: sam for WinNT? Message-Id: <97Jan10.165611est.23978@hawkwind.utcs.utoronto.ca> one of the guys in our group, sean quinlan, has a version of sam that works on NT. he started from the plan 9 version of sam, which is based on libg and not libXg, and hacked the bitblt and font handling in at a fairly low level. he plans to make it available in binary form, which should be ok for NT, when he gets the time to package it up. i have no idea when that will be, but sean or i will post an announcement to this list when it is available. From sam-fans-owner Mon Jan 13 03:04:06 1997 Received: from symbionics.co.uk ([158.43.6.17]) by hawkwind.utcs.utoronto.ca with SMTP id <23978>; Mon, 13 Jan 1997 03:02:57 -0500 Received: from symnt3.symbionics.co.uk by symbionics.co.uk (4.1/SMI-4.1) id AA16018; Mon, 13 Jan 97 08:02:28 GMT Received: by symnt3.symbionics.co.uk with SMTP (Microsoft Exchange Server Internet Mail Connector Version 4.0.994.63) id <01BC0128.36068D90@symnt3.symbionics.co.uk>; Mon, 13 Jan 1997 08:03:07 -0000 Message-Id: From: Nigel Roles To: "'sam-fans@hawkwind.utcs.toronto.edu'" , "'simon.turner@wago.de'" Subject: RE: sam for WinNT? Date: Mon, 13 Jan 1997 03:03:05 -0500 X-Mailer: Microsoft Exchange Server Internet Mail Connector Version 4.0.994.63 Encoding: 8 TEXT I can think of two people here who would willingly pawn their mother-in-laws for sam on W95. Can the source be available, as it needs hacks to meet our company coding standard? Nigel Roles, Symbionics Ltd.. > From sam-fans-owner Tue Jan 14 15:00:06 1997 Received: from plan9.cs.bell-labs.com ([204.178.16.2]) by hawkwind.utcs.utoronto.ca with SMTP id <23978>; Tue, 14 Jan 1997 14:56:32 -0500 From: bobf@plan9.bell-labs.com To: sam-fans@hawkwind.utcs.toronto.edu Date: Tue, 14 Jan 1997 14:52:26 -0500 Message-Id: <97Jan14.145632est.23978@hawkwind.utcs.utoronto.ca> i asked sean and he said that the reason he wasn't considering releasing the source is that he doesn't have the time to properly package it. ------ forwarded message follows ------ >From hawkwind.utcs.toronto.edu!sam-fans-owner Mon Jan 13 03:06:48 EST 1997 Received: from hawkwind.utcs.utoronto.ca by plan9; Mon Jan 13 03:06:48 EST 1997 Received: from symbionics.co.uk ([158.43.6.17]) by hawkwind.utcs.utoronto.ca with SMTP id <23978>; Mon, 13 Jan 1997 03:02:57 -0500 Received: from symnt3.symbionics.co.uk by symbionics.co.uk (4.1/SMI-4.1) id AA16018; Mon, 13 Jan 97 08:02:28 GMT Received: by symnt3.symbionics.co.uk with SMTP (Microsoft Exchange Server Internet Mail Connector Version 4.0.994.63) id <01BC0128.36068D90@symnt3.symbionics.co.uk>; Mon, 13 Jan 1997 08:03:07 -0000 Message-Id: From: Nigel Roles To: "'sam-fans@hawkwind.utcs.toronto.edu'" , "'simon.turner@wago.de'" Subject: RE: sam for WinNT? Date: Mon, 13 Jan 1997 03:03:05 -0500 X-Mailer: Microsoft Exchange Server Internet Mail Connector Version 4.0.994.63 Encoding: 8 TEXT I can think of two people here who would willingly pawn their mother-in-laws for sam on W95. Can the source be available, as it needs hacks to meet our company coding standard? Nigel Roles, Symbionics Ltd.. > From sam-fans-owner Wed Feb 12 15:08:43 1997 Received: from plan9.cs.bell-labs.com ([204.178.16.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24614>; Wed, 12 Feb 1997 15:05:01 -0500 From: seanq@plan9.bell-labs.com To: sam-fans@hawkwind.utcs.toronto.edu Date: Wed, 12 Feb 1997 14:53:14 -0500 Message-Id: <97Feb12.150501est.24614@hawkwind.utcs.utoronto.ca> By request, there is now a Windows 95/NT version of Sam. This version of sam is currently distributed in binary form only. The packaged can by obtained from http://netlib.bell-labs.com/netlib/research/index by selecting the file sam-win.zip Comments and bug reports can be sent to seanq@research.bell-labs.com From sam-fans-owner Mon Feb 17 11:32:20 1997 Received: from oberon.info-com.com ([194.72.127.140]) by hawkwind.utcs.utoronto.ca with SMTP id <24620>; Mon, 17 Feb 1997 11:28:59 -0500 Received: from goose.info-com.com (localhost [127.0.0.1]) by oberon.info-com.com (8.7.5/8.7.2) with SMTP id QAA15328 for ; Mon, 17 Feb 1997 16:26:38 GMT Message-Id: <3.0.32.19970217162635.006bb15c@oberon.info-com.com> X-Sender: pete@oberon.info-com.com X-Mailer: Windows Eudora Pro Version 3.0 (32) Date: Mon, 17 Feb 1997 11:26:39 -0500 To: sam-fans@hawkwind.utcs.toronto.edu From: Pete Fenelon Subject: sam for 95/nt Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MimeMultipartBoundary" --MimeMultipartBoundary Content-Type: text/plain; charset="us-ascii" In summary -- a lovely piece of work. Just what we've all been waiting for. One minor caveat, though -- under 95 (don't know about NT) it adopts the Unix-y (and indeed right-thinking) LF as newline.... which means it's not ideal for editing Windows text files which use CR/LF -- (A) it shows the CR half of CR/LF as a CR character and (B) it makes it a tad tricky to use files produced with Sam with utilities that aren't wise to the rest of the world's conventions on newline... I suppose this is the *logically* correct behaviour, but to push Sam as an editor which the Windows-user community will use, perhaps it should do the wrong but *visually* sensible thing :) Thoughts -- would it be difficult to bodge sam to treat CR/LF as one rune under Windows? pete -- Pete Fenelon, Infocom UK Ltd. pete.fenelon@info-com.com --MimeMultipartBoundary-- From sam-fans-owner Mon Feb 17 11:35:59 1997 Received: from symbionics.co.uk ([194.32.100.60]) by hawkwind.utcs.utoronto.ca with SMTP id <24626>; Mon, 17 Feb 1997 11:35:41 -0500 Received: from symnt3.symbionics.co.uk by symbionics.co.uk (4.1/SMI-4.1) id AA03917; Mon, 17 Feb 97 16:35:18 GMT Received: by symnt3.symbionics.co.uk with SMTP (Microsoft Exchange Server Internet Mail Connector Version 4.0.994.63) id <01BC1CF0.8D1BF640@symnt3.symbionics.co.uk>; Mon, 17 Feb 1997 16:35:14 -0000 Message-Id: From: Nigel Roles To: "'sam-fans@hawkwind.utcs.toronto.edu'" Subject: RE: sam for 95/nt Date: Mon, 17 Feb 1997 11:35:13 -0500 X-Mailer: Microsoft Exchange Server Internet Mail Connector Version 4.0.994.63 Encoding: 33 TEXT I modified the UNIX version to do CRLF translation, N space indentation, and tab to space conversion to observe our company coding standard. Not difficult. --------------- Nigel Roles, Symbionics Ltd.. >---------- >From: Pete Fenelon[SMTP:pete.fenelon@info-com.com] >Sent: 17 February 1997 16:26 >To: sam-fans@hawkwind.utcs.toronto.edu >Subject: sam for 95/nt > >In summary -- a lovely piece of work. Just what we've all been waiting for. > >One minor caveat, though -- under 95 (don't know about NT) it adopts the >Unix-y (and indeed right-thinking) LF as newline.... which means it's not >ideal for editing Windows text files which use CR/LF -- (A) it shows the CR >half of CR/LF as a CR character and (B) it makes it a tad tricky to use >files produced with Sam with utilities that aren't wise to the rest of the >world's conventions on newline... > >I suppose this is the *logically* correct behaviour, but to push Sam as an >editor which the Windows-user community will use, perhaps it should do the >wrong but *visually* sensible thing :) > >Thoughts -- would it be difficult to bodge sam to treat CR/LF as one rune >under Windows? > >pete >-- >Pete Fenelon, Infocom UK Ltd. pete.fenelon@info-com.com > From sam-fans-owner Mon Feb 17 11:57:44 1997 Received: from p9att.att.com ([135.205.33.187]) by hawkwind.utcs.utoronto.ca with SMTP id <24620>; Mon, 17 Feb 1997 11:55:07 -0500 From: rsc@research.att.com Date: Mon, 17 Feb 1997 11:54:19 -0500 To: pete.fenelon@info-com.com, sam-fans@hawkwind.utcs.toronto.edu Subject: re: sam for 95/nt Message-Id: <97Feb17.115507est.24620@hawkwind.utcs.utoronto.ca> One minor caveat, though -- under 95 (don't know about NT) it adopts the Unix-y (and indeed right-thinking) LF as newline.... which means it's not ideal for editing Windows text files which use CR/LF -- (A) it shows the CR half of CR/LF as a CR character and (B) it makes it a tad tricky to use files produced with Sam with utilities that aren't wise to the rest of the world's conventions on newline... Making a file with the commands ,s///g ,s/$//g is helpful, the sam equivalent of /acme/edit/guide. (I haven't figured out how to type a CR, and just copy them from other text files). Another way to add CR's is to open and close the file in MS-DOS Edit. One thing that would be very nice is if Shift-Right Button brought up the middle button menu (cut-paste-etc.), as it does in Plan 9. Russ From sam-fans-owner Mon Feb 17 12:03:57 1997 Received: from kissimmee.infomkt.ibm.com ([204.146.129.20]) by hawkwind.utcs.utoronto.ca with SMTP id <24627>; Mon, 17 Feb 1997 12:03:41 -0500 Received: from dingler.dev.infomkt.ibm.com (dingler.dev.infomkt.ibm.com [204.146.132.31]) by kissimmee.infomkt.ibm.com (8.6.10/8.6.10) with ESMTP id LAA25238 for ; Mon, 17 Feb 1997 11:58:11 -0500 Received: (from quanstro@localhost) by dingler.dev.infomkt.ibm.com (8.7.5/8.7.3) id MAA106172 for sam-fans@hawkwind.utcs.toronto.edu; Mon, 17 Feb 1997 12:01:05 -0500 Date: Mon, 17 Feb 1997 12:01:05 -0500 Message-Id: <199702171701.MAA106172@dingler.dev.infomkt.ibm.com> To: sam-fans@hawkwind.utcs.toronto.edu From: erik quanstrom Subject: re: sam for 95/nt >(I haven't figured out how to type a CR, and just copy them from other text files). X000d where is usually the key. i don't know if this works on the win{nt,95} version From sam-fans-owner Mon Feb 17 12:19:07 1997 Received: from irwell.zetnet.co.uk ([194.72.245.189]) by hawkwind.utcs.utoronto.ca with SMTP id <24628>; Mon, 17 Feb 1997 12:18:07 -0500 Received: from goose.info-com.com (148.info-com.com [194.72.127.148]) by irwell.zetnet.co.uk (8.7.6/8.7.3) with SMTP id RAA13021; Mon, 17 Feb 1997 17:17:28 GMT Message-Id: <3.0.32.19970217171441.006d4e98@mail.zetnet.co.uk> X-Sender: pete.fenelon@mail.zetnet.co.uk X-Mailer: Windows Eudora Pro Version 3.0 (32) Date: Mon, 17 Feb 1997 12:15:13 -0500 To: quanstro@Infomkt.ibm.com From: Pete Fenelon Subject: re: sam for 95/nt Cc: sam-fans@hawkwind.utcs.toronto.edu Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" At 12:01 17/02/97 -0500, you wrote: >>(I haven't figured out how to type a CR, and just copy them from other text files). > > X000d > >where is usually the key. i don't know if this works on the win{nt,95} >version ALT-nnn (using the numeric keypad keys) is the way of entering characters by code under Windows. ALT-013 duplicates the effects of the RETURN key, however, and for some odd reason ALT-010 inserts the C/R character -- not quite what I'd expect! Strange but true :) pete -- Pete Fenelon, 39 Broadway, Fulford, York, YO1 4JP Tel: +44 1904 670334 pete.fenelon@zetnet.co.uk "I could tell you, but only at consultancy rates". From sam-fans-owner Mon Feb 17 23:44:12 1997 Received: from star.vec.net ([208.133.32.5]) by hawkwind.utcs.utoronto.ca with SMTP id <24629>; Mon, 17 Feb 1997 23:41:42 -0500 Received: from skeeve by vec.net (MX V4.2 VAX) with UUCP; Mon, 17 Feb 1997 23:40:00 EST Received: by skeeve.atl.ga.us (/\==/\ Smail3.1.22.1 #22.1) id ; Mon, 17 Feb 97 23:02 EST Message-ID: Date: Mon, 17 Feb 1997 23:02:00 -0500 From: To: sam-fans@hawkwind.utcs.toronto.edu Subject: re: sam for 95/nt X-Mailer: [XMailTool v3.1.2] > (I haven't figured out how to type a CR, and just copy them from other > text files). Control-m works just fine for me under Unix. Haven't tried the NT version yet. Arnold Robbins -- The Basement Computer | Laundry increases Internet: arnold@gnu.ai.mit.edu | exponentially in the UUCP: dragon!skeeve!arnold | number of children. Bitnet: Forget it. Get on a real network. | -- Miriam Robbins From sam-fans-owner Fri Feb 21 09:34:02 1997 Received: from orpheus.amdahl.com ([129.212.11.6]) by hawkwind.utcs.utoronto.ca with SMTP id <24623>; Fri, 21 Feb 1997 09:31:22 -0500 Received: from juts.ccc.amdahl.com by orpheus.amdahl.com with smtp (Smail3.1.29.1 #3) id m0vxw0H-00011dC; Fri, 21 Feb 97 06:31 PST Received: by juts.ccc.amdahl.com (/\../\ Smail3.1.14.4 #14.6) id ; Fri, 21 Feb 97 06:31 PST Received: by juno.ccc.amdahl.com (/\==/\ Smail #25.1) id ; Fri, 21 Feb 97 06:31 PST Message-Id: X-Mailer: exmh version 1.6.9 8/22/96 To: sam-fans@hawkwind.utcs.utoronto.ca Subject: ssam-1.6 and libutf-2.7 X-Face: #XtQ?n%i%L2\|+cxl=,udz?jb=ZdVifqKtWh\j%[t%SpPO/J;r0V7jB2Q4[YOM6-\GQJf1- \}3/^-jzZl.WT^3-W\?aB::;?9B:FE53y [This has already been posted to the wily list. At the risk of offending those people who will thus see this message twice, I thought some folks here might be interested. - agc] I've made available new versions of libutf, some utf routines including UTF-aware regular expressions, and ssam, a stream editor using the sam command set. Please note the namechange, and the new URLs: http://www.westley.demon.co.uk/ssam-1.6.tar.gz http://www.westley.demon.co.uk/utf-2.7.tar.gz A complete list of changes follows at the end of this mail, but the changes to ssam are mainly cosmetic and bug fixes, whilst I have started implementing language-specific matching and ordering, using a function called utflangcmp(). Many thanks to Bengt Kleberg (Bengt.Kleberg@uab.ericsson.se) for the provision of Swedish, Finnish, Danish and Norwegian alphabets. As usual, the correct way to install the software is: % tar xvzf utf-2.7.tar.gz % cd utf-2.7 % ./configure % make tst % make install % cd .. % tar xvzf ssam-1.6.tar.gz % cd ssam-1.6 % ./configure % make tst % make install This release has been tested on UTS 4.3.2 (S390 mainframe), Solaris 2.4 (SS5), and NetBSD/i386 1.2C. Take care, Alistair ssam-1.6 changes + tarted up explanation code, and added a test + moved stuff around in ssam() + moved ure match arrays from the program stack to within ssam_t. We now allocate space for the match offsets when we know how many we'll need. This removes the hardcoded limit on subexpressions. + implemented a saner way of introducing default `p' command. We now do this when parsing, rather than on execution. Removes some cruft from execution functions. + ran gcc -Wall again, and cleaned up miscellaneous warnings, changing configure.in etc on the way. + added code to free match array, if requested via flags. Modify existing free checks, so that de-allocation takes place if storage was allocated, not if it was used. + re-code 'x' and 'y' commands to take advantage of improved ure ^ matching code. 'g', 'v' and 's' commands are unaffected. This is actually a significant speedup, especially when searching for anchored matches in large strings/files. + split writing files part of ssam() out into ssamcommit(), and call it accordingly. This gives us more control over file writing. + changed Makefile to track change to the name of the library + deleted "urelang.h", which doesn't exist anymore, and added "utf.h" utf-2.7 changes + fixed a bug in ^ matching - anchored searches were only tried once, which didn't take into account the case where the string to be matched included newline characters. + re-arrange tests so that error tests are done at end. Add a test for anchored beginning of line matching + added utflangcmp function, with a couple of supporting functions to get ordinal number of bits. Added findword test program, and one extra test case. + Swedish and Finnish alphabets from Bengt.Kleberg@uab.ericsson.se (Bengt Kleberg) + changed langcoll.utf file so that letters in brackets [] in an alphabet have the same collation ordering (e.g. v and w in Swedish) Modified all utf functions that use utfrune on the alphabets accordingly + bug fix for definition of ETCDIR - not incorporated in previous changes from Alan Watson (my mistake) + renamed library from libure to libutf (at suggestion of Alan Watson). Changed Makefile to make this possible. + fixed bug where v and w in Swedish weren't comparing as the same letter. + Norwegian and Danish alphabets from Bengt.Kleberg@uab.ericsson.se (Bengt Kleberg) + fixed a bug whereby language names were occasionally misconstrued (the old "English not found, using English" problem) From sam-fans-owner Sun Feb 23 19:17:09 1997 Received: from oldp.nmsu.edu ([128.123.26.31]) by hawkwind.utcs.utoronto.ca with SMTP id <24623>; Sun, 23 Feb 1997 19:15:09 -0500 Received: by oldp.nmsu.edu; id AA28769; Sun, 23 Feb 1997 17:15:03 -0700 Date: Sun, 23 Feb 1997 19:15:03 -0500 From: Alan Watson Message-Id: <9702240015.AA28769@oldp.nmsu.edu> To: sam-fans@hawkwind.utcs.toronto.edu, wilyfans@jli.com Subject: utftools-1.4 Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit I've written UTF-aware versions of wc, fmt, expand, and unexpand for UNIX. You can grab them from: http://www.pobox.com/~amw/software/utftools-1.5.tar.gz You will need Alistair Crooks' libutf, which you can get from: http://www.westley.demon.co.uk/utf-2.7.tar.gz Many thanks to Alistair for pointing out numerous errors and typos in the v1.1 man pages and an incompatibility between the behaviour of my wc and traditional UNIX wcs. Alan Watson From sam-fans-owner Mon Feb 24 11:37:27 1997 Received: from orpheus.amdahl.com ([129.212.11.6]) by hawkwind.utcs.utoronto.ca with SMTP id <24623>; Mon, 24 Feb 1997 11:29:47 -0500 Received: from juts.ccc.amdahl.com by orpheus.amdahl.com with smtp (Smail3.1.29.1 #3) id m0vz3HY-00018SC; Mon, 24 Feb 97 08:29 PST Received: by juts.ccc.amdahl.com (/\../\ Smail3.1.14.4 #14.6) id ; Mon, 24 Feb 97 08:29 PST Received: by juno.ccc.amdahl.com (/\==/\ Smail #25.1) id ; Mon, 24 Feb 97 08:29 PST Message-Id: X-Mailer: exmh version 1.6.9 8/22/96 To: wilyfans@jli.com cc: sam-fans@hawkwind.utcs.utoronto.ca Subject: libutf-2.8 and ssam-1.7 X-Face: #XtQ?n%i%L2\|+cxl=,udz?jb=ZdVifqKtWh\j%[t%SpPO/J;r0V7jB2Q4[YOM6-\GQJf1- \}3/^-jzZl.WT^3-W\?aB::;?9B:FE53y It was pointed out to me that my implementation of chartorune() was braindead, and I can only agree, and I've since also discovered that my implementation of fullrune() was lacking, to such a degree that it was just plain wrong. Apologies, as this hinders Alan Watson's wc from working correctly. I've also cleaned up a bug in utf_snprintf, which was also downright silly. The new versions have been uploaded to: http://www.westley.demon.co.uk/libutf-2.8.tar.gz http://www.westley.demon.co.uk/ssam-1.7.tar.gz although they're only visible from "close of business" (my ISP's words, not mine) today, 24th February, 17:00 GMT. As usual, the correct way to install the software is as follows: % tar xvzf libutf-2.8.tar.gz % cd libutf-2.8 % ./configure % make tst % make install % cd .. % tar xvzf ssam-1.7.tar.gz % cd ssam-1.7 % ./configure % make tst % make install A list of the changes appears at the end of this mail. This has been tested on UTS 4.3.2 (S390 mainframe), Solaris 2.4 (SS5), and NetBSD/i386 1.2C. Sorry about the bugs, Alistair ssam-1.7 changes + corrected spelling of Byron Rakitzis' name in ssam.1 manual page libutf-2.8 changes + added error checking to chartorune, at suggestion of Rob Pike (rob@plan9.bell-labs.com) - now recognise `error runes', and return the Runeerror character, with unity length. The previous code ignored error runes, and blindly gave them a length of 3 bytes, probably pushing the following runes in the string `out of sync'. Woops. + added a test for error runes + check for null expressions, which can cause gurep to coredump when dereferenced on some platforms e.g. Solaris. + added a test for null expressions given as args to gurep + corrected my implementation of fullrune(), which was just plain wrong. Shown up by testing Alan Watson's UTF-aware wc. + fixed a bug whereby I didn't zero-byte-terminate the buffer in utf_snprintf - this caused occasional "language not found" errors. From sam-fans-owner Tue Feb 25 13:48:06 1997 Received: from oldp.nmsu.edu ([128.123.26.31]) by hawkwind.utcs.utoronto.ca with SMTP id <24623>; Tue, 25 Feb 1997 13:44:47 -0500 Received: by oldp.nmsu.edu; id AA25458; Tue, 25 Feb 1997 11:44:32 -0700 Date: Tue, 25 Feb 1997 13:44:32 -0500 From: Alan Watson Message-Id: <9702251844.AA25458@oldp.nmsu.edu> To: sam-fans@hawkwind.utcs.toronto.edu, wilyfans@jli.com Subject: utftools-1.6 Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit New versions of my UTF-aware wc, fmt, expand, and unexpand for UNIX are available from: http://www.pobox.com/~Alan.Watson/software/utftools-1.6.tar.gz You will need Alistair Crooks libutf library, which can be obtained from: http://www.westley.demon.co.uk/software.html The major change has been to add basic functionality checks (invoked by make check). Hopefully, that should guard against a repeat performance of the problems with v1.5, for which I apologise. Alan Watson From sam-fans-owner Mon May 5 15:06:55 1997 Received: from antaries.vec.net ([208.133.32.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24655>; Mon, 5 May 1997 14:52:35 -0400 Received: from skeeve by vec.net (MX V4.2 VAX) with UUCP; Mon, 05 May 1997 06:41:39 EST Received: by skeeve.atl.ga.us (/\==/\ Smail3.1.22.1 #22.1) id ; Mon, 5 May 97 06:16 EDT Message-ID: Date: Mon, 5 May 1997 06:16:00 -0400 To: sam-fans@hawkwind.utcs.utoronto.ca Subject: new 9menu available From: arnold@gnu.ai.mit.edu X-Mailer: [XMailTool v3.1.2] I have updated my 9menu program with -fg and -bg options (contributed code). ftp://ftp.mathcs.emory.edu/pub/arnold/9menu-1.5.shar.gz is the code. Credits contained therein. Enjoy. -- Arnold Robbins Internet: arnold@gnu.ai.mit.edu IMPORTANT: The address arnold@skeeve.atl.ga.us will be GOING AWAY soon. Please make a note to change any references to me to the above GNU address. From sam-fans-owner Mon May 26 20:09:20 1997 Received: from mumrik.nada.kth.se ([130.237.226.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24651>; Mon, 26 May 1997 19:30:32 -0400 Received: (from d92-dne@localhost) by mumrik.nada.kth.se (8.8.5/8.6.9) id AAA16026; Tue, 27 May 1997 00:20:27 +0200 (MET DST) To: sam-fans@hawkwind.utcs.toronto.edu Subject: where is win32 sam? From: Daniel Neri Date: Mon, 26 May 1997 18:11:10 -0400 Message-ID: <199705270011.15889.out.babod@nada.kth.se> Organization: Royal Institute of Technology, Stockholm, Sweden Greetings, I have now spent a considerable amount of time searching through my mail archives for the announcement of winNT/95 sam that was sent to this list some time ago. No luck so far, so I thought I'd ask if any of you could give me a pointer? (maybe I deleted it, thinking I would never need it ;-). TIA /Daniel From sam-fans-owner Tue May 27 04:06:57 1997 Received: from velcro.inrs-telecom.uquebec.ca ([192.26.211.119]) by hawkwind.utcs.utoronto.ca with SMTP id <24656>; Tue, 27 May 1997 01:42:35 -0400 Received: from someware.inrs-telecom.uquebec.ca by velcro.inrs-telecom.uquebec.ca with SMTP id AA06152 (5.67a/IDA-1.5 for ); Mon, 26 May 1997 21:28:53 -0400 Received: by someware.INRS-Telecom.UQuebec.CA (SMI-8.6/SMI-SVR4) id VAA10860; Mon, 26 May 1997 21:27:30 -0400 Date: Mon, 26 May 1997 21:27:30 -0400 From: gregoire@inrs-telecom.uquebec.ca (Jean Charles Gregoire) Message-Id: <199705270127.VAA10860@someware.INRS-Telecom.UQuebec.CA> To: sam-fans@hawkwind.utcs.toronto.edu Subject: RE: where is win32 sam? Daniel, Sean posted the following URL for it: http://netlib.bell-labs.com/netlib/research/index tcs doesn't seem to be bundled in though, although it would be nice for us accented letters-addicts to have a windows 95/NT binary handy (hint?). jcg From sam-fans-owner Tue May 27 16:51:09 1997 Received: from staff.cs.su.OZ.AU ([129.78.8.1]) by hawkwind.utcs.utoronto.ca with SMTP id <24656>; Tue, 27 May 1997 16:48:36 -0400 Received: from pgrad.cs.su.OZ.AU. by staff.cs.su.OZ.AU.; Tue, 27 May 1997 13:00:45 +1000 X-Claimed-Received: from pgrad.su.oz.au Received: by pgrad.su.oz.au (SMI-8.6/SMI-SVR4) id NAA08483; Tue, 27 May 1997 13:00:44 +1000 Date: Mon, 26 May 1997 23:00:44 -0400 Message-Id: <199705270300.NAA08483@pgrad.su.oz.au> From: Gary Capell In-Reply-To: <199705270011.15889.out.babod@nada.kth.se> To: Daniel Neri Cc: Subject: Re: where is win32 sam? http://netlib.bell-labs.com/netlib/research/index.html Is there a sam-fans FAQ someplace? From sam-fans-owner Mon Jul 14 21:24:01 1997 Received: from abacus.plexsys.com ([207.207.206.50]) by hawkwind.utcs.utoronto.ca with SMTP id <24670>; Mon, 14 Jul 1997 21:17:55 -0400 Received: from localhost (mdash@localhost) by abacus.plexsys.com (8.7.3/8.7.3) with SMTP id AAA11963 for ; Tue, 15 Jul 1997 00:26:36 GMT From: mdash@abacus.plexsys.com Message-Id: <199707150026.AAA11963@abacus.plexsys.com> X-Authentication-Warning: abacus.plexsys.com: Host mdash@localhost didn't use HELO protocol To: sam-fans@hawkwind.utcs.toronto.edu Subject: win32 sam again IReply-to: mdash@plexsys.com Date: Mon, 14 Jul 1997 20:25:59 -0400 Any news on the win32 sam front? As nice as seanq's work is, the binary from the ftp site does not support an external B equivalent or pipe through commands. This matter has acquired a new urgency since I started a contract in an NT-only development shop. In more fork/exec-friendly environments, I frequently pipe stuff from sam through commands, but am now hobbled. --Mike Scheer, mdash@plexsys.com From sam-fans-owner Wed Jul 16 16:22:00 1997 Received: from orpheus.amdahl.com ([159.199.101.3]) by hawkwind.utcs.utoronto.ca with SMTP id <24674>; Wed, 16 Jul 1997 15:58:24 -0400 Received: from minerva.amdahl.com by orpheus.amdahl.com with smtp (Smail3.1.29.1 #3) id m0woWkC-0004kbC; Wed, 16 Jul 97 09:16 PDT Received: from juts.ccc.amdahl.com by minerva.amdahl.com with smtp (Smail3.1.29.1 #5) id m0woWjv-0002JtC; Wed, 16 Jul 97 09:15 PDT Received: by juts.ccc.amdahl.com (/\../\ Smail3.1.14.4 #14.6) id ; Wed, 16 Jul 97 09:16 PDT Received: by juno.ccc.amdahl.com (/\==/\ Smail #25.1) id ; Wed, 16 Jul 97 09:16 PDT Message-Id: To: wilyfans@jli.com cc: sam-fans@hawkwind.utcs.utoronto.ca Subject: libutf-2.9 and ssam-1.8 X-Face: #XtQ?n%i%L2\|+cxl=,udz?jb=ZdVifqKtWh\j%[t%SpPO/J;r0V7jB2Q4[YOM6-\GQJf1- \}3/^-jzZl.WT^3-W\?aB::;?9B:FE53y I've finally got around to doing some things that were on the back burner - changes outlined below, but they're just bug fixes, with some extra tests added for good measure. The new versions have been uploaded to: http://www.westley.demon.co.uk/src/libutf-2.9.tar.gz http://www.westley.demon.co.uk/src/ssam-1.8.tar.gz As usual, the correct way to install the software is as follows: % tar xvzf libutf-2.9.tar.gz % cd libutf-2.9 % ./configure % make tst % make install % cd .. % tar xvzf ssam-1.8.tar.gz % cd ssam-1.8 % ./configure % make tst % make install A list of the changes appears at the end of this mail. This has been tested on UTS 4.3.2 (S390 mainframe), Solaris 2.4 (SS5), and NetBSD/i386 1.2G. Sorry about the bugs, Alistair ssam-1.8 changes + Alan Watson (alan@oldp.nmsu.edu) pointed out a bug whereby two sequential commands cause changes to happen, and these changes cause the carefully ordered stack to be unordered. This only manifests itself where more than one pass over the file takes place. Added code to sort the changes into `from' address order, and order on deletion and insertion within that. + Added symbolic constants to the parse tables. This pushes column indentation out a bit, at the expense of making things much more understandable. + Byron Rakitzis (byron@netapp.com) pointed out an anomaly with sam, whereby a nul-byte terminated expression was allowed in sam, but produced an error in ssam. Eventually found time to fix this. Removed UnterminatedArg error constant and message, and change tests accordingly. libutf-2.9 changes + zero-byte terminate the arrays we copy in utfcpy + sort out utf_snprintf so that stdargs are handled correctly - I don't know if it's just gcc, but shorts and chars are put on the stack as ints, so, when we pop them off the stack, pop them off as ints. From sam-fans-owner Tue Jul 29 20:32:34 1997 Received: from plan9.bell-labs.com ([204.178.31.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24651>; Tue, 29 Jul 1997 20:11:53 -0400 From: seanq@plan9.bell-labs.com Date: Tue, 29 Jul 1997 17:25:55 -0400 To: 9fans@cse.psu.edu, sam-fans@hawkwind.utcs.toronto.edu Message-Id: <97Jul29.201153edt.24651@hawkwind.utcs.utoronto.ca> For those of you that use Sam on Windows 95/NT: There is a new version which can be installed by running the self extracting executable available thru netlib. Go to http://netlib.bell-labs.com/netlib/research and select the file sam.exe, or more directly, http://netlib.bell-labs.com/netlib/research/sam.exe Major changes from the previous release include: *) The commands that run external programs now work, i.e. '<', '>', '|', '!'. Included with the distribution are several command line programs that are useful with sam, such as: pwd, echo, fmt, and sort. *) There is a 'B' command that enables sam to receive file open requests from other programs. Let me know any problems you have. seanq@research.bell-labs.com From sam-fans-owner Wed Aug 27 18:14:59 1997 Received: from staff.cs.su.OZ.AU ([129.78.8.1]) by hawkwind.utcs.utoronto.ca with SMTP id <24664>; Wed, 27 Aug 1997 16:44:03 -0400 Date: Wed, 27 Aug 1997 05:27:20 -0400 From: bruce@staff.cs.su.oz.au (Bruce Janson) To: sam-fans@hawkwind.utcs.toronto.edu Subject: libXg Message-Id: <97Aug27.164403edt.24664@hawkwind.utcs.utoronto.ca> Hi, Has anyone modified libXg so that it supports screens of ldepth > 3? Regards, Bruce Janson Email: bruce@cs.usyd.edu.au Basser Department of Computer Science Phone: +61-2-9351-3423/4 University of Sydney, N.S.W., 2006, AUSTRALIA Fax: +61-2-9351-3838 From sam-fans-owner Tue Sep 16 03:02:33 1997 Received: from grolsch.cs.ubc.ca ([142.103.6.9]) by hawkwind.utcs.utoronto.ca with SMTP id <24650>; Tue, 16 Sep 1997 02:49:53 -0400 Received: from harpo.cs.ubc.ca (harpo.cs.ubc.ca [142.103.9.5]) by grolsch.cs.ubc.ca (8.8.5/8.6.9) with ESMTP id SAA02555 for ; Mon, 15 Sep 1997 18:19:08 -0700 (PDT) Message-Id: <199709160119.SAA02555@grolsch.cs.ubc.ca> To: sam-fans@hawkwind.utcs.utoronto.ca Subject: Sam for Windows 95 and extensions Date: Mon, 15 Sep 1997 21:17:11 -0400 From: "Paul A. Lalonde" I've recently started work in a Windows-only environment, and spent part of the day installing sam (and other useful tools), but am missing the extensions I had installed in my prior existance. In particular, I'm missing being able to use the escape key to switch from the current window to the sam window. Is there an easy way to get this functionality in the Windows 95 version? Thanks, Paul Internet: lalonde@cs.ubc.ca Web: http://www.cs.ubc.ca/spider/lalonde/homepage.html "On ne voit bien qu'avec le coeur. L'essentiel est invisible pour les yeux" - Antoine de St.-Exupery From sam-fans-owner Tue Oct 28 17:56:31 1997 Received: from finch.cse.psu.edu ([130.203.12.29]) by hawkwind.utcs.utoronto.ca with SMTP id <24684>; Tue, 28 Oct 1997 17:43:51 -0500 Received: (qmail 21504 invoked by uid 991); 28 Oct 1997 06:32:35 -0000 Message-ID: <19971028063235.21502.qmail@finch.cse.psu.edu> To: sam-fans@hawkwind.utcs.toronto.edu Subject: 9term bug Date: Tue, 28 Oct 1997 01:32:35 -0500 From: Scott Schwartz Hi all, I don't recall if this has been reported or not, but libtext from fails to initialize everything in a newly allocated Text. (bcheck is your friend.) =================================================================== RCS file: RCS/text.c,v retrieving revision 1.1 diff -c -r1.1 text.c *** /tmp/T0a005Fs Tue Oct 28 01:30:37 1997 --- text.c Tue Oct 28 01:23:56 1997 *************** *** 47,52 **** --- 47,53 ---- berror("textalloc: calloc"); t->length = 0; t->base = 0; + t->end = 0; t->p0 = 0; t->p1 = 0; t->pout = 0; From sam-fans-owner Fri Oct 31 19:37:31 1997 Received: from mn1.swip.net ([192.71.180.97]) by hawkwind.utcs.utoronto.ca with SMTP id <24687>; Fri, 31 Oct 1997 19:33:41 -0500 Received: by mn1.swip.net (8.8.8/2.01) id QAA03390; Fri, 31 Oct 1997 16:08:47 GMT Received: (from bengt@localhost) by trillian.softwell.se (8.8.3/8.8.3) id QAA22933; Fri, 31 Oct 1997 16:53:28 +0100 Date: Fri, 31 Oct 1997 10:53:28 -0500 From: Bengt Kleberg Message-Id: <199710311553.QAA22933@trillian.softwell.se> To: sam-fans@hawkwind.utcs.toronto.edu, schwartz@finch.cse.psu.edu Subject: Re: 9term bug > From: Scott Schwartz > I don't recall if this has been reported or not, but libtext from fails Greetings, I recompiled 9term (and libtext) to correct this bug (that had never bitten me IFAIK). During recompile I noticed something I had forgotten since last time (ages ago, since 9term is stable enough not to warrant updates every month). When compiling under linux there are some #defines, but no makefile. Has anybody produced an official one? I could submit mine, but I get warnings... Best Wishes, Bengt =============================================================== Everything aforementioned should be regarded as totally private opinions, and nothing else. bengt@softwell.se ``His great strength is that he is uncompromising. It would make him physically ill to think of programming in C++.'' From sam-fans-owner Sat Nov 1 08:51:21 1997 Received: from milawa.psrg.cs.usyd.EDU.AU ([129.78.8.50]) by hawkwind.utcs.utoronto.ca with SMTP id <24649>; Sat, 1 Nov 1997 08:47:28 -0500 Received: (from matty@localhost) by milawa.psrg.cs.usyd.EDU.AU (8.8.7/8.8.4) id LAA28615; Sat, 1 Nov 1997 11:47:24 +1100 (EST) From: James Matthew Farrow Message-Id: <199711010047.LAA28615@milawa.psrg.cs.usyd.EDU.AU> Subject: Re: 9term bug To: bengt@softwell.se (Bengt Kleberg) Date: Fri, 31 Oct 1997 19:47:24 -0500 Cc: sam-fans@hawkwind.utcs.toronto.edu, schwartz@finch.cse.psu.edu In-Reply-To: <199710311553.QAA22933@trillian.softwell.se> from "Bengt Kleberg" at Oct 31, 97 10:53:28 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit > > I don't recall if this has been reported or not, but libtext from fails > > I recompiled 9term (and libtext) to correct this bug (that had > never bitten me IFAIK). During recompile I noticed something I had > forgotten since last time (ages ago, since 9term is stable enough > not to warrant updates every month). When compiling under linux > there are some #defines, but no makefile. Has anybody produced an > official one? I could submit mine, but I get warnings... I have a whole pile of bits and pieces that I've started looking at pulling together now that I've been officially released from the bondage of my Ph.D. Things are going slowly (I still feel guilty working on things I enjoy ;-) but getting there. If you want to send me stuff I'll look at putting out a new version with some of the patches I've been given over the last while. Matty. -- James Matthew Farrow | "For in that moment I beheld the ruin matty@cs.usyd.edu.au | of my existence. My world fell dark Basser Department of Computer Science | and my life became a shallow dream. Sydney University - Fax: +61 2 9351 3838| `Odi et amo. Excrucior.'" - Tlindah From sam-fans-owner Mon Nov 17 18:58:30 1997 Received: from venus.ubs.com ([207.25.52.67]) by hawkwind.utcs.utoronto.ca with SMTP id <24673>; Mon, 17 Nov 1997 18:51:00 -0500 Received: by venus.ubs.com; id LAA23510; Mon, 17 Nov 1997 11:49:50 -0500 (EST) Received: from unknown(192.168.122.22) by venus.ubs.com via smap (3.2) id xma023505; Mon, 17 Nov 97 11:49:42 -0500 Received: from ns1.ny.ubs.com by hedy.ny.ubs.com (SMI-8.6/SMI-SVR4) id LAA28283; Mon, 17 Nov 1997 11:46:33 -0500 Received: from ny.ubs.com (rousseau.ny.ubs.com [161.239.153.13]) by ns1.ny.ubs.com (8.7.3/8.7.3) with ESMTP id KAA21240; Mon, 17 Nov 1997 10:58:15 -0500 (EST) Sender: mkr@ny.ubs.com Message-ID: <3470698F.405334B5@ny.ubs.com> Date: Mon, 17 Nov 1997 10:58:07 -0500 From: "Michael K. Rosenberg" X-Mailer: Mozilla 4.03 [en] (X11; U; SunOS 5.5.1 sun4m) MIME-Version: 1.0 To: Pete Fenelon CC: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: sam for 95/nt References: <3.0.32.19970217162635.006bb15c@oberon.info-com.com> Content-Type: multipart/mixed; boundary="MimeMultipartBoundary" --MimeMultipartBoundary Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit has anyone dealt with this problem? in my opinion, the best solution would be that sam on nt writes a cr/lf when you hit return, and does not show the cr character. this makes the files different from ones created on unix systems, but, makes them consistent with all other text files and text utilities on nt, such as printing utilities. i guess this is what pete meant in his suggestion below. i'm keeping my fingers crossed that there is a better nt version of sam out there somewhere....otherwise, i think i'm going to be stuck with notepad. mike Pete Fenelon wrote: > One minor caveat, though -- under 95 (don't know about NT) it adopts the > Unix-y (and indeed right-thinking) LF as newline.... which means it's not > ideal for editing Windows text files which use CR/LF -- (A) it shows the CR > half of CR/LF as a CR character and (B) it makes it a tad tricky to use > files produced with Sam with utilities that aren't wise to the rest of the > world's conventions on newline... > > I suppose this is the *logically* correct behaviour, but to push Sam as an > editor which the Windows-user community will use, perhaps it should do the > wrong but *visually* sensible thing :) > > Thoughts -- would it be difficult to bodge sam to treat CR/LF as one rune > under Windows? --MimeMultipartBoundary-- From sam-fans-owner Fri Nov 28 23:38:09 1997 Received: from finch.cse.psu.edu ([130.203.12.29]) by hawkwind.utcs.utoronto.ca with SMTP id <24696>; Fri, 28 Nov 1997 22:56:25 -0500 Received: (qmail 6505 invoked by uid 991); 28 Nov 1997 22:52:38 -0000 Message-ID: <19971128225238.6504.qmail@finch.cse.psu.edu> Date: Fri, 28 Nov 1997 17:52:38 -0500 To: sam-fans@hawkwind.utcs.toronto.edu Subject: libXg font handling improvement Date: Fri, 28 Nov 1997 17:52:38 -0500 From: Scott Schwartz Hi, As you know, libXg looks for fonts based on a filename, normally given in your xdefaults file, containing a Plan 9 style font map. That works if and only if all your X clients have the same filesystem namespace. Normally, with local NFS, that's the case, but if you ever log into some remote machine and try to run sam or 9term, the fonts probably won't be where sam has been told to look. So this patch arranges to store the font map in the X resources database. Combined with using the x font server to hold the actual fonts, this makes things work fairly nicely, without recourse to the filesystem(s). In my xinitrc I run the following to set things up: name = (char *)malloc(strlen(name)+1); if (fnt->name==0) --- 42,75 ---- free(buf); return 0; } + return buf; + } ! Font * ! rdfontfile(char *name, int ldepth) ! { ! return rdfontstring(name, file2string(name), ldepth); ! } ! ! Font* ! rdfontstring(char *name, char *s, int ldepth) ! { ! Font *fnt; ! Cachesubf *c; ! int i; ! char *buf, *t; ! struct stat sbuf; ! unsigned long min, max; ! ! buf = s; ! if (buf == 0) ! return 0; fnt = (Font *)malloc(sizeof(Font)); ! if (fnt == 0) { ! Err1: ! free(buf); ! return 0; ! } memset((void*)fnt, 0, sizeof(Font)); fnt->name = (char *)malloc(strlen(name)+1); if (fnt->name==0) *** /tmp/T0a001XK Fri Nov 28 15:05:48 1997 --- libXg/xtbinit.c Thu Nov 20 19:52:10 1997 *************** *** 181,187 **** font = 0; subfont = 0; if (fontname) { ! font = rdfontfile(fontname, screen.ldepth); if (!font || charwidth(font, (Rune) ' ') == 0) { subfont = getsubfont(fontname); if (!subfont) --- 181,189 ---- font = 0; subfont = 0; if (fontname) { ! font = (fontname[0] == '.' || fontname[0] == '/') ! ? rdfontfile(fontname, screen.ldepth) ! : rdfontstring("p9font", fontname, screen.ldepth); if (!font || charwidth(font, (Rune) ' ') == 0) { subfont = getsubfont(fontname); if (!subfont) *** /tmp/T0a001XK Fri Nov 28 15:05:48 1997 --- include/libg.h Thu Nov 20 19:43:54 1997 *************** *** 203,208 **** --- 203,209 ---- extern int bitbltclip(void*); extern Subfont* getsubfont(char*); extern Font *rdfontfile(char*, int); + extern Font *rdfontstring(char*, char*, int); extern void ffree(Font*); extern Font *mkfont(Subfont*); extern void subffree(Subfont*); From sam-fans-owner Fri Jan 30 18:14:00 1998 Received: from bio.cse.psu.edu ([130.203.12.29]) by hawkwind.utcs.utoronto.ca with SMTP id <24718>; Fri, 30 Jan 1998 17:05:33 -0500 Received: (qmail 19842 invoked by uid 991); 27 Jan 1998 21:47:56 -0000 Message-ID: <19980127214756.19841.qmail@bio.cse.psu.edu> Date: Tue, 27 Jan 1998 16:47:56 -0500 To: sam-fans@hawkwind.utcs.toronto.edu From: schwartz+sam-fans@bio.cse.psu.edu Subject: 9term buffer overflow Date: Tue, 27 Jan 1998 16:47:55 -0500 Sender: schwartz@bio.cse.psu.edu 9term "1.6.6 Nov 1995" (the latest?) has a problem in display.c, where a static buffer can overflow. (The font improvements for libXg that I posted a while ago can exercise this; since no one has complained I guess no one has tried those either (hmmm.)) *** /tmp/T0a004pS Tue Jan 27 16:43:03 1998 --- display.c Tue Jan 27 16:33:46 1998 *************** *** 121,126 **** --- 121,137 ---- _killpg(SIGHUP); } + static char * + str_ndup(char *p, unsigned int n) + { + char *s = malloc(n+1); + if (!s) + error("malloc failure"); + strncpy(s, p, n); + s[n] = 0; + return s; + } + /* * try to extract an X resource under a variety of names */ *************** *** 128,134 **** get_resource(char *resource, char *class, char *rname, char *cname) { char str1[256], str2[256]; - static char result[512]; XrmValue value; char *str_type; --- 139,144 ---- *************** *** 137,144 **** if (XrmGetResource( XrmGetDatabase(_dpy), str1, str2, &str_type, &value) == True) { ! strncpy(result, value.addr, (int)value.size); ! return result; } return 0; } --- 147,153 ---- if (XrmGetResource( XrmGetDatabase(_dpy), str1, str2, &str_type, &value) == True) { ! return str_ndup(value.addr, value.size); } return 0; } *************** *** 155,165 **** --- 164,176 ---- s = get_resource(resource, class, "debug", "Debug"); if (s && strcasecmp(s, "true")) { + free(s); XSetErrorHandler(error_handler); XSetIOErrorHandler(io_error_handler); } s = get_resource(resource, class, "login", "Login"); if (s && !strcasecmp(s, "true")) { + free(s); /* Change argv[0] if this is a login shell */ new = (char *)malloc(strlen(shargv[0])+2); if (!new) *************** *** 169,206 **** shargv[0] = new; } s = get_resource(resource, class, "scroll", "Scroll"); ! if (s && !strcasecmp(s, "true")) scrolling = 1; s = get_resource(resource, class, "utmp", "Utmp"); ! if (s && !strcasecmp(s, "true")) utmpentry = 1; if (s = get_resource(resource, class, "label", "Label")) { XStoreName(_dpy, XtWindow(_toplevel), s); XSetIconName(_dpy, XtWindow(_toplevel), s); XFlush(_dpy); } ! if (s = get_resource(resource, class, "ttyModes", "TtyModes")) parsettymodes(UNIX, s); ! if (s = get_resource(resource, class, "p9TtyModes", "P9TTyModes")) parsettymodes(PLAN9, s); ! if (s = get_resource(resource, class, "kbdMode", "KbdMode")) if (!strcasecmp(s, "unix")) kbdmode = UNIX; else if (!strcasecmp(s, "plan9")) kbdmode = PLAN9; ! if (s = get_resource(resource, class, "p9font", "P9font")) setenv("font", s, 1); ! if (s = get_resource(resource, class, "highwater", "Highwater")) highwater = atoi(s); ! if (s = get_resource(resource, class, "lowwater", "Lowwater")) lowwater = atoi(s); ! if (s = get_resource(resource, class, "9wm", "9Wm")) ninewm = !strcasecmp(s, "true"); if (s = get_resource(resource, class, "beep", "Beep")) { if (strstr(s, "unix")) beepmask |= UNIX; if (strstr(s, "plan9")) beepmask |= PLAN9; } } /* --- 180,237 ---- shargv[0] = new; } s = get_resource(resource, class, "scroll", "Scroll"); ! if (s && !strcasecmp(s, "true")) { ! free(s); scrolling = 1; + } s = get_resource(resource, class, "utmp", "Utmp"); ! if (s && !strcasecmp(s, "true")) { ! free(s); utmpentry = 1; + } if (s = get_resource(resource, class, "label", "Label")) { XStoreName(_dpy, XtWindow(_toplevel), s); XSetIconName(_dpy, XtWindow(_toplevel), s); XFlush(_dpy); + free(s); } ! if (s = get_resource(resource, class, "ttyModes", "TtyModes")) { parsettymodes(UNIX, s); ! free(s); ! } ! if (s = get_resource(resource, class, "p9TtyModes", "P9TTyModes")) { parsettymodes(PLAN9, s); ! free(s); ! } ! if (s = get_resource(resource, class, "kbdMode", "KbdMode")) { if (!strcasecmp(s, "unix")) kbdmode = UNIX; else if (!strcasecmp(s, "plan9")) kbdmode = PLAN9; ! free(s); ! } ! if (s = get_resource(resource, class, "p9font", "P9font")) { setenv("font", s, 1); ! free(s); ! } ! if (s = get_resource(resource, class, "highwater", "Highwater")) { highwater = atoi(s); ! free(s); ! } ! if (s = get_resource(resource, class, "lowwater", "Lowwater")) { lowwater = atoi(s); ! free(s); ! } ! if (s = get_resource(resource, class, "9wm", "9Wm")) { ninewm = !strcasecmp(s, "true"); + free(s); + } if (s = get_resource(resource, class, "beep", "Beep")) { if (strstr(s, "unix")) beepmask |= UNIX; if (strstr(s, "plan9")) beepmask |= PLAN9; + free(s); } } /* From sam-fans-owner Thu May 7 16:37:47 1998 Received: from plan9.bell-labs.com ([204.178.31.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24706>; Thu, 7 May 1998 16:35:12 -0400 Date: Thu, 7 May 1998 14:24:30 -0400 To: sam-fans@hawkwind.utcs.toronto.edu From: "bob flandrena" Message-Id: <98May7.163512edt.24706@hawkwind.utcs.utoronto.ca> a new sam bundle is available at ftp://plan9.bell-labs.com/netlib/research/sam.shar.gz there is no new functionality; just a couple of minor bugs fixed since the last release and references to AT&T in the boilerplate changed to Lucent. This version is almost completely untested, so the usual use-at-your-own-risk warnings apply. as a bonus, the package contains a port of the Plan 9 regular expression library. it is not used by sam, but is provided for play. From sam-fans-owner Thu Sep 17 03:42:20 1998 Received: from post.mail.demon.net ([194.217.242.40]) by hawkwind.utcs.utoronto.ca with SMTP id <24851>; Thu, 17 Sep 1998 02:29:59 -0400 Received: from [212.228.106.206] (helo=kremvax.demon.co.uk) by post.mail.demon.net with esmtp (Exim 2.02 #1) id 0zJ4wT-0001xm-00; Tue, 15 Sep 1998 23:55:34 +0000 Received: (from mhw@localhost) by kremvax.demon.co.uk (8.8.7/8.8.7) id AAA29001; Wed, 16 Sep 1998 00:18:51 +0100 To: bobf@research.bell-labs.com cc: sam-fans@hawkwind.utcs.toronto.edu Subject: libXg bug fix From: "Mark H. Wilkinson" Date: Tue, 15 Sep 1998 19:03:28 -0400 Message-ID: <199809160003.28896.out.badoz@kremvax.demon.co.uk> X-Face: Bsp[Ds(Y#/{==j:Cv'"IK4R^D0_z]{'OYtp2^EYqpG)88CsdBm&LJ{idLZWx}AKf}E4#|@4DT4cX3 ?!>aIVcxmd#1 This fixes a bug in ffree() in sam's libXg. c is a pointer to a structure within an array of such structures, and as such shouldn't be free'd. The later call to free(f->subf) frees the whole array. I should point out that sam doesn't actually call ffree() anywhere, so it's not going to fall over because of this. Other programs might. -Mark. Index: rdfontfile.c =================================================================== RCS file: /u/cvs/9libs/libXg/rdfontfile.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C4 -r1.4 -r1.5 *** rdfontfile.c 1998/08/11 00:20:44 1.4 --- rdfontfile.c 1998/09/15 23:03:22 1.5 *************** *** 126,134 **** c = f->subf+i; if (c->f) subffree(c->f); free(c->name); - free(c); } free(f->subf); free(f); } --- 126,133 ---- From sam-fans-owner Wed Jan 20 19:52:02 1999 Received: from mail.eclipse.net ([207.207.192.13]) by hawkwind.utcs.utoronto.ca with SMTP id <25135>; Wed, 20 Jan 1999 18:51:44 -0500 Received: from cnj1-06-48.eclipse.net (cnj1-06-48.eclipse.net [207.207.244.48]) by mail.eclipse.net (8.9.1a/8.9.1) with SMTP id JAA20369 for ; Wed, 20 Jan 1999 09:02:13 -0500 (EST) From: mdash@plexsys.com (Michael D. Scheer) To: sam-fans@hawkwind.utcs.toronto.edu Subject: sam on win32 Date: Wed, 20 Jan 1999 09:02:11 -0500 Message-ID: <36a5e163.219826@mail.eclipse.net> X-Mailer: Forte Agent 1.5/32.451 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Transfer-Encoding: quoted-printable Is this list still active? I haven't seen traffic in months, it seems. What is the current state of efforts to get sam onto win32? seanq's port does not seem to have been updated in a while. Anybody tried the X11 version over Korn's uwin or Cygnus's cygwin? Thanks. --Mike Scheer, mdash@plexsys.com, 908-273-1885 From sam-fans-owner Thu Jan 21 16:29:12 1999 Received: from bio.cse.psu.edu ([130.203.12.17]) by hawkwind.utcs.utoronto.ca with SMTP id <24723>; Thu, 21 Jan 1999 15:44:14 -0500 Received: (qmail 7491 invoked by uid 991); 21 Jan 1999 00:54:59 -0000 Message-ID: <19990121005459.7490.qmail@g.bio.cse.psu.edu> Date: Wed, 20 Jan 1999 19:54:59 -0500 to: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: sam on win32 In-reply-to: Your message of "Wed, 20 Jan 1999 09:02:11 EST." <36a5e163.219826@mail.eclipse.net> Date: Wed, 20 Jan 1999 19:54:59 -0500 From: Scott Schwartz mdash@plexsys.com (Michael D. Scheer) writes: | Is this list still active? I haven't seen traffic in months, it | seems. That's the benefit of ancient and stable software. :-) From sam-fans-owner Thu Jan 21 16:29:17 1999 Received: from repop2.jps.net ([209.63.224.239]) by hawkwind.utcs.utoronto.ca with SMTP id <24881>; Thu, 21 Jan 1999 15:45:23 -0500 Received: from 6625hvt3r227 (209-239-201-39.oak.jps.net [209.239.201.39]) by repop2.jps.net (8.9.0/8.8.5) with ESMTP id KAA12011; Thu, 21 Jan 1999 10:47:29 -0800 (PST) Message-Id: <199901211847.KAA12011@repop2.jps.net> From: "Chaotrope" To: "Michael D. Scheer" , Subject: Re: sam on win32 Date: Thu, 21 Jan 1999 13:39:52 -0500 X-MSMail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1155 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On: Wednesday, January 20, 1999: ---------- > From: Michael D. Scheer > To: sam-fans@hawkwind.utcs.toronto.edu > Subject: sam on win32 > What is the current state of efforts to get sam onto win32? seanq's > port does not seem to have been updated in a while. I don't understand the 'problem' - I use the seanq version in a Win95 system with no problem (alright, it will hang sometimes, but I blame that on B. Gates) so why would it need updating? I'm so happy with sam that I've even thought of buying my own i386 clone system (work pays for what I currently use) just to run the Linux p9 "emulation" (ie, sam, wily, rc/es, 9term,9wm), even tho I swore years back that I wouldn't spend my own money on computer junk any more - too much stuff collecting in closets. - kim BTW did you notice that 'rc' is in the /bin? Nice undocumented treat. From sam-fans-owner Thu Jan 21 16:29:23 1999 Received: from blackusi03.belrose.visionet.com.au ([210.0.31.9]) by hawkwind.utcs.utoronto.ca with SMTP id <24660>; Thu, 21 Jan 1999 15:41:49 -0500 Received: from ishtek.com ([210.0.3.138]) by blackusi03.belrose.visionet.com.au (Netscape Mail Server v2.01) with SMTP id AAA4571 for ; Thu, 21 Jan 1999 11:29:58 +1100 X-Mailer: Ishtek MeeMail 2.1 In-Reply-To: <36a5e163.219826@mail.eclipse.net> Date: Wed, 20 Jan 1999 19:31:53 -0500 From: Alex Danilo Subject: Re: sam on win32 To: sam-fans@hawkwind.utcs.toronto.edu X-Face: 3}u>)koHh${W+XV18fV{i/@Sw_Cvi'3hS04kL'J-3Qoz{?D R>c6<6{LbeD5'D9+C\lUPtNBF=h=yrnT,zMx$o3YbL/p;|UGb}@0^{Tr7ppFE_sk;'p[W9,gpJ$`N2 Sp?E#o2R Message-Id: <99Jan21.154149est.24660@hawkwind.utcs.utoronto.ca> >What is the current state of efforts to get sam onto win32? seanq's >port does not seem to have been updated in a while. Anybody tried the >X11 version over Korn's uwin or Cygnus's cygwin? Yep - I had a bash at it, and it doesn't work very well. The current uwin stuff is a bit flaky as far as the X stuff goes. However, both uwin and cygnus blow up on the call to XtAppIinitialize in libXg/xtbinit.c. I also compiled up X11R6.4 and it did the same thing. Given that you need to run an X-server to get that version to run anyway, I've found it easier to just run an NFS server on the Winoze box, then run sam on another UNIX box and edit that way. Ugly, but it works. Alex P.S. I asked seanq if we could have the source of his port, but he won't release it. P.P.S. I bashed in the cursor keys, ctrl-x/c/v and Windows style delete key if anyone wants those changes. -- Alex Danilo http://www.ishtek.com/alex PO Box 333 Forestville NSW 2087 +61-2-9975-2297 From sam-fans-owner Wed Jan 27 17:41:17 1999 Received: from cssun.mathcs.emory.edu ([170.140.150.1]) by hawkwind.utcs.utoronto.ca with SMTP id <25250>; Wed, 27 Jan 1999 16:56:23 -0500 Received: from dilbert.mathcs.emory.edu (dilbert [170.140.150.6]) by cssun.mathcs.emory.edu (8.9.1b+Sun/8.9.1) with ESMTP id KAA23791 for ; Tue, 26 Jan 1999 10:43:28 -0500 (EST) Received: from gold2.gezernet.co.il (gold2.gezernet.co.il [192.115.7.75]) by dilbert.mathcs.emory.edu (8.9.1b+Sun/8.9.1) with SMTP id KAA20063 for ; Tue, 26 Jan 1999 10:43:05 -0500 (EST) Message-Id: <199901261543.KAA20063@dilbert.mathcs.emory.edu> From: Aharon Robbins Date: Tue, 26 Jan 1999 10:35:45 -0500 To: sam-fans@hawkwind.utcs.toronto.edu Subject: 9term under Linux? I know this has come up before, but I don't remember the answers... Has anyone got patches to 9term 1.6.6 for Linux? I have it built, but hold mode isn't working. And with the latest rc as the shell, input characters are not echoed. I'm using Redhat 5.2, if that matters. Thanks, Arnold -- Aharon (a.k.a. Arnold) Robbins arnold@gnu.org P.O. Box 354 Home Phone: +972 8 979-0381 Nof Ayalon Cell Phone: +972 51 297-545 D.N. Shimshon 99784 Laundry increases exponentially in the ISRAEL number of children. -- Miriam Robbins From sam-fans-owner Wed Jan 27 17:50:26 1999 Received: from repop1.jps.net ([209.63.224.238]) by hawkwind.utcs.utoronto.ca with SMTP id <24767>; Wed, 27 Jan 1999 16:42:43 -0500 Received: from 6625hvt3r227 (209-239-204-85.oak.jps.net [209.239.204.85]) by repop1.jps.net (8.8.5/8.8.5) with ESMTP id PAA22622; Thu, 21 Jan 1999 15:56:41 -0800 (PST) Message-Id: <199901212356.PAA22622@repop1.jps.net> From: "Chaotrope" To: "Alex Danilo" , Subject: Re: sam on win32 Date: Thu, 21 Jan 1999 18:57:41 -0500 X-MSMail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1155 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Wednesday, January 20, 1999 > Alex Danilo > To: sam-fans@hawkwind.utcs.toronto.edu > Subject: Re: sam on win32 said > P.S. I asked seanq if we could have the source of his port, but he won't > release it. > P.P.S. I bashed in the cursor keys, ctrl-x/c/v and Windows style delete key > if anyone wants those changes. > -- > Alex Danilo http://www.ishtek.com/alex > PO Box 333 Forestville NSW 2087 +61-2-9975-2297 > seanq's Win95/NT version of sam implements the Crtl-X/C/V as well as allowing Crl-W to delete the word to the left of the cursor, and Ctrl-U to delete leftwards to beginning of line (I think these are remnants of 8-1/2). And if you want source, I remember in the list-archives a mail from someone who had ported sam to Win; they might be willing to pass it on. (and speaking of source, even if someone gets the Win32.exe, they should also get sam.shar because that includes a troff -ms encoded tutorial on using sam, something that is sorely needed, especially as the PDF of the 1987 paper doesn't print back-ticks (') so the one big example of changing 'n' to 'num' reads incorrectly) - kim From sam-fans-owner Thu Jan 28 11:34:42 1999 Received: from cssun.mathcs.emory.edu ([170.140.150.1]) by hawkwind.utcs.utoronto.ca with SMTP id <24927>; Thu, 28 Jan 1999 11:21:17 -0500 Received: from dilbert.mathcs.emory.edu (dilbert [170.140.150.6]) by cssun.mathcs.emory.edu (8.9.1b+Sun/8.9.1) with ESMTP id IAA26672 for ; Thu, 28 Jan 1999 08:35:41 -0500 (EST) Received: from gold2.gezernet.co.il (gold2.gezernet.co.il [192.115.7.75]) by dilbert.mathcs.emory.edu (8.9.1b+Sun/8.9.1) with SMTP id IAA19617 for ; Thu, 28 Jan 1999 08:34:52 -0500 (EST) Message-Id: <199901281334.IAA19617@dilbert.mathcs.emory.edu> From: Aharon Robbins Date: Thu, 28 Jan 1999 08:02:48 -0500 To: sam-fans@hawkwind.utcs.toronto.edu Subject: more on my 9term Hmmm. Control-c for interrupt doesn't work on the 9term I just built.... Maybe Bengt's version is better? I tried to build 9term 1.6.3 with the research!rsc patch file, and it is still much worse than the patched 1.6.6. Sigh. Nothing like portability. ☺ Arnold -- Aharon (a.k.a. Arnold) Robbins arnold@gnu.org P.O. Box 354 Home Phone: +972 8 979-0381 Nof Ayalon Cell Phone: +972 51 297-545 D.N. Shimshon 99784 Laundry increases exponentially in the ISRAEL number of children. -- Miriam Robbins From sam-fans-owner Thu Jan 28 11:38:28 1999 Received: from cssun.mathcs.emory.edu ([170.140.150.1]) by hawkwind.utcs.utoronto.ca with SMTP id <24917>; Thu, 28 Jan 1999 11:16:05 -0500 Received: from dilbert.mathcs.emory.edu (dilbert [170.140.150.6]) by cssun.mathcs.emory.edu (8.9.1b+Sun/8.9.1) with ESMTP id GAA23241; Thu, 28 Jan 1999 06:46:05 -0500 (EST) Received: from gold2.gezernet.co.il (gold2.gezernet.co.il [192.115.7.75]) by dilbert.mathcs.emory.edu (8.9.1b+Sun/8.9.1) with SMTP id GAA19439; Thu, 28 Jan 1999 06:45:42 -0500 (EST) Message-Id: <199901281145.GAA19439@dilbert.mathcs.emory.edu> From: Aharon Robbins Date: Thu, 28 Jan 1999 06:33:33 -0500 To: Jim.Robinson@Stanford.Edu Subject: Re: 9term under Linux? Cc: sam-fans@hawkwind.utcs.toronto.edu Me: > > I know this has come up before, but I don't remember the answers... > > Has anyone got patches to 9term 1.6.6 for Linux? I have it built, but > > hold mode isn't working. And with the latest rc as the shell, > > input characters are not echoed. > > > > I'm using Redhat 5.2, if that matters. From: "James A. Robinson" > Yes, I have it working. As I recall, I had to nab a patch off the net. A > quick search gave this: http://cm.bell-labs.com/who/rsc/linux/9term.patch > which I think is what I used. This is for 1.6.3. But it was enough to get me started. After a whopping 5 minutes of testing, rc and hold mode work. Here's a diff against the 1.6.6 sources. I can supply the makefile I used too, if anyone wants it; the main thing is to define _POSIX_SOURCE and LINUX. Now, to try restarting X with 9wm as the window manager... Much thanks! Arnold -------------------------------- *** 9term.c.dist Thu Sep 28 06:16:15 1995 --- 9term.c Thu Jan 28 13:15:36 1999 *************** *** 10,16 **** #include #include ! #ifdef SOLARIS #include #else #include --- 10,16 ---- #include #include ! #if defined SOLARIS || defined LINUX #include #else #include *** 9term.h.dist Tue Nov 28 07:27:04 1995 --- 9term.h Thu Jan 28 13:14:56 1999 *************** *** 30,35 **** --- 30,39 ---- extern int echo; extern int isig; + #if defined(LINUX) + #define setenv p9term_setenv + #endif + extern void specialchars(int); extern int setenv(char *, char *, int); extern void init_display(int *, char **, char**, char*); *************** *** 87,90 **** --- 91,99 ---- #if defined(SOLARIS) #define POSIXPTYS #define REMOTE + #endif + + #if defined(LINUX) + #define POSIXPTYS + #define BSDPTYS #endif *** display.c.dist Thu Oct 5 09:55:54 1995 --- display.c Thu Jan 28 13:10:28 1999 *************** *** 275,280 **** --- 275,287 ---- { int width, height; + static int called=0; + + if (called) { + /*fprintf(stderr, "ereshaped called twice\n");*/ + return; + } + called = 1; if (ninewm) { /* work around textsetrects wierdness */ r = inset(r, -3); *************** *** 286,291 **** --- 293,299 ---- tty_set_size(comm_fd, width, height, Dx(text->r), Dy(text->r)); setborder(); } + called = 0; } /* *** pty.c.dist Tue Nov 28 07:30:45 1995 --- pty.c Thu Jan 28 13:22:07 1999 *************** *** 60,73 **** # define V_FLUSH VFLUSH #endif ! #ifdef linux # define V_START VSTART # define V_STOP VSTOP # define V_SUSP VSUSP # define V_DSUSP VDSUSP # define V_RPRNT VREPRINT # define V_WERAS VWERASE - # define V_FLUSH VFLUSH #endif #ifdef HPUX --- 60,73 ---- # define V_FLUSH VFLUSH #endif ! #ifdef LINUX ! #include # define V_START VSTART # define V_STOP VSTOP # define V_SUSP VSUSP # define V_DSUSP VDSUSP # define V_RPRNT VREPRINT # define V_WERAS VWERASE #endif #ifdef HPUX *************** *** 304,309 **** --- 304,312 ---- ttmode.c_lflag |= ECHO; ttmode.c_oflag &= ~(ONLCR); ttmode.c_oflag |= ONLRET; + #ifdef LINUX + ttmode.c_lflag |= ICANON; + #endif } else { ttmode.c_iflag = BRKINT | IGNPAR | ICRNL | IXON; ttmode.c_oflag = OPOST | ONLRET; -- Aharon (a.k.a. Arnold) Robbins arnold@gnu.org P.O. Box 354 Home Phone: +972 8 979-0381 Nof Ayalon Cell Phone: +972 51 297-545 D.N. Shimshon 99784 Laundry increases exponentially in the ISRAEL number of children. -- Miriam Robbins From sam-fans-owner Thu Jan 28 11:39:01 1999 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.utoronto.ca with SMTP id <24907>; Thu, 28 Jan 1999 11:13:33 -0500 Received: from trillian.softwell.se (trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.8.5/8.8.5) with ESMTP id IAA13664; Thu, 28 Jan 1999 08:45:29 +0100 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id IAA28290; Thu, 28 Jan 1999 08:45:29 +0100 Date: Thu, 28 Jan 1999 02:45:29 -0500 From: Bengt Kleberg Message-Id: <199901280745.IAA28290@trillian.softwell.se> To: arnold@gnu.org, sam-fans@hawkwind.utcs.toronto.edu Subject: Re: 9term under Linux? > Has anyone got patches to 9term 1.6.6 for Linux? I have it built, but > hold mode isn't working. And with the latest rc as the shell, > input characters are not echoed. I have a 9term that works under Linux. Both hold mode and latest rc. Unfortunatly I do not remember how I built it! If nobody else steps forward with the right thing I could try and find out. Best Wishes, Bengt =============================================================== Everything aforementioned should be regarded as totally private opinions, and nothing else. bengt@softwell.se ``His great strength is that he is uncompromising. It would make him physically ill to think of programming in C++.'' From sam-fans-owner Thu Jan 28 11:40:18 1999 Received: from aubrey.stanford.edu ([36.48.0.102]) by hawkwind.utcs.utoronto.ca with SMTP id <24660>; Thu, 28 Jan 1999 11:09:28 -0500 Received: (qmail 21358 invoked from network); 27 Jan 1999 22:24:31 -0000 Received: from localhost.stanford.edu (HELO aubrey.stanford.edu) (jimr@127.0.0.1) by localhost.stanford.edu with SMTP; 27 Jan 1999 22:24:31 -0000 X-url: http://highwire.stanford.edu/~jimr/ X-face: "!ZH^<"U,NeU:732A To: Aharon Robbins cc: sam-fans@hawkwind.utcs.toronto.edu Dcc: Subject: Re: 9term under Linux? In-reply-to: Message from Aharon Robbins of "Tue, 26 Jan 1999 10:35:45 EST."References: <199901261543.KAA20063@dilbert.mathcs.emory.edu> <199901261543.KAA20063@dilbert.mathcs.emory.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <21346.917475870.1@aubrey.stanford.edu> Date: Wed, 27 Jan 1999 17:24:31 -0500 Sender: jimr@aubrey.stanford.edu Message-Id: <99Jan28.110928est.24660@hawkwind.utcs.utoronto.ca> > I know this has come up before, but I don't remember the answers... > Has anyone got patches to 9term 1.6.6 for Linux? I have it built, but > hold mode isn't working. And with the latest rc as the shell, > input characters are not echoed. > > I'm using Redhat 5.2, if that matters. Yes, I have it working. As I recall, I had to nab a patch off the net. A quick search gave this: http://cm.bell-labs.com/who/rsc/linux/9term.patch which I think is what I used. I've got 9term, 9wm, 9menu, wily, sam, and rc working on my system. I really love the interface! =) Jim From sam-fans-owner Thu Jan 28 11:41:21 1999 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.utoronto.ca with SMTP id <24919>; Thu, 28 Jan 1999 11:18:40 -0500 Received: from trillian.softwell.se (trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.8.5/8.8.5) with ESMTP id NAA14462; Thu, 28 Jan 1999 13:28:31 +0100 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id NAA32236; Thu, 28 Jan 1999 13:28:30 +0100 Date: Thu, 28 Jan 1999 07:28:30 -0500 From: Bengt Kleberg Message-Id: <199901281228.NAA32236@trillian.softwell.se> To: arnold@gnu.org, sam-fans@hawkwind.utcs.toronto.edu Subject: Re: 9term under Linux? > Has anyone got patches to 9term 1.6.6 for Linux? I have recreated my 9term with working hold mode and echoed input characters in rc. I have a patch (created with diff -Naur as per recommendation). _However_, there is a catch. I build 9term against 9libs, by Mark Wilkinson Ok? Anybody still wants the patch? Best Wishes, Bengt =============================================================== Everything aforementioned should be regarded as totally private opinions, and nothing else. bengt@softwell.se ``His great strength is that he is uncompromising. It would make him physically ill to think of programming in C++.'' From sam-fans-owner Thu Jan 28 16:53:12 1999 Received: from aubrey.stanford.edu ([36.48.0.102]) by hawkwind.utcs.utoronto.ca with SMTP id <24700>; Thu, 28 Jan 1999 12:27:41 -0500 Received: (qmail 24925 invoked from network); 28 Jan 1999 16:55:17 -0000 Received: from localhost.stanford.edu (HELO aubrey.stanford.edu) (jimr@127.0.0.1) by localhost.stanford.edu with SMTP; 28 Jan 1999 16:55:17 -0000 X-url: http://highwire.stanford.edu/~jimr/ X-face: "!ZH^<"U,NeU:732A To: Aharon Robbins cc: sam-fans@hawkwind.utcs.toronto.edu Dcc: Subject: Re: more on my 9term In-reply-to: Message from Aharon Robbins of "Thu, 28 Jan 1999 08:02:48 EST."References: <199901281334.IAA19617@dilbert.mathcs.emory.edu> <199901281334.IAA19617@dilbert.mathcs.emory.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <24917.917542517.1@aubrey.stanford.edu> Date: Thu, 28 Jan 1999 11:55:17 -0500 Sender: jimr@aubrey.stanford.edu Message-Id: <99Jan28.122741est.24700@hawkwind.utcs.utoronto.ca> > Hmmm. Control-c for interrupt doesn't work on the 9term I just built.... > Maybe Bengt's version is better? The default "intr" key for the 9term is Del. What I have in my .rcrc to deal with that is: if (~ `{tty} /dev/ttyp* && ~ $TERM 9term) { stty erase '^H' > /dev/null >[2=1] stty intr '^?' > /dev/null >[2=1] } else { if ( ! ~ $TERM ()) { stty sane > /dev/null >[2=1] } } From sam-fans-owner Thu Jan 28 16:54:09 1999 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.utoronto.ca with SMTP id <24694>; Thu, 28 Jan 1999 12:24:45 -0500 Received: from trillian.softwell.se (trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.8.5/8.8.5) with ESMTP id RAA15204; Thu, 28 Jan 1999 17:42:04 +0100 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id RAA18319; Thu, 28 Jan 1999 17:42:03 +0100 Date: Thu, 28 Jan 1999 11:42:03 -0500 From: Bengt Kleberg Message-Id: <199901281642.RAA18319@trillian.softwell.se> To: arnold@gnu.org, sam-fans@hawkwind.utcs.toronto.edu Subject: Re: more on my 9term > I tried to build 9term 1.6.3 with the research!rsc patch file, and it is still > much worse than the patched 1.6.6. AFAIK there where no patches applied to my 9term (before I added some for linux). From sam-fans-owner Tue Feb 2 15:43:55 1999 Received: from repop2.jps.net ([209.63.224.239]) by hawkwind.utcs.utoronto.ca with SMTP id <24748>; Tue, 2 Feb 1999 15:38:44 -0500 Received: from 6625hvt3r227 (209-239-194-114.oak.jps.net [209.239.194.114]) by repop2.jps.net (8.9.0/8.8.5) with ESMTP id QAA13600; Mon, 1 Feb 1999 16:26:40 -0800 (PST) Message-Id: <199902020026.QAA13600@repop2.jps.net> From: "Chaotrope" To: , "Aharon Robbins" Cc: Subject: Re: 9term under Linux? Date: Mon, 1 Feb 1999 19:25:45 -0500 X-MSMail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1155 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 99.01.27 > James A. Robinson replied to > Aharon Robbins > Cc: sam-fans@hawkwind.utcs.toronto.edu on the > Subject: Re: 9term under Linux? saying > I've got 9term, 9wm, 9menu, wily, sam, and rc working on my > system. I really love the interface! =) > > Jim This plan9 interface that Jim has is exactly what started me a few months back investigating getting a Linux system even tho I swore a number of years ago that I'd no longer spend my own money on computer stuff (I've got two closets full of junk already!). I read some articles of Aharon's (Arnold's) in 1995 "Linux Journal" and had the old R. Pike 'sam' article, and have been 'window shopping' (where in this case 'window' has nothing to do with Microsoft) with the intent of maybe putting together some no name x86 system. So when I read here that Arnold has difficulties, I think, Maybe I'm over my head, if *HE* has problems, what am I going to run into?! Thus far, Debian is the only Linux dist that has p9 emu binaries at its ftp site (Red Hat has 'sam' only). The NeBSD/FreeBSD people even have a 'plan9' directory at their ftp sites, just like an 'editors' and a 'TeX' directory. So I'm leaning toward BSD rather than Linux just because that indicates to me that these people are "thinking" along those lines. So my question is, e.g., Jim, what are you using? Is there a general consensus on ease of installation, whatever, getting this p9 'look and feel grafted on top of what version of Unix? Are there known problems with (obviously) RedHat vs. whatever? TIA, - kim BTW, Aharon/Arnold: I enjoyed your LJ articles enough that I'm planning to get your AWK book just because I assume it will be well written also. From sam-fans-owner Tue Feb 2 15:46:03 1999 Received: from post.mail.demon.net ([194.217.242.38]) by hawkwind.utcs.utoronto.ca with SMTP id <24842>; Tue, 2 Feb 1999 15:40:15 -0500 Received: from [212.228.106.206] (helo=kremvax.demon.co.uk) by post.mail.demon.net with esmtp (Exim 2.11 #1) id 107lKi-0005xc-00; Tue, 2 Feb 1999 19:18:02 +0000 Received: (from mhw@localhost) by kremvax.demon.co.uk (8.8.7/8.8.7) id TAA06797; Tue, 2 Feb 1999 19:17:57 GMT To: Bengt Kleberg , arnold@gnu.org, sam-fans@hawkwind.utcs.toronto.edu Subject: Re: 9term under Linux? From: "Mark H. Wilkinson" Date: Tue, 2 Feb 1999 14:11:51 -0500 In-Reply-To: <199901281228.NAA32236@trillian.softwell.se> Message-ID: <199902021911.6770.sam.bagiv@kremvax.demon.co.uk> X-Face: Bsp[Ds(Y#/{==j:Cv'"IK4R^D0_z]{'OYtp2^EYqpG)88CsdBm&LJ{idLZWx}AKf}E4#|@4DT4cX3 ?!>aIVcxmd#1 X-PGP-Fingerprint: 8E 43 1E D7 85 42 E0 C5 D3 8C B6 B1 EE 06 95 64 > > Has anyone got patches to 9term 1.6.6 for Linux? > I have recreated my 9term with working hold mode and echoed input characters > in rc. > I have a patch (created with diff -Naur as per recommendation). > _However_, there is a catch. I build 9term against 9libs, by Mark Wilkinson > > Ok? Anybody still wants the patch? Me :-) Bit of clarification here: 9libs is basically libXg and libframe with an autoconf/automake/libtool build system. We (Bengt and I) have versions of sam and wily which have compatible build systems. You can build the whole source tree with the usual `configure;make;make install,' even on Linux. 9term will come next... I think that we're close to releasing what we have. More soon. -Mark. From sam-fans-owner Tue Feb 2 15:47:08 1999 Received: from cssun.mathcs.emory.edu ([170.140.150.1]) by hawkwind.utcs.utoronto.ca with SMTP id <24797>; Tue, 2 Feb 1999 15:39:42 -0500 Received: from dilbert.mathcs.emory.edu (dilbert [170.140.150.6]) by cssun.mathcs.emory.edu (8.9.1b+Sun/8.9.1) with ESMTP id HAA21121; Tue, 2 Feb 1999 07:27:21 -0500 (EST) Received: from gold2.gezernet.co.il (gold2.gezernet.co.il [192.115.7.75]) by dilbert.mathcs.emory.edu (8.9.1b+Sun/8.9.1) with SMTP id HAA12648; Tue, 2 Feb 1999 07:26:56 -0500 (EST) Message-Id: <199902021226.HAA12648@dilbert.mathcs.emory.edu> From: Aharon Robbins Date: Tue, 2 Feb 1999 01:49:04 -0500 To: chaotrope@jps.net Subject: Re: 9term under Linux? Cc: sam-fans@hawkwind.utcs.toronto.edu > I read some articles of Aharon's (Arnold's) in 1995 "Linux Journal" > and had the old R. Pike 'sam' article, and have been 'window shopping' > (where in this case 'window' has nothing to do with Microsoft) with > the intent of maybe putting together some no name x86 system. > > So when I read here that Arnold has difficulties, I think, Maybe I'm > over my head, if *HE* has problems, what am I going to run into?! Don't be discouraged. The patches I posted to sam-fans for 9term do the trick. My problem with interrupts were 1) I forgot that 9term uses DEL, not ^C, and 2) I was running es-0.84 in the 9term, not rc. I will be switching to rc. > So my question is, e.g., Jim, what are you using? Is there a general > consensus on ease of installation, whatever, getting this p9 'look and > feel grafted on top of what version of Unix? Are there known problems > with (obviously) RedHat vs. whatever? I sent bobf Make.linux files and diffs to u.h for linux so that will be in the sam distribution soon. (Patches available on request, but they're pretty easy to do on your own.) The patches I sent for 9term 1.6.6 seem to do the trick. I am now happily running the 9wm/9term/9menu/sam/rc combination. After 1.5 years without X, it's like having an old friend back. :-) To answer your question, for my money, stick w/Linux. (No, I don't want to start a religious war. To each his own, etc.) > BTW, Aharon/Arnold: I enjoyed your LJ articles enough that I'm > planning to get your AWK book just because I assume it will be well > written also. Thanks. *I* think it's pretty good, but I'm sorta biased. OTOH, I have yet to have anyone tell me it sucked... :-) Arnold -- Aharon (a.k.a. Arnold) Robbins arnold@gnu.org P.O. Box 354 Home Phone: +972 8 979-0381 Nof Ayalon Cell Phone: +972 51 297-545 D.N. Shimshon 99784 Laundry increases exponentially in the ISRAEL number of children. -- Miriam Robbins From sam-fans-owner Tue Feb 2 15:47:31 1999 Received: from aubrey.stanford.edu ([36.48.0.102]) by hawkwind.utcs.utoronto.ca with SMTP id <24753>; Tue, 2 Feb 1999 15:39:20 -0500 Received: (qmail 30503 invoked from network); 2 Feb 1999 02:01:28 -0000 Received: from localhost.stanford.edu (HELO aubrey.stanford.edu) (jimr@127.0.0.1) by localhost.stanford.edu with SMTP; 2 Feb 1999 02:01:28 -0000 X-url: http://highwire.stanford.edu/~jimr/ X-face: "!ZH^<"U,NeU:732A To: "Chaotrope" cc: sam-fans@hawkwind.utcs.toronto.edu Dcc: Subject: Re: 9term under Linux? In-reply-to: Message from "Chaotrope" of "Mon, 01 Feb 1999 16:25:45 PST."References: <199902020026.QAA13600@repop2.jps.net> <199902020026.QAA13600@repop2.jps.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <30490.917920887.1@aubrey.stanford.edu> Date: Mon, 1 Feb 1999 21:01:28 -0500 Sender: jimr@aubrey.stanford.edu Message-Id: <99Feb2.153920est.24753@hawkwind.utcs.utoronto.ca> > 'editors' and a 'TeX' directory. So I'm leaning toward BSD rather > than Linux just because that indicates to me that these people are > "thinking" along those lines. > > So my question is, e.g., Jim, what are you using? Is there a general > consensus on ease of installation, whatever, getting this p9 'look and > feel grafted on top of what version of Unix? Are there known problems > with (obviously) RedHat vs. whatever? Hi, I'm using a heavily modified, stripped down, and generally munged version of RedHat 5.0 here at work. At home I'm running a customized Slackware 3.0 setup. I've got a /usr/local/src/plan9 tree on the home machine which has the source for 9menu 1.4, 9wm 1.2, es 0.90beta1, sam 4.3, 9term 1.6.6, rc 1.5b2, and wily 0.13.41. I've fiddled with the various make files and source so that they all compile without any problem on my box. As I recall, 9term is the hardest to compile. 9wm, 9menu, the editors, and the shells compiled without any trouble. 9term now compiles, but it does tend to give off quite a few "seems to be harmless" errors. Oh yeah, all the little tools that wily comes with were a pain in the ass to compile. But I got win, and tools/shell/* to compile. So, if people want to download entire 1.0 meg binaries and 2.9 meg source tree, grab it from http://highwire.stanford.edu/~jimr/plan9/plan9.bin.tar.gz http://highwire.stanford.edu/~jimr/plan9/plan9.src.tar.gz The only thing missing from the tars are the Xg unicode fonts. It doesn't have a clear distribution-rights copyright statement, so I can't bundle it in the archive. I'm not even sure where I got them from originally, so you'll have to hunt them up. =( If you unarchive both from your root, they will go into /opt/plan9/^(bin doc lib man) for the binaries, and /usr/local/src/plan9/^(9menu-1.4 9term-1.6.6 9wm-1.2 es-0.90beta1 rc-1.5b2 sam-4.3 wily-0.13.41) for the source. Jim From sam-fans-owner Tue Feb 2 15:52:19 1999 Received: from localhost by hawkwind.utcs.utoronto.ca with SMTP id <24855>; Tue, 2 Feb 1999 15:41:42 -0500 To: sam-fans Subject: Re: 9term under Linux? Date: Tue, 2 Feb 1999 15:41:27 -0500 From: Chris Siebenmann Message-Id: <99Feb2.154142est.24855@hawkwind.utcs.utoronto.ca> | So my question is, e.g., Jim, what are you using? Is there a general | consensus on ease of installation, whatever, getting this p9 'look and | feel grafted on top of what version of Unix? Are there known problems | with (obviously) RedHat vs. whatever? I find that my version of 9term (it started out at 1.6.6 and grew) is about equally easy to bring up on anything. The fiddling required is usually to set up the V_* defines, almost always to not use TCSADRAIN, and some functions that are prototyped in standard header files in ways that clash with u.h et al. I have similar results for sam and rc (generally). They're all Unix. They all work. - cks, who's lost count of how many Unixes he's made 9term run on From sam-fans-owner Wed Feb 3 20:32:13 1999 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.utoronto.ca with SMTP id <24837>; Wed, 3 Feb 1999 20:28:36 -0500 Received: from trillian.softwell.se (trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.8.5/8.8.5) with ESMTP id IAA03765; Wed, 3 Feb 1999 08:19:47 +0100 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id IAA13132; Wed, 3 Feb 1999 08:19:46 +0100 Date: Wed, 3 Feb 1999 02:19:46 -0500 From: Bengt Kleberg Message-Id: <199902030719.IAA13132@trillian.softwell.se> To: cks@hawkwind.utcs.toronto.edu, sam-fans@hawkwind.utcs.toronto.edu Subject: Re: 9term under Linux? > - cks, who's lost count of how many Unixes he's made 9term run on BSD too? My 9term for BSD does not work properly (unexplainable freezes at times). May I look at your 9term, please? Best Wishes, Bengt =============================================================== Everything aforementioned should be regarded as totally private opinions, and nothing else. bengt@softwell.se ``His great strength is that he is uncompromising. It would make him physically ill to think of programming in C++.'' From sam-fans-owner Mon Feb 8 19:56:19 1999 Received: from post.mail.demon.net ([194.217.242.38]) by hawkwind.utcs.utoronto.ca with SMTP id <25055>; Mon, 8 Feb 1999 18:55:57 -0500 Received: from [212.228.106.206] (helo=kremvax.demon.co.uk) by post.mail.demon.net with esmtp (Exim 2.11 #1) id 108s3Q-0004gd-00; Fri, 5 Feb 1999 20:40:44 +0000 Received: (from mhw@localhost) by kremvax.demon.co.uk (8.8.7/8.8.7) id UAA01299; Fri, 5 Feb 1999 20:39:34 GMT To: wilyfans@jli.com, sam-fans@hawkwind.utcs.toronto.edu Subject: 9libs-0.3, wily, sam test distributions From: "Mark H. Wilkinson" Date: Fri, 5 Feb 1999 15:04:45 -0500 Message-ID: <199902052004.1048.9libs.babul@kremvax.demon.co.uk> X-Face: Bsp[Ds(Y#/{==j:Cv'"IK4R^D0_z]{'OYtp2^EYqpG)88CsdBm&LJ{idLZWx}AKf}E4#|@4DT4cX3 ?!>aIVcxmd#1 X-PGP-Fingerprint: 8E 43 1E D7 85 42 E0 C5 D3 8C B6 B1 EE 06 95 64 We (myself and Bengt Kleberg) have been doing some work on adding a more modern build system to the Plan 9 tools which are available. The result is a distribution called 9libs which includes the graphics library libXg, the text frame library libframe and a fledgling accumulation of other Plan 9 work-a-like functions called libplan9c. I've also reworked the build system for wily to work with 9libs, and Bengt Kleberg has done the same for sam. The overall aim of the 9libs distribution is to allow libXg and libframe to be distributed separately from the programs which rely on it, and hopefully to make it easier to build a number of different programs which all use libXg and libframe. We also aim to bring the build system up to date with modern Unix systems so that it will build out of the box on more systems. Given that many people use more than one out of sam, wily, 9term, 9wm and so on, this should make building the basic tools of your windowing environment simpler. We're making a test distribution available to try and thrash out any remaining portability problems on machine types we haven't been able to lay our hands on. If all goes well we intend to do a 9libs-1.0 release pretty soon. The distributions are available from the following URLs: ftp://ftp.cs.york.ac.uk/pub/mhw/experimental/9libs-0.3.tar.gz ftp://ftp.cs.york.ac.uk/pub/mhw/experimental/sam-9libs.tar.gz ftp://ftp.cs.york.ac.uk/pub/mhw/experimental/wily-9libs.tar.gz Instructions for building are included in the distribution. If you can't follow them, let me know how they could be improved. If the build system doesn't work for you, submit a bug report to me and I'll see what can be done. I'm on holiday for the next two weeks so you might not get a reply straight away, but I'll look into any problems reported. To get you interested, here's a brief installation synopsis: ; gzcat 9libs-0.3.tar.gz | tar xf - ; cd 9libs-0.3 ; gzcat ../sam-9libs.tar.gz | tar xf - ; gzcat ../wily-9libs.tar.gz | tar xf - ; ./configure ; make ; make install That will compile and install the libraries, sam and wily. Good things: * You can build shared libraries without much trouble. * You can build binaries for multiple architectures from the same source tree without much trouble. * You will be able to build 9term and co with no extra effort someday soon. * wily gains a more complete implementation of the Font builtin which lets you use any font (X or libXg font file) you have on your system. The p9fixed resource is gone; use -F instead like you would with acme. Current problems, off the top of my head: * There's a problem linking the sam executable against shared libraries: the build system tries to link it with libXg, libframe and libplan9c when only libplan9c is necessary. libXg and libframe contain undefined symbols, so the link fails. You can workaround it by editing sam-9libs/sam/Makefile and removing libXg and libframe from the LIBS variable. * The implementation of the Plan 9 print() routines in libplan9c is incomplete (it doesn't cover floating point). I'm intending to finish it soon. It does include string formatting, so you can write Unicode aware command line programs and see their output in 9term. * The build system contains more lines of text than the source code that makes up the libraries. Largely a side effect of using autoconf, automake and libtool, I'm afraid. Just think of the bonuses which it gets you. Enjoy, -Mark. From sam-fans-owner Mon Feb 8 20:15:35 1999 Received: from repop1.jps.net ([209.63.224.238]) by hawkwind.utcs.utoronto.ca with SMTP id <25030>; Mon, 8 Feb 1999 18:54:50 -0500 Received: from 6625hvt3r227 (209-239-201-189.oak.jps.net [209.239.201.189]) by repop1.jps.net (8.8.5/8.8.5) with ESMTP id JAA22064; Fri, 5 Feb 1999 09:51:48 -0800 (PST) Message-Id: <199902051751.JAA22064@repop1.jps.net> From: "Chaotrope" To: "wilyfans" , "samfans" Subject: History Is Just Old Stuff Date: Fri, 5 Feb 1999 12:52:25 -0500 X-MSMail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1155 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit While cleaning out useless outdated computer junk from my closets, so I can have space to store more useless outdated computer junk in the closets, in order to have room in my "living" space for the Linux system I'm aiming to get because it will include: sam, wily, rc/es, 9term, 9menu, & 9wm which are all going to work together with no problems, with absolutely no problems. . . Anyhow, while cleaning I came across this old article I'd saved (along with a 300 baud modem and some other really useful items!), an interview with Bill Joy from the August 1984 issue of 'Unix Review'. I was surprised at how much of what was mentioned during the course of the interview is still applicable today, they even touched on sam and acme/wily! First question of course was, "How did vi come about?" Joy told how he had come to Berkeley in 1975 and they were first hacking on 'ed' and then someone brought 'em' ('editor for mortals') which they combined into 'en' and eventually 'ex'. When they got the first glass terminals (1976) they were just playing with them, nothing planned, kids showing off: 'I can clear the screen and home the cursor,' that kind of accrued into "features" that eventually became vi. He says a Mike Horton came from Bell Labs around that time with 'hed' (Horton's editor) but it arrived too late and vi already had a sizeable following. Joy talks about getting a manual page and stealing ideas from (this is a direct quote): "the Toronto version of ed, which I think Rob Pike had something to do with." And he mentions "looking forward to the editor Warren Teitelman is working on. Having editing functionally everywhere..." Teitelman's work became the Cedar system that Wirth saw and developed into the Oberon interface, which Pike saw that influenced Acme, and so on, and so on. Joy even presages 'sam' somewhat, saying he'd toyed with writing an editor for bitmap and mouse that had "almost no commands, (just a) Smalltalk editing menu, a scroll bar and a thumb bar." Why? asks the interviewer. Joy answers: "Since I sort of invented the editor that was the most complicated, I thought I would compensate by also designing the editor that was the most simple." But then Berkeley got that VAX and Bill became busy doing other things. Still, before the article ends they do get in the old, "Real programmers use cat as their editor." Some things never change. - kim From sam-fans-owner Mon Feb 8 20:40:11 1999 Received: from bio.cse.psu.edu ([130.203.12.17]) by hawkwind.utcs.utoronto.ca with SMTP id <24694>; Mon, 8 Feb 1999 20:38:32 -0500 Received: (qmail 29432 invoked by uid 991); 9 Feb 1999 00:41:49 -0000 Message-ID: <19990209004149.29431.qmail@g.bio.cse.psu.edu> Date: Mon, 8 Feb 1999 19:41:49 -0500 To: "Mark H. Wilkinson" cc: wilyfans@jli.com, sam-fans@hawkwind.utcs.toronto.edu Subject: Re: 9libs-0.3, wily, sam test distributions In-reply-to: Your message of "Fri, 05 Feb 1999 15:04:45 EST." <199902052004.1048.9libs.babul@kremvax.demon.co.uk> Date: Mon, 8 Feb 1999 19:41:49 -0500 From: Scott Schwartz "Mark H. Wilkinson" writes: | * The implementation of the Plan 9 print() routines in libplan9c is | incomplete (it doesn't cover floating point). I'm intending to finish | it soon. It does include string formatting, so you can write Unicode | aware command line programs and see their output in 9term. The version of print that I submitted to comp.sources.unix a while ago is fairly complete. With a little help from David Gay's fp code from netlib, it prints floating point very nicely. From sam-fans-owner Tue Mar 23 16:52:14 1999 Received: from blackusi03.belrose.visionet.com.au ([210.0.31.9]) by hawkwind.utcs.utoronto.ca with SMTP id <24733>; Tue, 23 Mar 1999 16:46:38 -0500 Received: from ishtek.com ([210.0.3.138]) by blackusi03.belrose.visionet.com.au (Netscape Mail Server v2.01) with SMTP id AAA13776 for ; Tue, 23 Mar 1999 23:15:26 +1100 X-Mailer: Ishtek MeeMail 2.1 Date: Tue, 23 Mar 1999 07:13:14 -0500 From: Alex Danilo Subject: sam on Solaris To: sam-fans@hawkwind.utcs.toronto.edu X-Face: 3}u>)koHh${W+XV18fV{i/@Sw_Cvi'3hS04kL'J-3Qoz{?D R>c6<6{LbeD5'D9+C\lUPtNBF=h=yrnT,zMx$o3YbL/p;|UGb}@0^{Tr7ppFE_sk;'p[W9,gpJ$`N2 Sp?E#o2R Message-Id: <99Mar23.164638est.24733@hawkwind.utcs.utoronto.ca> Hi, Has anyone had success running Sam on Solaris. I know there are Make.solaris files, and yes, the out of the box distribution compiles fine. But, when you run it, it locks up the X-server. Note, that I've built the 'test' program in libXg, which runs fine, but sam barfs the moment you try to use the menus. All help appreciated. Alex P.S. Seems to lock up when processing the next X event. -- Alex Danilo http://www.ishtek.com/alex PO Box 333 Forestville NSW 2087 +61-2-9975-2297 From sam-fans-owner Fri Mar 26 16:18:19 1999 Received: from finch-post-12.mail.demon.net ([194.217.242.41]) by hawkwind.utcs.utoronto.ca with SMTP id <24797>; Fri, 26 Mar 1999 15:41:28 -0500 Received: from [212.228.106.206] (helo=kremvax.demon.co.uk) by finch-post-12.mail.demon.net with esmtp (Exim 2.12 #1) id 10QKlZ-000Fof-0C; Fri, 26 Mar 1999 00:46:29 +0000 Received: (from mhw@localhost) by kremvax.demon.co.uk (8.8.7/8.8.7) id AAA04805; Fri, 26 Mar 1999 00:46:28 GMT To: Alex Danilo , sam-fans@hawkwind.utcs.toronto.edu Subject: Re: sam on Solaris From: "Mark H. Wilkinson" Date: Thu, 25 Mar 1999 18:57:36 -0500 In-Reply-To: <99Mar23.164638est.24733@hawkwind.utcs.utoronto.ca> Message-ID: <199903252357.4232.sam.bagon@kremvax.demon.co.uk> X-Face: Bsp[Ds(Y#/{==j:Cv'"IK4R^D0_z]{'OYtp2^EYqpG)88CsdBm&LJ{idLZWx}AKf}E4#|@4DT4cX3 ?!>aIVcxmd#1 X-PGP-Fingerprint: 8E 43 1E D7 85 42 E0 C5 D3 8C B6 B1 EE 06 95 64 > Hi, > Has anyone had success running Sam on Solaris. I know there are > Make.solaris files, and yes, the out of the box distribution compiles fine. > But, when you run it, it locks up the X-server. > Note, that I've built the 'test' program in libXg, which runs fine, > but sam barfs the moment you try to use the menus. All help appreciated. Just a guess, but are you running on a 15bpp X server? libXg only supports screens whose depth is a power of 2. Popping up a menu trys to create a bitmap with depth 16 to store part of the screen bitmap; the X server faults the request, causing sam to bomb out. -Mark. From sam-fans-owner Wed Jun 2 19:08:30 1999 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <25041>; Wed, 2 Jun 1999 18:53:05 -0400 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 2.12 #1) id 10pCMU-0004TO-00 for sam-fans@hawkwind.utcs.toronto.edu; Wed, 2 Jun 1999 15:51:22 +0100 Received: (qmail 17260 invoked from network); 2 Jun 1999 14:51:43 -0000 Received: from ltpcg.star.le.ac.uk (tjg@143.210.36.203) by happy.star.le.ac.uk with SMTP; 2 Jun 1999 14:51:43 -0000 To: wilyfans@jli.com, 9fans-request@cse.psu.edu, sam-fans@hawkwind.utcs.toronto.edu Subject: Release of rc-1.6 Date: Wed, 2 Jun 1999 10:51:42 -0400 From: Tim Goodwin Message-ID: I've just made a new full release of the rc shell, rc-1.6. For furhter information, please see my rc web page. http://www.star.le.ac.uk/~tjg/rc/ Apologies to those who've already seen the announcement elsewhere... Tim. From sam-fans-owner Sun Jun 13 21:15:42 1999 Received: from finch-post-10.mail.demon.net ([194.217.242.38]) by hawkwind.utcs.utoronto.ca with SMTP id <24836>; Sun, 13 Jun 1999 20:42:32 -0400 Received: from kremvax.demon.co.uk ([212.228.106.206]) by finch-post-10.mail.demon.net with esmtp (Exim 2.12 #1) id 10sF83-0006U3-0A; Fri, 11 Jun 1999 00:25:04 +0000 Received: (from mhw@localhost) by kremvax.demon.co.uk (8.8.7/8.8.7) id BAA25160; Fri, 11 Jun 1999 01:23:05 +0100 To: Sam Fans , 9fans@cse.psu.edu, wilyfans@jli.com Subject: 9libs, new sam release, experimental wily release From: "Mark H. Wilkinson" Date: Thu, 10 Jun 1999 19:04:28 -0400 Message-ID: <199905110004.4944.9libs.badoj@kremvax.demon.co.uk> X-Face: Bsp[Ds(Y#/{==j:Cv'"IK4R^D0_z]{'OYtp2^EYqpG)88CsdBm&LJ{idLZWx}AKf}E4#|@4DT4cX3 ?!>aIVcxmd#1 X-PGP-Fingerprint: 8E 43 1E D7 85 42 E0 C5 D3 8C B6 B1 EE 06 95 64 We would like to announce the release of the following bundles of code: * 9libs-1.0, a collection of libraries which emulate some parts of the Plan 9 programming environment under Unix and the X Window System. * sam-9libs, a new release of Rob Pike's editor, sam, which uses 9libs-1.0. * wily-9libs, an experimental release of Gary Capell's editor, wily, which emulates the functionality of Rob's editor "acme" from Plan 9. Again, wily-9libs uses 9libs. 9libs-1.0 is a repackaging of libXg, libframe and libregexp from the last release of sam. It replaces the collection of Makefiles with a build system which uses a GNU-style configure script and which will build shared libraries using GNU libtool. The intention is to make it easier to compile and install the libraries (and applications which use them) on modern Unix systems. It also adds some new implementations of Plan 9 functions (notably the print() functions) which have been grouped with libregexp into a new library called libplan9c. sam-9libs is a new release of sam which links against the libraries from 9libs-1.0. Other than changes in the build system there is only one new feature: sam uses the value of the environment variable TABSTOP to set the size of its tabstop. It is intended that this release of sam become the "official" release: the version of samterm which Bell Labs run on brazil uses a newer graphics model than that provided by libg (and libXg). As such it is growing increasingly difficult for them to support this older version. wily-9libs is an experimental (as in "not official") release of wily-0.13.43 which has been modified to build against 9libs. It also adds an implementation of the Font builtin which more closely emulates the same builtin in acme. You can get the code from the following locations: ftp://netlib.bell-labs.com/netlib/research/9libs ftp://ftp.demon.co.uk/pub/unix/plan9 Why would you want to use this? Basically, it makes your life easier. You can compile and install 9libs, sam and wily separately if you want. You can also build the whole lot together: it's as simple as this: ; gunzip -c 9libs-1.0.tar.gz | tar xf - ; cd 9libs-1.0 ; gunzip -c ../sam-9libs.tar.gz | tar xf - ; gunzip -c ../wily-9libs.tar.gz | tar xf - ; ./configure ; make The build system also supports building for multiple architectures from one directory tree. Enjoy! Mark Wilkinson Bengt Kleberg From sam-fans-owner Tue Jun 15 19:27:00 1999 Received: from bio.cse.psu.edu ([130.203.12.17]) by hawkwind.utcs.utoronto.ca with SMTP id <25108>; Tue, 15 Jun 1999 17:58:47 -0400 Received: (qmail 8334 invoked by uid 991); 15 Jun 1999 00:39:48 -0000 Message-ID: <19990615003948.8333.qmail@g.bio.cse.psu.edu> Date: Mon, 14 Jun 1999 20:39:48 -0400 To: "Mark H. Wilkinson" cc: Sam Fans , Bengt Kleberg Subject: Re: 9libs, new sam release, experimental wily release In-reply-to: Your message of "Mon, 14 Jun 1999 20:46:50 BST." <199906142046.20514.9libs.badum@kremvax.demon.co.uk> Date: Mon, 14 Jun 1999 20:39:48 -0400 From: Scott Schwartz "Mark H. Wilkinson" writes: | It looks like your patches hadn't made it into the Bell Labs source, | although I do remember some of them being posted to sam-fans. If you | forward them to Bengt and myself we'll get them integrated. Here they are. (Hopefully I haven't introduced any new problems today; I did tweak some things.) The program I use in my xinitrc to load the font property looks like this: #!/bin/rc F=``(){sed -e 's/$/ \\n\\/'} { echo -n '*p9font: ' echo $F echo -n '*p9fixed: ' echo $F } | xrdb -merge I use it like: load9font <$home/lib/unicode.9.font Wily users might want to do this slightly differently, since that requires a proportional font for one case. cd ./libXg =================================================================== RCS file: rdfontfile.c,v retrieving revision 1.1 diff -c -r1.1 rdfontfile.c *** /tmp/T0s0Qol_ Mon Jun 14 20:25:00 1999 --- rdfontfile.c Mon Jun 14 18:06:11 1999 *************** *** 13,27 **** return s; } ! Font * ! rdfontfile(char *name, int ldepth) { ! Font *fnt; ! Cachesubf *c; ! int fd, i; ! char *buf, *s, *t; struct stat sbuf; ! unsigned long min, max; fd = open(name, O_RDONLY); if (fd < 0) --- 13,25 ---- return s; } ! char * ! file2string(char* name) { ! int fd; struct stat sbuf; ! char *buf; ! int i; fd = open(name, O_RDONLY); if (fd < 0) *************** *** 44,54 **** free(buf); return 0; } ! s = buf; fnt = (Font *)malloc(sizeof(Font)); ! if (fnt == 0) ! goto Err1; memset((void*)fnt, 0, sizeof(Font)); fnt->name = (char *)malloc(strlen(name)+1); if (fnt->name==0) --- 42,73 ---- free(buf); return 0; } + return buf; + } ! Font * ! rdfontfile(char *name, int ldepth) ! { ! return rdfontstring(name, file2string(name), ldepth); ! } ! ! Font* ! rdfontstring(char *name, char *s, int ldepth) ! { ! Font *fnt; ! Cachesubf *c; ! int i; ! char *t; ! struct stat sbuf; ! unsigned long min, max; ! ! if (s == 0) ! return 0; fnt = (Font *)malloc(sizeof(Font)); ! if (fnt == 0) { ! Err1: ! return 0; ! } memset((void*)fnt, 0, sizeof(Font)); fnt->name = (char *)malloc(strlen(name)+1); if (fnt->name==0) *************** *** 97,117 **** c->min = min; c->max = max; t = s; ! while (*s && *s!='\n' && *s!='\t') s++; ! *s++ = 0; c->f = (Subfont *)0; ! c->name = (char *)malloc(strlen(t)+1); if (c->name == 0) { free(c); goto Err3; } ! strcpy(c->name, t); s = skip(s); fnt->nsubf++; } while(*s); - free(buf); return fnt; } --- 116,139 ---- c->min = min; c->max = max; t = s; ! while (*s && *s!='\n' && *s!='\t' && *s!=' ') s++; ! /* *s++ = 0; */ c->f = (Subfont *)0; ! c->name = (char *)malloc(s-t+1); if (c->name == 0) { free(c); goto Err3; } ! { int i; ! for (i = 0; i < s-t; ++i) c->name[i] = t[i]; ! c->name[i] = 0; ! } ! /* strcpy(c->name, t); */ s = skip(s); fnt->nsubf++; } while(*s); return fnt; } *************** *** 127,132 **** --- 149,155 ---- if (c->f) subffree(c->f); free(c->name); + free(c); } free(f->subf); free(f); =================================================================== RCS file: xtbinit.c,v retrieving revision 1.1 diff -c -r1.1 xtbinit.c *** /tmp/T0s0Qol_ Mon Jun 14 20:25:00 1999 --- xtbinit.c Mon Jun 14 17:24:10 1999 *************** *** 185,191 **** font = 0; subfont = 0; if (fontname) { ! font = rdfontfile(fontname, screen.ldepth); if (!font || charwidth(font, (Rune) ' ') == 0) { subfont = getsubfont(fontname); if (!subfont) --- 185,193 ---- font = 0; subfont = 0; if (fontname) { ! font = (fontname[0] == '.' || fontname[0] == '/') ! ? rdfontfile(fontname, screen.ldepth) ! : rdfontstring("p9font", fontname, screen.ldepth); if (!font || charwidth(font, (Rune) ' ') == 0) { subfont = getsubfont(fontname); if (!subfont) cd ./include =================================================================== RCS file: libg.h,v retrieving revision 1.1 diff -c -r1.1 libg.h *** /tmp/T0gdJVh_ Mon Jun 14 20:25:01 1999 --- libg.h Mon Jun 14 02:15:54 1999 *************** *** 201,206 **** --- 201,207 ---- extern int bitbltclip(void*); extern Subfont* getsubfont(char*); extern Font *rdfontfile(char*, int); + extern Font *rdfontstring(char*, char*, int); extern void ffree(Font*); extern Font *mkfont(Subfont*); extern void subffree(Subfont*); cd ./sam-9libs/sam =================================================================== RCS file: sam.c,v retrieving revision 1.1 diff -c -r1.1 sam.c *** /tmp/T002r2br Mon Jun 14 20:25:01 1999 --- sam.c Mon Jun 14 02:27:09 1999 *************** *** 151,157 **** continue; if(io == -1){ sprint(buf, "%s/sam.save", home); ! io = create(buf, 1, 0777); if(io<0) return; } --- 151,157 ---- continue; if(io == -1){ sprint(buf, "%s/sam.save", home); ! io = create(buf, 1, 0700); if(io<0) return; } =================================================================== RCS file: shell.c,v retrieving revision 1.1 diff -c -r1.1 shell.c *** /tmp/T002r2br Mon Jun 14 20:25:01 1999 --- shell.c Mon Jun 14 02:28:37 1999 *************** *** 34,40 **** remove(errfile); if((pid=fork()) == 0){ if(downloaded){ /* also put nasty fd's into errfile */ ! fd = create(errfile, 1, 0666L); if(fd < 0) fd = create("/dev/null", 1, 0666L); dup(fd, 2); --- 34,40 ---- remove(errfile); if((pid=fork()) == 0){ if(downloaded){ /* also put nasty fd's into errfile */ ! fd = create(errfile, 1, 0600L); if(fd < 0) fd = create("/dev/null", 1, 0666L); dup(fd, 2); cd ./sam-9libs/samterm =================================================================== RCS file: samterm.h,v retrieving revision 1.1 diff -c -r1.1 samterm.h *** /tmp/T00P2og_ Mon Jun 14 20:25:01 1999 --- samterm.h Mon Jun 14 17:51:13 1999 *************** *** 2,8 **** #define SAMTERM #define RUNESIZE sizeof(Rune) ! #define MAXFILES 256 #define NL 5 enum{ --- 2,8 ---- #define SAMTERM #define RUNESIZE sizeof(Rune) ! #define MAXFILES (4*1024) #define NL 5 enum{ From sam-fans-owner Tue Jun 15 19:36:29 1999 Received: from bio.cse.psu.edu ([130.203.12.17]) by hawkwind.utcs.utoronto.ca with SMTP id <25101>; Tue, 15 Jun 1999 17:58:37 -0400 Received: (qmail 7755 invoked by uid 991); 15 Jun 1999 00:10:04 -0000 Message-ID: <19990615001004.7754.qmail@g.bio.cse.psu.edu> Date: Mon, 14 Jun 1999 20:10:04 -0400 To: "Mark H. Wilkinson" cc: Sam Fans , Bengt Kleberg Subject: Re: 9libs, new sam release, experimental wily release In-reply-to: Your message of "Mon, 14 Jun 1999 20:46:50 BST." <199906142046.20514.9libs.badum@kremvax.demon.co.uk> Date: Mon, 14 Jun 1999 20:10:04 -0400 From: Scott Schwartz "Mark H. Wilkinson" writes: | > * In libXg, "fontfile" is specified by the X client app. In general | > that cannot work: unlike in Plan 9, the X terminal usually won't | > share any filesystem with the machine on which the X app is | > running, so *no* filename can be valid for "-p9font". The fix is | > to store the unicode font map in an X property which is set by your | > xinitrc. | | By this, do you mean the case where you're logging into remote machines | and running sam & samterm on the remote machine? Yes. | ... but I guess you're after a | solution which is easier to manage, using the X server as shared storage. Yup. | That sounds reasonable, but I'd like to retain the existing mechanism | too: it works well in networks where the file system is common to all | machines to some degree. Of course. The patch does that. It checks to see if the fontfile starts with '.' or '/', and if so, reads that file. Otherwise it treats it as the literal contents of the font file. In either case, as before, it falls back to using a literal X font name if the previous steps don't resolve to a font file. | That would be great! I'll have them ready soon. I got diverted hacking on 9term today. From sam-fans-owner Tue Jun 15 19:42:32 1999 Received: from finch-post-10.mail.demon.net ([194.217.242.38]) by hawkwind.utcs.utoronto.ca with SMTP id <25085>; Tue, 15 Jun 1999 17:58:18 -0400 Received: from kremvax.demon.co.uk ([212.228.106.206]) by finch-post-10.mail.demon.net with esmtp (Exim 2.12 #1) id 10tfDK-000MWD-0A; Mon, 14 Jun 1999 22:28:22 +0000 Received: (from mhw@localhost) by kremvax.demon.co.uk (8.8.7/8.8.7) id XAA20899; Mon, 14 Jun 1999 23:27:17 +0100 To: Scott Schwartz Cc: Sam Fans , Bengt Kleberg Subject: Re: 9libs, new sam release, experimental wily release From: "Mark H. Wilkinson" Date: Mon, 14 Jun 1999 15:46:50 -0400 In-Reply-To: <19990614064432.24527.qmail@g.bio.cse.psu.edu> Message-ID: <199906142046.20514.9libs.badum@kremvax.demon.co.uk> X-Face: Bsp[Ds(Y#/{==j:Cv'"IK4R^D0_z]{'OYtp2^EYqpG)88CsdBm&LJ{idLZWx}AKf}E4#|@4DT4cX3 ?!>aIVcxmd#1 X-PGP-Fingerprint: 8E 43 1E D7 85 42 E0 C5 D3 8C B6 B1 EE 06 95 64 > "Mark H. Wilkinson" writes: > | 9libs-1.0, sam-9libs, wily-9libs > Thanks. I have a couple of complaints, though. Several of my > favorite bugs (patches posted ages ago) have been resurrected > in this new release. It looks like your patches hadn't made it into the Bell Labs source, although I do remember some of them being posted to sam-fans. If you forward them to Bengt and myself we'll get them integrated. > They are: > * In samterm, MAXFILES is too small. (I've been using 4K.) Sounds reasonable. The "sam" program uses a variable length list to hold open files whilst the "samterm" program uses a fixed size array. A better solution might be to replace the fixed size array with a variable sized list, but upping the limit looks fine for the time being. > * In sam, private temp files are world readable/writable. Yup, I remember this one too. Again, sounds Ok to me. > * In libXg, "fontfile" is specified by the X client app. In general > that cannot work: unlike in Plan 9, the X terminal usually won't > share any filesystem with the machine on which the X app is > running, so *no* filename can be valid for "-p9font". The fix is > to store the unicode font map in an X property which is set by your > xinitrc. By this, do you mean the case where you're logging into remote machines and running sam & samterm on the remote machine? You can always get round the problem by making sure the font file you want to use is available on each of the machines you connect to, but I guess you're after a solution which is easier to manage, using the X server as shared storage. That sounds reasonable, but I'd like to retain the existing mechanism too: it works well in networks where the file system is common to all machines to some degree. It also has utility in wily where the Font builtin can be used to switch between font files dynamically. > I'll dig the diffs out of my RCS files tomorrow and sent them along. That would be great! Cheers, -Mark. From sam-fans-owner Tue Jun 15 19:50:57 1999 Received: from bio.cse.psu.edu ([130.203.12.17]) by hawkwind.utcs.utoronto.ca with SMTP id <24846>; Tue, 15 Jun 1999 17:53:36 -0400 Received: (qmail 24528 invoked by uid 991); 14 Jun 1999 06:44:32 -0000 Message-ID: <19990614064432.24527.qmail@g.bio.cse.psu.edu> Date: Mon, 14 Jun 1999 02:44:32 -0400 To: "Mark H. Wilkinson" cc: Sam Fans , 9fans@cse.psu.edu, wilyfans@jli.com Subject: Re: 9libs, new sam release, experimental wily release In-reply-to: Your message of "Thu, 10 Jun 1999 19:04:28 EDT." <199905110004.4944.9libs.badoj@kremvax.demon.co.uk> Date: Mon, 14 Jun 1999 02:44:31 -0400 From: Scott Schwartz "Mark H. Wilkinson" writes: | 9libs-1.0, sam-9libs, wily-9libs Thanks. I have a couple of complaints, though. Several of my favorite bugs (patches posted ages ago) have been resurrected in this new release. They are: * In samterm, MAXFILES is too small. (I've been using 4K.) * In sam, private temp files are world readable/writable. * In libXg, "fontfile" is specified by the X client app. In general that cannot work: unlike in Plan 9, the X terminal usually won't share any filesystem with the machine on which the X app is running, so *no* filename can be valid for "-p9font". The fix is to store the unicode font map in an X property which is set by your xinitrc. I'll dig the diffs out of my RCS files tomorrow and sent them along. From sam-fans-owner Tue Aug 31 02:01:53 1999 Received: from highwire.stanford.edu ([171.64.249.40]) by hawkwind.utcs.utoronto.ca with SMTP id <24920>; Tue, 31 Aug 1999 01:35:15 -0400 Received: from aubrey.stanford.edu (aubrey.Stanford.EDU [36.48.0.102]) by highwire.stanford.edu (8.8.5/8.7.1) with ESMTP id LAA18626 for ; Sun, 29 Aug 1999 11:41:18 -0700 (PDT) Message-Id: <199908291841.LAA18626@highwire.stanford.edu> X-url: http://highwire.stanford.edu/~jimr/ X-face: "!ZH^<"U,NeU:732A To: sam-fans@hawkwind.utcs.toronto.edu Subject: paper referenced in The Text Editor sam MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <31043.935952078.1@aubrey.stanford.edu> Date: Sun, 29 Aug 1999 14:41:18 -0400 Sender: jimr@aubrey.stanford.edu I've been hunting around the web to see if the following has been publisher online: Structural Regular Expressions Proceedings of the EUUG Spring 1987 Conference, p21-28 Helsinki May, 1987 I've had no luck. Anyone know if it is available online, or would I have to interlibrary loan it? I assume the EUUG is the European Unix User's Group, the only other reference I saw was Estonian Unix User's Group. =) Jim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - James A. Robinson jim.robinson@stanford.edu Stanford University HighWire Press http://highwire.stanford.edu/ 650-723-7294 (W) 650-725-9335 (F) From sam-fans-owner Tue Aug 31 03:47:43 1999 Received: from mail-blue.research.att.com ([135.207.30.102]) by hawkwind.utcs.utoronto.ca with SMTP id <24840>; Tue, 31 Aug 1999 03:45:47 -0400 Received: from postal.research.att.com (postal.research.att.com [135.207.23.30]) by mail-blue.research.att.com (Postfix) with ESMTP id 898154CE05; Tue, 31 Aug 1999 02:03:34 -0400 (EDT) Received: from plan9.cs.bell-labs.com (castle4040.research.att.com [135.207.228.40]) by postal.research.att.com (8.8.7/8.8.7) with SMTP id CAA05084; Tue, 31 Aug 1999 02:03:23 -0400 (EDT) Message-Id: <199908310603.CAA05084@postal.research.att.com> From: "Russ Cox" Subject: Re: paper referenced in The Text Editor sam Date: Tue, 31 Aug 1999 02:03:12 -0400 To: Jim.Robinson@Stanford.Edu, sam-fans@hawkwind.utcs.toronto.edu MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit netlib.bell-labs.com/cm/cs/doc/87/3-se.ps.gz From sam-fans-owner Tue Aug 31 03:48:06 1999 Received: from highwire.stanford.edu ([171.64.249.40]) by hawkwind.utcs.utoronto.ca with SMTP id <24824>; Tue, 31 Aug 1999 03:44:11 -0400 Received: from aubrey.stanford.edu (aubrey.Stanford.EDU [36.48.0.102]) by highwire.stanford.edu (8.8.5/8.7.1) with ESMTP id WAA06077 for ; Mon, 30 Aug 1999 22:59:52 -0700 (PDT) Message-Id: <199908310559.WAA06077@highwire.stanford.edu> X-url: http://highwire.stanford.edu/~jimr/ X-face: "!ZH^<"U,NeU:732A To: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: paper referenced in The Text Editor sam In-reply-to: Message from "James A. Robinson" of "Sun, 29 Aug 1999 14:41:18 EDT."References: <199908291841.LAA18626@highwire.stanford.edu> <199908291841.LAA18626@highwire.stanford.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <29791.936079192.1@aubrey.stanford.edu> Date: Tue, 31 Aug 1999 01:59:52 -0400 Sender: jimr@aubrey.stanford.edu > Structural Regular Expressions > Proceedings of the EUUG Spring 1987 Conference, p21-28 > Helsinki > May, 1987 So never mind. It was hidden in the very sam archive from bell-labs under the name "se.ps" -- the README even says "se.ps is further documentation" (It just didn't say anything else). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - James A. Robinson jim.robinson@stanford.edu Stanford University HighWire Press http://highwire.stanford.edu/ 650-723-7294 (W) 650-725-9335 (F) From sam-fans-owner Wed Sep 1 03:55:07 1999 Received: from highwire.stanford.edu ([171.64.249.40]) by hawkwind.utcs.utoronto.ca with SMTP id <24916>; Wed, 1 Sep 1999 01:27:49 -0400 Received: from aubrey.stanford.edu (aubrey.Stanford.EDU [36.48.0.102]) by highwire.stanford.edu (8.8.5/8.7.1) with ESMTP id IAA06460 for ; Tue, 31 Aug 1999 08:47:28 -0700 (PDT) Message-Id: <199908311547.IAA06460@highwire.stanford.edu> X-url: http://highwire.stanford.edu/~jimr/ X-face: "!ZH^<"U,NeU:732A To: "sam Fans" Subject: formatting HTML tables in ascii MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <26591.936114448.1@aubrey.stanford.edu> Date: Tue, 31 Aug 1999 11:47:28 -0400 Sender: jimr@aubrey.stanford.edu I'm trying to format an HTML table using sam's regexp commands. What I wanted was a single line for each row, with each column seperated by a tab. I can handle single-line columns in a row like a a a b b b b b c c c c c d d d d d e e e e e e e e f f without a problem using , y/\n[A-Za-z0-9]/ x/\n/ d , x/ +/ c/ / But how do I craft a regexp to handle a blob of a multicolumn lines? 01F6 1 LATIN CAPITAL LETTER HWAIR 97-May-29 Accepted 98-Oct-22 Stage 6 01F7 1 LATIN CAPITAL LETTER WYNN 97-May-29 Accepted 98-Oct-22 Stage 6 I can match the blobs with , x/^[A-Za-z0-9]+ *\n( +([A-Za-z0-9\- ]+)+\n)+/ But is there any way to craft a regxp that, in the above example, replaces 'HWAIR\n' with 'HWAIR\t' but replaces '97-May-29\n' with '97-May-29 ' (a column sep vs a line join)? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - James A. Robinson jim.robinson@stanford.edu Stanford University HighWire Press http://highwire.stanford.edu/ 650-723-7294 (W) 650-725-9335 (F) From sam-fans-owner Thu Sep 2 04:55:24 1999 Received: from mailgate.cadence.com ([158.140.2.1]) by hawkwind.utcs.utoronto.ca with SMTP id <24769>; Thu, 2 Sep 1999 04:26:38 -0400 Received: (from smap@localhost) by mailgate.cadence.com (8.8.5/8.6.8) id BAA28322; Wed, 1 Sep 1999 01:09:09 -0700 (PDT) Received: from symnt3.Cadence.COM(194.32.101.100) by mailgate.cadence.com via smap (mjr-v1.2) id xma936173348.028309; Wed, 1 Sep 99 01:09:08 -0700 Received: by symnt3.cadence.com with Internet Mail Service (5.5.2232.9) id ; Wed, 1 Sep 1999 09:07:55 +0100 Message-ID: <1E485299309FD211A2100090271E27A4143246@symnt3.cadence.com> From: Nigel Roles To: "'Jim.Robinson@Stanford.Edu'" , sam Fans Subject: RE: formatting HTML tables in ascii Date: Wed, 1 Sep 1999 04:07:54 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2232.9) Content-Type: text/plain; charset="iso-8859-1" My HTML might be a bit weak, but this will swap all the \n's in the blob to \t's. ,x/^[A-Za-z0-9]+ *(\n +([A-Za-z0-9\- ]+)+)+/x/\n/c/ / -----Original Message----- From: James A. Robinson [mailto:Jim.Robinson@Stanford.Edu] Sent: Tuesday, August 31, 1999 4:47 PM To: sam Fans Subject: formatting HTML tables in ascii I'm trying to format an HTML table using sam's regexp commands. What I wanted was a single line for each row, with each column seperated by a tab. I can handle single-line columns in a row like a a a b b b b b c c c c c d d d d d e e e e e e e e f f without a problem using , y/\n[A-Za-z0-9]/ x/\n/ d , x/ +/ c/ / But how do I craft a regexp to handle a blob of a multicolumn lines? 01F6 1 LATIN CAPITAL LETTER HWAIR 97-May-29 Accepted 98-Oct-22 Stage 6 01F7 1 LATIN CAPITAL LETTER WYNN 97-May-29 Accepted 98-Oct-22 Stage 6 I can match the blobs with , x/^[A-Za-z0-9]+ *\n( +([A-Za-z0-9\- ]+)+\n)+/ But is there any way to craft a regxp that, in the above example, replaces 'HWAIR\n' with 'HWAIR\t' but replaces '97-May-29\n' with '97-May-29 ' (a column sep vs a line join)? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - James A. Robinson jim.robinson@stanford.edu Stanford University HighWire Press http://highwire.stanford.edu/ 650-723-7294 (W) 650-725-9335 (F) From sam-fans-owner Fri Oct 15 03:30:23 1999 Received: from highwire.stanford.edu ([171.64.249.40]) by hawkwind.utcs.utoronto.ca with SMTP id <25694>; Fri, 15 Oct 1999 02:50:58 -0400 Received: from aubrey.stanford.edu (aubrey.Stanford.EDU [36.48.0.102]) by highwire.stanford.edu (8.8.5/8.7.1) with ESMTP id HAA11298 for ; Thu, 14 Oct 1999 07:03:41 -0700 (PDT) Message-Id: <199910141403.HAA11298@highwire.stanford.edu> X-url: http://highwire.stanford.edu/~jimr/ X-face: "!ZH^<"U,NeU:732A To: "sam Fans" Subject: large file in sam? MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19370.939909820.1@aubrey.stanford.edu> Date: Thu, 14 Oct 1999 10:03:40 -0400 Sender: jimr@aubrey.stanford.edu >From my reading of Pike's main paper on sam, I got the impression that sam could handle very large files. I thought it only read in the blocks being worked on, as it needed access to them. I find that when I try and open an 80mb text file, I get a message 'write: ?I/O error: "Success"', and no file appears. =( Anyone know if this is just a limitation of the sam port to linux? Or if there is some way around the problem (other than split(1)!)? Jim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - James A. Robinson jim.robinson@stanford.edu Stanford University HighWire Press http://highwire.stanford.edu/ 650-723-7294 (W) 650-725-9335 (F) From sam-fans-owner Tue Oct 19 02:26:25 1999 Received: from fw2.softwell.se ([193.15.236.44]) by hawkwind.utcs.utoronto.ca with SMTP id <24747>; Tue, 19 Oct 1999 02:14:27 -0400 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw2.softwell.se (8.9.3/8.8.7) with ESMTP id NAA12391 for ; Fri, 15 Oct 1999 13:19:08 +0200 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id NAA27244 for sam-fans@hawkwind.utcs.toronto.edu; Fri, 15 Oct 1999 13:19:07 +0200 Date: Fri, 15 Oct 1999 07:19:07 -0400 From: Bengt Kleberg Message-Id: <199910151119.NAA27244@trillian.softwell.se> To: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: large file in sam? I have updated sam-9libs to accept the env var TMPDIR. This is slightly better than always using /tmp. The new sam-9libs is sent to "Mark H. Wilkinson" and will get a place at ftp://ftp.demon.co.uk/pub/unix/plan9 when time permits. Those in a hurry could get their copy by email from me. Best Wishes, Bengt =============================================================== Everything aforementioned should be regarded as totally private opinions, and nothing else. bengt@softwell.se ``His great strength is that he is uncompromising. It would make him physically ill to think of programming in C++.'' From sam-fans-owner Thu Feb 10 15:08:34 2000 Received: from smtp-out1.bellatlantic.net ([199.45.39.156]) by hawkwind.utcs.utoronto.ca with SMTP id <25517>; Thu, 10 Feb 2000 14:50:40 -0500 Received: from client-117-21.bellatlantic.net (client-117-21.bellatlantic.net [151.198.117.21]) by smtp-out1.bellatlantic.net (8.9.1/8.9.1) with SMTP id RAA07046 for ; Wed, 9 Feb 2000 17:14:14 -0500 (EST) From: "Michael D. Scheer" To: sam-fans@hawkwind.utcs.toronto.edu Subject: NT4 Service Pack 6 Organization: Plexus Systems Inc. Reply-To: mdash@plexsys.com Message-ID: X-Mailer: Forte Agent 1.7/32.534 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Date: Wed, 9 Feb 2000 17:16:49 -0500 I recently installed SP6. Sam (seanq's july 1997 binaries) now hangs on startup. I'm thinking the service pack may be the cause. Thoughts/experience? --Mike Scheer From sam-fans-owner Mon Feb 14 02:22:20 2000 Received: from spdmraab.compuserve.com ([149.174.206.155]) by hawkwind.utcs.utoronto.ca with SMTP id <26009>; Mon, 14 Feb 2000 02:14:36 -0500 Received: (from mailgate@localhost) by spdmraab.compuserve.com (8.9.3/8.9.3/SUN-REL-1.2) id VAA28073 for sam-fans@hawkwind.utcs.toronto.edu; Sat, 12 Feb 2000 21:09:01 -0500 (EST) Sender: humans@ishtek.com Received: from ishtek.com (hkg-tgn-rwd-vty39.as.wcom.net [63.12.173.39]) by spdmraab.compuserve.com (8.9.3/8.9.3/SUN-REL-1.2) with SMTP id VAA28002 for ; Sat, 12 Feb 2000 21:08:51 -0500 (EST) Message-Id: <200002130208.VAA28002@spdmraab.compuserve.com> X-Mailer: Ishtek MeeMail 2.1 In-Reply-To: Date: Sun, 30 Jan 2000 19:06:16 -0500 From: Alex Danilo Subject: Re: NT4 Service Pack 6 To: sam-fans@hawkwind.utcs.toronto.edu X-Face: 3}u>)koHh${W+XV18fV{i/@Sw_Cvi'3hS04kL'J-3Qoz{?D R>c6<6{LbeD5'D9+C\lUPtNBF=h=yrnT,zMx$o3YbL/p;|UGb}@0^{Tr7ppFE_sk;'p[W9,gpJ$`N2 Sp?E#o2R "Michael D. Scheer" wrote: >I recently installed SP6. Sam (seanq's july 1997 binaries) now hangs >on startup. I'm thinking the service pack may be the cause. >Thoughts/experience? I have SP6 on NT4 installed and have never seen any problem with Sam. It works fine. Naybe you should re-install it:-) Alex -- Alex Danilo http://www.ishtek.com/alex PO Box 333 Forestville NSW 2087 +61-2-9975-2297 From sam-fans-owner Mon Feb 14 02:22:27 2000 Received: from ejk.cso.uiuc.edu ([130.126.112.162]) by hawkwind.utcs.utoronto.ca with SMTP id <25291>; Mon, 14 Feb 2000 02:11:21 -0500 Received: (qmail 15000 invoked from network); 10 Feb 2000 20:33:22 -0000 Received: from archbald-17.slip.uiuc.edu (HELO uiuc.edu) (130.126.26.141) by ejk.cso.uiuc.edu with SMTP; 10 Feb 2000 20:33:22 -0000 Sender: ejk Message-ID: <38A3208B.C8188CBF@uiuc.edu> From: Ed Kubaitis Organization: CCSO - University of Illinois - Urbana-Champaign X-Mailer: Mozilla 4.7 [en] (X11; U; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: NT4 Service Pack 6 References: Content-Type: text/plain; charset=big5 Content-Transfer-Encoding: 7bit Date: Thu, 10 Feb 2000 15:33:49 -0500 "Michael D. Scheer" wrote: > > I recently installed SP6. Sam (seanq's july 1997 binaries) now hangs > on startup. I'm thinking the service pack may be the cause. > Thoughts/experience? > --Mike Scheer Absolutely no help for this problem but FWIW, we found SP6 problematic in a totally unrelated area: adherance to the Common Gateway Interface specs in SP6 IIS. And advised departmental IIS web server administrators to avoid SP6 for the time being. If there's no pertinent help forthcoming from sam-fans, and you don't absolutely require something in SP6, backing out of SP6 might be plan B. -------------------------- Ed Kubaitis - ejk@uiuc.edu CCSO - University of Illinois at Urbana-Champaign From sam-fans-owner Wed Mar 1 13:29:34 2000 Received: from highwire.stanford.edu ([171.64.249.40]) by hawkwind.utcs.utoronto.ca with SMTP id <25867>; Wed, 1 Mar 2000 13:09:36 -0500 Received: from aubrey.stanford.edu (jimr@aubrey.Stanford.EDU [171.64.31.58]) by highwire.stanford.edu (8.9.3/HIGHWIRE2.0) with ESMTP id IAA19806; Wed, 1 Mar 2000 08:17:16 -0800 (PST) Message-Id: <200003011617.IAA19806@highwire.stanford.edu> X-url: http://highwire.stanford.edu/~jimr/ X-face: "!ZH^<"U,NeU:732A To: Bengt Kleberg cc: sam-fans@hawkwind.utcs.toronto.edu, wilyfans@jli.com Dcc: Subject: Re: ssam, again In-reply-to: Message from Bengt Kleberg of "Wed, 01 Mar 2000 16:01:39 +0100."References: <200003011501.QAA08510@trillian.softwell.se> <200003011501.QAA08510@trillian.softwell.se> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <19165.951927435.0@aubrey.stanford.edu> Sender: jimr@aubrey.stanford.edu Date: Wed, 1 Mar 2000 11:17:51 -0500 ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19165.951927435.1@aubrey.stanford.edu> > There has been previous incarnations of a stream version of sam. I have > used one by Alistair Crooks agc@westley.demon.co.uk. Here is a new one, > implemented as a rc script using sam -d. Since the fans email list is > low volume I hope that you will all survive that I email b oth the script > and the man page in seperate emails :-) > > I have thought about including this script with sam-9libs. Is it > sufficiently useful, or does it detract so much from sam that it > should be kept hidden? It's always nice to see useful wily scripts. I don't know if I ever posted or sent this one out, but I have a copy of a sam script someone posted to sam-fans ages ago. It is neat in that it uses a FIFO instead of a temporary file. It is no where near as flexibly as what you posted, but I thought you might be interested... ------- =_aaaaaaaaaa0 Content-Type: text/plain; name="wsam"; charset="us-ascii" Content-ID: <19165.951927435.2@aubrey.stanford.edu> Content-Description: FIFO based sam #!/opt/plan9/bin/rc umask 077 if ( ~ $#* 0) { echo >[1=2] Usage: wsam commands ... builtin exit 1 } if ( test -d /usr/tmp ) { tmp_dir=/usr/tmp } else if ( test -d /var/tmp ) { tmp_dir=/var/tmp } else if ( test -d /tmp ) { tmp_dir=/tmp } else if ( test -d $HOME ) { tmp_dir=$HOME } else { echo >[1=2] wsam: I cannot find a nice place to put my FIFO builtin exit 1 } FIFO=$tmp_dir^'/'^wsam.$pid.rd mkfifo -m 0700 $FIFO { echo 'r '$FIFO while ( ! ~ $#* 0 ) { echo $1 shift } echo ',p' } | sam -d >[2=] & cat >$FIFO wait $apid rm -f $FIFO builtin exit 0 ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19165.951927435.3@aubrey.stanford.edu> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - James A. Robinson jim.robinson@stanford.edu Stanford University HighWire Press http://highwire.stanford.edu/ 650-723-7294 (W) 650-725-9335 (F) ------- =_aaaaaaaaaa0-- From sam-fans-owner Wed Mar 1 13:29:52 2000 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.utoronto.ca with SMTP id <25860>; Wed, 1 Mar 2000 13:08:32 -0500 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id QAA10613; Wed, 1 Mar 2000 16:03:12 +0100 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id QAA08517; Wed, 1 Mar 2000 16:03:13 +0100 From: Bengt Kleberg Message-Id: <200003011503.QAA08517@trillian.softwell.se> To: sam-fans@hawkwind.utcs.toronto.edu, wilyfans@jli.com Subject: ssam, script Date: Wed, 1 Mar 2000 10:04:04 -0500 #! /usr/local/plan9/bin/rc cmd_name = $0 fn usage { echo Usage: $cmd_name [-n] [-e script ] [-f sfile ] [ script ] [--] [ file ] ... } # directory for saving all text to be edited # use /tmp or TMPDIR if set tmp_dir=/tmp if (! ~ $TMPDIR ()) { tmp_dir=$TMPDIR } # file for saving all text to be edited tmp_file = $tmp_dir/ssam.$pid.XXXXXXXX # if OpenBSD mktemp exist, use it if (test -x /usr/bin/mktemp) { tmp_file = `{/usr/bin/mktemp $tmp_file} } # clean up on signals fn sighup { rm $tmp_file exit 3 } fn sigint { rm $tmp_file exit 3 } fn sigquit { rm $tmp_file exit 3 } # default values for variables printall = 1 edit_script = () edit_type = () # parse command line arguments while ({~ $1 -*} && {! ~ $1 --}) { switch ($1) { case -n printall = 0 shift case -e shift edit_script = ($edit_script $1) edit_type = ($edit_type e) shift case -f shift if (test -f $1) { edit_script = ($edit_script $1) edit_type = ($edit_type f) shift } else { echo $0: No such sfile: $1 exit 2 } case * usage exit 1 } } # anything left that is not a file is a (single) edit script if (! test -f $1) { edit_script = ($edit_script $1) edit_type = ($edit_type e) shift } # anything left is file(s) to be edited, otherwise use stdin if (~ $#* 0) { cat >> $tmp_file } else { cat $* >> $tmp_file } # send edit scripts to sam and contents of edit files # then print contents, unless -n argument # quit (twice since file has probably not been saved) i = 1 max = `{expr $#edit_script + 1} { while (! ~ $i $max) { switch ($edit_type($i)) { case e echo $edit_script($i) case f cat $edit_script($i) } i = `{expr $i + 1} } if (~ $printall 1) { echo '1,$ p' } echo q echo q } | sam -d $tmp_file >[2] /dev/null #} rm $tmp_file exit 0 From sam-fans-owner Wed Mar 1 13:29:58 2000 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.utoronto.ca with SMTP id <25859>; Wed, 1 Mar 2000 13:09:20 -0500 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id QAA10609; Wed, 1 Mar 2000 16:01:39 +0100 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id QAA08510; Wed, 1 Mar 2000 16:01:39 +0100 From: Bengt Kleberg Message-Id: <200003011501.QAA08510@trillian.softwell.se> To: sam-fans@hawkwind.utcs.toronto.edu, wilyfans@jli.com Subject: ssam, again Date: Wed, 1 Mar 2000 10:04:05 -0500 There has been previous incarnations of a stream version of sam. I have used one by Alistair Crooks agc@westley.demon.co.uk. Here is a new one, implemented as a rc script using sam -d. Since the fans email list is low volume I hope that you will all survive that I email both the script and the man page in seperate emails :-) I have thought about including this script with sam-9libs. Is it sufficiently useful, or does it detract so much from sam that it should be kept hidden? Best Wishes, Bengt =============================================================== Everything aforementioned should be regarded as totally private opinions, and nothing else. bengt@softwell.se ``His great strength is that he is uncompromising. It would make him physically ill to think of programming in C++.'' From sam-fans-owner Wed Mar 1 13:30:04 2000 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.utoronto.ca with SMTP id <25861>; Wed, 1 Mar 2000 13:09:28 -0500 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id QAA10624; Wed, 1 Mar 2000 16:04:02 +0100 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id QAA08527; Wed, 1 Mar 2000 16:04:02 +0100 From: Bengt Kleberg Message-Id: <200003011504.QAA08527@trillian.softwell.se> To: sam-fans@hawkwind.utcs.toronto.edu, wilyfans@jli.com Subject: ssam , man page Date: Wed, 1 Mar 2000 10:04:28 -0500 .TH SSAM 1 "2000-01-01" .SH NAME ssam \- stream editor .SH SYNOPSIS .B ssam .RB [ \-n ] .RB [ \-e .IR script ] .RB [ \-f .IR sfile ] .RB [ \-\- ] .RB [ script ] .RI [ file " ..." ] .SH DESCRIPTION .I ssam pretends to be a stream version of .IR sam (1). .PP It saves all input, stdin and files, into a single file and then uses sam \-d to edit this file. So, despite the name, it is not a stream editor. But it does allow for text to be piped into it and edited with the editing commands used in sam. This is useful if one is spending most of ones time in .IR wily (1), instead of sam. .PP A single editing script may be specified as the last argument to ssam, before any subsequent files. Multiple editing scripts may be specified by using the -e or -f options. All editing scripts are applied to the input in the order they are specified. .SS Editing scripts Editing scripts are made from the commands described in .IR sam (1). .SH OPTIONS .TP .B \-n By default, all input is echoed to the standard output after all of the commands have been applied to it. The \-n option suppresses this behavior. .TP .B \-e " script" Append the editing script specified by the script argument to the list of editing scripts. .TP .B \-e " sfile" Append the editing scripts found in the file sfile to the list of editing scripts. .TP .B \-\- One can use the special argument \-\- to terminate the options. This allows the use of file names beginning with a dash. .SH ENVIRONMENTAL VARIABLES .TP .B TMPDIR The location used to store temporary files. If not set, /tmp is used. .SH FILES .TP .B /tmp/ssam.$pid.XXXXXXXX The file used to store all of the text to be edited. On systems that has .IR mktemp (1), (eg OpenBSD), this utility is used to further randomize the file name. .SH SEE ALSO .IR sam (1), .IR wily (1), .IR rc (1), .IR mktemp (1). .SH BUGS .PP Despite its name this is not a stream editor. It saves all input, stdin and files, into a single file and then uses sam \-d to edit this file. Since sam itself makes a copy of the file to be edited this means that there are 2 copies of all of the text. Ssam is clearly of no help if problems with disk space stops the use of sam. .PP Ssam is not written in .IR sh (1). Instead it uses .IR rc (1). This is actually more of a feature than a bug. Most sam users already have rc. If not, get it from http://www.star.le.ac.uk/~tjg/rc/. From sam-fans-owner Sat Mar 11 22:45:38 2000 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.utoronto.ca with SMTP id <26323>; Sat, 11 Mar 2000 21:32:23 -0500 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id MAA19972; Mon, 6 Mar 2000 12:05:36 +0100 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id MAA22737; Mon, 6 Mar 2000 12:05:36 +0100 From: Bengt Kleberg Message-Id: <200003061105.MAA22737@trillian.softwell.se> To: sam-fans@hawkwind.utcs.toronto.edu, wilyfans@jli.com Subject: Re: ssam, again Date: Mon, 6 Mar 2000 06:06:49 -0500 Thanks to suggestion and code by "James A. Robinson" I have managed to cut disk usage in 1/2, using a fifo instead of a tmp file. I now think it is good enough to ship with sam-9libs. Any one aginst? (it is still not a stream editor, and would not work if /tmp is 50 MB and the file to edit is 50 MB, too) script follows: #! /usr/local/plan9/bin/rc cmd_name = $0 fn usage { echo Usage: $cmd_name [-n] [-e script ] [-f sfile ] [ script ] [--] [ file ] ... } # directory for saving all text to be edited # use /tmp or TMPDIR if set tmp_dir=/tmp if (! ~ $TMPDIR ()) { tmp_dir=$TMPDIR } # file for saving all text to be edited tmp_file = $tmp_dir ^ /ssam.$pid.XXXXXXXX # if OpenBSD mktemp exist, use it if (test -x /usr/bin/mktemp) { tmp_file = `{/usr/bin/mktemp $tmp_file} # there is no change-file-into-pipe cmd, so remove it before mkfifo # this allows for a denial-of-service attack, but mkfifo -m protect against disclosure rm $tmp_file } mkfifo -m 0700 $tmp_file if (! ~ $status 0) { echo mkfifo failed, someone is deliberatly "stealing" your filename echo this indicates an attempt to read the text you want to edit exit 4 } # clean up on signals fn sighup { rm $tmp_file exit 3 } fn sigint { rm $tmp_file exit 3 } fn sigquit { rm $tmp_file exit 3 } # default values for variables printall = 1 edit_script = () edit_type = () # parse command line arguments while ({~ $1 -*} && {! ~ $1 --}) { switch ($1) { case -n printall = 0 shift case -e shift edit_script = ($edit_script $1) edit_type = ($edit_type e) shift case -f shift if (test -f $1) { edit_script = ($edit_script $1) edit_type = ($edit_type f) shift } else { echo $0: No such sfile: $1 exit 2 } case * usage exit 1 } } # anything left that is not a file is a (single) edit script if (! test -f $1) { edit_script = ($edit_script $1) edit_type = ($edit_type e) shift } # send edit scripts to sam and contents of edit script files # then print contents, unless -n argument # quit (twice since file has probably not been saved) i = 1 max = `{expr $#edit_script + 1} { echo r $tmp_file while (! ~ $i $max) { switch ($edit_type($i)) { case e echo $edit_script($i) case f cat $edit_script($i) } i = `{expr $i + 1} } if (~ $printall 1) { echo '1,$ p' } echo q echo q } | sam -d >[2] /dev/null & #} sam_pid = $apid # anything left is file(s) to be edited, otherwise use stdin if (~ $#* 0) { cat >> $tmp_file } else { cat $* >> $tmp_file } wait $sam_pid rm $tmp_file exit 0 From sam-fans-owner Sat Mar 11 22:46:08 2000 Received: from highwire.stanford.edu ([171.64.249.40]) by hawkwind.utcs.utoronto.ca with SMTP id <26331>; Sat, 11 Mar 2000 21:54:19 -0500 Received: from aubrey.stanford.edu (jimr@aubrey.Stanford.EDU [171.64.31.58]) by highwire.stanford.edu (8.9.3/HIGHWIRE2.0) with ESMTP id QAA19570; Mon, 6 Mar 2000 16:35:37 -0800 (PST) Message-Id: <200003070035.QAA19570@highwire.stanford.edu> X-url: http://highwire.stanford.edu/~jimr/ X-face: "!ZH^<"U,NeU:732A To: sam-fans@hawkwind.utcs.toronto.edu, wilyfans@jli.com Dcc: Subject: Re: ssam, again In-reply-to: Message from Bengt Kleberg of "Mon, 06 Mar 2000 12:05:36 +0100."References: <200003061105.MAA22737@trillian.softwell.se> <200003061105.MAA22737@trillian.softwell.se> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23496.952389336.1@aubrey.stanford.edu> Sender: jimr@aubrey.stanford.edu Date: Mon, 6 Mar 2000 19:36:39 -0500 > Thanks to suggestion and code by "James A. Robinson" > I have managed to cut disk usage in 1/2, > using a fifo instead of a tmp file. Credit for the original code should go to Alan Watson , not to me. Jim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - James A. Robinson jim.robinson@stanford.edu Stanford University HighWire Press http://highwire.stanford.edu/ 650-723-7294 (W) 650-725-9335 (F) From sam-fans-owner Wed Mar 22 18:19:17 2000 Received: from highwire.stanford.edu ([171.64.249.40]) by hawkwind.utcs.utoronto.ca with SMTP id <26714>; Wed, 22 Mar 2000 17:31:08 -0500 Received: from aubrey.stanford.edu (jimr@aubrey.Stanford.EDU [171.64.31.58]) by highwire.stanford.edu (8.9.3/HIGHWIRE2.0) with ESMTP id VAA13856 for ; Fri, 17 Mar 2000 21:23:13 -0800 (PST) Message-Id: <200003180523.VAA13856@highwire.stanford.edu> X-url: http://highwire.stanford.edu/~jimr/ X-face: "!ZH^<"U,NeU:732A To: "sam Fans" Dcc: Subject: shorter struct regex? MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23843.953356993.1@aubrey.stanford.edu> Sender: jimr@aubrey.stanford.edu Date: Sat, 18 Mar 2000 00:24:24 -0500 I'm starting to develop some mild RSI problems, and am trying to move away from the mouse. This leads me to look at editors like vi or sam instead of wily. In wily I end up using a pipe to sam half the time anyway, so I'm working through using structured regular expressions while editing my code in sam. I just worked through a problem, and am wondering if there was a shorter way to solve it. I had a bunch of arrays defined in a java file: ... public Hashtable return() throws MissingRequiredValueException { String[] req = { "order-id", "amount" }; String[] opt = { "card-number", "card-exp", "card-name", "card-address", "card-city", "card-zip" }; return processRequest("return", req, opt); } ... I wanted to expand the elements of the arrays to one per line. This is what I used: ,x/{\n([^}]+\n)+ }/x/, +[^\n]/x/ +/c/\n / Is there way I could of done this with less work? Jim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - James A. Robinson jim.robinson@stanford.edu Stanford University HighWire Press http://highwire.stanford.edu/ 650-723-7294 (W) 650-725-9335 (F) From sam-fans-owner Wed Mar 22 22:25:48 2000 Received: from proxy2.ba.best.com ([206.184.139.14]) by hawkwind.utcs.utoronto.ca with SMTP id <28302>; Wed, 22 Mar 2000 22:02:58 -0500 Received: from peanut.rakitzis.com (dynamic59.pm01.san-mateo.best.com [205.149.174.59]) by proxy2.ba.best.com (8.9.3/8.9.2/best.out) with ESMTP id QAA18816; Wed, 22 Mar 2000 16:02:20 -0800 (PST) Received: (from byron@localhost) by peanut.rakitzis.com (8.8.7/8.8.7) id QAA24942; Wed, 22 Mar 2000 16:00:35 -0800 From: Byron Rakitzis Message-Id: <200003230000.QAA24942@peanut.rakitzis.com> To: jim.robinson@stanford.edu Subject: Re: shorter struct regex? Cc: sam-fans@hawkwind.utcs.toronto.edu Date: Wed, 22 Mar 2000 19:05:47 -0500 > public Hashtable return() > throws MissingRequiredValueException > { > String[] req = > { > "order-id", "amount" > }; > > String[] opt = > { > "card-number", "card-exp", "card-name", "card-address", "card-city", > "card-zip" > }; > return processRequest("return", req, opt); > } > .... > > I wanted to expand the elements of the arrays to one per line. This is > what I used: > > ,x/{\n([^}]+\n)+ }/x/, +[^\n]/x/ +/c/\n / > > Is there way I could of done this with less work? > > > Jim Jim, One of my favorite tricks is a pipe to fmt. Fmt will preserve leading whitespace (well, it can be trickier than that since fmt tries to do pharagraph indentation as well). To force one-column output, you only need to do "fmt -1", which strictly speaking denotes one-CHARACTER output, but fmt does the right thing. So: "card-number", "card-exp", "card-name", "card-address", "card-city", "card-zip" piped through "fmt -1" gives (at least on this linux machine): "card-number", "card-exp", "card-name", "card-address", "card-city", "card-zip" Of course, you still have the problem about selecting the braced-in regions without using the mouse. Perhaps another out-of-the-box approach is to pipe your entire code through a C beautifier. "indent" has so many options, I would be surprised if array initializers one-per-line was not one of them. Byron. From sam-fans-owner Thu Mar 23 01:29:17 2000 Received: from sgi.com ([192.48.153.1]) by hawkwind.utcs.utoronto.ca with SMTP id <25894>; Thu, 23 Mar 2000 01:25:43 -0500 Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) by sgi.com (980327.SGI.8.8.8-aspam/980304.SGI-aspam: SGI does not authorize the use of its proprietary systems or networks for unsolicited or bulk email from the Internet.) via ESMTP id QAA01232 for <@external-mail-relay.sgi.com:sam-fans@hawkwind.utcs.toronto.edu>; Wed, 22 Mar 2000 16:57:49 -0800 (PST) mail_from (pj@sam.engr.sgi.com) Received: from sam.engr.sgi.com (sam.engr.sgi.com [163.154.6.37]) by cthulhu.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) via ESMTP id QAA10957 for <@cthulhu.engr.sgi.com:sam-fans@hawkwind.utcs.toronto.edu>; Wed, 22 Mar 2000 16:57:48 -0800 (PST) mail_from (pj@sam.engr.sgi.com) Received: (from pj@localhost) by sam.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) id QAA92854 for sam-fans@hawkwind.utcs.toronto.edu; Wed, 22 Mar 2000 16:57:19 -0800 (PST) From: pj@sam.engr.sgi.com (Paul Jackson) Message-Id: <200003230057.QAA92854@sam.engr.sgi.com> To: sam-fans@hawkwind.utcs.toronto.edu Subject: Applying old samx patch to newer sam? Date: Wed, 22 Mar 2000 22:30:41 -0500 Summary: The only samx patch I could find was old, and didn't entirely apply to the latest sam code. But it (the samkey features) seem to work. Should I worry? Is there a more recent samx patch? Background: I've just stumbled onto sam and samx, while casting about for a 'decent' editor for use on Linux, Irix and occassionally Windows. For the last few years, I had used 'ed' for global work, and Rick Davis' jot (aka zip) for mouse work. But jot only runs on Irix, and now I am working more with Linux. So off to look for another editor. Thanks especially to all who have contributed to this email list over the years -- the ~500 messages in the archives were very useful in getting up to speed quickly. Sam and samx are great - I am glad I found them. Details: The only samx patches I could find were: Samx Version 2: Extensions to the Unix/X11 Sam Editor ----------------------------------------------------- Ed Kubaitis (ejk@uiuc.edu) 17 April 1993 from: ftp://ftp.funet.fi/pub/unix/editors/sam/samx2/ I've managed to apply these patches to the most recent sam that I could find, circa April 1999, under: ftp://ftp.demon.co.uk/pub/unix/plan9/sam-9libs.* and the result seems to work, after a little futzing around, _except_ that the following piece of the patch seems to be quite inapplicable. The old samx patch would change the file strwidth.c thusly: *************** *** 13,18 **** l = 0; n = f->n; info = f->info; if(s) while(c = *s++) if(c < n) --- 13,28 ---- l = 0; n = f->n; info = f->info; + if (Keydefs && s) { + while (*s) { + unsigned short r; + s += chartorune(&r, s); + if (r >= n || info[r].width == 0) + r = 0x7e; + l += info[r].width; + } + return Pt(l,f->height); + } if(s) while(c = *s++) if(c < n) Should I worry that I could find no place resembling the above location to add this code? ======================================================================= I won't rest till it's the best ... Software Production Engineer Paul Jackson (pj@sgi.com; pj@usa.net) 3x1373 http://sam.engr.sgi.com/pj From sam-fans-owner Thu Mar 23 16:45:40 2000 Received: from highwire.stanford.edu ([171.64.249.40]) by hawkwind.utcs.utoronto.ca with SMTP id <28311>; Thu, 23 Mar 2000 16:43:28 -0500 Received: from aubrey.stanford.edu (jimr@aubrey.Stanford.EDU [171.64.31.58]) by highwire.stanford.edu (8.9.3/HIGHWIRE2.0) with ESMTP id HAA06451 for ; Thu, 23 Mar 2000 07:18:16 -0800 (PST) Message-Id: <200003231518.HAA06451@highwire.stanford.edu> X-url: http://highwire.stanford.edu/~jimr/ X-face: "!ZH^<"U,NeU:732A To: "sam Fans" Dcc: Subject: Re: shorter struct regex? In-reply-to: Message from "Russ Cox" of "Wed, 22 Mar 2000 19:26:06 EST."References: <200003230026.TAA06530@smtp3.fas.harvard.edu> <200003230026.TAA06530@smtp3.fas.harvard.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <10134.953824696.1@aubrey.stanford.edu> Sender: jimr@aubrey.stanford.edu Date: Thu, 23 Mar 2000 10:19:04 -0500 > ,x/{\n([^}]+\n)+ }/x/, +[^\n]/x/ +/c/\n / > > Is there way I could of done this with less work? > > > In sam, highlight the suspect arrays and then ,s/, */,\n /g > would work. This is a case where I think using the mouse > makes more sense than typing all the gook. Ah, but the point was to do this without the mouse. =) Not because I'm perverse, but because I had about 30 of these arrays in my program. Plus I'm writing it in noweb, so I had a mix of latex documentation mixed in with the code (which about doubles the size of the file). > But if you want > to type the gook, can't you just say > > ,x/{([^}]|\n)+}/,s/, */,\n /g The extra ',' in there before s/// would mess things up. But with a few tweaks, like making sure it doesn't add a newline if one already exists: ,x/{([^}]|\n)+}/s/, *[^\n]/,\n /g It works and would have saved 8 characters. Thank you! Jim From sam-fans-owner Thu Mar 23 16:45:55 2000 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.utoronto.ca with SMTP id <28302>; Thu, 23 Mar 2000 16:42:49 -0500 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id LAA27359; Thu, 23 Mar 2000 11:26:21 +0100 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id LAA20000; Thu, 23 Mar 2000 11:26:20 +0100 From: Bengt Kleberg Message-Id: <200003231026.LAA20000@trillian.softwell.se> To: pj@sam.engr.sgi.com, sam-fans@hawkwind.utcs.toronto.edu Subject: Re: Applying old samx patch to newer sam? Date: Thu, 23 Mar 2000 05:26:47 -0500 Greetings, Please note that I am trying to 'maintain' sam-9libs. So if I seem reluctant to make any changes it could be plain lazyness :-) ANyway, samx was news to me. I think (afer having read the man page and so for a short while) that I rahter not include this in sam-9libs. 1 sam is supposed to be mouse driven, not keyboard driven. 2 auto placing of windows is something that acme/wily does (and I think they are better at user interfaceing than sam anyway) 3 auto indent, see 2 4 the perl scripts would be nice to include though. Best Wishes, Bengt =============================================================== Everything aforementioned should be regarded as totally private opinions, and nothing else. bengt@softwell.se ``His great strength is that he is uncompromising. It would make him physically ill to think of programming in C++.'' From sam-fans-owner Thu Mar 23 16:46:01 2000 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.utoronto.ca with SMTP id <24747>; Thu, 23 Mar 2000 16:42:10 -0500 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id KAA27287 for ; Thu, 23 Mar 2000 10:49:48 +0100 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id KAA19813 for sam-fans@hawkwind.utcs.toronto.edu; Thu, 23 Mar 2000 10:49:48 +0100 From: Bengt Kleberg Message-Id: <200003230949.KAA19813@trillian.softwell.se> To: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: shorter struct regex? Date: Thu, 23 Mar 2000 04:51:53 -0500 > From: "James A. Robinson" > I wanted to expand the elements of the arrays to one per line. > ,x/{\n([^}]+\n)+ }/x/, +[^\n]/x/ +/c/\n / This might be totally wrong, but I assume that since you have 'hard coded' the 2 #\tab in the final c// expression I am allowed the same kind of works-for-this-problem solution :-). Presumable there is a way to get hold of the amount of #\tab and then use t to copy it to the right place... Anyway, my suggestion would be: ,x/ +".+\n/ x/ +/ c/\n / Best Wishes, Bengt =============================================================== Everything aforementioned should be regarded as totally private opinions, and nothing else. bengt@softwell.se ``His great strength is that he is uncompromising. It would make him physically ill to think of programming in C++.'' From sam-fans-owner Thu Mar 23 16:46:23 2000 Received: from deliverator.sgi.com ([204.94.214.10]) by hawkwind.utcs.utoronto.ca with SMTP id <28314>; Thu, 23 Mar 2000 16:43:36 -0500 Received: from cthulhu.engr.sgi.com (gate3-relay.engr.sgi.com [130.62.1.234]) by deliverator.sgi.com (980309.SGI.8.8.8-aspam-6.2/980310.SGI-aspam) via ESMTP id IAA07556; Thu, 23 Mar 2000 08:57:55 -0800 (PST) mail_from (pj@sam.engr.sgi.com) Received: from sam.engr.sgi.com (sam.engr.sgi.com [163.154.6.37]) by cthulhu.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) via ESMTP id JAA64038; Thu, 23 Mar 2000 09:02:31 -0800 (PST) mail_from (pj@sam.engr.sgi.com) Received: (from pj@localhost) by sam.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) id JAA99286; Thu, 23 Mar 2000 09:01:34 -0800 (PST) From: pj@sam.engr.sgi.com (Paul Jackson) Message-Id: <200003231701.JAA99286@sam.engr.sgi.com> To: Bengt Kleberg Subject: Re: Applying old samx patch to newer sam? Cc: sam-fans@hawkwind.utcs.toronto.edu Date: Thu, 23 Mar 2000 12:03:28 -0500 Bengt wrote: |> Please note that I am trying to 'maintain' sam-9libs. Thank-you and bless you! |> I rather not include this [samx] in sam-9libs. That's fine - I wasn't expecting sam-9libs to accomodate samx. I acknowledge that samx is "controversial". I should have been clearer that I was more looking for feedback from other samx users as to whether I should worry about the failed chunk of the patch. |> 1 sam is supposed to be mouse driven, not keyboard driven. It is common-place for the finest tools to be written with a focused vision, and then for users to turn around and do the darndest things with them. Life is good. ======================================================================= I won't rest till it's the best ... Software Production Engineer Paul Jackson (pj@sgi.com; pj@usa.net) 3x1373 http://sam.engr.sgi.com/pj From sam-fans-owner Sat Mar 25 01:30:47 2000 Received: from highwire.stanford.edu ([171.64.249.40]) by hawkwind.utcs.toronto.edu with SMTP id <28359>; Sat, 25 Mar 2000 01:00:42 -0500 Received: from aubrey.stanford.edu (jimr@aubrey.Stanford.EDU [171.64.31.58]) by highwire.stanford.edu (8.9.3/HIGHWIRE2.0) with ESMTP id NAA22426 for ; Fri, 24 Mar 2000 13:25:07 -0800 (PST) Message-Id: <200003242125.NAA22426@highwire.stanford.edu> X-url: http://highwire.stanford.edu/~jimr/ X-face: "!ZH^<"U,NeU:732A To: "sam Fans" Dcc: Subject: the obvious. =) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <9897.953933106.1@aubrey.stanford.edu> Date: Fri, 24 Mar 2000 16:25:07 -0500 Sender: jimr@aubrey.stanford.edu I just have to shout to the world (well, to sam fans) that this editor is wonderful! Now that I'm actually working directly in sam instead of just using it via a pipe (from wily), I'm amazed at how much easier it is to do stuff. One of the things I tend to do in Java is write a method with name X that takes no args, X(), or takes N args, X(N). X() tends to just pass some sort of defaults on to X(N). When writing JavaDoc comments for each method, it's a major pain a lot of it tends to be a straight copy and paste one to the other Now, with sam, I can just write the top java doc comment, and when I'm finally ready I can just write ,x/^\/\*(.+\n)+ \*\/\n/ t /}\n/ To copy the top comment down to the second method. e.g. /** * 1-5 lines describing Foo */ public void X() { ... } public void X(N) { ... } turns into /** * 1-5 lines describing Foo */ public void X() { ... } /** * 1-5 lines describing Foo */ public void X(N) { ... } sam's slogan ought to be 'Making your life easier through structured regular expressions.' =) Jim From sam-fans-owner Sat Mar 25 01:33:46 2000 Received: from ejk.cso.uiuc.edu ([130.126.112.162]) by hawkwind.utcs.toronto.edu with SMTP id <28337>; Sat, 25 Mar 2000 01:00:08 -0500 Received: (qmail 24505 invoked from network); 24 Mar 2000 12:32:33 -0000 Received: from localhost (HELO uiuc.edu) (ejk@127.0.0.1) by localhost with SMTP; 24 Mar 2000 12:32:33 -0000 Sender: ejk Message-ID: <38DB6061.3F9125E9@uiuc.edu> Date: Fri, 24 Mar 2000 07:32:33 -0500 From: Ed Kubaitis Organization: CCSO - University of Illinois at Urbana-Champaign X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.12-20smp i686) X-Accept-Language: en MIME-Version: 1.0 To: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: Applying old samx patch to newer sam? References: <200003231701.JAA99286@sam.engr.sgi.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, AFAIK, the failed pieces in the samx patch can be ignored. As I recollect, the failed pieces were applying changes which the new (circa 1993) libXg provided in a different way/place. I've been using versions of sam + samx patch since then, building it most recently a few months ago for Redhat Linux 6.1 and have not seen any problems. Ed -------------------------- Ed Kubaitis (ejk@uiuc.edu) CCSO - University of Illinois - Urbana-Champaign Paul Jackson wrote: > > Bengt wrote: > |> Please note that I am trying to 'maintain' sam-9libs. > > Thank-you and bless you! > > |> I rather not include this [samx] in sam-9libs. > > That's fine - I wasn't expecting sam-9libs to accomodate > samx. I acknowledge that samx is "controversial". > > I should have been clearer that I was more looking > for feedback from other samx users as to whether > I should worry about the failed chunk of the patch. > > |> 1 sam is supposed to be mouse driven, not keyboard driven. > > It is common-place for the finest tools to be written > with a focused vision, and then for users to turn around > and do the darndest things with them. Life is good. > > ======================================================================= > I won't rest till it's the best ... Software Production Engineer > Paul Jackson (pj@sgi.com; pj@usa.net) 3x1373 http://sam.engr.sgi.com/pj From sam-fans-owner Mon Mar 27 00:40:07 2000 Received: from highwire.stanford.edu ([171.64.249.40]) by hawkwind.utcs.toronto.edu with SMTP id <25342>; Mon, 27 Mar 2000 00:24:55 -0500 Received: from aubrey.stanford.edu (jimr@aubrey.Stanford.EDU [171.64.31.58]) by highwire.stanford.edu (8.9.3/HIGHWIRE2.0) with ESMTP id TAA02299 for ; Sun, 26 Mar 2000 19:35:10 -0800 (PST) Message-Id: <200003270335.TAA02299@highwire.stanford.edu> X-url: http://highwire.stanford.edu/~jimr/ X-face: "!ZH^<"U,NeU:732A To: "sam Fans" Dcc: Subject: Re: the obvious. =) In-reply-to: Message from "kim kubik" of "Sun, 26 Mar 2000 12:54:17 PST."References: <01bf9765$97d9fd00$a4d2efd1@pkwksj.sjna.corp.dom> <01bf9765$97d9fd00$a4d2efd1@pkwksj.sjna.corp.dom> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16178.954128110.1@aubrey.stanford.edu> Date: Sun, 26 Mar 2000 22:35:10 -0500 Sender: jimr@aubrey.stanford.edu > # Do these guys: &, <, > : > [,x/&|<|>/{ > g/&/c/&/ > g/ g/>/c/>/ > }] > > where double clicking inside the last [bracket] backhilites this > section (but not the [ ] brackets), snarf it, click in the text > file, sam it, and send it. Bang, end of story. That's a pretty good idea. Coming off of using wily (an Acme clone), one of the things I thought about doing was writing a set of guide files for sam. It's really too bad one can't have a real acme clone (with the same neat file handling) with a sam command window! =) > # BOLD FACE DOT: > [s/./&/ > a/<\/b>/ ] Since you have dot selected, why not just [s/.+/&<\/b>/]? > If you're at the EOF when you dot-out of text entry, it's easy to > get back; otherwise one can type e.g. zz, then dot out, make the > correction, and get right back to zz and continue on. Is there any vi influance here (zz)? =) I'm wondering if you really enter most of your text via the command window? I'd find it hard to go back and hunt down previous commands from the scroll-back. Does anyone have a nice make system in place to use from sam, or perhaps etags support? I'm thinking of writing up a make script that will dump the results to an ERRORS file and open it up using sam's pipe. If it exists one could send 'e ERRORS' and stuff as well, I suppose. Jim P.S. In case folks are interested, here is a diff of changes I had to make against sam.1 in order to read the man page on my Linux box (the original works fine under Solaris, but linux's groff barfs on it). *** sam.1.orig Wed Mar 22 12:36:06 2000 --- sam.1 Wed Mar 22 12:39:24 2000 *************** *** 20,26 **** .de TF .br .IP "" \w'\fB\\$1\ \ \fP'u ! .PD0 .. .de EX .CW --- 20,26 ---- .de TF .br .IP "" \w'\fB\\$1\ \ \fP'u ! .PD .. .de EX .CW *************** *** 71,77 **** the editor's file until it first becomes the current file\(emthat to which editing commands apply\(emwhereupon its menu entry is printed. The options are ! .TF "\-r machine " .TP .B \-d Do not download the terminal part of --- 71,77 ---- the editor's file until it first becomes the current file\(emthat to which editing commands apply\(emwhereupon its menu entry is printed. The options are ! .TF .TP .B \-d Do not download the terminal part of *************** *** 105,111 **** to represent newlines. A regular expression may never contain a literal newline character. The elements of regular expressions are: ! .TF "[^abc] " .TP .B . Match any character except newline. --- 105,111 ---- to represent newlines. A regular expression may never contain a literal newline character. The elements of regular expressions are: ! .TF .TP .B . Match any character except newline. *************** *** 145,151 **** and .I r2 are regular expressions. ! .TF "r1|r2 " .TP .BI ( r1 ) Match what --- 145,151 ---- and .I r2 are regular expressions. ! .TF .TP .BI ( r1 ) Match what *************** *** 210,216 **** All files always have a current substring, called dot, that is the default address. .SS Simple Addresses ! .TF ?regexp? .TP .BI # n The empty string after character --- 210,216 ---- All files always have a current substring, called dot, that is the default address. .SS Simple Addresses ! .TF .TP .BI # n The empty string after character *************** *** 223,229 **** .IR n . .TP .BI / regexp / ! .PD0 .TP .BI ? regexp ? The substring that matches the regular expression, --- 223,229 ---- .IR n . .TP .BI / regexp / ! .PD .TP .BI ? regexp ? The substring that matches the regular expression, *************** *** 272,278 **** and .I a2 are addresses. ! .TF "a1+a2 " .TP .IB a1 + a2 The address --- 272,278 ---- and .I a2 are addresses. ! .TF .TP .IB a1 + a2 The address *************** *** 413,419 **** .br .ne 1.2i .SS Text commands ! .PD0 .TP .BI a/ text / .TP --- 413,419 ---- .br .ne 1.2i .SS Text commands ! .PD .TP .BI a/ text / .TP *************** *** 526,532 **** Print a menu of files. The format is: .RS ! .TF "XorXblankXX" .TP .BR ' " or blank" indicating the file is modified or clean, --- 526,532 ---- Print a menu of files. The format is: .RS ! .TF .TP .BR ' " or blank" indicating the file is modified or clean, *************** *** 791,797 **** provides the following operators, each of which uses one or more cursors to prompt for selection of a window or sweeping of a rectangle. ! .TF "reshape " .TP .B new Create a new, empty file: --- 791,797 ---- provides the following operators, each of which uses one or more cursors to prompt for selection of a window or sweeping of a rectangle. ! .TF .TP .B new Create a new, empty file: *************** *** 873,879 **** quoted strings or bracketed strings, depending on the text at the click. .PP Button 2 provides a menu of editing commands: ! .TF "/regexp" .TP .B cut Delete dot and save the deleted text in the snarf buffer. --- 873,879 ---- quoted strings or bracketed strings, depending on the text at the click. .PP Button 2 provides a menu of editing commands: ! .TF .TP .B cut Delete dot and save the deleted text in the snarf buffer. From sam-fans-owner Mon Mar 27 00:40:27 2000 Received: from highwire.stanford.edu ([171.64.249.40]) by hawkwind.utcs.toronto.edu with SMTP id <25205>; Mon, 27 Mar 2000 00:24:43 -0500 Received: from aubrey.stanford.edu (jimr@aubrey.Stanford.EDU [171.64.31.58]) by highwire.stanford.edu (8.9.3/HIGHWIRE2.0) with ESMTP id RAA22703; Sat, 25 Mar 2000 17:51:46 -0800 (PST) Message-Id: <200003260151.RAA22703@highwire.stanford.edu> X-url: http://highwire.stanford.edu/~jimr/ X-face: "!ZH^<"U,NeU:732A To: "kim kubik" cc: "sam Fans" Dcc: Subject: Re: the obvious. =) In-reply-to: Message from "kim kubik" of "Sat, 25 Mar 2000 15:47:54 PST."References: <01bf96b4$8a262aa0$7dc9efd1@pkwksj.sjna.corp.dom> <01bf96b4$8a262aa0$7dc9efd1@pkwksj.sjna.corp.dom> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3671.954035506.1@aubrey.stanford.edu> Date: Sat, 25 Mar 2000 20:51:46 -0500 Sender: jimr@aubrey.stanford.edu > >,x/^\/\*(.+\n)+ \*\/\n/ t /}\n/ > > this just ran up against my (mis)understanding of > sam's regexp's. I'm sure when first using sam I did > something similar to your example above and the > 'greedy' little bastard (.+\n)+ would (to my way > of thinking) eat the whole file, that is, never see > the closing */ of the commment because the .+ should > just keep on going. Here's what I *think* is going on, but I'm no regex guru... A '(.*\n)+' would keep it going to the end of the file. With '(.+\n)+' I'm specifying that there must be at least one character before the newline. So this match ends at the first blank line. I think the engine then backtracks until it finds a match for ' \*\/' -- which is the end of the comment. I believe the previous match of a newline ensures that it will not hit the comments within the blocks (as those are '\n\t *'). And yes, I do space indent my comments so the '*' lines up with the topmost one. I thought that was in my post, though I did tab-indent the whole block. Perhaps my mailer munged it. Jim From sam-fans-owner Mon Mar 27 00:40:38 2000 Received: from smtp6.jps.net ([216.119.0.86]) by hawkwind.utcs.toronto.edu with SMTP id <25324>; Mon, 27 Mar 2000 00:24:49 -0500 Received: from pkwksj.sjna.corp.dom (209-239-210-164.oak.jps.net [209.239.210.164]) by smtp6.jps.net (8.9.3/8.9.0) with SMTP id MAA24750; Sun, 26 Mar 2000 12:54:39 -0800 (PST) From: "kim kubik" To: Cc: "sam Fans" Subject: Re: the obvious. =) Date: Sun, 26 Mar 2000 15:54:17 -0500 Message-ID: <01bf9765$97d9fd00$a4d2efd1@pkwksj.sjna.corp.dom> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.71.1712.3 X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 -----Original Message----- From: James A. Robinson To: kim kubik Cc: sam Fans Date: Saturday, March 25, 2000 5:54 PM Subject: Re: the obvious. =) >> >,x/^\/\*(.+\n)+ \*\/\n/ t /}\n/ >> >> this just ran up against my (mis)understanding of >> sam's regexp's. > > >Here's what I *think* is going on, but I'm no regex guru... A '(.*\n)+' >would keep it going to the end of the file. With '(.+\n)+' I'm specifying >that there must be at least one character before the newline. So this >match ends at the first blank line. I think the engine then backtracks >until it finds a match for ' \*\/' Jim - I tried a couple of different scenarios on before I posted and *think* a blank line was one of the first I tried since the . in (.+\n)+ obviously needs to match something "real". Since I can't remember exactly, my best guess is that what I tried must have been something like: /** * stuff about foo * * and the above is a "blank" line * only if you're a total moron. . . */ which should put me in the forefront of those nominated for the Homer Simpson Award, Year 2000 ("Doooh!"). Since you seem to like to pass around neat SREs, there are times when it's necessary to convert a txt file to html and using a sam "macro" file that I stick off to the side next to the txt file (and using # faux-comments to remind me what each does), there are things in txt2htm.sam like: # Do these guys: &, <, > : [,x/&|<|>/{ g/&/c/&/ g//c/>/ }] where double clicking inside the last [bracket] backhilites this section (but not the [ ] brackets), snarf it, click in the text file, sam it, and send it. Bang, end of story. And when casually perusing the text, if I note something worth embolding, backhiliting the text of interest and snarfing this from the "macro" file, sam-ing the text file and sending: # BOLD FACE DOT: [s/./&/ a/<\/b>/ ] does just that. And tho old habits are difficult to break, I've learned (but still find myself forgetting) that one does not need the samX cursor-arrow keys if you just STAY IN THE SAM COMMAND WINDOW and move around using /re and -/re. It is so much easier than cursoring around, trying to remember which -Duh moves right one word, whatever. You're looking at 'miscake' and want it to be 'mistake' and almost as if sam can read one's mind, you just dot-out and send the cursor there in one move, make the correction, and get back where you were. If you're at the EOF when you dot-out of text entry, it's easy to get back; otherwise one can type e.g. zz, then dot out, make the correction, and get right back to zz and continue on. Maybe all this is obvious to everyone but me. . . most things are. - kim From sam-fans-owner Mon Mar 27 00:40:45 2000 Received: from smtp5.jps.net ([216.119.0.85]) by hawkwind.utcs.toronto.edu with SMTP id <25114>; Mon, 27 Mar 2000 00:24:09 -0500 Received: from pkwksj.sjna.corp.dom (209-239-201-125.oak.jps.net [209.239.201.125]) by smtp5.jps.net (8.9.3/8.9.0) with SMTP id PAA05678; Sat, 25 Mar 2000 15:47:52 -0800 (PST) From: "kim kubik" To: , "sam Fans" Subject: Re: the obvious. =) Date: Sat, 25 Mar 2000 18:47:54 -0500 Message-ID: <01bf96b4$8a262aa0$7dc9efd1@pkwksj.sjna.corp.dom> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.71.1712.3 X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 -----Original Message----- From: James A. Robinson To: sam Fans Date: Friday, March 24, 2000 10:26 PM Subject: the obvious. =) >I just have to shout to the world (well, to sam fans) that this editor >is wonderful>I'm finally ready I can just write > >,x/^\/\*(.+\n)+ \*\/\n/ t /}\n/ > >To copy the top comment down to the second method. e.g. > Jim (or anyone): this just ran up against my (mis)understanding of sam's regexp's. I'm sure when first using sam I did something similar to your example above and the 'greedy' little bastard (.+\n)+ would (to my way of thinking) eat the whole file, that is, never see the closing */ of the commment because the .+ should just keep on going. But I tried what you have and it works, so obviously all this time the way I've been getting around this, using addresses, e.g. ,x/re/{ .,/re2/do stuff } isn't necessary. So what am I missing? - kim PS: in your example there's a space after the second + that shouldn't be there, right? At least by your example, but probably you do comments as: /* * so there really is a space * before the last splat. * */ And the example left this out. From sam-fans-owner Mon Mar 27 15:40:08 2000 Received: from plan9.cs.bell-labs.com ([204.178.31.2]) by hawkwind.utcs.toronto.edu with SMTP id <25324>; Mon, 27 Mar 2000 15:22:20 -0500 From: "rob pike" Subject: Re: the obvious. =) Date: Mon, 27 Mar 2000 09:37:26 -0500 To: sam-fans@hawkwind.utcs.toronto.edu MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <00Mar27.152220est.25324@hawkwind.utcs.toronto.edu> ,x/^\/\*(.+\n)+ \*\/\n/ t /}\n/ Regular expressions have their limitations, which is why Sam also has addresses. These provide a simpler and safer way to match multi-line things like comments: ,x/^\/\*/ .,/\*\/\n/ t /}\n/ This one works even if there are no blank lines. Here's a troff paragraph-at-a-time pattern: ,x/^\.PP/ .,/^\.(PP|SH)/- ... Also if there's a slash in the pattern, you can use another character as the delimiter and save a backslash, as in this example for C++ // comments: x/\/\// goes to x;//; Have fun. -rob From sam-fans-owner Mon Mar 27 15:40:19 2000 Received: from web3207.mail.yahoo.com ([204.71.202.204]) by hawkwind.utcs.toronto.edu with SMTP id <25205>; Mon, 27 Mar 2000 15:19:35 -0500 Message-ID: <20000327135218.17756.qmail@web3207.mail.yahoo.com> Received: from [204.68.140.35] by web3207.mail.yahoo.com; Mon, 27 Mar 2000 05:52:18 PST Date: Mon, 27 Mar 2000 08:52:18 -0500 From: Jim Crigler Subject: sam-9libs vs. Linux (RH 6.0) To: sam-fans@hawkwind.utcs.toronto.edu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Hmmm ... I asked this on comp.editors a couple of weeks ago, and was pointed here as a place to subscribe for real sam help. Under RedHat 6.0 I can run sam -d fine, but when I attempt to start the "gui" version, samterm shows up and then disappears. The sam process then dies with a "broken pipe" message. Where can I go from here? BTW, sam works on Solaris (at work) with no problems at all. -- Jim Crigler __________________________________________________ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com From sam-fans-owner Mon Mar 27 18:18:49 2000 Received: from smtp5.jps.net ([216.119.0.85]) by hawkwind.utcs.toronto.edu with SMTP id <25225>; Mon, 27 Mar 2000 17:57:50 -0500 Received: from pkwksj.sjna.corp.dom (209-239-207-129.oak.jps.net [209.239.207.129]) by smtp5.jps.net (8.9.3/8.9.0) with SMTP id OAA02049; Mon, 27 Mar 2000 14:38:25 -0800 (PST) From: "kim kubik" To: , "sam Fans" Subject: Re: the obvious. =) (to everyone but kim) Date: Mon, 27 Mar 2000 17:39:41 -0500 Message-ID: <01bf983d$578f4f60$1ec5efd1@pkwksj.sjna.corp.dom> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.71.1712.3 X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 -----Original Message----- From: James A. Robinson To: sam Fans Date: Sunday, March 26, 2000 9:45 PM Subject: Re: the obvious. =) J.A.R. wrote: >one of the things I thought about doing was writing a set of guide >files for sam. It's really too bad one can't have a real acme clone >(with the same neat file handling) with a sam command window! =) > that's sort of what gave me the idea of these sam "macro" files, the acme/wily guide files. I just put the oft-used command sequences in a little window about the shape of a vertical Hershey candy bar off to the right and then snarf what I need. >> # BOLD FACE DOT: >> [s/./&/ >> a/<\/b>/ ] >Since you have dot selected, why not just [s/.+/&<\/b>/]? > I *think* that the above will work on text in one line ONLY. My memory is that I tried a number of convoluted SREs (well, the number I could come up with is still a small integer) and finally had to settle on the a/<\/b> as being necessary if I wanted to backhilite any arbitrary section of possibly multi-line text which could possibly include multi \n\n+ 's. >Is there any vi influance here (zz)? =) I'm wondering if you really >enter most of your text via the command window? I'd find it hard to go >back and hunt down previous commands from the scroll-back. Like I said originally, old habits die hard; I still shove the mouse cursor into the text window, click and start typing, but I really really try to do it in the sam window. And yes, every once in a while I need to telnet to a Unix system and so have to remember some vi, but the zz idea actually came from a much older editor, called creatively EDIT, described in Software-P&E (1971)v1, p73-81, the author being a guy at Cambridge (UK) name of S.R. Bourne, before he came across the pond to play with that other OS. EDIT used a lone z to get out of text entry mode and enter command mode and had a cute way of walking thru the whole file, executing commands if you prefaced the command sequence with a 0 (similar to sam's , ). Being almost thirty years ago, one had to give a small line number range at startup which would be kept in core and edited; the rest of the file remained unaltered on disc. Over the years the editor got altered by various people including maybe Chris Fraser. While EDIT did't have re's, Marting Richards did publish an algorithm "strongly influenced by ... Thompson" (S-P&E (1979)v9,p527-534) later on (a student onced described Richards as the dullest lecturer he had in his whole time at Cambridge). Anyhow, I hope some of this helps someone. - kim PS: Jim I also have a number of SREs that walk through a file and delete those little copywrite notices and things like that which you Elsevier people seem to be so keen on including. :-) From sam-fans-owner Mon Mar 27 18:18:57 2000 Received: from highwire.stanford.edu ([171.64.249.40]) by hawkwind.utcs.toronto.edu with SMTP id <25166>; Mon, 27 Mar 2000 17:57:31 -0500 Received: from aubrey.stanford.edu (jimr@aubrey.Stanford.EDU [171.64.31.58]) by highwire.stanford.edu (8.9.3/HIGHWIRE2.0) with ESMTP id MAA11002; Mon, 27 Mar 2000 12:54:45 -0800 (PST) Message-Id: <200003272054.MAA11002@highwire.stanford.edu> X-url: http://highwire.stanford.edu/~jimr/ X-face: "!ZH^<"U,NeU:732A To: Jim Crigler cc: sam-fans@hawkwind.utcs.toronto.edu Dcc: Subject: Re: sam-9libs vs. Linux (RH 6.0) In-reply-to: Message from Jim Crigler of "Mon, 27 Mar 2000 08:52:18 EST."References: <20000327135218.17756.qmail@web3207.mail.yahoo.com> <20000327135218.17756.qmail@web3207.mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <17534.954190485.1@aubrey.stanford.edu> Date: Mon, 27 Mar 2000 15:54:45 -0500 Sender: jimr@aubrey.stanford.edu > Hmmm ... I asked this on comp.editors a couple of weeks ago, and was > pointed here as a place to subscribe for real sam help. Under RedHat > 6.0 I can run sam -d fine, but when I attempt to start the "gui" version, > samterm shows up and then disappears. The sam process then dies with a > "broken pipe" message. I think I responded to your post in Usenet, but in case you didn't see it: check your color depth. I found that samterm had problems with (I think) 24 bit depth. I normally use 16, and that works fine. I think 32 should also work. Try running 'xwininfo' and clicking on the root window to see what depth it is running at. Jim From sam-fans-owner Tue Mar 28 18:56:49 2000 Received: from highwire.stanford.edu ([171.64.249.40]) by hawkwind.utcs.toronto.edu with SMTP id <26299>; Tue, 28 Mar 2000 18:20:38 -0500 Received: from aubrey.stanford.edu (jimr@aubrey.Stanford.EDU [171.64.31.58]) by highwire.stanford.edu (8.9.3/HIGHWIRE2.0) with ESMTP id KAA18140; Tue, 28 Mar 2000 10:28:56 -0800 (PST) Message-Id: <200003281828.KAA18140@highwire.stanford.edu> X-url: http://highwire.stanford.edu/~jimr/ X-face: "!ZH^<"U,NeU:732A To: Jim Crigler cc: sam-fans@hawkwind.utcs.toronto.edu Dcc: Subject: Re: sam-9libs vs. Linux (RH 6.0) In-reply-to: Message from Jim Crigler of "Tue, 28 Mar 2000 10:15:41 PST."References: <20000328181541.26330.qmail@web3203.mail.yahoo.com> <20000328181541.26330.qmail@web3203.mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19312.954268136.1@aubrey.stanford.edu> Date: Tue, 28 Mar 2000 13:28:56 -0500 Sender: jimr@aubrey.stanford.edu > 16-bit X works, thanks. Neither 24 nor 32 works, > however. Is this likely to be a libXg problem or > something in samterm per se? I seem to recall it was a libXg problem. Someone explained that part of the code expects the depth to be have some properties that don't apply to 24bit depth (or, I guess, 32bit). I'm sorry that I don't remember the details. Jim From sam-fans-owner Tue Mar 28 18:56:56 2000 Received: from web3203.mail.yahoo.com ([204.71.202.200]) by hawkwind.utcs.toronto.edu with SMTP id <26298>; Tue, 28 Mar 2000 18:20:02 -0500 Message-ID: <20000328181541.26330.qmail@web3203.mail.yahoo.com> Received: from [192.31.86.34] by web3203.mail.yahoo.com; Tue, 28 Mar 2000 10:15:41 PST Date: Tue, 28 Mar 2000 13:15:41 -0500 From: Jim Crigler Subject: Re: sam-9libs vs. Linux (RH 6.0) To: jim.robinson@stanford.edu Cc: sam-fans@hawkwind.utcs.toronto.edu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii --- "Jim Robinson" wrote: > > Hmmm ... I asked this on comp.editors a couple of > weeks ago, and was > > pointed here as a place to subscribe for real sam > help. Under RedHat > > 6.0 I can run sam -d fine, but when I attempt to > start the "gui" version, > > samterm shows up and then disappears. The sam > process then dies with a > > "broken pipe" message. > > I think I responded to your post in Usenet, but in > case > you didn't see it: check your color depth. I found > that > samterm had problems with (I think) 24 bit depth. > > I normally use 16, and that works fine. I think 32 > should also work. Try running 'xwininfo' and > clicking > on the root window to see what depth it is running > at. 16-bit X works, thanks. Neither 24 nor 32 works, however. Is this likely to be a libXg problem or something in samterm per se? -- Another Jim __________________________________________________ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com From sam-fans-owner Mon Apr 3 18:49:56 2000 Received: from bio.cse.psu.edu ([130.203.12.17]) by hawkwind.utcs.toronto.edu with SMTP id <24954>; Mon, 3 Apr 2000 18:34:14 -0400 Received: (qmail 26971 invoked by uid 991); 29 Mar 2000 05:10:33 -0000 Message-ID: <20000329051033.26969.qmail@g.bio.cse.psu.edu> To: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: sam-9libs vs. Linux (RH 6.0) In-Reply-To: Message from "James A. Robinson" of "Tue, 28 Mar 2000 13:28:56 EST." <200003281828.KAA18140@highwire.stanford.edu> Date: Wed, 29 Mar 2000 00:10:32 -0500 From: Scott Schwartz | I seem to recall it was a libXg problem. Someone explained that part of | the code expects the depth to be have some properties that don't apply | to 24bit depth (or, I guess, 32bit). I'm sorry that I don't remember | the details. Yes, exactly. The bug was, libXg only does power-of-two depths, so 24 bits doesn't work. Annoyingly, most X servers don't let you ask for more than one depth visual, which would be the obvious workaround for something like sam. From sam-fans-owner Mon Apr 3 18:50:09 2000 Received: from ratatosk.utfors.se ([195.58.103.123]) by hawkwind.utcs.toronto.edu with SMTP id <24865>; Mon, 3 Apr 2000 18:32:59 -0400 Received: from nowhere (md469203b.utfors.se) by ratatosk.utfors.se (Sun Internet Mail Server sims.3.5.1999.07.30.00.05.p8) with ESMTP id <0FS500309PSDPA@ratatosk.utfors.se> for sam-fans@hawkwind.utcs.toronto.edu; Wed, 29 Mar 2000 02:09:50 +0200 (MET DST) Received: (qmail 25170 invoked by uid 1000); Wed, 29 Mar 2000 00:07:54 +0000 Date: Tue, 28 Mar 2000 19:07:54 -0500 From: Daniel Neri Subject: Re: sam-9libs vs. Linux (RH 6.0) In-reply-to: "James A. Robinson"'s message of "Tue, 28 Mar 2000 13:28:56 -0500" To: jim.robinson@stanford.edu Cc: Jim Crigler , sam-fans@hawkwind.utcs.toronto.edu Message-id: <87wvmm8wpx.fsf@nowhere.mayonnaise.net> Organization: mayonnaise.net -- a safe european home MIME-version: 1.0 Content-type: text/plain; charset=us-ascii User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.6 Lines: 18 References: <200003281828.KAA18140@highwire.stanford.edu> "James A. Robinson" writes: > I seem to recall it was a libXg problem. Someone explained that part of > the code expects the depth to be have some properties that don't apply > to 24bit depth (or, I guess, 32bit). I'm sorry that I don't remember > the details. FWIW, sam(term) works fine for me at 24bit depth (running on OpenBSD/i386 and XFree86 3.3.5). Though this is "plain sam", not based on 9libs. Best wishes, /Daniel -- Daniel Neri dne@mayonnaise.net From sam-fans-owner Mon Apr 3 18:50:17 2000 Received: from smtp6.jps.net ([216.119.0.86]) by hawkwind.utcs.toronto.edu with SMTP id <25423>; Mon, 3 Apr 2000 18:34:20 -0400 Received: from pkwksj.sjna.corp.dom (209-239-201-230.oak.jps.net [209.239.201.230]) by smtp6.jps.net (8.9.3/8.9.0) with SMTP id RAA06831; Thu, 30 Mar 2000 17:11:51 -0800 (PST) From: "kim kubik" To: "kim kubik" , , "sam Fans" Subject: Re: the obvious. =) (to everyone but kim) Date: Thu, 30 Mar 2000 20:12:53 -0500 Message-ID: <01bf9aae$3d654fe0$e6c9efd1@pkwksj.sjna.corp.dom> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.71.1712.3 X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 -----Original Message----- From: James A. Robinson To: kim kubik Date: Monday, March 27, 2000 2:55 PM Subject: Re: the obvious. =) (to everyone but kim) (kim wrote): >> PS: Jim I also have a number of SREs that walk through a file and >> delete those little copywrite notices and things like that which >> you Elsevier people seem to be so keen on including. :-) (and Jim replied): > Elsevier??? What gave you the idea I was an Elsevier person? > I work for HighWire Press, Elsevier is the antithesis of us. > > Jim Ooops, guess I stuck my foot in it again! Sorry if there are any implications I'm unaware of vis-a-vis Highwire & Elsevier, like maybe Elsevier publishes only to the pederast trade, while Highwire has loftier aspirations. On a safer topic the re you gave for bolding dot in an html file just needed a tiny addition to work in (I think, a dubious activity at best and not equating to 'I am') that s/(.+\n*)*/&<\/b>/ will surround any amount of backhilited text with ..., not just text on one line, and the text may include blank lines. So thank you and sorry about the faux pas. - kim From sam-fans-owner Mon Apr 3 18:50:24 2000 Received: from web3202.mail.yahoo.com ([204.71.202.199]) by hawkwind.utcs.toronto.edu with SMTP id <24931>; Mon, 3 Apr 2000 18:34:08 -0400 Message-ID: <20000329041205.767.qmail@web3202.mail.yahoo.com> Received: from [64.1.54.123] by web3202.mail.yahoo.com; Tue, 28 Mar 2000 20:12:05 PST Date: Tue, 28 Mar 2000 23:12:05 -0500 From: Jim Crigler Subject: Re: sam-9libs vs. Linux (RH 6.0) To: Daniel Neri , jim.robinson@stanford.edu Cc: sam-fans@hawkwind.utcs.toronto.edu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > "James A. Robinson" > writes: > > > I seem to recall it was a libXg problem. Someone > explained that part of > > the code expects the depth to be have some > properties that don't apply > > to 24bit depth (or, I guess, 32bit). I'm sorry > that I don't remember > > the details. > > FWIW, sam(term) works fine for me at 24bit depth > (running on > OpenBSD/i386 and XFree86 3.3.5). Though this is > "plain sam", not based > on 9libs. Hmm ... I compiled sam-9libs at the same time as wily-9libs, and wily seems to have no problem (modulo not getting caps lock when it's pressed under wily). -- Jim Crigler __________________________________________________ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com From sam-fans-owner Mon Apr 3 18:50:29 2000 Received: from web3202.mail.yahoo.com ([204.71.202.199]) by hawkwind.utcs.toronto.edu with SMTP id <25484>; Mon, 3 Apr 2000 18:34:27 -0400 Message-ID: <20000331154744.5873.qmail@web3202.mail.yahoo.com> Received: from [192.31.86.34] by web3202.mail.yahoo.com; Fri, 31 Mar 2000 07:47:44 PST Date: Fri, 31 Mar 2000 10:47:44 -0500 From: Jim Crigler Subject: Input buffer limit??? To: sam-fans@hawkwind.utcs.toronto.edu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii The other day I was typing in some text via the "sam" (command) window and after a few tens of lines (don't know how many; sorry), I suddenly got a message in the command window like "?out of buffer memory" or some such. Is this a known characteristic of sam? Where should I have looked in the docs to find it? -- Jim Crigler __________________________________________________ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com From sam-fans-owner Wed Apr 12 01:04:36 2000 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.toronto.edu with SMTP id <24785>; Wed, 12 Apr 2000 00:52:11 -0400 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id MAA25126; Wed, 5 Apr 2000 12:51:38 +0200 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id MAA03109; Wed, 5 Apr 2000 12:51:37 +0200 Date: Wed, 5 Apr 2000 06:51:37 -0400 From: Bengt Kleberg Message-Id: <200004051051.MAA03109@trillian.softwell.se> To: criglerj@yahoo.com, sam-fans@hawkwind.utcs.toronto.edu Subject: Re: Input buffer limit??? > From: Jim Crigler > The other day I was typing in some text via the "sam" > (command) window and after a few tens of lines (don't > know how many; sorry), I suddenly got a message in the > command window like "?out of buffer memory" Greetings, I ahve tried various combinations. Many lines work fine, I have > 60 lines with > 1500 characters after an a command. But, 1 long line does have problem after 512 characters. It appears that sam can only send 512 bytes to samterm. As a workaround, could you limit your lines to 512 characters and then join them together after they have arrived in the file? Presumably it should be possible to change this limit if it is a problem... Best Wishes, Bengt =============================================================== Everything aforementioned should be regarded as totally private opinions, and nothing else. bengt@softwell.se ``His great strength is that he is uncompromising. It would make him physically ill to think of programming in C++.'' From sam-fans-owner Fri Apr 14 17:39:30 2000 Received: from deliverator.sgi.com ([204.94.214.10]) by hawkwind.utcs.toronto.edu with SMTP id <25463>; Fri, 14 Apr 2000 17:35:24 -0400 Received: from cthulhu.engr.sgi.com (gate3-relay.engr.sgi.com [130.62.1.234]) by deliverator.sgi.com (980309.SGI.8.8.8-aspam-6.2/980310.SGI-aspam) via ESMTP id QAA00900 for <@external-mail-relay.sgi.com:sam-fans@hawkwind.utcs.toronto.edu>; Thu, 13 Apr 2000 16:04:52 -0700 (PDT) mail_from (pj@sam.engr.sgi.com) Received: from sam.engr.sgi.com (sam.engr.sgi.com [163.154.6.37]) by cthulhu.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) via ESMTP id QAA74538 for <@cthulhu.engr.sgi.com:sam-fans@hawkwind.utcs.toronto.edu>; Thu, 13 Apr 2000 16:09:33 -0700 (PDT) mail_from (pj@sam.engr.sgi.com) Received: (from pj@localhost) by sam.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) id QAA02307 for sam-fans@hawkwind.utcs.toronto.edu; Thu, 13 Apr 2000 16:09:09 -0700 (PDT) Date: Thu, 13 Apr 2000 19:09:09 -0400 From: pj@sam.engr.sgi.com (Paul Jackson) Message-Id: <200004132309.QAA02307@sam.engr.sgi.com> To: sam-fans@hawkwind.utcs.toronto.edu Subject: reworked samx patch, plus softtab feature [sorry for the email a few minutes ago w/o a Subject, I botched an email session ... pj ] Bengt in particular, but anyone -- I invite comment on where (or if) to publicize these 3 sam and samx patches. -- I would like to make available the following three patches: samx.a.patch -- upgrade sam to samx (samx2 for 9libs) samx.b.patch -- fix compiler warnings samx.c.patch -- add softtab feature to samx These three patches apply to the Editor "sam", in the "9libs" for maintained by Bengt Kleberg , and distributed from: ftp://ftp.demon.co.uk/pub/unix/plan9/sam-9libs.* These three patches update the "samx2" extensions for Sam, and add one more feature: softtabs. -- What is samx: Samx Version 2 (samx2) adds some extensions to the sam editor. So far as I can find, the only samx patches are: Samx Version 2: Extensions to the Unix/X11 Sam Editor ----------------------------------------------------- Ed Kubaitis (ejk@uiuc.edu) 17 April 1993 from: ftp://ftp.funet.fi/pub/unix/editors/sam/samx2/ Samx provides several additional gui editing features, and a "samkeys" facility for mapping these features to the desired keyboard or mouse input. -- What each patch does: samx.a.patch: This patch reworks the old "samx2" patch for application to the current (as of May 1999) 9libs version of the sam editor. The old 1993 samx patch no longer applied cleanly to this current sam. samx.b.patch: Recompiling the above current 9libs sam on my system (SGI Irix 6.5.7m) generated several compiler warnings, mostly for (1) unused variables (2) missing enum typecasts and (3) missing 'int' in declarations. This patch corrects these warnings. samx.c.patch: This patch adds a "softtab" capability, to let you work with 4 space (the '4' is configurable) soft tabs, while maintaining compatibility with 8 space (the '8' was already hardcoded in sam, and continues to be so) hardware (or display manager) tabs. The details of these softtabs are given below. -- Applying these patches: These three patches are intended to be applied sequentially to the 9libs sam base. The following instructions are overly specific in several places -- I figure it is easier for the reader to generalize the specific than to attempt these instructions in their full generality. 1) Obtain 9libs and sam-9libs, from: ftp://ftp.demon.co.uk/pub/unix/plan9/9libs-1.0.tar.gz ftp://ftp.demon.co.uk/pub/unix/plan9/sam-9libs.tar.gz 2) Obtain samx2, from: ftp://ftp.funet.fi/pub/unix/editors/sam/samx2/samx2.shar.Z 3) Obtain these samx.[abc].patch patches, from: ??? Not publically available yet -- would it make sense to put these patches on ftp.demon.co.uk or ftp.funet.fi or SourceForge.net (perhaps we should establish a "sam" project there) or oss.sgi.com (my employers Open Source site). I can email or otherwise deliver these patches, but want to give the sam old-timers, especially Bengt, a chance to comment and express preferences before putting them up on a public site. My preference would be to create a SourceForge.net project, and put all the pieces (sam, samx and my three patches) there. But I'm quite flexible. 4) Unpack 9libs: gunzip 9libs-1.0.tar.gz tar xvf 9libs-1.0.tar 5) Unpack sam-9libs: gunzip sam-9libs.tar.gz cd 9libs-1.0 tar xvf ../sam-9libs.tar 6) Unpack samx2 (for the documentation and example configuration, not for the patch, which samx.a.patch replaces): cd .. gunzip samx2.shar.Z mkdir samx mv samx2.shar samx cd samx sh samx2.shar 7) Apply patches. They are intended to be applied in order. You can apply just a, or a and b, and all three a, b and c. cd .. patch < samx.a.patch patch < samx.b.patch patch < samx.c.patch 8) Configure, make and install: cd 9libs-1.0 ./configure make su make install -- Details of softtabs: These softtabs emulate tabs at a specified spacing, while assuming that the actual tab character '\t' has a fixed 8 column spacing. These softtabs _only_ apply in the left margin (in the horizontal whitespace immediately following a new line or beginning of file). The "softtab" key spaces to the next column, modulo "softtabWidth", and rewrites all the preceeding horizontal whitespace on that line to use as many hard tab '\t' characters as there is space for, given the hardcoded assumption that hard tabs are 8 columns. The "softbackspace" key (in the left margin) backs up to the previous soft tab stop, converting hard tabs to spaces and removing spaces, as need be. Outside of the left margin, or if softtabs are not enabled or if softtabwidth is not > 0, softtab and softbackspace behave like simple tab and backspace (adding a tab char, and deleting the previous char, whatever it is). The X11 resource samterm*softtabWidth controls the soft tab width. Attempts to set softtabWidth to any number greater than 16 are silently forced to set it to 16. The resource samterm*softTab controls the initial setting of whether softtabs are enabled or not. The Samkey softtabtoggle toggles whether softtabs are enabled. -- Configuring softtabs: The following settings, copied from my .Xresources and Samkeys files, control and bind softtabs: ............ .Xresources ................ samterm*softtabWidth: 4 samterm*softTab: on ............ Samkeys ................ BackSpace : softbackspace Tab : softtab Delete : softbackspace ctrl h : softbackspace ctrl i : softtab alt Tab : softtabtoggle ======================================================================= I won't rest till it's the best ... Software Production Engineer Paul Jackson (pj@sgi.com; pj@usa.net) 3x1373 http://sam.engr.sgi.com/pj From sam-fans-owner Fri Apr 14 17:39:46 2000 Received: from deliverator.sgi.com ([204.94.214.10]) by hawkwind.utcs.toronto.edu with SMTP id <25462>; Fri, 14 Apr 2000 17:34:09 -0400 Received: from cthulhu.engr.sgi.com (gate3-relay.engr.sgi.com [130.62.1.234]) by deliverator.sgi.com (980309.SGI.8.8.8-aspam-6.2/980310.SGI-aspam) via ESMTP id PAA29468 for <@external-mail-relay.sgi.com:sam-fans@hawkwind.utcs.toronto.edu>; Thu, 13 Apr 2000 15:52:09 -0700 (PDT) mail_from (pj@sam.engr.sgi.com) Received: from sam.engr.sgi.com (sam.engr.sgi.com [163.154.6.37]) by cthulhu.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) via ESMTP id PAA71525 for <@cthulhu.engr.sgi.com:sam-fans@hawkwind.utcs.toronto.edu>; Thu, 13 Apr 2000 15:56:44 -0700 (PDT) mail_from (pj@sam.engr.sgi.com) Received: (from pj@localhost) by sam.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) id PAA27205 for sam-fans@hawkwind.utcs.toronto.edu; Thu, 13 Apr 2000 15:56:20 -0700 (PDT) Date: Thu, 13 Apr 2000 18:56:20 -0400 From: pj@sam.engr.sgi.com (Paul Jackson) Message-Id: <200004132256.PAA27205@sam.engr.sgi.com> To: sam-fans@hawkwind.utcs.toronto.edu Bengt in particular, but anyone -- I invite comment on where (or if) to publicize these 3 sam and samx patches. -- I would like to make available the following three patches: samx.a.patch -- upgrade sam to samx (samx2 for 9libs) samx.b.patch -- fix compiler warnings samx.c.patch -- add softtab feature to samx These three patches apply to the Editor "sam", in the "9libs" for maintained by Bengt Kleberg , and distributed from: ftp://ftp.demon.co.uk/pub/unix/plan9/sam-9libs.* These three patches update the "samx2" extensions for Sam, and add one more feature: softtabs. -- What is samx: Samx Version 2 (samx2) adds some extensions to the sam editor. So far as I can find, the only samx patches are: Samx Version 2: Extensions to the Unix/X11 Sam Editor ----------------------------------------------------- Ed Kubaitis (ejk@uiuc.edu) 17 April 1993 from: ftp://ftp.funet.fi/pub/unix/editors/sam/samx2/ Samx provides several additional gui editing features, and a "samkeys" facility for mapping these features to the desired keyboard or mouse input. -- What each patch does: samx.a.patch: This patch reworks the old "samx2" patch for application to the current (as of May 1999) 9libs version of the sam editor. The old 1993 samx patch no longer applied cleanly to this current sam. samx.b.patch: Recompiling the above current 9libs sam on my system (SGI Irix 6.5.7m) generated several compiler warnings, mostly for (1) unused variables (2) missing enum typecasts and (3) missing 'int' in declarations. This patch corrects these warnings. samx.c.patch: This patch adds a "softtab" capability, to let you work with 4 space (the '4' is configurable) soft tabs, while maintaining compatibility with 8 space (the '8' was already hardcoded in sam, and continues to be so) hardware (or display manager) tabs. The details of these softtabs are given below. -- Applying these patches: These three patches are intended to be applied sequentially to the 9libs sam base. The following instructions are overly specific in several places -- I figure it is easier for the reader to generalize the specific than to attempt these instructions in their full generality. 1) Obtain 9libs and sam-9libs, from: ftp://ftp.demon.co.uk/pub/unix/plan9/9libs-1.0.tar.gz ftp://ftp.demon.co.uk/pub/unix/plan9/sam-9libs.tar.gz 2) Obtain samx2, from: ftp://ftp.funet.fi/pub/unix/editors/sam/samx2/samx2.shar.Z 3) Obtain these samx.[abc].patch patches, from: ??? Not publically available yet -- would it make sense to put these patches on ftp.demon.co.uk or ftp.funet.fi or SourceForge.net (perhaps we should establish a "sam" project there) or oss.sgi.com (my employers Open Source site). I can email or otherwise deliver these patches, but want to give the sam old-timers, especially Bengt, a chance to comment and express preferences before putting them up on a public site. My preference would be to create a SourceForge.net project, and put all the pieces (sam, samx and my three patches) there. But I'm quite flexible. 4) Unpack 9libs: gunzip 9libs-1.0.tar.gz tar xvf 9libs-1.0.tar 5) Unpack sam-9libs: gunzip sam-9libs.tar.gz cd 9libs-1.0 tar xvf ../sam-9libs.tar 6) Unpack samx2 (for the documentation and example configuration, not for the patch, which samx.a.patch replaces): cd .. gunzip samx2.shar.Z mkdir samx mv samx2.shar samx cd samx sh samx2.shar 7) Apply patches. They are intended to be applied in order. You can apply just a, or a and b, and all three a, b and c. cd .. patch < samx.a.patch patch < samx.b.patch patch < samx.c.patch 8) Configure, make and install: cd 9libs-1.0 ./configure make su make install -- Details of softtabs: These softtabs emulate tabs at a specified spacing, while assuming that the actual tab character '\t' has a fixed 8 column spacing. These softtabs _only_ apply in the left margin (in the horizontal whitespace immediately following a new line or beginning of file). The "softtab" key spaces to the next column, modulo "softtabWidth", and rewrites all the preceeding horizontal whitespace on that line to use as many hard tab '\t' characters as there is space for, given the hardcoded assumption that hard tabs are 8 columns. The "softbackspace" key (in the left margin) backs up to the previous soft tab stop, converting hard tabs to spaces and removing spaces, as need be. Outside of the left margin, or if softtabs are not enabled or if softtabwidth is not > 0, softtab and softbackspace behave like simple tab and backspace (adding a tab char, and deleting the previous char, whatever it is). The X11 resource samterm*softtabWidth controls the soft tab width. Attempts to set softtabWidth to any number greater than 16 are silently forced to set it to 16. The resource samterm*softTab controls the initial setting of whether softtabs are enabled or not. The Samkey softtabtoggle toggles whether softtabs are enabled. -- Configuring softtabs: The following settings, copied from my .Xresources and Samkeys files, control and bind softtabs: ............ .Xresources ................ samterm*softtabWidth: 4 samterm*softTab: on ............ Samkeys ................ BackSpace : softbackspace Tab : softtab Delete : softbackspace ctrl h : softbackspace ctrl i : softtab alt Tab : softtabtoggle ======================================================================= I won't rest till it's the best ... Software Production Engineer Paul Jackson (pj@sgi.com; pj@usa.net) 3x1373 http://sam.engr.sgi.com/pj From sam-fans-owner Mon Apr 17 16:31:35 2000 Received: from web3205.mail.yahoo.com ([204.71.202.202]) by hawkwind.utcs.toronto.edu with SMTP id <25571>; Mon, 17 Apr 2000 16:22:00 -0400 Message-ID: <20000417145820.14626.qmail@web3205.mail.yahoo.com> Received: from [192.31.86.35] by web3205.mail.yahoo.com; Mon, 17 Apr 2000 07:58:20 PDT Date: Mon, 17 Apr 2000 10:58:20 -0400 From: Jim Crigler Subject: wily-9libs and sam-9libs on 24-bit Linux display To: Sam Fans , Wily Fans MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Before I delve into the particulars, is does anyone know in advance why wily-9libson a 24-bit Linux display works fine (modulo I can't use the capslock key), while sam-9libs (samterm, actually) balks? They were built in the same 9libs hierarchy at the same time. -- Jim Crigler __________________________________________________ Do You Yahoo!? Send online invitations with Yahoo! Invites. http://invites.yahoo.com From sam-fans-owner Tue Apr 25 04:18:06 2000 Received: from pneumatic-tube.sgi.com ([204.94.214.22]) by hawkwind.utcs.toronto.edu with SMTP id <25475>; Tue, 25 Apr 2000 04:08:39 -0400 Received: from cthulhu.engr.sgi.com (gate3-relay.engr.sgi.com [130.62.1.234]) by pneumatic-tube.sgi.com (980327.SGI.8.8.8-aspam/980310.SGI-aspam) via ESMTP id TAA02984 for <@external-mail-relay.sgi.com:sam-fans@hawkwind.utcs.toronto.edu>; Thu, 20 Apr 2000 19:13:03 -0700 (PDT) mail_from (pj@sam.engr.sgi.com) Received: from sam.engr.sgi.com (sam.engr.sgi.com [163.154.6.37]) by cthulhu.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) via ESMTP id TAA90061 for <@cthulhu.engr.sgi.com:sam-fans@hawkwind.utcs.toronto.edu>; Thu, 20 Apr 2000 19:08:56 -0700 (PDT) mail_from (pj@sam.engr.sgi.com) Received: (from pj@localhost) by sam.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) id TAA48323 for sam-fans@hawkwind.utcs.toronto.edu; Thu, 20 Apr 2000 19:08:30 -0700 (PDT) Date: Thu, 20 Apr 2000 22:08:30 -0400 From: pj@sam.engr.sgi.com (Paul Jackson) Message-Id: <200004210208.TAA48323@sam.engr.sgi.com> To: sam-fans@hawkwind.utcs.toronto.edu Subject: Samx - one more time ... I continue to work in my spare time (slowly) adding features to sam+samx. I worry that I might be "splintering" sam - creating a fork of development off the main stream. But so far as I can tell, no one else is touching the code. I'd like to openly consider desires and directions suggested by others. But so far as I can tell, no one else cares. If anyone is interested, or worried, let me know. Meanwhile, I'm having fun adding some sugar to a really fine editor. -- My most recent completed change is: This patch adds two Samkeys to push and pop the current Sam window, so that Samkeys macros can safely restore the current window after intentionally switching to another. This way, Samkey macros don't have to assume that they are only invoked in the work window, say. I have also gotten my patches working cleanly on Linux, in addition to Irix, where I started. I am seeking to make this work available on SGI's Open Source Server, http://oss.sgi.com - perhaps within the next month or two, at the leisurely pace this is proceeding. If anyone wants it by other means or sooner, let me know. Or if Bengt or anyone objects to this, let me know. Later on, if there is interest, and if I get to it, I might also include this on SGI's freeware, so that it is accessible to our Irix users as well (oss.sgi.com is focused on Linux users). -- My current, biased entirely to my idiosyncracies, "todo" list is: 1) Add KD_pushwin/KD_popwin so can write Samkeys macros that don't assume starting in work window, but can always return to whatever was the starting window. [Done - April 17, 2000] 2) KD_markline that extends dot to full lines, and that always extends right end of dot at least one char. Hence repeated invocations cause dot to grow forward by another line. 3) KD_reverselook - search upward for dot 4) debug loss of samterm/sam sync. 5) package sam+samx onto http://oss.sgi.com reasonably. 6) add samd, samb to package (for situation where you want to control foreground vs separate window display: samd invokes "sam -d", for when invoking from other tools that expect an editor to not fork; samb goes background if DISPLAY is set, else foreground, for when invoking from other tools that should behave differently depending on whether coming from the X11 server (gfx head) or remotely (rsh/ssh/telnet/...). [samb, samd coded and working on March 27, 2000. Need to package.] 7) Finish the above samkeys_parse stuff, and add Makefile that will install sam*_* scripts as part of install, fixing #!...perl... header along the way. [Done - April 14, 2000] 8) Need updated samparse_keys, and add Makefile configure stuff to handle samx as part of sam-9libs. [Done April 13, 2000] 9) Package as rpm (source and Linux binary) with patches called out. 10) Adapt configure/Makefile.in so that it picks up X headers and libraries on Linux from /usr/include/X11 (or where ever X11 headers normally go) and from /usr/X11R6/lib (in addition to /usr/lib for other libraries). 11) Brief like Home & End key KD_BriefHome, KD_BriefEnd support (press Home 1, 2 or 3 times to go to beginning of line, page or file). 12) Do something about undo working off screen, and not undoing pure motion. As it works now, I find it surprising that doing (a) a change, (b) another change, then (c) large motion, followed by an undo appears to do nothing (but undoes (b)), and if the undo is repeated, again appears to do nothing (but undoes (a)). Either motion should be considered an undoable event, or undo should force some part of what it changes on screen, or ... 13) Redo sure would be nice, if I can learn sam well enough to implement it. For one, it would help ameliorate the botch that I get into with item (12), undoing more than I realize or can easily recall. 14) Just as with Python's Idle (at least until recent changes in the developers branch), it seems too easy to get the cursor off the command line in the sam window, and get confused as to what it means to press enter. I'd like a tighter control by sam of the sam window cursor, more like working at a shell prompt, or at least along the lines of what I hear tell has recently been done to Idle to improve its interface there. 15) More X11 like mouse behaviour, at least when on X11, would be nice. Though its not clear I have the skills to implement this. The middle mouse thing is a minor unpleasant complication. 16) The Rick Davis jot (aka zip, only on Irix) editor had several accessible buffers for what was most recently entered, removed, ..., making it easy to do things like entering the same text in multiple places - typing it once, and using the mouse and Insert key to place duplicates of it. I miss that. ======================================================================= I won't rest till it's the best ... Software Production Engineer Paul Jackson (pj@sgi.com; pj@usa.net) 3x1373 http://sam.engr.sgi.com/pj From sam-fans-owner Wed Apr 26 18:00:58 2000 Received: from deliverator.sgi.com ([204.94.214.10]) by hawkwind.utcs.toronto.edu with SMTP id <25762>; Wed, 26 Apr 2000 17:13:43 -0400 Received: from cthulhu.engr.sgi.com (gate3-relay.engr.sgi.com [130.62.1.234]) by deliverator.sgi.com (980309.SGI.8.8.8-aspam-6.2/980310.SGI-aspam) via ESMTP id NAA19862; Wed, 26 Apr 2000 13:22:11 -0700 (PDT) mail_from (pj@sam.engr.sgi.com) Received: from sam.engr.sgi.com (sam.engr.sgi.com [163.154.6.37]) by cthulhu.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) via ESMTP id NAA28571; Wed, 26 Apr 2000 13:26:53 -0700 (PDT) mail_from (pj@sam.engr.sgi.com) Received: (from pj@localhost) by sam.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) id NAA74945; Wed, 26 Apr 2000 13:25:47 -0700 (PDT) Date: Wed, 26 Apr 2000 16:25:47 -0400 From: pj@sam.engr.sgi.com (Paul Jackson) Message-Id: <200004262025.NAA74945@sam.engr.sgi.com> To: sam-fans@hawkwind.utcs.toronto.edu, Bengt Kleberg Subject: Re: Samx - one more time ... Bengt wrote: |> I am (very low-key) maintaining sam as it is, ... and grateful we are for your work |> Perhaps we complement each other? I maintain sam as it is, |> you enhance it? As I concluded in a private email thread that branched off this public thread: Seems like what I am dreaming of is really yet-another-editor, likely using sam+samx as a code base, and for its core design element integrating the gui and command interface, but undergoing some major surgery, aimed entirely at X11 environments. Looks like I should choose yet-another-name for such a beast, if it ever gets past being my private toy. I will read the license that comes with Sam again, to be sure I am fitting comfortably within its terms. Not sure if I will go down this path or not - if you're uncomfortable with it, let me know. I might call it 'tam' -- because 't' comes after 's', and because I used to work with a fine chap called Sam Tam. ======================================================================= I won't rest till it's the best ... Software Production Engineer Paul Jackson (pj@sgi.com; pj@usa.net) 3x1373 http://sam.engr.sgi.com/pj From sam-fans-owner Wed Apr 26 18:01:06 2000 Received: from proxy2.ba.best.com ([206.184.139.14]) by hawkwind.utcs.toronto.edu with SMTP id <24945>; Wed, 26 Apr 2000 17:11:15 -0400 Received: from ishtek.com (co3001671-a.belrs1.nsw.optushome.com.au [203.164.12.105]) by proxy2.ba.best.com (8.9.3/8.9.2/best.out) with SMTP id DAA03351 for ; Tue, 25 Apr 2000 03:58:48 -0700 (PDT) Message-Id: <200004251058.DAA03351@proxy2.ba.best.com> X-Mailer: Ishtek MeeMail 2.5 In-Reply-To: <200004210208.TAA48323@sam.engr.sgi.com> Date: Tue, 25 Apr 2000 06:59:10 -0400 From: Alex Danilo Subject: Re: Samx - one more time ... To: sam-fans@hawkwind.utcs.toronto.edu X-Face: _H@C|CDucW'FeI!o@eNy]QydT!"gdD,Xv&JAv^*tM/y@pY>~0@nw0O7$>v!wTPjXQFHs#5_ Y,7bd!O43rX(n1G}C+T,Befs7r,Ur%MrgK8_.p) ,^{ pj@sam.engr.sgi.com (Paul Jackson) wrote: >I continue to work in my spare time (slowly) adding features >to sam+samx. > >I worry that I might be "splintering" sam - creating a fork of >development off the main stream. But so far as I can tell, no >one else is touching the code. I'm sure there are many people 'touching' the code, it's just that there is no formalised source project base on the 'sam' distribution, it's just an 'as-is' release. >From what I've seen, there is a huge reluctance by the developers (i.e. Rob) to add any 'features'. This is in line with the original interface which is mouse for movement, and keyboard for entry only. It is minimalistic, and is meant to be so - things like auto-indent were never meant to be in 'sam', it isn't a user-interface ideal. The released code was supposed to be just that - a release, and if you want to add stuff to it, then go for it, but it won't be part of 'sam' proper. I offered some simple mods to do implement cursor keys a while ago in the comp.os.plan9 list, but no-one wanted it. So, what I'm saying is that anything that changes 'sam' from the Lucent release makes it not sam. So, if you want to add 'features', that should be done as some alternate project, like 'samx' which is of course sam with Xtensions. >I am seeking to make this work available on SGI's Open Source >Server, http://oss.sgi.com - perhaps within the next month or I'd honestly consider creating a new project on SourceForge, as that is (sort-of) vendor-neutral, and it can be maintained after you leave SGI. > 4) debug loss of samterm/sam sync. This, as far as I can see is the only bad bug which exists in the Lucent release. If you open a big batch of files, and do something like: X/.*/,x//d to nuke carriage returns in all your source files, sam and samterm get out of sync and barf. This is a really nasty bug, and the Windows version created by Sean Quinlan doesn't seem to exhibit it - so I guess it may have been fixed internally to the Labs, but never made it out into the public release. By all means add new features if you wish, but it should be made a distinct stream of development from that which we know as 'sam'. Perhaps we could call it son-of-sam:-) Alex -- Alex Danilo http://www.ishtek.com/alex PO Box 333 Forestville NSW 2087 +61-2-9975-2297 From sam-fans-owner Wed Apr 26 18:01:41 2000 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.toronto.edu with SMTP id <25238>; Wed, 26 Apr 2000 17:13:36 -0400 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id QAA04143; Tue, 25 Apr 2000 16:38:52 +0200 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id QAA08798; Tue, 25 Apr 2000 16:38:51 +0200 Date: Tue, 25 Apr 2000 10:38:51 -0400 From: Bengt Kleberg Message-Id: <200004251438.QAA08798@trillian.softwell.se> To: pj@sam.engr.sgi.com, sam-fans@hawkwind.utcs.toronto.edu Subject: Re: Samx - one more time ... > pj@sam.engr.sgi.com > I worry that I might be "splintering" sam I am (very low-key) maintaining sam as it is, just doing bug fixes and adding ports (ie making sure that configure works for any new platforms). Sometime in the future, if time permits, I will try to remove any hardcoded limits (like the 512 characters samterm -> sam message limit). I will not attempt to add features. You have clearly a much broader scoop in your interest for sam. Perhaps we complement each other? I maintain sam as it is, you enhance it? Effectivly creating two sams, ofcourse. Presumably sam-as-it-is will stop beeing used, and that does not matter to me since I am not doing anyhting anyway. However, have you looked at wily? This is generally considered as a alternative to sam, and it has loads of the things you seem (to me) to be interested in. Perhaps it would be better to devout your energy to wily instead? Best Wishes, Bengt =============================================================== Everything aforementioned should be regarded as totally private opinions, and nothing else. bengt@softwell.se ``His great strength is that he is uncompromising. It would make him physically ill to think of programming in C++.'' From sam-fans-owner Wed Apr 26 18:01:48 2000 Received: from plan9.cs.bell-labs.com ([204.178.31.2]) by hawkwind.utcs.toronto.edu with SMTP id <25043>; Wed, 26 Apr 2000 17:12:03 -0400 From: "rob pike" Subject: Re: Samx - one more time ... Date: Tue, 25 Apr 2000 08:42:32 -0400 To: sam-fans@hawkwind.utcs.toronto.edu MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <00Apr26.171203edt.25043@hawkwind.utcs.toronto.edu> Around here, we spend most of our time avoiding adding sam features. But we did add one recently: Redo. Sean Dorward and I plugged Acme's file management stuff into Sam a few months ago. This made it much faster (a factor of 6 or 7) at reading big files, and made redo possible. (The command syntax is u with a negative count; u- redoes the last undone change). There have been many other changes triggered by changes in Plan 9, rendering the Plan 9 source quite different from the publicly available version of Sam, but if someone is interested in doing the work I will send them the code. -rob From sam-fans-owner Thu Apr 27 12:37:10 2000 Received: from pneumatic-tube.sgi.com ([204.94.214.22]) by hawkwind.utcs.toronto.edu with SMTP id <25762>; Thu, 27 Apr 2000 12:24:24 -0400 Received: from cthulhu.engr.sgi.com (gate3-relay.engr.sgi.com [130.62.1.234]) by pneumatic-tube.sgi.com (980327.SGI.8.8.8-aspam/980310.SGI-aspam) via ESMTP id PAA08102; Wed, 26 Apr 2000 15:31:50 -0700 (PDT) mail_from (pj@sam.engr.sgi.com) Received: from sam.engr.sgi.com (sam.engr.sgi.com [163.154.6.37]) by cthulhu.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) via ESMTP id PAA75177; Wed, 26 Apr 2000 15:27:37 -0700 (PDT) mail_from (pj@sam.engr.sgi.com) Received: (from pj@localhost) by sam.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) id PAA76824; Wed, 26 Apr 2000 15:26:30 -0700 (PDT) Date: Wed, 26 Apr 2000 18:26:30 -0400 From: pj@sam.engr.sgi.com (Paul Jackson) Message-Id: <200004262226.PAA76824@sam.engr.sgi.com> To: sam-fans@hawkwind.utcs.toronto.edu, Alex Danilo Subject: Re: Samx - one more time ... |> So, what I'm saying is that anything that changes 'sam' |> from the Lucent release makes it not sam. Yes - that agrees with my conclusions so far. Ah but I'll miss the name 'sam'. That's my son's name ... |> SGI's Open Source Server [vs] SourceForge If it gets to the point that either I am not at SGI or that there is enough to involve others, then definitely SourceForge. And if it happens that I left SGI unexpectedly and suddenly, I can certainly start the SourceForge project at that time, from the SGI OSS base. Perhaps sooner to SourceForge, perhaps not. Doesn't matter much yet. ======================================================================= I won't rest till it's the best ... Software Production Engineer Paul Jackson (pj@sgi.com; pj@usa.net) 3x1373 http://sam.engr.sgi.com/pj From sam-fans-owner Thu Apr 27 12:37:25 2000 Received: from pneumatic-tube.sgi.com ([204.94.214.22]) by hawkwind.utcs.toronto.edu with SMTP id <25768>; Thu, 27 Apr 2000 12:25:43 -0400 Received: from cthulhu.engr.sgi.com (gate3-relay.engr.sgi.com [130.62.1.234]) by pneumatic-tube.sgi.com (980327.SGI.8.8.8-aspam/980310.SGI-aspam) via ESMTP id PAA05557; Wed, 26 Apr 2000 15:39:56 -0700 (PDT) mail_from (pj@sam.engr.sgi.com) Received: from sam.engr.sgi.com (sam.engr.sgi.com [163.154.6.37]) by cthulhu.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) via ESMTP id PAA78804; Wed, 26 Apr 2000 15:35:42 -0700 (PDT) mail_from (pj@sam.engr.sgi.com) Received: (from pj@localhost) by sam.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) id PAA76725; Wed, 26 Apr 2000 15:34:41 -0700 (PDT) Date: Wed, 26 Apr 2000 18:34:41 -0400 From: pj@sam.engr.sgi.com (Paul Jackson) Message-Id: <200004262234.PAA76725@sam.engr.sgi.com> To: sam-fans@hawkwind.utcs.toronto.edu, "rob pike" Subject: Re: Samx - one more time ... |> Around here, we spend most of our time avoiding adding |> sam features. it's already pretty damn good. |> But we did add one recently: Redo. excellent |> but if someone is interested in doing the work I will If I am able to free up a block of time, and if Bengt is willing to pick up the merge (this would be pure 'sam', no samx or whatever I'm doing), then I'd like to do that. But I can't right now. If I did that for the public sam fans, then I would feel better about using this code base for my own endeavors - which tend to blend Rick Davis's zip (jot) with sam, focused on X11. If someone else gets there first - more power to them. ======================================================================= I won't rest till it's the best ... Software Production Engineer Paul Jackson (pj@sgi.com; pj@usa.net) 3x1373 http://sam.engr.sgi.com/pj From sam-fans-owner Thu Apr 27 12:37:33 2000 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.toronto.edu with SMTP id <25801>; Thu, 27 Apr 2000 12:30:53 -0400 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id KAA08881; Thu, 27 Apr 2000 10:04:14 +0200 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id KAA14913; Thu, 27 Apr 2000 10:04:14 +0200 Date: Thu, 27 Apr 2000 04:04:14 -0400 From: Bengt Kleberg Message-Id: <200004270804.KAA14913@trillian.softwell.se> To: rob@plan9.bell-labs.com, sam-fans@hawkwind.utcs.toronto.edu Subject: Re: Samx - one more time ... > From: "rob pike" > There have been many other changes triggered by > changes in Plan 9, rendering the Plan 9 source quite > different from the publicly available version of Sam, > but if someone is interested in doing the work I will > send them the code. Yes please. I would like to try updateing sam to the current Plan9 version. One thing: Does this mean that libXg also needs changes? As is perhaps known I only look after sam/samterm, not libXg. The latter is handled by a skilled person by the name of Mark H Wilkinson. Best Wishes, Bengt =============================================================== Everything aforementioned should be regarded as totally private opinions, and nothing else. bengt@softwell.se ``His great strength is that he is uncompromising. It would make him physically ill to think of programming in C++.'' From sam-fans-owner Fri Apr 28 00:11:20 2000 Received: from plan9.cs.bell-labs.com ([204.178.31.2]) by hawkwind.utcs.toronto.edu with SMTP id <24768>; Thu, 27 Apr 2000 23:22:09 -0400 From: "Russ Cox" Date: Thu, 27 Apr 2000 16:17:43 -0400 To: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: Samx - one more time ... MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <00Apr27.232209edt.24768@hawkwind.utcs.toronto.edu> One thing: Does this mean that libXg also needs changes? The graphics model has changed quite a bit, and there is not currently anything approximating libXg, at least in such a form. I have vague notions of it being a nice thing to have a libXg equivalent for the new graphics model, and I do have many of the pieces, but not all, and they're not packaged correctly. Rob should correct me if I'm wrong, but I believe that the protocol between sam and samterm has not changed, so that you could pick up the aforementioned sam changes and keep using the current samterm, if you were not inclined to do battle with X. Russ From sam-fans-owner Mon May 8 18:57:05 2000 Received: from anchor-post-32.mail.demon.net ([194.217.242.90]) by hawkwind.utcs.toronto.edu with SMTP id <25878>; Mon, 8 May 2000 18:52:20 -0400 Received: from kremvax.demon.co.uk ([212.228.106.206] helo=kremvax.kremvax.net) by anchor-post-32.mail.demon.net with esmtp (Exim 2.12 #1) id 12ovzh-0001T9-0W; Mon, 8 May 2000 23:27:23 +0100 Received: from bijou.kremvax.net (bijou.kremvax.net [192.168.144.20]) by kremvax.kremvax.net (Postfix) with ESMTP id 5022E4C; Mon, 8 May 2000 23:22:26 +0100 (BST) Received: from kremvax.net (kremvax.kremvax.net [192.168.144.24]) by bijou.kremvax.net (Postfix) with ESMTP id 982819413; Mon, 8 May 2000 23:22:24 +0100 (BST) Sender: mhw@kremvax.net Message-ID: <39173E20.77F0D49@kremvax.net> Date: Mon, 8 May 2000 18:22:24 -0400 From: "Mark H. Wilkinson" X-Mailer: Mozilla 4.61 [en] (X11; I; Linux 2.2.12-20 i586) X-Accept-Language: en MIME-Version: 1.0 To: Jim Crigler Cc: Sam Fans , Wily Fans Subject: Re: wily-9libs and sam-9libs on 24-bit Linux display References: <20000417145820.14626.qmail@web3205.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Jim Crigler wrote: > Before I delve into the particulars, is does anyone know in advance why > wily-9libson a 24-bit Linux display works fine (modulo I can't use the capslock > key), while sam-9libs (samterm, actually) balks? They were built in the same > 9libs hierarchy at the same time. Probably because sam allocates new bitmaps for things like pop-up menus while wily doesn't (not having menus) - if you run the libXg test program does it crash when it gets to the menu test on the same display? libXg just doesn't work with some bitmap depths, notably 15bpp. However, I thought it worked Ok on 24bpp displays so I'd like to dig a bit more to find out what's going on. -Mark. From sam-fans-owner Tue May 9 19:02:19 2000 Received: from ejk.cso.uiuc.edu ([130.126.112.162]) by hawkwind.utcs.toronto.edu with SMTP id <25878>; Tue, 9 May 2000 18:51:58 -0400 Received: (qmail 15990 invoked from network); 8 May 2000 23:18:41 -0000 Received: from castle-89.slip.uiuc.edu (HELO uiuc.edu) (ejk@130.126.28.89) by ejk.cso.uiuc.edu with SMTP; 8 May 2000 23:18:41 -0000 Sender: ejk Message-ID: <39174AE2.CEC76A4@uiuc.edu> Date: Mon, 8 May 2000 19:16:50 -0400 From: Ed Kubaitis Organization: CCSO - University of Illinois at Urbana-Champaign X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 To: Sam Fans CC: Wily Fans Subject: Re: wily-9libs and sam-9libs on 24-bit Linux display References: <20000417145820.14626.qmail@web3205.mail.yahoo.com> <39173E20.77F0D49@kremvax.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit "Mark H. Wilkinson" wrote: > > Jim Crigler wrote: > > > Before I delve into the particulars, is does anyone know in advance why > > wily-9libson a 24-bit Linux display works fine (modulo I can't use the capslock > > key), while sam-9libs (samterm, actually) balks? They were built in the same > > 9libs hierarchy at the same time. > > Probably because sam allocates new bitmaps for things like pop-up menus while wily > doesn't (not having menus) - if you run the libXg test program does it crash when > it gets to the menu test on the same display? > > libXg just doesn't work with some bitmap depths, notably 15bpp. However, I thought > it worked Ok on 24bpp displays so I'd like to dig a bit more to find out what's > going on. > > -Mark. FWIW, on RH Linux 6.2 recently, I had to backoff 24bpp to 16 to make an ancient (circa 1993-4) version of libXg/samterm functional. -------------------------- Ed Kubaitis (ejk@uiuc.edu) CCSO - University of Illinois at Urbana-Champaign From sam-fans-owner Fri May 26 15:27:11 2000 Received: from bio.cse.psu.edu ([130.203.12.17]) by hawkwind.utcs.toronto.edu with SMTP id <26700>; Fri, 26 May 2000 15:14:48 -0400 Received: (qmail 24795 invoked by uid 991); 25 May 2000 19:37:07 -0000 Message-ID: <20000525193707.24793.qmail@g.bio.cse.psu.edu> To: sam-fans@hawkwind.utcs.toronto.edu Subject: new sam for unix MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <24790.959283335.0@bio.cse.psu.edu> Date: Thu, 25 May 2000 15:37:07 -0400 From: Scott Schwartz ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <24790.959283335.1@bio.cse.psu.edu> Hi all, Rob Pike was kind enough to send me the source for the new sam, and I've gone through and made the changes necessary to get it to compile under unix. I found one bug in the process, so I hope everyone else will look things over carefully too. The changes: - replaced anonymous unions with ansi-std ones. - used a plan9-flavor print library instead of stdio (mostly). - the sam err file in tmp is now given a unique name, to avoid symlink races. mktemp used where necessary. - all plumbing is stubbed out. maybe we can revisit this after the next edition of plan 9 is published. This version appears to work with samterm, but it does exercise what I think is a problem with the X11 version of that. If I create a large file, all lines the same length, and make a global substitution, and then repeatedly undo and redo, samterm appears to miss some characters. ------- =_aaaaaaaaaa0 Content-Type: application/octet-stream Content-ID: <24790.959283335.2@bio.cse.psu.edu> Content-Description: sam.tar.gz Content-Transfer-Encoding: base64 c2FtMmsvAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAwNDA3NTUAMDAwMTcz NwAwMDAwMTUxADAwMDAwMDAwMDAwADA3MTEyMDI3MTIxADAwMTI3NTQANQAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB1c3RhcgAwMHNjaHdhcnR6AAAAAAAAAAAAAA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SAmJiAoZSA8 IHN5c19uZXJyKSkgCgkgICAgZm10Y2F0IChmb3JtYXQsIHN5c19lcnJsaXN0W2VdKTsKCWVsc2UK CSAgICBmbXRwcmludCAoZm9ybWF0LCAidW5rbm93biBlcnJvciAoJWQpIiwgZSk7CiAgICB9CiAg ICByZXR1cm4gRk1UX3ZlcmI7CQp9CgovKgogKiBjb252ZXJzaW9uIHRhYmxlIG1hbmFnZW1lbnQK ICovCgpzdGF0aWMgRm10Y29udiBkZmx0X2ZtdHRhYltGTVRfTUFYQ09OVl07CgpzdGF0aWMgRm10 Y29udiogZW5zdXJlX2luaXR0YWIgKEZtdGNvbnYgZm10dGFiW10pCnsKICAgIGludCBpOwoKICAg IGlmIChmbXR0YWJbMF0gIT0gMCkKCXJldHVybiBmbXR0YWI7CgogICAgZm9yIChpID0gMDsgaSA8 IEZNVF9NQVhDT05WOyBpKyspCglmbXR0YWJbaV0gPSBmbXRfYmFkY29udjsKCiAgICBmbXR0YWJb JyUnXSA9IGxpdGNvbnY7CgogICAgZm10dGFiWydzJ10gPSBzY29udjsKICAgIGZtdHRhYlsnYydd ID0gY2NvbnY7CiAgICBmbXR0YWJbJ2QnXSA9IGRjb252OwogICAgZm10dGFiWydpJ10gPSBkY29u djsKICAgIGZtdHRhYlsnbyddID0gb2NvbnY7CiAgICBmbXR0YWJbJ3gnXSA9IHhjb252OwogICAg Zm10dGFiWydyJ10gPSByY29udjsKICAgIGZtdHRhYlsnbSddID0gcmNvbnY7CiAgICBmbXR0YWJb J24nXSA9IG5jb252OwoKICAgIGZtdHRhYlsndSddID0gdWNvbnY7CiAgICBmbXR0YWJbJ2gnXSA9 IGhjb252OwogICAgZm10dGFiWydsJ10gPSBsY29udjsKICAgIGZtdHRhYlsnIyddID0gYWx0Y29u djsKICAgIGZtdHRhYlsnLSddID0gbGVmdGNvbnY7CiAgICBmbXR0YWJbJy4nXSA9IGRvdGNvbnY7 CiAgICBmbXR0YWJbJyonXSA9IHN0YXJjb252OwoKICAgI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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= ------- =_aaaaaaaaaa0-- From sam-fans-owner Sun Jun 4 19:04:48 2000 Received: from bio.cse.psu.edu ([130.203.12.17]) by hawkwind.utcs.toronto.edu with SMTP id <28357>; Sun, 4 Jun 2000 18:40:40 -0400 Received: (qmail 4133 invoked by uid 991); 3 Jun 2000 04:41:43 -0000 Message-ID: <20000603044143.4132.qmail@g.bio.cse.psu.edu> From: "Scott Schwartz" Date: Sat, 3 Jun 2000 00:41:43 -0400 To: sam-fans@hawkwind.utcs.toronto.edu Subject: new sam So, did anyone try the new sam? From sam-fans-owner Thu Jun 29 13:58:07 2000 Received: from aubrey.stanford.edu ([171.64.31.58]) by hawkwind.utcs.utoronto.ca with SMTP id <44226>; Thu, 29 Jun 2000 13:56:25 -0500 Received: (qmail 14493 invoked from network); 29 Jun 2000 02:33:28 -0000 Received: from localhost.highwire.org (HELO aubrey.stanford.edu) (127.0.0.1) by localhost.highwire.org with SMTP; 29 Jun 2000 02:33:28 -0000 X-url: http://highwire.stanford.edu/~jimr/ X-face: "!ZH^<"U,NeU:732A To: sam-fans@hawkwind.utcs.toronto.edu Dcc: Subject: preserving indention levels? MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <14486.962246008.1@aubrey.stanford.edu> Date: Wed, 28 Jun 2000 22:33:28 -0500 Message-Id: <00Jun29.135625edt.44226@hawkwind.utcs.utoronto.ca> I've got a question on how to solve an editing problem. When one has code that is indented at various levels, and needs to be replaced with multiple-line blocks, how does one handle preserving the indention? For example: ... System.err.println("some annoying debugging but in"); ... System.err.println("some other annoying debugging but in"); ... into ... if (Debug.level(Debug.DEBUG)) { Debug.debug(this, "some annoying debugging but in"); } ... if (Debug.level(Debug.DEBUG)) { Debug.debug(this, "some other annoying debugging but in"); } ... Is using something like s/^([ ]+).../...\1\n\1/ the only solution? Jim From sam-fans-owner Thu Jul 27 18:09:53 2000 Received: from gsyc.escet.urjc.es ([212.128.1.45]) by hawkwind.utcs.utoronto.ca with SMTP id <44215>; Thu, 27 Jul 2000 17:48:21 -0500 Received: from nautilus.dat.escet.urjc.es (IDENT:root@nautilus.dat.escet.urjc.es [212.128.1.37]) by gsyc.escet.urjc.es (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id KAA13356 for ; Thu, 27 Jul 2000 10:01:16 +0200 Received: (from nemo@localhost) by nautilus.dat.escet.urjc.es (8.9.3/8.9.3) id KAA00925; Thu, 27 Jul 2000 10:14:53 +0100 From: "Fco. J. Ballesteros" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14719.64908.755161.847689@nautilus.dat.escet.urjc.es> Date: Thu, 27 Jul 2000 05:14:52 -0500 To: sam-fans@hawkwind.utcs.toronto.edu Subject: but tom-2 repeat cmd feature? X-Mailer: VM 6.75 under Emacs 20.5.1 Wouldn't it be nice if the button-2 menu could have an entry to repeat the last command in the ~~sam~~ window? I found myself repeating "|fmt" just to reformat paragraphs in a LaTeX document I was editing. Anyone made that change to sam? Or is there a better way to do it? (Doing a single |fmt when done with the modifications is not an option because there are sections of the document that shoudn't be fmt'd). regards -- () ascii ribbon campaign - against html mail /\ - against microsoft attachments From sam-fans-owner Mon Jul 31 20:19:32 2000 Received: from whitecrow.demon.co.uk ([194.222.126.246]) by hawkwind.utcs.utoronto.ca with SMTP id <44239>; Mon, 31 Jul 2000 20:09:46 -0500 Received: from whitecrow.demon.co.uk (steve@localhost [127.0.0.1]) by whitecrow.demon.co.uk (8.8.7/8.8.7) with ESMTP id HAA11988 for ; Fri, 28 Jul 2000 07:52:53 +0100 Message-Id: <200007280652.HAA11988@whitecrow.demon.co.uk> X-Mailer: exmh version 2.0zeta 7/24/97 To: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: but tom-2 repeat cmd feature? In-reply-to: Your message of "Thu, 27 Jul 2000 05:14:52 CDT." <14719.64908.755161.847689@nautilus.dat.escet.urjc.es> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 28 Jul 2000 01:52:53 -0500 From: Steve Kilbane > Wouldn't it be nice if the button-2 menu could have an entry to repeat > the last command in the ~~sam~~ window? plausibly, but where the does "the last command" start and finish? > I found myself repeating "|fmt" just to reformat > paragraphs in a LaTeX document I was editing. After having done a "send" in the sam window, it's the default option next time around. So four cicks do it: - single click selects the sam window; - double-click on b1 selects the whole line - single click on b2 sends. > (Doing a single |fmt when done with the modifications is not an option > because there are sections of the document that shoudn't be fmt'd). And you can't use y/pattern/ to avoid those parts? steve From sam-fans-owner Mon Jul 31 20:20:44 2000 Received: from aubrey.stanford.edu ([171.64.31.58]) by hawkwind.utcs.utoronto.ca with SMTP id <44290>; Mon, 31 Jul 2000 20:10:12 -0500 Received: (qmail 14895 invoked from network); 29 Jul 2000 20:41:06 -0000 Received: from localhost.highwire.org (HELO aubrey.stanford.edu) (127.0.0.1) by localhost.highwire.org with SMTP; 29 Jul 2000 20:41:06 -0000 X-url: http://highwire.stanford.edu/~jimr/ X-face: "!ZH^<"U,NeU:732A To: "Fco. J. Ballesteros" cc: sam-fans@hawkwind.utcs.toronto.edu Dcc: Subject: Re: but tom-2 repeat cmd feature? In-reply-to: Message from "Fco. J. Ballesteros" of "Thu, 27 Jul 2000 05:14:52 CDT."References: <14719.64908.755161.847689@nautilus.dat.escet.urjc.es> <14719.64908.755161.847689@nautilus.dat.escet.urjc.es> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <14888.964903265.1@aubrey.stanford.edu> Date: Sat, 29 Jul 2000 16:41:06 -0500 Message-Id: <00Jul31.201012edt.44290@hawkwind.utcs.utoronto.ca> > Wouldn't it be nice if the button-2 menu could have an entry to repeat > the last command in the ~~sam~~ window? > > I found myself repeating "|fmt" just to reformat > paragraphs in a LaTeX document I was editing. If I find I have to keep using ~~sam~~ do to the same thing, I just set dot, double click the command in ~~sam~~ and select send. It is more mouse movement and clicks than what you are suggesting. However, I have found that it is normally pretty easy to use sam's command language to find the patterns I want to format. For example if I had a selection Here is some text that should be adjusted with fmt \begin{math} math != fmt ( x, y, z, a) \end{math} But the above math should not, and certainly not \begin{quote} a quote of sorts \end{quote} then the regex command 'x/(.+\n)+/v/^\\begin{/|fmt' applied to the selection will run through the text and fmt only those blocks of text that don't begin with \begin{. If you didn't have newline seperators I imagine you could do some fancy things with ',' and ';' and friends, but I'm not sure what. In those cases, I normally take a three step process where one regex splits the text into managable pieces, one regex formats select pieces, and the last regex recombines the pieces. Jim From sam-fans-owner Mon Jul 31 20:20:59 2000 Received: from deliverator.sgi.com ([204.94.214.10]) by hawkwind.utcs.utoronto.ca with SMTP id <44193>; Mon, 31 Jul 2000 20:04:51 -0500 Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) by deliverator.sgi.com (980309.SGI.8.8.8-aspam-6.2/980310.SGI-aspam) via ESMTP id RAA02212; Thu, 27 Jul 2000 17:19:56 -0700 (PDT) mail_from (pj@cthulhu.engr.sgi.com) Received: from sam.engr.sgi.com (sam.engr.sgi.com [163.154.6.37]) by cthulhu.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) via ESMTP id RAA56655; Thu, 27 Jul 2000 17:27:22 -0700 (PDT) mail_from (pj@engr.sgi.com) Received: from localhost (pj@localhost) by sam.engr.sgi.com (SGI-8.9.3/8.9.3) with ESMTP id RAA35696; Thu, 27 Jul 2000 17:27:11 -0700 (PDT) X-Authentication-Warning: sam.engr.sgi.com: pj owned process doing -bs Date: Thu, 27 Jul 2000 20:27:11 -0500 From: Paul Jackson To: "Fco. J. Ballesteros" cc: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: but tom-2 repeat cmd feature? In-Reply-To: <14719.64908.755161.847689@nautilus.dat.escet.urjc.es> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Thu, 27 Jul 2000, Fco. J. Ballesteros wrote: > I found myself repeating "|fmt" > just to reformat paragraphs ... A simple thing I do that helps here -- I have a couple commands, named "F" and "Q", on my path, which are trivial shell scripts calling my favorite formating and quoting (prepend '> ' to each line) filters. Then the command is reduced a couple of key strokes, to such as "|F" (both of which are shifted, it happens, for even less finger calisthenics). -- I won't rest till it's the best ... Software Production Engineer Paul Jackson (pj@sgi.com; pj@usa.net) 3x1373 http://sam.engr.sgi.com/pj From sam-fans-owner Tue Aug 8 12:02:31 2000 Received: from aubrey.stanford.edu ([171.64.31.58]) by hawkwind.utcs.utoronto.ca with SMTP id <44317>; Tue, 8 Aug 2000 11:55:15 -0500 Received: (qmail 18093 invoked from network); 7 Aug 2000 07:22:56 -0000 Received: from localhost.highwire.org (HELO aubrey.stanford.edu) (127.0.0.1) by localhost.highwire.org with SMTP; 7 Aug 2000 07:22:56 -0000 X-url: http://highwire.stanford.edu/~jimr/ X-face: "!ZH^<"U,NeU:732A To: "sam Fans" Dcc: Subject: sam -r and remove env MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18086.965632975.1@aubrey.stanford.edu> Date: Mon, 7 Aug 2000 03:22:55 -0500 Message-Id: <00Aug8.115515edt.44317@hawkwind.utcs.utoronto.ca> Is there any way to force 'sam -r' to initalize my login environmen on the remote end? I find losing my variables like $h and $proj annoying when trying to do 'B < echo $proj/...'? From sam-fans-owner Tue Sep 12 21:16:10 2000 Received: from web3206.mail.yahoo.com ([204.71.202.203]) by hawkwind.utcs.utoronto.ca with SMTP id <44394>; Tue, 12 Sep 2000 21:14:05 -0500 Message-ID: <20000911151022.22157.qmail@web3206.mail.yahoo.com> Received: from [204.68.140.35] by web3206.mail.yahoo.com; Mon, 11 Sep 2000 08:10:22 PDT Date: Mon, 11 Sep 2000 11:10:22 -0500 From: Jim Crigler Subject: ssam??? To: Sam Fans , Wily Fans MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii I saw on the Wily Fans list last week a reference to "ssam". Is this a "streamed sam" to which there is (I think) an allusion in one of the sam papers. I just got the latest sam distribution from netlib, but didn't see it there --- perhaps I didn't look carefully enough? -- Jim Crigler __________________________________________________ Do You Yahoo!? Yahoo! Mail - Free email you can access from anywhere! http://mail.yahoo.com/ From sam-fans-owner Tue Sep 12 21:16:41 2000 Received: from aubrey.stanford.edu ([171.64.31.58]) by hawkwind.utcs.utoronto.ca with SMTP id <44397>; Tue, 12 Sep 2000 21:15:47 -0500 Received: (qmail 17774 invoked from network); 11 Sep 2000 15:28:26 -0000 Received: from localhost.highwire.org (HELO aubrey.stanford.edu) (127.0.0.1) by localhost.highwire.org with SMTP; 11 Sep 2000 15:28:26 -0000 X-url: http://highwire.stanford.edu/~jimr/ X-face: "!ZH^<"U,NeU:732A To: Jim Crigler cc: Sam Fans , Wily Fans Dcc: Subject: Re: ssam??? In-reply-to: Message from Jim Crigler of "Mon, 11 Sep 2000 08:10:22 PDT."References: <20000911151022.22157.qmail@web3206.mail.yahoo.com> <20000911151022.22157.qmail@web3206.mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <17769.968686105.1@aubrey.stanford.edu> Date: Mon, 11 Sep 2000 11:28:26 -0500 Message-Id: <00Sep12.211547edt.44397@hawkwind.utcs.utoronto.ca> > I saw on the Wily Fans list last week a reference to "ssam". Is this > a "streamed sam" to which there is (I think) an allusion in one of the > sam papers. I just got the latest sam distribution from netlib, but > didn't see it there --- perhaps I didn't look carefully enough? It was made by Alistair Crooks, in the UK. There are Linux and NetBSD ports of it all over, but the main homepage is http://www.westley.demon.co.uk/software.html From sam-fans-owner Thu Sep 14 16:11:35 2000 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.utoronto.ca with SMTP id <44306>; Thu, 14 Sep 2000 16:11:09 -0500 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id VAA21854 for ; Thu, 14 Sep 2000 21:45:21 +0200 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id VAA31264 for sam-fans@hawkwind.utcs.toronto.edu; Thu, 14 Sep 2000 21:45:20 +0200 Date: Thu, 14 Sep 2000 15:45:20 -0500 From: Bengt Kleberg Message-Id: <200009141945.VAA31264@trillian.softwell.se> To: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: ssam??? > > I saw on the Wily Fans list last week a reference to "ssam". > It was made by Alistair Crooks, in the UK. There is also a rc script that uses sam to produce a semblance of stream editing. Look in sam-9libs. Bengt From sam-fans-owner Mon Sep 25 16:52:02 2000 Received: from c002.snv.cp.net ([209.228.32.172]) by hawkwind.utcs.utoronto.ca with SMTP id <44469>; Mon, 25 Sep 2000 16:47:08 -0500 Received: (cpmta 8107 invoked from network); 24 Sep 2000 12:32:39 -0700 Received: from 1Cust195.tnt2.det3.da.uu.net (HELO home.wa8tzg.org) (63.27.42.195) by smtp.peoplepc.com (209.228.32.172) with SMTP; 24 Sep 2000 12:32:39 -0700 X-Sent: 24 Sep 2000 19:32:39 GMT Received: by home.wa8tzg.org (Postfix, from userid 501) id F29EB760C; Sun, 24 Sep 2000 15:30:47 -0400 (EDT) Date: Sun, 24 Sep 2000 15:30:35 -0500 From: Bill Meahan To: Wily Fans Cc: Sam Fans Subject: Re: wily-9libs and sam-9libs on 24-bit Linux display Message-ID: <20000924093231.A25653@wa8tzg.org> Mail-Followup-To: Wily Fans , Sam Fans References: <20000417145820.14626.qmail@web3205.mail.yahoo.com> <39173E20.77F0D49@kremvax.net> <39174AE2.CEC76A4@uiuc.edu> Mime-Version: 1.0 Content-Type: text/plain Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <39174AE2.CEC76A4@uiuc.edu>; from ejk@uiuc.edu on Mon, May 08, 2000 at 06:16:50PM -0500 Content-Length: 876 Lines: 24 Organization: None, can't you tell? X-Mailer: KMail [version 1.0.28] Content-Transfer-Encoding: 8bit On Mon, May 08, 2000 at 06:16:50PM -0500, Ed Kubaitis wrote: > "Mark H. Wilkinson" wrote: [snip] > FWIW, on RH Linux 6.2 recently, I had to backoff 24bpp to 16 to make an > ancient (circa 1993-4) version of libXg/samterm functional. Sory for the reply to such an old message but I've recently hit this myself. Looking at the code for 9libs, I find a lot of places where the number of colors is hard-coded at 256 (8-bit depth). I changed these to 65536 for an experiment,as well as reducing my colordepth to 16-bit, but no joy. Things die where the color map is being read via the X function. Not being an X programmer, I'm now stuck. System is Mandrake 7.1 with XFree86 3.3.6 Suggestions or fixes? Thanks! -- 73 de Bill Meahan WA8TZG wmeahan@wa8tzg.org Home for Orphan Hand Tools & Boatanchors (esp. Collins) Relax -- I use Genuine SMTP Mail, not that M$ virus trap! From sam-fans-owner Mon Nov 13 18:30:46 2000 Received: from bio.cse.psu.edu ([130.203.12.17]) by hawkwind.utcs.utoronto.ca with SMTP id <44241>; Mon, 13 Nov 2000 18:24:00 -0500 Received: (qmail 21177 invoked by uid 991); 28 Oct 2000 06:30:18 -0000 Message-ID: <20001028063018.21176.qmail@g.bio.cse.psu.edu> To: sam-fans@hawkwind.utcs.toronto.edu To: 9fans@cse.psu.edu Subject: updated unix port of sam Date: Sat, 28 Oct 2000 02:30:18 -0500 From: Scott Schwartz Hi, I've made a few changes to the unix port of sam, to make it match the third edition's code more closely. (As before, this relies on the old version of samterm (libXg)). The compressed tar file is available from: http://www.cse.psu.edu/~schwartz/sam-9.3.1-unix.tar.bz2 -- Scott From sam-fans-owner Tue Dec 12 17:56:46 2000 Received: from aubrey.stanford.edu ([171.66.232.31]) by hawkwind.utcs.utoronto.ca with SMTP id <45081>; Tue, 12 Dec 2000 17:45:50 -0500 Received: (qmail 15123 invoked from network); 12 Dec 2000 07:23:33 -0000 Received: from localhost.highwire.org (HELO aubrey.stanford.edu) (127.0.0.1) by localhost.highwire.org with SMTP; 12 Dec 2000 07:23:33 -0000 X-url: http://highwire.stanford.edu/~jimr/ X-face: "!ZH^<"U,NeU:732A To: "sam Fans" Dcc: Subject: 24/32 bpp with 9libs vs. orig libXg MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15118.976605813.1@aubrey.stanford.edu> Date: Tue, 12 Dec 2000 02:23:33 -0500 Message-Id: <00Dec12.174550edt.45081@hawkwind.utcs.utoronto.ca> A few people have noted problems running sam and 9term on 24 bpp or 32 bpp displays (we would get the error 'libg: i/o error' when we tried to open a menu in 9term or simply bring up samterm). It appears that my problem may have stemmed from a problem specific to the 9libs port of the original libXg library. The other day I installed limbo, and found that wm/wm couldn't handle 16bpp depth. 8bpp was unacceptable to me, and I had not been able to run sam and 9term in 24bpp mode before. Today I installed the original samterm from Rob Pike's release, available at ftp://netlib.bell-labs.com/netlib/research/sam.shar.gz, and found the samterm compiled from that source works perfectly at 24bpp. I recompiled my 9term against this original libXg, and found that it also works at 24bpp without any visible problems. Since the samterm works with the latest sam (editor only) released a few months ago, I'm happy. =) My original goal was to get a static version of libXg compiled so that I could debug it with gdb. I was having great difficulty getting the 9libs version working with gdb (perhaps because it uses this .la/.lo format that I've never really understood). Imagine my surpise when compiling the original libXg fixed the problem. =) Jim From sam-fans-owner Thu Dec 14 02:33:24 2000 Received: from albatross-ext.wise.edt.ericsson.se ([194.237.142.116]) by hawkwind.utcs.utoronto.ca with SMTP id <44709>; Thu, 14 Dec 2000 02:32:53 -0500 Received: from etxb.ericsson.se (avx6.etxb.ericsson.se [130.100.180.16]) by albatross.wise.edt.ericsson.se (8.11.0/8.11.0/WIREfire-1.3) with ESMTP id eBE7MI420054 for ; Thu, 14 Dec 2000 08:22:18 +0100 (MET) Received: from avc093.etxb.ericsson.se (avc093 [130.100.180.205]) by etxb.ericsson.se (8.9.3+Sun/8.9.3/eri-dom-1.1) with ESMTP id IAA26292 for ; Thu, 14 Dec 2000 08:22:18 +0100 (MET) From: Bengt Kleberg Received: (from qtxkleb@localhost) by avc093.etxb.ericsson.se (8.9.3+Sun/8.9.3/client-1.0) id IAA00286 for sam-fans@hawkwind.utcs.utoronto.ca; Thu, 14 Dec 2000 08:22:15 +0100 (MET) Date: Thu, 14 Dec 2000 02:22:15 -0500 Message-Id: <200012140722.IAA00286@avc093.etxb.ericsson.se> To: sam-fans@hawkwind.utcs.utoronto.ca Subject: 'original' libXg and 24 bpp, follow up X-Sun-Charset: US-ASCII greetings, after the good news about the original sams libXg working on 24 bpp, i tried it. both to get a working sam, and in the hope of perhaps finding out why. 'test' did not work for me. 'rdcolmap bitmap too deep' anything in particular i need to do? (apart from modifying 'test.c' and 'Make.solaris' to get 'test' to compile) PS: does anybody have the url to wily? wily-fans produced no response... From sam-fans-owner Thu Dec 14 13:55:58 2000 Received: from aubrey.stanford.edu ([171.66.232.31]) by hawkwind.utcs.utoronto.ca with SMTP id <45076>; Thu, 14 Dec 2000 13:55:38 -0500 Received: (qmail 26786 invoked from network); 14 Dec 2000 08:25:10 -0000 Received: from localhost.highwire.org (HELO aubrey.stanford.edu) (127.0.0.1) by localhost.highwire.org with SMTP; 14 Dec 2000 08:25:10 -0000 X-url: http://highwire.stanford.edu/~jimr/ X-face: "!ZH^<"U,NeU:732A To: Bengt Kleberg cc: sam-fans@hawkwind.utcs.toronto.edu Dcc: Subject: Re: 'original' libXg and 24 bpp, follow up In-reply-to: Message from Bengt Kleberg of "Thu, 14 Dec 2000 02:22:15 EST."References: <200012140722.IAA00286@avc093.etxb.ericsson.se> <200012140722.IAA00286@avc093.etxb.ericsson.se> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <26781.976782309.1@aubrey.stanford.edu> Date: Thu, 14 Dec 2000 03:25:10 -0500 Sender: jimr@aubrey.stanford.edu Message-Id: <00Dec14.135538edt.45076@hawkwind.utcs.utoronto.ca> > 'test' did not work for me. > 'rdcolmap bitmap too deep' After including "u.h" to fix a problem with a missing def for Rune, test in the libXg directory compiled for me, and ran up to the test of arc. At that point it bailed with the same error as you reported. The problem appears to be that rdcolmap handles only up to 256 colors (it's hard coded as a magic number). If it detects more than that, it bails. I just went into xtbinit.c commented out the 'return;' statement after the color depth check in rdcolmap. Test ran for me after that, though the inversion test doesn't do the right thing. I guess I'm curious about samterm itself -- since it doesn't use color I'm thinking the above doesn't matter much in terms of it's impact. A message I dug up from the wily list: Date: Wed, 22 Nov 1995 12:57:40 EST To: wilyfans@jli.com From: Chris Siebenmann Subject: Re: wily doesn't seem to like 24-bit TrueColor ... A friend fixed this (in sam) and has given me some patches I need to integrate. The core problem is that libXg assumes that the framebuffer depth is equal to the number of colour bits; '24-bit' colour in my X server is actually 32 bits deep, breaking this. The solution is apparently fairly simple -- just stop libXg assuming this in the few places where it matters. ... > PS: does anybody have the url to wily? wily-fans produced no response... The url for the editor is now at http://www.cs.yorku.ca/~oz/wily/, wilyfans@jli.com is the email address for the list. Jim From sam-fans-owner Mon Dec 18 22:04:58 2000 Received: from albatross-ext.wise.edt.ericsson.se ([194.237.142.116]) by hawkwind.utcs.utoronto.ca with SMTP id <45415>; Mon, 18 Dec 2000 22:04:35 -0500 Received: from etxb.ericsson.se (avx6.etxb.ericsson.se [130.100.180.16]) by albatross.wise.edt.ericsson.se (8.11.0/8.11.0/WIREfire-1.3) with ESMTP id eBIEnF426738; Mon, 18 Dec 2000 15:49:16 +0100 (MET) Received: from avc093.etxb.ericsson.se (avc093 [130.100.180.205]) by etxb.ericsson.se (8.9.3+Sun/8.9.3/eri-dom-1.1) with ESMTP id PAA08481; Mon, 18 Dec 2000 15:49:14 +0100 (MET) From: Bengt Kleberg Received: (from qtxkleb@localhost) by avc093.etxb.ericsson.se (8.9.3+Sun/8.9.3/client-1.0) id PAA18696; Mon, 18 Dec 2000 15:49:12 +0100 (MET) Date: Mon, 18 Dec 2000 09:49:12 -0500 Message-Id: <200012181449.PAA18696@avc093.etxb.ericsson.se> To: qtxkleb@etxb.ericsson.se, jim.robinson@stanford.edu Subject: Re: 'original' libXg and 24 bpp, follow up Cc: sam-fans@hawkwind.utcs.toronto.edu X-Sun-Charset: US-ASCII Confirmed. A simple change to 9libs, taken from the original sam/libXg, makes it poissible to run sam on 24 bpp. Diff sent to Mark, to allow him a chance to 'polish' it before incorporation. Bengt Kleberg From sam-fans-owner Wed Feb 21 17:13:46 2001 Received: from prv-mail21.provo.novell.com ([137.65.81.126]) by hawkwind.utcs.utoronto.ca with SMTP id <44648>; Wed, 21 Feb 2001 17:13:30 -0500 Received: from wumpus (wumpus.bht.novell.com [164.99.41.132]) by prv-mail21.provo.novell.com; Wed, 21 Feb 2001 13:42:31 -0700 From: Mike Scheer To: sam-fans@hawkwind.utcs.toronto.edu Subject: p9 or other on linux? Date: Wed, 21 Feb 2001 15:42:36 -0500 Organization: Plexus Systems Inc. Reply-To: mdash@plexsys.com Message-ID: X-Mailer: Forte Agent 1.8/32.548 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable I've been using win-based development tools for a couple of years, and am now about to move onto my first linux project. This gives me the opportunity to dust off sam , 9term, and 9wm. Years ago, I had them running on various unices, but I would like to get hold of existing linux ports if possible. URLs? I haven't had much luck with google or yahoo searches. Thanks. Incidentally, there appear no longer to be sam downloads on bell-labs.com, other than as part of the plan9 distribution. seanq's win32 port is not to be seen. --Mike Scheer From sam-fans-owner Thu Feb 22 13:57:27 2001 Received: from prv-mail21.provo.novell.com ([137.65.81.126]) by hawkwind.utcs.utoronto.ca with SMTP id <44342>; Thu, 22 Feb 2001 13:57:11 -0500 Received: from wumpus (wumpus.bht.novell.com [164.99.41.131]) by prv-mail21.provo.novell.com; Thu, 22 Feb 2001 09:56:31 -0700 From: Mike Scheer To: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: p9 or other on linux? Date: Thu, 22 Feb 2001 11:56:33 -0500 Organization: Plexus Systems Inc. Reply-To: mdash@plexsys.com Message-ID: References: In-Reply-To: X-Mailer: Forte Agent 1.8/32.548 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Sorrry for the auto-followup, but gregoire@inrs-telecom.uquebec.ca pointed out that sam is indeed still available in netlib. I can only say that the searches I had tried on bell-labs.com did not show sam. --Mike Scheer On Wed, 21 Feb 2001 15:42:36 -0500, I wrote: >I've been using win-based development tools for a couple of years, and >am now about to move onto my first linux project. This gives me the >opportunity to dust off sam , 9term, and 9wm. Years ago, I had them >running on various unices, but I would like to get hold of existing >linux ports if possible. URLs? I haven't had much luck with google or >yahoo searches. Thanks. > >Incidentally, there appear no longer to be sam downloads on >bell-labs.com, other than as part of the plan9 distribution. seanq's >win32 port is not to be seen. > >--Mike Scheer From sam-fans-owner Thu Feb 22 13:57:29 2001 Received: from hoemail2.firewall.lucent.com ([192.11.226.163]) by hawkwind.utcs.utoronto.ca with SMTP id <44343>; Thu, 22 Feb 2001 13:57:26 -0500 Received: from hoemail2.firewall.lucent.com (localhost [127.0.0.1]) by hoemail2.firewall.lucent.com (Pro-8.9.3/8.9.3) with ESMTP id MAA11683 for ; Thu, 22 Feb 2001 12:17:08 -0500 (EST) Received: from scalene.wh.lucent.com (h135-88-38-89.lucent.com [135.88.38.89]) by hoemail2.firewall.lucent.com (Pro-8.9.3/8.9.3) with ESMTP id MAA11646; Thu, 22 Feb 2001 12:17:06 -0500 (EST) Received: from localhost (rubin@localhost) by scalene.wh.lucent.com (8.9.3/8.8.7) with ESMTP id IAA14335; Thu, 22 Feb 2001 08:16:43 -0500 X-Authentication-Warning: scalene.wh.lucent.com: rubin owned process doing -bs Date: Thu, 22 Feb 2001 08:16:43 -0500 From: David L Rubin X-Sender: rubin@scalene.wh.lucent.com To: Mike Scheer cc: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: p9 or other on linux? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 21 Feb 2001, Mike Scheer wrote: > I've been using win-based development tools for a couple of years, and > am now about to move onto my first linux project. This gives me the > opportunity to dust off sam , 9term, and 9wm. Years ago, I had them > running on various unices, but I would like to get hold of existing > linux ports if possible. URLs? I haven't had much luck with google or > yahoo searches. Thanks. Try http://www.freshmeat.net. Also, http://www.plan9.bell-labs.com/plan9dist. > Incidentally, there appear no longer to be sam downloads on > bell-labs.com, other than as part of the plan9 distribution. seanq's > win32 port is not to be seen. I downloaded Sean's win32 port a few months ago. You can always send him email: seanq@lucent.com. david ~~ David L Rubin f/973.581.6665 v/973.386.8598 Lucent Technologies, NJ0117 15G-117, 67 Whippany Rd, Whippany, NJ 07981 pub key fingerprint: 59E BC8E 79CB A6CB 4B57 A1B2 CDB0 2FD4 AADC 81AA temporary voice mail: +34 91.807.1054 From sam-fans-owner Thu Feb 22 16:19:56 2001 Received: from bio.cse.psu.edu ([130.203.12.17]) by hawkwind.utcs.utoronto.ca with SMTP id <44407>; Thu, 22 Feb 2001 16:19:17 -0500 Received: (qmail 10223 invoked by uid 991); 22 Feb 2001 19:40:48 -0000 Message-ID: <20010222194048.10221.qmail@g.bio.cse.psu.edu> to: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: p9 or other on linux? In-Reply-To: Message from Mike Scheer of "Thu, 22 Feb 2001 11:56:33 EST." Date: Thu, 22 Feb 2001 14:40:48 -0500 From: Scott Schwartz I'm worried about version skew. The current Plan 9 version of sam uses code from acme. At least three people, including me, have done unix ports. Right now, I have no clue what version any particular archive site will be handing out. We really ought to converge on something. From sam-fans-owner Fri Feb 23 04:26:27 2001 Received: from penguin-ext.wise.edt.ericsson.se ([194.237.142.110]) by hawkwind.utcs.utoronto.ca with SMTP id <44537>; Fri, 23 Feb 2001 04:26:08 -0500 Received: from etxb.ericsson.se (avx6.etxb.ericsson.se [130.100.180.16]) by penguin.wise.edt.ericsson.se (8.11.0/8.10.1/WIREfire-1.3) with ESMTP id f1N7I8d18584; Fri, 23 Feb 2001 08:18:08 +0100 (MET) Received: from avc093.etxb.ericsson.se (avc093 [130.100.180.205]) by etxb.ericsson.se (8.9.3+Sun/8.9.3/eri-dom-1.1) with ESMTP id IAA23485; Fri, 23 Feb 2001 08:18:07 +0100 (MET) From: Bengt Kleberg Received: (from qtxkleb@localhost) by avc093.etxb.ericsson.se (8.9.3+Sun/8.9.3/client-1.0) id IAA11581; Fri, 23 Feb 2001 08:18:06 +0100 (MET) Date: Fri, 23 Feb 2001 02:18:06 -0500 Message-Id: <200102230718.IAA11581@avc093.etxb.ericsson.se> To: mdash@plexys.com Subject: Re: p9 or other on linux? Cc: sam-fans@hawkwind.utcs.toronto.edu X-Sun-Charset: US-ASCII > sam , 9term, and 9wm. Do not forget acme (under Inferno, or as wily, for unix), 9menu, rc and tcs. > URLs? The ones I have that freshmeat.org is unlikely to know about: www.vitanuova.com www.cs.yorku.ca/~oz/wily ftp://ftp.freefriends.org/arnold www.cse.psu.edu/~schwartz www.eecs.harvard.edu/~rcs From sam-fans-owner Mon Feb 26 23:46:00 2001 Received: from smtp07.mail.onemain.com ([63.208.208.73]) by hawkwind.utcs.utoronto.ca with SMTP id <44591>; Mon, 26 Feb 2001 23:45:54 -0500 Received: (qmail 20714 invoked from network); 24 Feb 2001 19:02:58 -0000 Received: from 209-239-203-50.oak.jps.net (HELO pkwksj.sjna.corp.dom) ([209.239.203.50]) (envelope-sender ) by smtp07.mail.onemain.com (qmail-ldap-1.03) with SMTP for ; 24 Feb 2001 19:02:58 -0000 From: "kim kubik" To: , Subject: Re: p9 or other on linux? Date: Sat, 24 Feb 2001 14:05:05 -0500 Message-ID: <01c09e94$d14544a0$32cbefd1@pkwksj.sjna.corp.dom> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.71.1712.3 X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 -----Original Message----- From: Mike Scheer Subject: p9 or other on linux? >I would like to get hold of existing >linux ports if possible. URLs? I haven't had >much luck with google or >yahoo searches. Thanks. I remember when I first started looking for the same p9-4-linux stuff a number of years back that the FreeBSD people had a more complete and more up-to-date collection in their ports section than any of the Linux dists (Debian was the only one that came close). I once bought a Linux magazine with a cover proclaiming the issue was devoted to the "Internationalization of Linux". Inside were about ten articles on emacs and how someday it was going to display UTF-8 or some such. They had never even heard of 9term/sam/wily/etc. But I can't use emacs because I only have a 10-Gig Hard Drive . . . :-) - kim From sam-fans-owner Mon Feb 26 23:46:01 2001 Received: from d1-hrz.uni-duisburg.de ([134.91.4.38]) by hawkwind.utcs.utoronto.ca with SMTP id <44547>; Mon, 26 Feb 2001 23:44:21 -0500 Received: from l1-hrz.uni-duisburg.de (sb463ba@l1-hrz.uni-duisburg.de [134.91.1.34]) by d1-hrz.uni-duisburg.de (8.11.1/8.11.1) with ESMTP id f1NCxLJ10566; Fri, 23 Feb 2001 13:59:21 +0100 (MET) Received: (from sb463ba@localhost) by l1-hrz.uni-duisburg.de (8.9.3 (PHNE_18546)/8.9.3) id NAA05633; Fri, 23 Feb 2001 13:59:09 +0100 (MEZ) From: Georg Bauhaus Message-Id: <200102231259.NAA05633@l1-hrz.uni-duisburg.de> Subject: Re: p9 or other on linux? In-Reply-To: from Mike Scheer at "Feb 21, 2001 03:42:36 pm" To: mdash@plexsys.com Date: Fri, 23 Feb 2001 07:59:09 -0500 CC: sam-fans@hawkwind.utcs.toronto.edu X-Mailer: ELM [version 2.4ME+ PL66 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > This gives me the > opportunity to dust off sam , 9term, and 9wm. Years ago, I had them > running on various unices, but I would like to get hold of existing > linux ports if possible. URLs? I haven't had much luck with google or > yahoo searches. Thanks. > http://packages.debian.org/stable/editors/sam.html http://packages.debian.org/stable/x11/9wm.html 9term appears to have been withdrawn, because the package is in need of a new maintainer: http://www.debian.org/devel/wnpp/work_needing.html, http://bugs.debian.org/cgi-bin/bugreport.cgi?archive=no&bug=68295 Georg Bauhaus From sam-fans-owner Tue Mar 13 18:02:29 2001 Received: from prv-mail21.provo.novell.com ([137.65.81.126]) by hawkwind.utcs.utoronto.ca with SMTP id <46163>; Tue, 13 Mar 2001 18:02:10 -0500 Received: from wumpus (wumpus.bht.novell.com [164.99.41.143]) by prv-mail21.provo.novell.com; Tue, 13 Mar 2001 07:24:17 -0700 From: Mike Scheer To: pj@sam.engr.sgi.com (Paul Jackson) Cc: sam-fans@hawkwind.utcs.toronto.edu Subject: samx Date: Tue, 13 Mar 2001 09:24:26 -0500 Organization: Plexus Systems Inc. Reply-To: mdash@plexsys.com Message-ID: References: <200004262234.PAA76725@sam.engr.sgi.com> In-Reply-To: <200004262234.PAA76725@sam.engr.sgi.com> X-Mailer: Forte Agent 1.8/32.548 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Paul-- Are the samx sources posted anywhere? My saved email shows that discussion thread petering-out inconclusively. Thanks. --Mike Scheer From sam-fans-owner Wed Mar 14 03:11:01 2001 Received: from ejk.cso.uiuc.edu ([130.126.112.162]) by hawkwind.utcs.utoronto.ca with SMTP id <44379>; Wed, 14 Mar 2001 03:10:37 -0500 Received: (qmail 12913 invoked from network); 14 Mar 2001 01:12:53 -0000 Received: from c330414-c.chmpgn1.il.home.com (HELO uiuc.edu) (ejk@24.22.18.168) by ejk.cso.uiuc.edu with SMTP; 14 Mar 2001 01:12:53 -0000 Sender: ejk Message-ID: <3AAEC593.187C6641@uiuc.edu> Date: Tue, 13 Mar 2001 20:12:51 -0500 From: Ed Kubaitis Organization: CCSO - University of Illinois at Urbana-Champaign X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.16-22 i686) X-Accept-Language: en MIME-Version: 1.0 To: sam-fans@hawkwind.utcs.toronto.edu Subject: Re: samx References: <200004262234.PAA76725@sam.engr.sgi.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mike Scheer wrote: > > Paul-- > > Are the samx sources posted anywhere? My saved email shows that > discussion thread petering-out inconclusively. Thanks. > > --Mike Scheer Try ftp://ftp.funet.fi/pub/unix/editors/sam/samx2/ FWIW, I have been running more or less this version since 1993, most recently on Redhat 7. -------------------------- Ed Kubaitis (ejk@uiuc.edu) CCSO - University of Illinois at Urbana-Champaign From sam-fans-owner Wed Mar 14 03:11:02 2001 Received: from smtp01.mail.onemain.com ([63.208.208.73]) by hawkwind.utcs.utoronto.ca with SMTP id <44433>; Wed, 14 Mar 2001 03:10:53 -0500 Received: (qmail 19525 invoked from network); 14 Mar 2001 05:28:39 -0000 Received: from 209-239-195-155.oak.jps.net (HELO pkwksj.sjna.corp.dom) ([209.239.195.155]) (envelope-sender ) by smtp01.mail.onemain.com (qmail-ldap-1.03) with SMTP for ; 14 Mar 2001 05:28:39 -0000 From: "kim kubik" To: , "Paul Jackson" Cc: Subject: Re: samx Date: Wed, 14 Mar 2001 00:32:23 -0500 Message-ID: <01c0ac48$25e41020$9bc3efd1@pkwksj.sjna.corp.dom> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.71.1712.3 X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 -----Original Message----- From: Mike Scheer Subject: samx Are the samx sources posted anywhere? My saved email shows that discussion thread petering-out inconclusively. Thanks. ----Unoriginal Reply---- ftp.funet.fi/pub/unix/editors/sam/samx2 - circa 1993, know nothing else about it . . . - kim From sam-fans-owner Wed Jul 25 14:18:12 2001 Received: from highwire.stanford.edu ([171.66.121.166]) by hawkwind.utcs.utoronto.ca with SMTP id <45367>; Wed, 25 Jul 2001 14:16:46 -0500 Received: from highwire.stanford.edu (highwire.stanford.edu [171.66.121.166]) by highwire.stanford.edu (8.10.1/HIGHWIRE2.0) with ESMTP id f6KHOgb05259 for ; Fri, 20 Jul 2001 10:24:42 -0700 (PDT) Message-Id: <200107201724.f6KHOgb05259@highwire.stanford.edu> X-url: http://highwire.stanford.edu/~jimr/ X-face: "!ZH^<"U,NeU:732A To: "sam fans" Dcc: Subject: samterm panic MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <5253.995649882.1@highwire.stanford.edu> Date: Fri, 20 Jul 2001 13:24:42 -0500 Sender: jimr@highwire.stanford.edu Cause some folks expressed an interest in when sam panics, I was asked to make a note of it to this list. =) I'm using the new sam with acme data structures, combined with the old samterm. Every once in a while I get a panic. I never really payed attention to if it was sam or samterm. =( I just got a panic from samterm when I: opened a file locked by RCS made a change tried to save got permission denied in another window, checked out the file from RCS tried to save the file again samterm spat out the following and dumped core samterm: host mesg: count 24933 114x 101x 97x te "local_env" ...ignored 74 65 20 22 6c 6f 63 61 6c 5f 65 6e 76 22 a 6 2 samterm: host mesg: count 24933 114x 101x 97x te "local_env" ...ignored 74 65 20 22 6c 6f 63 61 6c 5f 65 6e 76 22 a 6 2 samterm: host mesg: count 24933 114x 101x 97x te "local_env" ...ignored 74 65 20 22 6c 6f 63 61 6c 5f 65 6e 76 22 a 6 2 samterm: host mesg: count 24933 114x 101x 97x te "local_env" ...ignored 74 65 20 22 6c 6f 63 61 6c 5f 65 6e 76 22 a 6 2 type 114 count 24933 samterm:panic: count>DATASIZE: Error 0 I can't reproduce the problem. I took the exact same steps as before, and sam properly warned me that I might be changing an already altered file, and then let me save. Jim From sam-fans-owner Tue Sep 25 17:39:09 2001 Received: from nog.cse.psu.edu ([130.203.12.16]) by hawkwind.utcs.utoronto.ca with SMTP id <51674>; Tue, 25 Sep 2001 17:37:07 -0500 Received: (qmail 20913 invoked by uid 991); 13 Sep 2001 19:34:32 -0000 Message-ID: <20010913193432.20912.qmail@x.nog.bio.cse.psu.edu> Date: Thu, 13 Sep 2001 15:34:32 -0500 To: sam-fans@hawkwind.utcs.toronto.edu cc: 9fans@cse.psu.edu Subject: debugging unix v3 sam vs v2 samterm MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <20908.1000409599.0@bio.cse.psu.edu> Date: Thu, 13 Sep 2001 15:34:32 -0500 From: Scott Schwartz ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20908.1000409599.1@bio.cse.psu.edu> Friends, As you may recall, we've had some problems when using the v3 sam with the v2 samterm, under unix. I've done a bit of debugging, and have a couple of message traces (generated with -DDEBUG) leading up to a crash. Anyone want to help look into these? (The original files were some random source file, and a copy of redhat's termcap.) ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20908.1000409599.2@bio.cse.psu.edu> $ samterm: host mesg: count 26670 115x 46x 104x ,v --> bz_census.h revision 1.1 (locked) done ! ...ignored 2c 76 20 20 2d 2d 3e 20 20 62 7a 5f 63 65 6e 73 75 73 2e 68 a 72 65 76 69 73 69 6f 6e 20 31 2e 31 20 28 6c 6f 63 6b 65 64 29 a 64 6f 6e 65 a 21 a samterm: host mesg: count 26670 115x 46x 104x ,v --> bz_census.h revision 1.1 (locked) done ! ...ignored 2c 76 20 20 2d 2d 3e 20 20 62 7a 5f 63 65 6e 73 75 73 2e 68 a 72 65 76 69 73 69 6f 6e 20 31 2e 31 20 28 6c 6f 63 6b 65 64 29 a 64 6f 6e 65 a 21 a samterm: host mesg: count 26670 115x 46x 104x ,v --> bz_census.h revision 1.1 (locked) done ! ...ignored 2c 76 20 20 2d 2d 3e 20 20 62 7a 5f 63 65 6e 73 75 73 2e 68 a 72 65 76 69 73 69 6f 6e 20 31 2e 31 20 28 6c 6f 63 6b 65 64 29 a 64 6f 6e 65 a 21 a samterm: host mesg: count 26670 115x 46x 104x ,v --> bz_census.h revision 1.1 (locked) done ! ...ignored 2c 76 20 20 2d 2d 3e 20 20 62 7a 5f 63 65 6e 73 75 73 2e 68 a 72 65 76 69 73 69 6f 6e 20 31 2e 31 20 28 6c 6f 63 6b 65 64 29 a 64 6f 6e 65 a 21 a type 115 count 26670 samterm:panic: count>DATASIZE: Success ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20908.1000409599.3@bio.cse.psu.edu> out: Hversion out: 2 out: Hnewname out: 0 out: Hmovname out: 11 out: bz_census.c in: Tversion in: 0 in: Tstartcmdfile in: 134601792 out: Hnewname out: 1 out: Hbindname out: 134601792 out: Hcurrent out: 1 out: Hmovname out: 7 out: ~~sam~~ out: Hcheck0 out: 1 out: Hack in: Tcheck out: Hcheck out: 1 in: Tack out: Hunlock in: Tstartfile out: Hbindname out: 134711368 out: Hcurrent out: 0 in: 0 out: Hgrow out: 0 out: 2436 out: Hcheck0 out: 0 out: Hcheck0 out: 0 out: Hack in: Trequest in: 0 in: 512 out: Hdata out: 0 out: 0 out: 512 out: #include "util.h" #include "seq.h" #include "bz_all.h" #include "bz_main.h" #include "bz_census.h" in: Tcheck out: Hcheck out: 0 in: Tcheck out: Hcheck out: 0 in: Tack out: Hgrow out: 0 out: 16 out: Hcheck0 out: 1 out: Hack in: Trequest in: 512 in: 512 out: Hdata out: 0 out: 512 out: 512 out: c(census,n,i); } void census_mask_align(align_t *a, int n, uchar *fwd, uchar *rev, census_t *cens in: Tcheck out: Hcheck out: 0 in: Trequest in: 512 in: 512 out: Hdata out: 0 out: 512 out: 0 out: in: Tcheck out: Hcheck out: 0 in: Trequest in: 0 in: 16 out: Hdata out: 1 out: 0 out: 16 out: +. bz_census.c in: Tcheck out: Hcheck out: 1 in: Tack out: Hsetdot out: 16 out: 16 out: Hunlock in: Trequest in: 1024 in: 512 out: Hdata out: 0 out: 1024 out: 512 out: += len; break; case EDIT_OP_REP: //fprintf(stderr, "%d %d -> ", x, y); for (i=x, j=x+len in: Tcheck out: Hcheck out: 0 in: Trequest in: 1536 in: 512 out: Hdata out: 0 out: 1536 out: 512 out: ensus_mask_interval(int n, uchar *fwd, uchar *rev, int a, int z, census_t census[], int k) { int i in: Tcheck out: Hcheck out: 0 in: Trequest in: 2048 in: 388 out: Hdata out: 0 out: 2048 out: 388 out: =n; ++i) { if (census[i] >= k) fprintf(fp, "%d %d\n", i, census[i]); } fprintf(fp, "}\n") in: Tcheck out: Hcheck out: 0 in: Torigin in: 19 out: Horigin out: 1223 in: Torigin in: 19 out: Horigin out: 696 in: Torigin in: 19 out: Horigin out: 302 in: Torigin in: 18 out: Horigin out: 0 in: Torigin in: 18 out: Horigin out: 0 in: Torigin in: 18 out: Horigin out: 0 in: Torigin in: 29 out: Horigin out: 1909 in: Torigin in: 29 out: Horigin out: 1251 in: Torigin in: 29 out: Horigin out: 527 in: Torigin in: 8 out: Horigin out: 364 in: Torigin in: 8 out: Horigin out: 201 in: Torigin in: 8 out: Horigin out: 76 in: Torigin in: 6 out: Horigin out: 1998 in: Torigin in: 6 out: Horigin out: 1932 in: Tworkfile in: 0 in: 0 in: 0 in: Ttype in: 16 in: /inter out: Hsetdot out: 1178 out: 1183 out: Hmoveto out: 1178 out: Hsetpat out: 5 out: inter out: Hunlock in: Torigin in: 2 out: Horigin out: 1140 in: Tworkfile in: 0 in: 1178 in: 1183 in: Ttype in: 23 in: / out: Hsetdot out: 1547 out: 1552 out: Hmoveto out: 1547 out: Hunlock in: Tworkfile in: 0 in: 1547 in: 1552 in: Ttype in: 25 in: / out: Hsetdot out: 1178 out: 1183 out: Hmoveto out: 1178 out: Hunlock in: Tworkfile in: 0 in: 1178 in: 1183 in: Ttype in: 27 in: / out: Hsetdot out: 1547 out: 1552 out: Hmoveto out: 1547 out: Hunlock in: Tworkfile in: 0 in: 2151 in: 2151 in: Ttype in: 2151 in: out: Hdirty out: 0 in: Ttype in: 2152 in: msp_ in: Tworkfile in: 0 in: 2156 in: 2156 in: Ttype in: 29 in: B #inc in: Tcheck out: Hcheck out: 3 in: Trequest in: 512 in: 512 out: Hdata out: 3 out: 512 out: 512 out: len, pos1, pos2; score_t score, cum_score; int filter; } msp_t; typedef struct msp_table { int in: Tcheck out: Hcheck out: 3 in: Trequest in: 1024 in: 450 out: Hdata out: 3 out: 1024 out: 450 out: bt, ss_t ss, int X, int K, int T); void blast_table_free(blast_table_t *bt); void msp_free_table(m in: Tcheck out: Hcheck out: 3 in: Tworkfile in: 3 in: 646 in: 646 in: Tdclick out: Hsetdot out: 643 out: 654 out: Hunlockfile out: 3 in: Tworkfile in: 0 in: 2156 in: 2156 in: Ttype in: 2156 in: table_t *census_intervals() in: Ttype in: 2184 in: { in: Ttype in: 2186 in: } in: Twrite in: 0 out: Hclean out: 0 out: Hgrowdata out: 64 out: 19 out: 19 out: bz_census.c: #2473 out: Hcheck0 out: 1 out: Hack in: Torigin in: 2 out: Horigin out: 64 in: Tcheck out: Hcheck out: 1 in: Tack out: Hsetdot out: 83 out: 83 out: Hunlock in: Tworkfile in: 0 in: 1703 in: 1703 in: Tworkfile in: 0 in: 1873 in: 1873 in: Tworkfile in: 0 in: 1931 in: 1931 in: Tworkfile in: 0 in: 1932 in: 1932 in: Tworkfile in: 0 in: 2006 in: 2006 in: Tworkfile in: 0 in: 2182 in: 2182 in: Ttype in: 2182 in: uchar census[], int n out: Hdirty out: 0 in: Tworkfile in: 0 in: 2206 in: 2206 in: Torigin in: 20 out: Horigin out: 1291 in: Torigin in: 20 out: Horigin out: 734 in: Torigin in: 20 out: Horigin out: 304 in: Torigin in: 32 out: Horigin out: 0 in: Ttype in: 2206 in: in: Ttype in: 2207 in: in: Tworkfile in: 0 in: 2273 in: 2493 in: Tsnarf in: Tworkfile in: 0 in: 2207 in: 2207 in: Tpaste in: 2207 out: Hgrow out: 2207 out: 220 out: Hcheck0 out: 0 out: Hack in: Trequest in: 2207 in: 220 out: Hdata out: 0 out: 2207 out: 220 out: int i=0, j=0, k; int in = 1; for (k=0; k 2) { print_align_header(sf1, sf2, ss, &gs, K, L); print_msp_l in: Tcheck out: Hcheck out: 4 in: Trequest in: 3276 in: 512 out: Hdata out: 4 out: 3276 out: 512 out: *argv[]) { SEQ *sf1, *sf2; uchar *rf1; blast_table_t *bt; gap_scores_t gs; int W, X, Y, K, L, in: Tcheck out: Hcheck out: 4 in: Tworkfile in: 4 in: 3083 in: 3089 in: Tsnarf in: Tsnarf in: Tsnarf in: Tsnarf in: Tsnarf in: Tworkfile in: 4 in: 3160 in: 3160 in: Ttype in: 3160 in: out: Hdirty out: 4 in: Tworkfile in: 4 in: 3161 in: 3161 in: Ttype in: 3161 in: in: Tworkfile in: 4 in: 2941 in: 2941 in: Ttype in: 2941 in: ; in: Tworkfile in: 4 in: 2945 in: 2946 in: Tworkfile in: 4 in: 2945 in: 2945 in: Ttype in: 2945 in: a in: Tworkfile in: 4 in: 2942 in: 2942 in: Ttype in: 2942 in: in: Ttype in: 2943 in: msp_table_t *m; in: Tworkfile in: 4 in: 3103 in: 3103 in: Ttype in: 3103 in: m = in: Tworkfile in: 4 in: 3187 in: 3187 in: Tworkfile in: 4 in: 3107 in: 3107 in: Tcut in: 3106 in: 3107 in: Tcut in: 3105 in: 3106 in: Tcut in: 3104 in: 3105 in: Tcut in: 3103 in: 3104 in: Tworkfile in: 4 in: 3180 in: 3180 in: Tworkfile in: 4 in: 3183 in: 3183 in: Ttype in: 3183 in: m = census_intervals(census, in: Tworkfile in: 4 in: 3124 in: 3137 in: Tsnarf in: Tworkfile in: 4 in: 3211 in: 3211 in: Tpaste in: 3211 out: Hgrowdata out: 3211 out: 13 out: 13 out: SEQ_LEN(sf1), out: Hcheck0 out: 4 out: Hack in: Tcheck out: Hcheck out: 4 in: Tack out: Hsetdot out: 3211 out: 3224 out: Hunlockfile out: 4 in: Tworkfile in: 4 in: 3211 in: 3211 in: Ttype in: 3211 in: in: Tworkfile in: 4 in: 3225 in: 3225 in: Ttype in: 3225 in: mask_thresh); in: Ttype in: 3240 in: in: Tworkfile in: 4 in: 3187 in: 3187 in: Tcut in: 3186 in: 3187 in: Tcut in: 3185 in: 3186 in: Tcut in: 3184 in: 3185 in: Tcut in: 3183 in: 3184 in: Ttype in: 3183 in: print_ in: Tworkfile in: 4 in: 3244 in: 3244 in: Torigin in: 5 out: Horigin out: 2683 in: Trequest in: 2683 in: 81 out: Hdata out: 4 out: 2683 out: 81 out: p->filter = 1 - p->cum_score; msp_compress(mt); msp_sort_pos1(mt); } in: Tcheck out: Hcheck out: 4 in: Torigin in: 5 out: Horigin out: 2492 in: Trequest in: 2492 in: 191 out: Hdata out: 4 out: 2492 out: 191 out: if (chain == 1 || chain == 2) { msp_t *p; (void)msp_make_chain(mt, bz_flags.G, bz_flags.G, M in: Tcheck out: Hcheck out: 4 in: Torigin in: 5 out: Horigin out: 2423 in: Trequest in: 2423 in: 69 out: Hdata out: 4 out: 2423 out: 69 out: { msp_table_t *mt; mt = blast_search(sf1, sf2, bt, sss, X, K, P); in: Tcheck out: Hcheck out: 4 in: Torigin in: 5 out: Horigin out: 2141 in: Trequest in: 2141 in: 282 out: Hdata out: 4 out: 2141 out: 282 out: /* strand1 -- process one sequence from the second file in one orientation */ static void strand1(S in: Tcheck out: Hcheck out: 4 in: Torigin in: 5 out: Horigin out: 2057 in: Trequest in: 2057 in: 84 out: Hdata out: 4 out: 2057 out: 84 out: substitutions*bz_flags.R : -substitutions*scale*ss[(uchar)'A'][(uchar)'A']); } in: Tcheck out: Hcheck out: 4 in: Tworkfile in: 4 in: 2943 in: 2943 in: Tdclick out: Hsetdot out: 2943 out: 2961 out: Hunlockfile out: 4 in: Tsnarf in: Tcut in: 2943 in: 2961 in: Tworkfile in: 4 in: 3015 in: 3015 in: Ttype in: 3015 in: { in: Ttype in: 3017 in: in: Tworkfile in: 4 in: 3067 in: 3067 in: Ttype in: 3067 in: in: Tworkfile in: 4 in: 3091 in: 3091 in: Ttype in: 3091 in: in: Tworkfile in: 4 in: 3172 in: 3172 in: Ttype in: 3172 in: in: Tworkfile in: 4 in: 3231 in: 3231 in: Tworkfile in: 4 in: 3234 in: 3234 in: Ttype in: 3234 in: } in: Twrite in: 4 out: Hclean out: 4 out: Hgrowdata out: 255 out: 17 out: 17 out: bz_main.c: #5860 out: Hcheck0 out: 1 out: Hack in: Tcheck out: Hcheck out: 1 in: Tack out: Hsetdot out: 272 out: 272 out: Hunlock in: Tworkfile in: 4 in: 3235 in: 3235 in: Tworkfile in: 4 in: 3231 in: 3231 in: Tworkfile in: 4 in: 3178 in: 3178 in: Tworkfile in: 4 in: 3231 in: 3231 in: Ttype in: 3231 in: out: Hdirty out: 4 in: Tworkfile in: 4 in: 3232 in: 3232 in: Tdclick out: Hsetdot out: 3170 out: 3233 out: Hunlockfile out: 4 in: Tworkfile in: 4 in: 3232 in: 3232 in: Tworkfile in: 4 in: 3177 in: 3177 in: Tworkfile in: 4 in: 3092 in: 3092 in: Tworkfile in: 4 in: 3016 in: 3016 in: Ttype in: 3016 in: in: Ttype in: 3017 in: int n; in: Tworkfile in: 4 in: 3102 in: 3102 in: Ttype in: 3102 in: n = in: Tworkfile in: 4 in: 3183 in: 3183 in: Ttype in: 3183 in: in: Ttype in: 3184 in: if (n) printf(" x %d\n", n); in: Tworkfile in: 4 in: 3219 in: 3219 in: Tdclick out: Hunlockfile out: 4 in: Tworkfile in: 4 in: 3184 in: 3184 in: Tworkfile in: 4 in: 3217 in: 3217 in: Tdclick out: Hsetdot out: 3217 out: 3280 out: Hunlockfile out: 4 in: Tsnarf in: Tcut in: 3217 in: 3280 in: Tworkfile in: 4 in: 3187 in: 3220 in: Tworkfile in: 4 in: 3187 in: 3194 in: Tsnarf in: Tcut in: 3187 in: 3194 in: Tworkfile in: 4 in: 3227 in: 3227 in: Tdclick out: Hsetdot out: 3216 out: 3231 out: Hunlockfile out: 4 in: Tworkfile in: 4 in: 3191 in: 3191 in: Twrite in: 4 out: Hclean out: 4 out: Hgrowdata out: 272 out: 17 out: 17 out: bz_main.c: #5838 out: Hcheck0 out: 1 out: Hack in: Torigin in: 2 out: Horigin out: 272 in: Tcheck out: Hcheck out: 1 in: Tack out: Hsetdot out: 289 out: 289 out: Hunlock in: Tworkfile in: 0 in: 2445 in: 2445 in: Ttype in: 289 in: /mask_ali out: Hsetdot out: 543 out: 551 out: Hmoveto out: 543 out: Hsetpat out: 8 out: mask_ali out: Hunlock in: Torigin in: 2 out: Horigin out: 530 in: Tworkfile in: 0 in: 534 in: 534 in: Tdclick out: Hsetdot out: 531 out: 535 out: Hunlockfile out: 0 in: Tsnarf in: Tcut in: 531 in: 535 out: Hdirty out: 0 in: Ttype in: 531 in: int in: Tworkfile in: 0 in: 638 in: 638 in: Ttype in: 638 in: in: Ttype in: 639 in: int cnt; in: Tcut in: 648 in: 649 in: Tworkfile in: 0 in: 648 in: 648 in: Tworkfile in: 0 in: 665 in: 665 in: Ttype in: 665 in: in: Tworkfile in: 0 in: 666 in: 666 in: Ttype in: 666 in: in: Ttype in: 667 in: cnt = 0; in: Tworkfile in: 0 in: 1186 in: 1186 in: Ttype in: 1186 in: cnt += in: Tworkfile in: 0 in: 1637 in: 1637 in: Tdclick out: Hsetdot out: 1637 out: 1643 out: Hunlockfile out: 0 in: Tworkfile in: 0 in: 1558 in: 1558 in: Tdclick out: Hsetdot out: 1557 out: 1561 out: Hunlockfile out: 0 in: Tsnarf in: Tcut in: 1557 in: 1561 in: Ttype in: 1557 in: int in: Tworkfile in: 0 in: 1663 in: 1663 in: Ttype in: 1663 in: int cnt; in: Ttype in: 1673 in: in: Ttype in: 1674 in: cnt = 0; in: Tworkfile in: 0 in: 1973 in: 1973 in: Ttype in: 1973 in: in: Ttype in: 1974 in: ++cnt; in: Tworkfile in: 0 in: 1990 in: 1990 in: Ttype in: 1990 in: in: Ttype in: 1991 in: return cnt; in: Tworkfile in: 0 in: 1569 in: 1569 in: Tdclick out: Hsetdot out: 1561 out: 1581 out: Hunlockfile out: 0 in: Tlook in: 1561 in: 1581 out: Hsetdot out: 1193 out: 1213 out: Hmoveto out: 1193 out: Hunlock in: Torigin in: 2 out: Horigin out: 1160 in: Tworkfile in: 0 in: 1435 in: 1435 in: Ttype in: 1435 in: in: Ttype in: 1436 in: return cnt; in: Torigin in: 17 out: Horigin out: 716 in: Torigin in: 17 out: Horigin out: 377 in: Torigin in: 17 out: Horigin out: 76 in: Tworkfile in: 0 in: 1448 in: 1448 in: Ttype in: 299 in: B bz_census.h out: Hnewname out: 5 out: Hmovname out: 11 out: bz_census.h out: Hgrowdata out: 313 out: 16 out: 16 out: -. bz_census.h out: Hcheck0 out: 1 out: Hack in: Tcheck out: Hcheck out: 1 in: Tack out: Hsetdot out: 329 out: 329 out: Hcurrent out: 5 out: Hunlock in: Tstartfile out: Hbindname out: 134734872 out: Hcurrent out: 5 in: 5 out: Hgrow out: 0 out: 425 out: Hcheck0 out: 5 out: Hmoveto out: 0 out: Hunlock in: Trequest in: 0 in: 425 out: Hdata out: 5 out: 0 out: 425 out: #ifndef BZ_CENSUS_H #define BZ_CENSUS_H typedef unsigned char census_t; void msp_census(census_t ce in: Tcheck out: Hcheck out: 5 in: Tworkfile in: 5 in: 212 in: 212 in: Tworkfile in: 5 in: 133 in: 133 in: Tdclick out: Hsetdot out: 132 out: 136 out: Hunlockfile out: 5 in: Tsnarf in: Tcut in: 132 in: 136 out: Hdirty out: 5 in: Ttype in: 132 in: int in: Tworkfile in: 5 in: 229 in: 229 in: Tdclick out: Hsetdot out: 228 out: 232 out: Hunlockfile out: 5 in: Tsnarf in: Tcut in: 228 in: 232 in: Ttype in: 228 in: int in: Tworkfile in: 5 in: 423 in: 423 in: Tworkfile in: 4 in: 3191 in: 3191 in: Ttype in: 329 in: X/'/ w out: Hclean out: 0 out: Hcurrent out: 5 out: Hgrowdata out: 336 out: 47 out: 47 out: bz_census.c: #2799 ?can't create "bz_census.h" out: Hcheck0 out: 1 out: Hack in: Tcheck out: Hcheck out: 1 in: Tack out: Hsetdot out: 383 out: 383 out: Hsetpat out: 1 out: ' out: Hunlock in: Torigin in: 2 out: Horigin out: 355 in: Ttype in: 383 in: !co -l in: Tdclick out: Hsetdot out: 370 out: 379 out: Hunlockfile out: 1 in: Tdclick out: Hsetdot out: 370 out: 381 out: Hunlockfile out: 1 in: Tworkfile in: 5 in: 423 in: 423 in: Tsend out: Hsnarflen out: Hgrowdata out: 390 out: 12 out: 12 out: bz_census.h out: Hcheck0 out: 1 out: Hack in: Tcheck out: Hcheck out: 1 in: Tack out: Hsetdot out: 402 out: 402 out: Hgrow out: 402 out: 65 out: Hcheck0 out: 1 out: Hack in: Trequest in: 402 in: 65 out: Hdata out: 1 out: 402 out: 65 out: RCS/bz_census.h,v --> bz_census.h revision 1.1 (locked) done ! in: Tcheck out: Hcheck out: 1 in: Tack out: Hsetdot out: 467 out: 467 out: Hunlock in: Tworkfile in: 5 in: 423 in: 423 in: Ttype in: 467 in: X w ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20908.1000409599.4@bio.cse.psu.edu> $ type 117 samterm:panic: rcv unknown: Success ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20908.1000409599.5@bio.cse.psu.edu> out: Hversion out: 2 in: Tversion in: 0 in: Tstartcmdfile in: 134601792 out: Hnewname out: 0 out: Hbindname out: 134601792 out: Hcurrent out: 0 out: Hmovname out: 7 out: ~~sam~~ out: Hcheck0 out: 0 out: Hack in: Tcheck out: Hcheck out: 0 in: Tack out: Hunlock in: Ttype in: 0 in: B /tmp/foo out: Hnewname out: 1 out: Hmovname out: 8 out: /tmp/foo out: Hgrow out: 11 out: 13 out: Hcheck0 out: 0 out: Hack in: Trequest in: 11 in: 13 out: Hdata out: 0 out: 11 out: 13 out: -. /tmp/foo in: Tcheck out: Hcheck out: 0 in: Tack out: Hsetdot out: 24 out: 24 out: Hcurrent out: 1 out: Hunlock in: Tstartfile out: Hbindname out: 134714464 out: Hcurrent out: 1 in: 1 out: Hgrow out: 0 out: 625272 out: Hcheck0 out: 1 out: Hmoveto out: 0 out: Hunlock in: Trequest in: 0 in: 512 out: Hdata out: 1 out: 0 out: 512 out: ######## TERMINAL TYPE DESCRIPTIONS SOURCE FILE # # Version 10.2.7 # $Date: 2001/08/28 03:18:20 $ # in: Tcheck out: Hcheck out: 1 in: Trequest in: 512 in: 512 out: Hdata out: 1 out: 512 out: 512 out: tware such as screen-oriented editors. # # Other terminfo and termcap files exist, supported by var in: Tcheck out: Hcheck out: 1 in: Trequest in: 1024 in: 512 out: Hdata out: 1 out: 1024 out: 512 out: o versions. # # Pointers to related resources (including the ncurses distribution) may # be found a in: Tcheck out: Hcheck out: 1 in: Tworkfile in: 1 in: 205 in: 569 in: Tsnarf in: Tcut in: 205 in: 569 out: Hdirty out: 1 in: Trequest in: 1172 in: 512 out: Hdata out: 1 out: 1172 out: 512 out: n a Japanese-processing environment using EUC/Japanese or Shift-JIS, # C1 characters are considered in: Tcheck out: Hcheck out: 1 in: Ttype in: 205 in: in: Tworkfile in: 1 in: 205 in: 763 in: Tsnarf in: Tcut in: 205 in: 763 in: Trequest in: 1127 in: 512 out: Hdata out: 1 out: 1127 out: 512 out: rses suite; it differs from stock (System V-compatible) terminfo only # in that it admits a group o in: Tcheck out: Hcheck out: 1 in: Ttype in: 205 in: in: Tworkfile in: 1 in: 116 in: 585 in: Tsnarf in: Tcut in: 116 in: 585 in: Trequest in: 1171 in: 512 out: Hdata out: 1 out: 1171 out: 512 out: tering leaves in the OT capabilities under their # original termcap names. All translated entries in: Tcheck out: Hcheck out: 1 in: Ttype in: 116 in: in: Tworkfile in: 1 in: 70 in: 1073 in: Tsnarf in: Tcut in: 70 in: 1073 in: Trequest in: 681 in: 512 out: Hdata out: 1 out: 681 out: 512 out: in the 4.4BSD Unix Programmer's Manual. Be aware that 4.4BSD # curses has been declared obsolete in: Tcheck out: Hcheck out: 1 in: Trequest in: 1193 in: 512 out: Hdata out: 1 out: 1193 out: 512 out: urther note: older versions of this file were often installed with an editor # script (reorder) tha in: Tcheck out: Hcheck out: 1 in: Trequest in: 1705 in: 512 out: Hdata out: 1 out: 1705 out: 512 out: or their hardware # (notably DEC and Wyse). # # A detailed change history is included at the end of in: Tcheck out: Hcheck out: 1 in: Ttype in: 70 in: in: Tworkfile in: 1 in: 1143 in: 1673 in: Tsnarf in: Tcut in: 1143 in: 1673 in: Tworkfile in: 1 in: 455 in: 455 in: Tpaste in: 455 out: Hgrow out: 455 out: 530 out: Hcheck0 out: 1 out: Hack in: Trequest in: 455 in: 512 out: Hdata out: 1 out: 455 out: 512 out: whitespace (such whitespace confuses rdist). # # Further note: older versions of this file were of in: Tcheck out: Hcheck out: 1 in: Tack out: Hsetdot out: 455 out: 985 out: Hunlockfile out: 1 in: Trequest in: 967 in: 18 out: Hdata out: 1 out: 967 out: 18 out: omes from vendors in: Tcheck out: Hcheck out: 1 in: Tworkfile in: 1 in: 763 in: 763 in: Tpaste in: 763 out: Hgrow out: 763 out: 530 out: Hcheck0 out: 1 out: Hack in: Trequest in: 763 in: 512 out: Hdata out: 1 out: 763 out: 512 out: whitespace (such whitespace confuses rdist). # # Further note: older versions of this file were of in: Tcheck out: Hcheck out: 1 in: Tack out: Hsetdot out: 763 out: 1293 out: Hunlockfile out: 1 in: Trequest in: 1275 in: 18 out: Hdata out: 1 out: 1275 out: 18 out: omes from vendors in: Tcheck out: Hcheck out: 1 in: Tworkfile in: 1 in: 160 in: 160 in: Tpaste in: 160 out: Hgrow out: 160 out: 530 out: Hcheck0 out: 1 out: Hack in: Trequest in: 160 in: 512 out: Hdata out: 1 out: 160 out: 512 out: whitespace (such whitespace confuses rdist). # # Further note: older versions of this file were of in: Tcheck out: Hcheck out: 1 in: Tack out: Hsetdot out: 160 out: 690 out: Hunlockfile out: 1 in: Trequest in: 672 in: 18 out: Hdata out: 1 out: 672 out: 18 out: omes from vendors in: Tcheck out: Hcheck out: 1 in: Tworkfile in: 1 in: 1448 in: 1448 in: Tpaste in: 1448 out: Hgrow out: 1448 out: 530 out: Hcheck0 out: 1 out: Hack in: Trequest in: 1448 in: 512 out: Hdata out: 1 out: 1448 out: 512 out: whitespace (such whitespace confuses rdist). # # Further note: older versions of this file were of in: Tcheck out: Hcheck out: 1 in: Tack out: Hsetdot out: 1448 out: 1978 out: Hunlockfile out: 1 in: Tworkfile in: 1 in: 619 in: 619 in: Tpaste in: 619 out: Hgrow out: 619 out: 530 out: Hcheck0 out: 1 out: Hack in: Trequest in: 619 in: 512 out: Hdata out: 1 out: 619 out: 512 out: whitespace (such whitespace confuses rdist). # # Further note: older versions of this file were of in: Tcheck out: Hcheck out: 1 in: Tack out: Hsetdot out: 619 out: 1149 out: Hunlockfile out: 1 in: Trequest in: 1131 in: 18 out: Hdata out: 1 out: 1131 out: 18 out: omes from vendors in: Tcheck out: Hcheck out: 1 in: Tworkfile in: 1 in: 777 in: 777 in: Tpaste in: 777 out: Hgrow out: 777 out: 530 out: Hcheck0 out: 1 out: Hack in: Trequest in: 777 in: 512 out: Hdata out: 1 out: 777 out: 512 out: whitespace (such whitespace confuses rdist). # # Further note: older versions of this file were of in: Tcheck out: Hcheck out: 1 in: Tack out: Hsetdot out: 777 out: 1307 out: Hunlockfile out: 1 in: Trequest in: 1289 in: 18 out: Hdata out: 1 out: 1289 out: 18 out: omes from vendors in: Tcheck out: Hcheck out: 1 in: Tworkfile in: 1 in: 227 in: 227 in: Tpaste in: 227 out: Hgrow out: 227 out: 530 out: Hcheck0 out: 1 out: Hack in: Trequest in: 227 in: 512 out: Hdata out: 1 out: 227 out: 512 out: whitespace (such whitespace confuses rdist). # # Further note: older versions of this file were of in: Tcheck out: Hcheck out: 1 in: Tack out: Hsetdot out: 227 out: 757 out: Hunlockfile out: 1 in: Trequest in: 739 in: 18 out: Hdata out: 1 out: 739 out: 18 out: omes from vendors in: Tcheck out: Hcheck out: 1 in: Tworkfile in: 1 in: 1218 in: 1218 in: Tpaste in: 1218 out: Hgrow out: 1218 out: 530 out: Hcheck0 out: 1 out: Hack in: Trequest in: 1218 in: 512 out: Hdata out: 1 out: 1218 out: 512 out: whitespace (such whitespace confuses rdist). # # Further note: older versions of this file were of in: Tcheck out: Hcheck out: 1 in: Tack out: Hsetdot out: 1218 out: 1748 out: Hunlockfile out: 1 in: Tcut in: 1218 in: 1748 in: Tpaste in: 1218 out: Hgrow out: 1218 out: 530 out: Hcheck0 out: 1 out: Hack in: Trequest in: 1218 in: 512 out: Hdata out: 1 out: 1218 out: 512 out: whitespace (such whitespace confuses rdist). # # Further note: older versions of this file were of in: Tcheck out: Hcheck out: 1 in: Tack out: Hsetdot out: 1218 out: 1748 out: Hunlockfile out: 1 in: Tworkfile in: 1 in: 607 in: 607 in: Tpaste in: 607 out: Hgrow out: 607 out: 530 out: Hcheck0 out: 1 out: Hack in: Trequest in: 607 in: 512 out: Hdata out: 1 out: 607 out: 512 out: whitespace (such whitespace confuses rdist). # # Further note: older versions of this file were of in: Tcheck out: Hcheck out: 1 in: Tack out: Hsetdot out: 607 out: 1137 out: Hunlockfile out: 1 in: Trequest in: 1119 in: 18 out: Hdata out: 1 out: 1119 out: 18 out: omes from vendors in: Tcheck out: Hcheck out: 1 in: Tworkfile in: 1 in: 377 in: 377 in: Tpaste in: 377 out: Hgrow out: 377 out: 530 out: Hcheck0 out: 1 out: Hack in: Trequest in: 377 in: 512 out: Hdata out: 1 out: 377 out: 512 out: whitespace (such whitespace confuses rdist). # # Further note: older versions of this file were of in: Tcheck out: Hcheck out: 1 in: Tack out: Hsetdot out: 377 out: 907 out: Hunlockfile out: 1 in: Trequest in: 889 in: 18 out: Hdata out: 1 out: 889 out: 18 out: omes from vendors in: Tcheck out: Hcheck out: 1 in: Tworkfile in: 1 in: 297 in: 297 in: Tpaste in: 297 out: Hgrow out: 297 out: 530 out: Hcheck0 out: 1 out: Hack in: Trequest in: 297 in: 512 out: Hdata out: 1 out: 297 out: 512 out: whitespace (such whitespace confuses rdist). # # Further note: older versions of this file were of in: Tcheck out: Hcheck out: 1 in: Tack out: Hsetdot out: 297 out: 827 out: Hunlockfile out: 1 in: Trequest in: 809 in: 18 out: Hdata out: 1 out: 809 out: 18 out: omes from vendors in: Tcheck out: Hcheck out: 1 in: Tworkfile in: 1 in: 686 in: 686 in: Tpaste in: 686 out: Hgrow out: 686 out: 530 out: Hcheck0 out: 1 out: Hack in: Trequest in: 686 in: 512 out: Hdata out: 1 out: 686 out: 512 out: whitespace (such whitespace confuses rdist). # # Further note: older versions of this file were of in: Tcheck out: Hcheck out: 1 in: Tack out: Hsetdot out: 686 out: 1216 out: Hunlockfile out: 1 in: Trequest in: 1198 in: 18 out: Hdata out: 1 out: 1198 out: 18 out: omes from vendors in: Tcheck out: Hcheck out: 1 in: Tworkfile in: 1 in: 1075 in: 1075 in: Tpaste in: 1075 out: Hgrow out: 1075 out: 530 out: Hcheck0 out: 1 out: Hack in: Trequest in: 1075 in: 512 out: Hdata out: 1 out: 1075 out: 512 out: whitespace (such whitespace confuses rdist). # # Further note: older versions of this file were of in: Tcheck out: Hcheck out: 1 in: Tack out: Hsetdot out: 1075 out: 1605 out: Hunlockfile out: 1 in: Tworkfile in: 1 in: 1434 in: 1434 in: Tpaste in: 1434 out: Hgrow out: 1434 out: 530 out: Hcheck0 out: 1 out: Hack in: Trequest in: 1434 in: 512 out: Hdata out: 1 out: 1434 out: 512 out: whitespace (such whitespace confuses rdist). # # Further note: older versions of this file were of in: Tcheck out: Hcheck out: 1 in: Tack out: Hsetdot out: 1434 out: 1964 out: Hunlockfile out: 1 in: Tworkfile in: 1 in: 1434 in: 1964 in: Ttype in: 24 in: w out: Hcurrent out: 1 out: Hgrowdata out: 26 out: 25 out: 25 out: ?can't create "/tmp/foo" out: Hcheck0 out: 0 out: Hack in: Tcheck out: Hcheck out: 0 in: Tack out: Hsetdot out: 51 out: 51 out: Hunlock in: Tworkfile in: 1 in: 1434 in: 1964 in: Ttype in: 51 in: !co -l /tmp/foo out: Hgrow out: 67 out: 59 out: Hcheck0 out: 0 out: Hack in: Trequest in: 67 in: 59 out: Hdata out: 0 out: 67 out: 59 out: /tmp/RCS/foo,v --> /tmp/foo revision 1.1 (locked) done ! in: Tcheck out: Hcheck out: 0 in: Tack out: Hsetdot out: 126 out: 126 out: Hunlock in: Torigin in: 1 out: Horigin out: 97 in: Torigin in: 6 out: Horigin out: 11 in: Tworkfile in: 1 in: 1434 in: 1964 in: Ttype in: 126 in: w out: Hgrow out: 128 out: 56 out: Hcheck0 out: 0 out: Hack in: Trequest in: 128 in: 56 out: Hdata out: 0 out: 128 out: 56 out: ?warning: write might change good version of `/tmp/foo' in: Tcheck out: Hcheck out: 0 in: Tack out: Hsetdot out: 184 out: 184 out: Hunlock in: Tworkfile in: 1 in: 1434 in: 1964 in: Ttype in: 184 in: X w out: Hclean out: 1 out: Hgrowdata out: 188 out: 18 out: 18 out: /tmp/foo: #629772 out: Hcheck0 out: 0 out: Hack in: Tcheck out: Hcheck out: 0 in: Tack out: Hsetdot out: 206 out: 206 out: Hunlock in: Torigin in: 1 out: Horigin out: 128 in: Tworkfile in: 1 in: 207 in: 1079 in: Tworkfile in: 1 in: 517 in: 517 in: Tworkfile in: 1 in: 516 in: 1386 in: Tsnarf in: Tworkfile in: 1 in: 274 in: 274 in: Tpaste in: 274 out: Hdirty out: 1 out: Hgrow out: 274 out: 870 out: Hcheck0 out: 1 out: Hack in: Trequest in: 274 in: 512 out: Hdata out: 1 out: 274 out: 512 out: his should no longer be necessary, as the file is now ordered # roughly by type frequency with ANSI in: Tcheck out: Hcheck out: 1 in: Tack out: Hsetdot out: 274 out: 1144 out: Hunlockfile out: 1 in: Trequest in: 786 in: 358 out: Hdata out: 1 out: 786 out: 358 out: types up front. # # Some information has been m whitespace (such whitespace confuses rdist). # # Fu in: Tcheck out: Hcheck out: 1 in: Tworkfile in: 1 in: 290 in: 290 in: Tdclick out: Hsetdot out: 150 out: 156 out: Hunlockfile out: 0 in: Tdclick out: Hsetdot out: 150 out: 156 out: Hunlockfile out: 0 in: Tdclick out: Hsetdot out: 150 out: 156 out: Hunlockfile out: 0 in: Tdclick out: Hsetdot out: 150 out: 156 out: Hunlockfile out: 0 in: Tworkfile in: 1 in: 290 in: 290 in: Ttype in: 206 in: X w out: Hcurrent out: 1 out: Hgrowdata out: 210 out: 25 out: 25 out: ?can't create "/tmp/foo" out: Hcheck0 out: 0 out: Hack in: Tcheck out: Hcheck out: 0 in: Tack out: Hsetdot out: 235 out: 235 out: Hunlock in: Tworkfile in: 1 in: 290 in: 290 in: Ttype in: 235 in: !co -l /tmp/foo out: Hgrow out: 251 out: 59 out: Hcheck0 out: 0 out: Hack in: Trequest in: 251 in: 59 out: Hdata out: 0 out: 251 out: 59 out: /tmp/RCS/foo,v --> /tmp/foo revision 1.2 (locked) done ! in: Tcheck out: Hcheck out: 0 in: Tack out: Hsetdot out: 310 out: 310 out: Hunlock in: Tworkfile in: 1 in: 290 in: 290 in: Ttype in: 310 in: X/'/ w out: Hgrow out: 317 out: 56 out: Hcheck0 out: 0 out: Hack in: Trequest in: 317 in: 56 out: Hdata out: 0 out: 317 out: 56 out: ?warning: write might change good version of `/tmp/foo' in: Tcheck out: Hcheck out: 0 in: Tack out: Hsetdot out: 373 out: 373 out: Hsetpat out: 1 out: ' out: Hunlock in: Torigin in: 2 out: Horigin out: 317 in: Tworkfile in: 1 in: 290 in: 290 in: Ttype in: 373 in: w ------- =_aaaaaaaaaa0-- From sam-fans-owner Wed Dec 12 02:21:44 2001 Received: from galapagos.cse.psu.edu ([130.203.12.17]) by hawkwind.utcs.toronto.edu with SMTP id <58491>; Wed, 12 Dec 2001 02:20:25 -0500 Received: (qmail 23179 invoked by uid 991); 11 Dec 2001 21:50:14 -0000 Message-ID: <20011211215014.23178.qmail@g.bio.cse.psu.edu> From: "Scott Schwartz" Date: Tue, 11 Dec 2001 16:50:14 -0500 To: 9fans@cse.psu.edu, sam-fans@hawkwind.utcs.toronto.edu Subject: libXg patch For those using libXg, if you want it to work with X11 unicode fonts (and there are a few these days) with more than 32K characters, don't forget to change libg.h to suit: ; diff libg.h.old libg.h 97,102c97,102 < short minrow; /* first character row in font (for X subfonts) */ < short mincol; /* first character col in font (for X subfonts) */ < short minchar; /* first char code in subfont */ < short maxchar; /* last char code in subfont */ < short width; /* number of chars in row */ < short n; /* number of chars in font */ --- > int minrow; /* first character row in font (for X subfonts) */ > int mincol; /* first character col in font (for X subfonts) */ > int minchar; /* first char code in subfont */ > int maxchar; /* last char code in subfont */ > int width; /* number of chars in row */ > int n; /* number of chars in font */