From icon-group-sender Wed Jan 4 02:55:19 1995 Received: by cheltenham.cs.arizona.edu; Tue, 3 Jan 1995 20:30:36 MST To: icon-group-l@cs.arizona.edu Date: 4 Jan 1995 02:55:19 GMT From: Moshe Yudkowsky Message-Id: <3ed2mn$bhp@News1.mcs.com> Organization: The Institute Sender: icon-group-request@cs.arizona.edu Subject: Help Needed - Archive for Mac Icon Errors-To: icon-group-errors@cs.arizona.edu Sorry to post such an obvious newbie question, but I've watched this group for a couple of weeks, and I haven't spotted any FAQ; Web search engines turn up blank, and archie doesn't help. I'm interested in an Icon compiler for my Mac. I run system 7.0 or better. I've called the ProIcon people, and they say they've given their compiler to the public domain in the hands of U of Arizona; but U of Arizona didn't answer their phones last week, and it doesn't seem to be in their FTP site. Any pointers appreciated. I've got an app that's perfect for Icon, and vice-versa. Thanks for your indulgence. Moshe Yudkowsky * moshe@mcs.com * From icon-group-sender Wed Jan 4 02:23:34 1995 Received: by cheltenham.cs.arizona.edu; Wed, 4 Jan 1995 03:30:38 MST To: icon-group-l@cs.arizona.edu Date: 4 Jan 1995 02:23:34 -0700 From: scott@cs.arizona.edu (Scott E Gilbert) Message-Id: <3edpem$bad@caslon.CS.Arizona.EDU> Organization: University of Arizona CS Department, Tucson AZ Sender: icon-group-request@cs.arizona.edu References: <3ed2mn$bhp@news1.mcs.com> Subject: Re: Help Needed - Archive for Mac Icon Errors-To: icon-group-errors@cs.arizona.edu In article <3ed2mn$bhp@news1.mcs.com>, Moshe Yudkowsky wrote: >I'm interested in an Icon compiler for my Mac. ftp://ftp.cs.arizona.edu/icon/packages/macintosh Enjoy!!! -- Scott Gilbert ( scott@cs.arizona.edu ) From icon-group-sender Thu Jan 5 08:20:15 1995 Received: by cheltenham.cs.arizona.edu; Thu, 5 Jan 1995 08:33:32 MST To: icon-group-l@cs.arizona.edu Date: 5 Jan 1995 08:20:15 -0700 From: icon-project@cs.arizona.edu Message-Id: <3eh2nf$7ot@optima.cs.arizona.edu> Organization: University of Arizona CS Department, Tucson AZ Sender: icon-group-request@cs.arizona.edu Reply-To: icon-project@cs.arizona.edu Subject: Icon Programming Language FAQ Errors-To: icon-group-errors@cs.arizona.edu Archive-name: comp-lang-icon-faq Frequently Asked Questions About The Icon Programming Language last updated: 08/21/94 This FAQ answers various questions about the Icon programming language, ranging from what it is to how you can get it. This first version of the Icon FAQ is devoted to the issues that are likely to be of most interest to persons who don't know anything about Icon or who are relatively new to it. Future versions of this FAQ will answer questions from more experienced Icon programmers. This FAQ is written by Ralph Griswold with help from Cliff Hathaway, Clint Jeffery, and Gregg Townsend. Section I -- General Questions: I.1. What is Icon? I.2. What is Icon good for? I.3. Where did Icon come from? I.4. What does "Icon" stand for? I.5. On what computers does Icon run? I.6. Who did all these implementations? I.7. Are there other implementations in the works? I.8. Are there different versions of Icon? I.9. Which implementations of Icon have graphics/window capabilities? I.10. Where can I get Icon? I.11. Where can I get documentation about Icon? I.12. How do I get started with Icon? I.13. What is the Icon Project? I.14. Where can I find examples of Icon programs? I.15. What is Idol? I.16. How often is material in Icon's FTP area updated? I.17. How do I stay up to date with what's going on with Icon? I.18. Why isn't the Icon Newsletter available electronically? I.19. Is there a users' group for Icon? I.20. How do I get technical support? I.21. Is there an optimizing compiler for Icon? I.22. What do I need to run the interpreter? I.23. What do I need to run the compiler? I.24. Can I build my own implementation of Icon for a new platform? +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ I.1. What is Icon? Icon is a very high level general-purpose programming language with extensive features for processing strings (text) and data structures. Icon is an imperative, procedural language with a syntax that is reminiscent of C and Pascal, but its semantics are at a much higher level than those languages. Icon has a novel expression-evaluation mechanism that integrates goal- directed evaluation and backtracking with conventional control structures. It has a string scanning facility for pattern matching that avoids the tedious details usually associated with analyzing strings. Icon's built-in data structures include sets and tables with associative lookup, lists that can be used as vectors or stacks and queues, and records. Icon is a strongly, though not statically, typed language. It provides transparent automatic type conversion. For example, if an integer is used in an operation that requires a string, the integer is automatically converted to a string. Several implementations of Icon have high-level graphics facilities with an easily programmed window interface. Icon manages storage automatically. Objects are created as needed during program execution and space is reclaimed by garbage collection as needed. The sizes of strings and data structures are limited only by the amount of available memory. I.2. What is Icon good for? As a general-purpose programming language with a large computational repertoire, Icon can be used for most programming tasks. It's at its best when used as a prototyping tool, for processing text, and when ease of programming is needed for experimental and research applications. Paradoxically, Icon is used most often for short, one-shot tasks and for very complex applications. Icon is designed to make programming easy; it emphasizes the value of programmer's time and the importance of getting programs to work quickly. This explains its usefulness for prototyping as well as the apparent paradox of applicability to simple and complex applications. I.3. Where did Icon come from? Icon is the latest in a series of high-level programming languages designed to facilitate programming tasks involving strings and structures. The original language, SNOBOL, was developed at Bell Telephone Laboratories in the early 60s. SNOBOL evolved into SNOBOL4, which is still in use. Subsequent languages were developed at The University of Arizona with support from the National Science Foundation. Incidentally, Icon bears little physical resemblance to SNOBOL4, although it has similar objectives and many similar capabilities. I.4. What does "Icon" stand for? The name Icon (which is not spelled ICON) is not an acronym nor does it stand for anything in particular, although the word iconoclastic was mentioned at the time the name was chosen. The name predates the now common use of "icon" to refer to small images used in graphical user interfaces. This latter usage sometimes causes persons to think mistakenly that Icon is designed to create or manipulate icons. There's not much that can be done about this. I.5. On what computers does Icon run? The implementation of Icon is highly portable. There are versions for the Acorn Archimedes, the Amiga, the Atari ST, IBM CMS and MVS, the Macintosh, MS-DOS, OS/2, UNIX, and VMS. Nearly 60 UNIX platforms are supported. Icon programs also are highly portable. Most Icon programs can run on any platform that supports Icon. I.6. Who did all these implementations? The original implementation of Icon for UNIX was done at The University of Arizona. Most of the other implementations originally were done by volunteers scattered around the world. It's worth noting that all implementations of Icon are based on the same source code, which is written in C. This contributes to the portability of Icon itself, as well as to the portability of programs written in Icon. I.7. Are there other implementations in the works? Yes, work is constantly underway on implementations of Icon for new platforms. Present projects include Windows NT, Win32, and a new Macintosh implementation. I.8. Are there different versions of Icon? Icon has evolved through a series of versions with improved and extended capabilities. The latest major version number is 9. This version includes recent changes and additions, notably in the graphics area. As of this writing, the MS-DOS, UNIX, and VMS implementations are are up to 9.0. Other implementations that presently are at Version 8.10 are being converted to 9.0. There are a few platforms still at 8.0. Almost all programs that run under 8.0 or 8.10 and that do not use graphics will run under 9.0. Programs that use graphics require conversion to 9.0. The 9.0 release provides conversion aids. I.9. Which implementations of Icon have graphics/window capabilities? Icon's graphics facilities presently are supported on the OS/2, UNIX, and VMS implementations. The UNIX and VMS implementations use X, while the OS/2 implementation uses Presentation Manager. The NT and Win32 implementations that are in progress will support Icon's graphics facilities. A Macintosh implementation to support graphics also is in the works. I.10. Where can I get Icon? Most implementations of Icon are available via anonymous FTP to cs.arizona.edu in /icon. The directory /icon/binaries contains executable versions of Icon for several systems, including several popular UNIX platforms. The directory /icon/packages contains source code, test programs, related material, and, most cases, executable binaries as well. All directories have READ.ME files with additional information. Icon also is available on a variety of physical media for prices ranging from $15 to $50. Contact: Icon Project Department of Computer Science The University of Arizona Tucson, AZ 85721 602-621-8448 (voice) 602-621-4246 (fax) icon-orders@cs.arizona.edu (e-mail) Request a copy of the Icon Newsletter for a listing of what's available and what the prices are. Purchases can be made by credit card (MasterCard, Visa, or Discover) or by check drawn on a bank with a branch in the United States and made payable to The University of Arizona. I.11. Where can I get documentation about Icon? The definitive work on Icon is the book The Icon Programming Language, Griswold and Griswold, Prentice-Hall, 1990, 368 pages, ISBN 0-13-447889-4. This book is a complete description and reference manual for Version 8 of Icon. There also is a book on the implementation of Icon: The Implementation of the Icon Programming Language, Griswold and Griswold, Princeton University Press, 1986, 336 pages, ISBN 0-691-08431-9. This book describes the implementation as of Version 6 of Icon. Although the implementation has changed somewhat since then, the basic structure is the same. Technical reports describing recent implementation changes are included with books purchased from the Icon Project. These books are available from the Icon Project or from any book store that handles special orders. Additional documentation is available via FTP in /icon/doc. Notable documents are: TR 90-6 an overview of Icon IPD255 graphics/window facilities IPD236 changes between Versions 8.0 and 9.0 There are manual pages for UNIX systems, but there is no complete on-line documentation. The Icon Newsletter, which includes topical material about Icon and a list of material available from the Icon Project, is published three times a year. Subscriptions are free; contact the Icon Project to get a copy of the latest Newsletter and to be put on the mailing list. The Icon Analyst, a technically oriented newsletter that features articles about programming, is published six times a year. There is a subscription fee for the Analyst. A sample copy is available on request. All back issues of both newsletters are available for purchase. I.12. How do I get started with Icon? If you're a newcomer to Icon, get the package for your platform (by FTP, cd /icon/packages and get READ.ME for more information). This will give you documentation concerning running Icon on your platform, test programs and other material. If the package you pick up does not contain executable files, see /icon/binaries. You also may want to get the overview of Icon: /icon/doc/tr90-6.doc or tr90-6.ps.Z. You'll find pointers to other documents of interest in the package you pick up. I.13. What is the Icon Project? The Icon Project is a name used by the group at The University of Arizona that develops, implements, distributes, and supports the Icon programming language. The Icon Project is not commercial organization. It derives support from The University of Arizona, grants, and (primarily) revenue from the sale of program material and documentation. I.14. Where can I find examples of Icon programs? There is a large program library for Icon. It is an excellent resource for both new and experienced programmers, containing numerous examples of how to do things with Icon. The library also provides many useful applications, as well as hundreds of procedures that supplement Icon's built-in repertoire. The library, like other Icon material, is available via FTP (cd /icon/library) and on physical media from the Icon Project. I.15. What is Idol? Idol is an object-oriented extension to Icon that provides concepts such as classes and multiple inheritance. Idol is written in Idol and is distributed as part of the Icon program library. Idol runs on almost all of the platforms that Icon runs on. Additional Idol information is available from Clint Jeffery, jeffery@ringer.cs.utsa.edu. I.16. How often is material in Icon's FTP area updated? New material is added when it's available. Established implementations usually are only updated when there's a major new release. This typically is every year or two. The Icon program library is updated on a similar schedule. I.17. How do I stay up to date with what's going on with Icon? The best way to find out about developments related to Icon is to subscribe to the Icon Newsletter. It's free, but it is distributed only by postal mail, so you must provide a mailing address. You can stay up to date on the source code, which is changed much more frequently than the version on FTP is updated, by subscribing to the source update service, which provides a new version about three times a year. There also is a subscription service for updates to the Icon program library, which provides new material three or four times a year. See the Icon Newsletter for information about subscribing to these services. I.18. Why isn't the Icon Newsletter available electronically? The Icon Newsletter contains diagrams, images, and other material that cannot be rendered in plain ASCII text. The Newsletter is prepared with a desktop publishing system that produces PostScript, but the files are enormous -- too large to include in the Icon FTP area. Selected articles from the Newsletter are available by FTP in /icon/doc/articles. I.19. Is there a users' group for Icon? There is no official Icon users' group. The Icon Project maintains an electronic mailing list, icon-group@cs.arizona.edu. Mail sent to this address is forwarded to subscribers. To subscribe (or unsubscribe), send a message to icon-group-request@cs.arizona.edu. There is a gateway between icon-group and comp.lang.icon, an unmoderated newsgroup for discussing issues related to Icon. The gateway, which exchanges messages between the two systems, is imperfect and not under the control of the Icon Project. The newsgroup generally provides faster response than the mailing list. The newsgroup is less intrusive, but it sometimes suffers from inappropriate postings. The Icon Project usually sends messages of interest to the Icon community to icon-group. I.20. How do I get technical support? Free technical support is available from the Icon Project via electronic mail to icon-project@cs.arizona.edu or by fax, telephone, and postal mail to the Icon Project as listed above. Since the Icon Project is not a commercial organization, support is limited to what it can provide with its available resources. If the Icon Project cannot help with a problem (such as for a platform it doesn't have), it will attempt to provide a contact with someone who can help. I.21. Is there an optimizing compiler for Icon? Yes. The original implementation was an interpreter. An optimizing compiler was added a few years ago. The interpreter and compiler are largely source-language compatible. The interpreter is used by most Icon programmers because it gets into execution quickly and runs fast enough for most applications. The compiler is best suited for applications that require the fastest possible execution time. In this case, it's generally best to develop the program using the interpreter and then compile the final result for production use. I.22. What do I need to run the interpreter? The Icon interpreter will run on most computers. It requires a reasonable amount of memory, however. Under MS-DOS, the Icon interpreter needs 500KB of application RAM to work well. I.23. What do I need to run the compiler? The Icon compiler is another matter. It requires a C compiler, a fast CPU for tolerable compilation times, a considerable amount of disk space, and a lot of memory -- at least several megabytes. The Icon compiler generates C code, which must then be compiled to produce an executable program. The flexibility that Icon provides to programmers makes compilation technically difficult and the process requires a large amount of memory. The C code it produces is voluminous and stresses the most robust C compilers. Generally speaking, the Icon compiler is practical for platforms in the workstation class but not for most personal computers. Although the compiler can be built and made to run on 286 platforms running standard MS-DOS, only trivially small programs can be compiled. In principle, the Icon compiler is practical on MS-DOS 386/486 platforms with extended memory, but the limited availability of suitable 32-bit C compilers for this environment has discouraged the use of the Icon compiler on such platforms. I.24. Can I build my own implementation of Icon for a new platform? As mentioned above, Icon is written in C and the source code is available via FTP and the Icon Project. The existing implementations are testament to its portability. (a small amount of assembly-language code is required for a context switch, but this is only needed for an optional feature -- co-expressions -- that can be disabled without affecting most of Icon.) New ports involve platform-specific configuration parameters and, in some cases, platform-specific code. The feasibility of a new port and the amount of work it may take depends on the platform -- its architecture, its C compiler, and its environment. Ports to new UNIX platforms generally are easy, although novel architecture may present problems. Ports to new operating systems generally are more difficult, especially if Icon's graphics facilities are implemented. The Icon Project provides what help it can with new ports. In return, it asks that code related to the port to be returned to the Icon Project for inclusion in future versions of the source code for Icon. This makes the new port available to others as well as to the porter when Icon is updated. From icon-group-sender Sun Jan 8 06:20:38 1995 Received: by cheltenham.cs.arizona.edu; Sun, 8 Jan 1995 00:32:43 MST To: icon-group-l@cs.arizona.edu Date: 8 Jan 1995 06:20:38 GMT From: Blake McBride Message-Id: <3eo07m$k8h@edge.ercnet.com> Organization: The Edge Sender: icon-group-request@cs.arizona.edu Subject: Some Questions Errors-To: icon-group-errors@cs.arizona.edu Hello, I used ICON several years ago and after reading the faq on ICON I decided to give it another look. The thing that really caught my eye was the object oriented extension, IDOL. I downloaded the MS-DOS source and executables as well as the library which contained IDOL. After looking at the stuff for a short time, I became curious about a couple of things and thought I'd post the questions to the net prior to going any further. I sure would appreciate answers to the following questions: 1. I noticed that the source code under the MS-DOS packages area only contained the source for DOS (and maybe OS/2). I use MS-DOS, Windows 3.1, Windows NT, and Linux on a daily basis. I, therefore, would like to have source for all those environments, however, I don't want to download and keep 4 or more copies of virtually the same files. Is there a _single_ .tar.gz file I can download which containes the entire source tree for all supported platforms? If not can I convince someone to produce such an animal? 2. The FAQ talked about an ICON->C compiler. Since it didn't come with my MS-DOS package, I am curious about what environments support the compiler? Can it be made to run under DOS (32 bit)? Where is the source to it? 3. Are there many people making real use of IDOL? If so, whats your opinion of it? Will it work in conjunction with the ICON->C compiler? How effecient is it? Well, thanks for the help! --blake From icon-group-sender Sun Jan 8 16:19:16 1995 Received: by cheltenham.cs.arizona.edu; Sun, 8 Jan 1995 14:21:34 MST Resent-Date: Sun, 08 Jan 1995 16:19:16 -0500 (EST) Resent-From: satish@alpha.acast.nova.edu Date: Sun, 08 Jan 1995 16:19:16 -0500 (EST) From: SATISH KESHAVANARYAN Subject: Resent-To: icon-group@cs.arizona.edu To: icon-group@arizona.edu Resent-Message-Id: <01HLLUVUXCTWEVXBMT@Arizona.EDU> Message-Id: X-Vms-To: IN%"icon-group@Arizona.EDU" Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Content-Transfer-Encoding: 7BIT Errors-To: icon-group-errors@cs.arizona.edu UNSUBSCRIBE ICON-GROUP SATISH KESHAVANARAYAN & Keshavanarayan satish@alpha.acast.nova.edu From icon-group-sender Sun Jan 8 17:04:03 1995 Received: by cheltenham.cs.arizona.edu; Sun, 8 Jan 1995 16:04:13 MST Date: Sun, 8 Jan 1995 17:04:03 -0600 From: jeffery@runner.jpl.utsa.edu (Clinton L. Jeffery) Message-Id: <9501082304.AA14576@runner.utsa.edu> To: blake@edge.ercnet.com Cc: icon-group@cs.arizona.edu In-Reply-To: <3eo07m$k8h@edge.ercnet.com> (message from Blake McBride on 8 Jan 1995 06:20:38 GMT) Subject: Re: Some Questions Content-Length: 1052 Errors-To: icon-group-errors@cs.arizona.edu 3. Are there many people making real use of IDOL? No. Idol is used by only a tiny segment of the Icon community. Most Icon programmers either don't care for object-oriented concepts, or never write large programs where objects would be useful. Icon's built-in repertoire of data types and operations are so sophisticated that using objects for smaller programs does not help very much. Will it work in conjunction with the ICON->C compiler? Yes. The current version of idol generates Icon code as its output, which may then be used as input to iconc. How effecient is it? Idol's objects are just records, and member function invocations are just field accesses -- which require constant time (and the constant is small). Idol programs use a bit more space than Icon programs. Idol's efficiency is one of its strong points. Its weak points (so far) stem from its preprocessor-based implementation, which is not as convenient or as efficient as would be an implementation that directly modifies Icon's translator and run-time system. From icon-group-sender Mon Jan 9 17:32:55 1995 Received: by cheltenham.cs.arizona.edu; Mon, 9 Jan 1995 11:34:43 MST To: icon-group-l@cs.arizona.edu Date: Mon, 9 Jan 1995 17:32:55 +0000 From: GeoffC@respub.demon.co.uk (geoffc) Message-Id: <789672775snz@respub.demon.co.uk> Organization: Myorganisation Sender: icon-group-request@cs.arizona.edu Reply-To: GeoffC@respub.demon.co.uk Subject: Newbie Problems..Help Please Errors-To: icon-group-errors@cs.arizona.edu Hi, I am running a no-name clone 486DX266 with 8MB ram, I have the files icont.exe, iconx.exe and ixhdr.exe, yet I have been unable to run sample programmes successfully - they complie without errors but on executing them nothing happens. Am I missing some files? Any ideas please. -- geoffc From icon-group-sender Wed Jan 11 02:34:58 1995 Received: by cheltenham.cs.arizona.edu; Tue, 10 Jan 1995 21:31:15 MST To: icon-group-l@cs.arizona.edu Date: 11 Jan 1995 02:34:58 GMT From: Will Mengarini Message-Id: <3evg4i$jhb@news.halcyon.com> Organization: Northwest Nexus Inc. Sender: icon-group-request@cs.arizona.edu References: <3eo07m$k8h@edge.ercnet.com> Subject: Re: Some Questions Errors-To: icon-group-errors@cs.arizona.edu Blake McBride writes: >I use MS-DOS, Windows 3.1, Windows NT, and Linux on a daily basis. >I, therefore, would like to have source for all those environments, >however, I don't want to download and keep 4 or more copies of >virtually the same files. Is there a _single_ .tar.gz file I >can download which containes the entire source tree for all supported >platforms? If not can I convince someone to produce such an animal? I have the same OS situation & would also consider this very useful. Also, I wanted the variant translator system back when I only had DOS, but it was only available for Unix; I probably could've hacked it. From icon-group-sender Wed Jan 11 14:50:42 1995 Received: by cheltenham.cs.arizona.edu; Wed, 11 Jan 1995 06:48:48 MST Message-Id: <199501111450.OAA04153@aiguemarine.unice.fr> X-Authentication-Warning: aiguemarine.unice.fr: Host localhost didn't use HELO protocol To: icon-group@cs.arizona.edu Subject: Pipes in Icon X-Mailer: exmh version 1.5phi 9/15/94 Date: Wed, 11 Jan 1995 14:50:42 +0000 From: William Bourgeois Errors-To: icon-group-errors@cs.arizona.edu Hello, I would like to open a pipe for reading AND writing. How can I to do that? thanks for the help... # # # -- William Bourgeois ---------------------------------------# # Laboratoire I3S - Bat. 4 # # CNRS - Universite de Nice-Sophia Antipolis # # ------------------------------------------ # # 250, Av Albert Einstein # # Tel: 92 94 26 57 Les Lucioles 1 # # e-mail: wb@beryl.unice.fr F-06560 Valbonne # #--------------------------------------------------------------# From icon-group-sender Wed Jan 11 18:47:00 1995 Received: by cheltenham.cs.arizona.edu; Wed, 11 Jan 1995 21:36:57 MST To: icon-group-l@cs.arizona.edu Date: Wed, 11 Jan 95 18:47:00 -0400 From: bbs.america@loa.com (BBS AMERICA) Message-Id: <8A16467.04AA000015.uuout@loa.com> Organization: Log On America, Inc. Sender: icon-group-request@cs.arizona.edu Reply-To: bbs.america@loa.com (BBS AMERICA) Subject: Run a BBS? Want full Internet for $24.95/mo? Errors-To: icon-group-errors@cs.arizona.edu Hello there! Right about now you're probably wondering just what it is you've gone and downloaded. Well, first off, I'll be honest with you... if you're not a SysOp, it's more than likely just something to upload to various BBSes for the credit. But, if you're a SysOp then you have heard all the rage about the Internet that's come up recently. I'll bet you even considered looking into getting full access Internet for your own system! Well, more than likely you eventually realized that full access Internet was way too expensive for your BBS to support.... Until now. Log On America is now offering full access internet for any BBS in the nation for the amazingly low price of $24.95 per month. That's right, this is no joke... All you need is a BBS and at least 2 modems... It's simple, you merely set up the transport door (included as CST54.ZIP) to run from your BBS software. Once you contact us, we will give you the LOCAL phone number that you will need and set up your account. Here's how it works. Your users call your BBS as normal, when they run the Cyberspace Transporter door, it will have your user wait while it dials Log On America. Your user will then get full access to Telnet, FTP, Finger, Whois, World Wide Web. Using the Telnet client, your users can access IRC, MUDs, schools, libraries, and more! With FTP, millions of files from all over the world become available! Easy-to-use hypertext interfaces make surfing the Internet simple with Gopher and the World Wide Web! You can find out information about both people and systems with the Finger and Whois clients! For as much time as you care to allow them... Then, when the user types EXIT, the software will drop carrier and return control to your BBS -- without the user EVER SEEING Log On America. It's that easy! For more information or to sign up, you can contact us by any of the following: Phone: (401)453-6100 M-F 9a-5p EST Fax: (401)459-6222 BBS: (401)459-6200 E-Mail: david.paolo@loa.com Mail: Log On America, Inc. 3 Regency Plaza Providence, RI 02903 ATTN: Internet BBS -------------------------------------------------------------------------- This article was an automated post. Any posting in unrelated newsgroups is an error, please disregard this article if it is off-topic. From icon-group-sender Sun Jan 15 21:49:24 1995 Received: by cheltenham.cs.arizona.edu; Sun, 15 Jan 1995 15:32:55 MST To: icon-group-l@cs.arizona.edu Date: Sun, 15 Jan 1995 21:49:24 GMT From: axd0822@hertz.njit.edu (Adam DePrince) Message-Id: <1995Jan15.214924.24623@njitgw.njit.edu> Organization: New Jersey Institute of Technology, Newark, New Jersey Sender: icon-group-request@cs.arizona.edu References: <3eo07m$k8h@edge.ercnet.com>, <3evg4i$jhb@news.halcyon.com> Subject: Re: Some Questions Errors-To: icon-group-errors@cs.arizona.edu In article <3evg4i$jhb@news.halcyon.com>, Will Mengarini wrote: >Blake McBride writes: > >>I use MS-DOS, Windows 3.1, Windows NT, and Linux on a daily basis. >>I, therefore, would like to have source for all those environments, >>however, I don't want to download and keep 4 or more copies of >>virtually the same files. Is there a _single_ .tar.gz file I >>can download which containes the entire source tree for all supported >>platforms? If not can I convince someone to produce such an animal? [stuff deleted] Get all of the source images. Store all but one as a difference from the remaining one. This should get you the space savings you need. -- -------------------------------------------------------------------- | Tic. | Adam DePrince | | | Doctoral Student | | | Real Time Computing Laboratory | From icon-group-sender Sun Jan 15 13:25:44 1995 Received: by cheltenham.cs.arizona.edu; Sun, 15 Jan 1995 16:26:43 MST From: Phil Bralich To: icon-group@cs.arizona.edu Subject: Natural Language Software Content-Length: 616 Message-Id: <95Jan15.132556hst.5966@uhunix2.uhcc.Hawaii.Edu> Date: Sun, 15 Jan 1995 13:25:44 -1000 Errors-To: icon-group-errors@cs.arizona.edu I mailed this message once before, but I never saw it appear, so I suspect there was a problem in handling the message. In any case this is important so at the risk of being repititious here is my re quest... I am trying to find the names and addreses of indivduals, departments, and companies that have or are developing Natural Language Processors. Ideally, I would like to both receive the parser and communicate with the developer. Any assistance you can give me on this matter would be greatly appreciated. I can be reached at: bralich@uhccux.uhunix.Hawaii.edu Sincerely, Philip Bralich, Ph.D. D From icon-group-sender Mon Jan 16 19:40:50 1995 Received: by cheltenham.cs.arizona.edu; Mon, 16 Jan 1995 14:31:44 MST To: icon-group-l@cs.arizona.edu Date: 16 Jan 1995 19:40:50 GMT From: jburns@sos.net (Jim Burns) Message-Id: <3fei42$2pe@cleese.nas.com> Organization: Network Access Services Sender: icon-group-request@cs.arizona.edu Subject: Icon Makers Errors-To: icon-group-errors@cs.arizona.edu I'm looking for a icon making program for windows. If anyone knows where I can find a shareware or freeware version, please let me know here or E-mail me. Thanks. Jim From icon-group-sender Tue Jan 17 12:30:50 1995 Received: by cheltenham.cs.arizona.edu; Tue, 17 Jan 1995 07:33:07 MST To: icon-group-l@cs.arizona.edu Date: 17 Jan 1995 12:30:50 GMT From: Will Mengarini Message-Id: <3fgd9q$10t@news.halcyon.com> Organization: Northwest Nexus Inc. Sender: icon-group-request@cs.arizona.edu Subject: OK so DeMorgan's Law does work after all, hey, I'm from Delphi Errors-To: icon-group-errors@cs.arizona.edu I needed to find the first filename of the form "w[0-9][0-9]" that was not in use in either of 2 directories. I posted this code ( nn := (0 to 9) || (0 to 9) , not exists( downloadDir || "w" || nn ) , not exists( targetDir || "w" || nn ) )|stop( "No names of the form w[0-9][0-9] were unused." ) which works, but said I wanted to factor out the 2 "not exists" calls, & claimed that this code ( nn := (0 to 9) || (0 to 9) , not exists( (downloadDir|targetDir) || "w" || nn ) )|stop( "No names of the form w[0-9][0-9] were unused." ) doesn't work because DeMorgan's Law doesn't work. I was wrong, & Ken Walker explained why in an e-mail exchange. It's trivial to mentally model the execution of the expression in the cases where the file exists in neither directory or in both. What happens if it exists in exactly one is more complicated. The easier of the 2 cases is the one where the file doesn't exist in downloadDir, so exists() fails. I wrote that then not exists() succeeds, & the expression succeeds, without ever testing whether targetDir || "w" || nn exists. This is wrong because "not" doesn't get control after the failure; because the alternation is an an argument to exists(), the alternation is immediately resumed & the other alternative is tested. That mistake was just a brain fart, but the other case can't be understood without knowing about an error in Griswold's /The Icon Programming Language/. I thought not exists( (downloadDir|targetDir) || "w" || nn ) would err in the case where "w"||nn existed in downloadDir but not in targetDir, as follows: exists(downloadDir...) would succeed, "not" would fail the expression resuming the alternation, exists(targetDir...) would fail, & "not" would reverse that causing the expression to succeed (which would erroneously imply that the file existed in neither directory although it had already been detected in the first). The mistake I made is that "not" never resumes its operand. The operand is a bounded expression; it either succeeds or fails, & any suspended generators in it are discarded without ever being resumed. This is why "not" is a control structure rather than an operator. However, I never knew that "not"'s argument was a bounded expression, because Griswold's /The Icon Programming Language/ (1990) p85 claims to list them all, & never mentions "not". Also, there's nothing in the reference manual (p286 of that book) which would suggest this. Ken Walker knew about it only because he wrote the Icon compiler. Ken says the list on p85 is missing these items: not repeat suspend do return In addition, limitation is a generalization of bounding. This kind of thing is especially important when programming is done by mentally modelling what the expressions do, rather than by testing. I never tested the expression I said wouldn't work; that sounds irresponsible, but in fact the program I did end up writing worked the first time, & wasn't the kind of thing for which erecting test scaffoldings is generally cost-effective. I tend to use Icon for quick-&-dirty string processing, for which the whole point is to make programming cheap. The only way I can do this in Icon is by mentally modelling the code. It might help to try developing an online reference manual for Icon. Part of the problem I've had attempting to evangelize the language is that I need to start by urging people to buy a $40 book that bookstores here (Seattle) don't stock, but must special-order (which takes 3 months). The reference manual should be much terser than Griswold's TIPL, but could be up-to-date with the latest language enhancements. For an example of what is possible, take a look at Perl Man Page formatted in HTML by rgs@cs.cmu.edu. Something else that might help would be a graphic debugging system. Snobol-family expressions are so different from what Algol-family programmers are accustomed to that they'll get the idea much more quickly if they can actually watch expressions being executed. The graphical conventions for such a debugger might need to be more powerful than those customary in Algol-family debuggers. It's probably not enough, for example, to specify what /line/ of code is being executed; debugging information output by the compiler needs to specify that a /range of characters/ is being executed, & the debugger needs to highlight the range. The user must be able to step thru the execution of an expression, observing temporary results & backtracking. --------------------------------APPENDIX------------------------------ ############################################################################ # # File: DeMorgan.Icn # # Subject: Demonstrate DeMorgan's Law using &null as false and 1 as true # # Author: Ken Walker # # Date: June 12, 1991 # ############################################################################ record pair(a,b) procedure main() local x # # Print truth tables. # write("A B (not A) & (not B) not (A | B)") write("------------------------------------------") every x := comb() do { writes(format(x.a), " ", format(x.b), " ") if ((not \x.a) & (not \x.b)) then writes("T") else writes("F") writes(" ") if not (\x.a | \x.b) then write("T") else write("F") } write() write("A B (not A) | (not B) not (A & B)") write("------------------------------------------") every x := comb() do { writes(format(x.a), " ", format(x.b), " ") if ((not \x.a) | (not \x.b)) then writes("T") else writes("F") writes(" ") if not (\x.a & \x.b) then write("T") else write("F") } end # # comb() - produce all 4 pairs of "logical" values. # procedure comb() suspend pair(1 | &null, 1 | &null) end # # Convert a "logical" value to "T" or "F". # procedure format(x) if \x then return "T" else return "F" end ---------------------------------------------------------------------- "The three principal virtues of a programmer are laziness, impatience, and hubris." --Larry Wall Will Mengarini In a profound sense we are ultimately all from Delphi From icon-group-sender Tue Jan 17 15:40:56 1995 Received: by cheltenham.cs.arizona.edu; Tue, 17 Jan 1995 09:32:31 MST To: icon-group-l@cs.arizona.edu Date: Tue, 17 Jan 1995 15:40:56 GMT From: idealord@dorsai.dorsai.org (Jeff Harrington) Message-Id: Organization: The Dorsai Embassy - New York Sender: icon-group-request@cs.arizona.edu Subject: Using Icon for CGI Scripts Errors-To: icon-group-errors@cs.arizona.edu So, anyone doing this? I've been using Icon happily for about 4 years and really don't want to learn Perl... Jeff Harrington idealord@dorsai.dorsai.org -- (*) New IdEAL ORDER WWW HOME PAGE: (*) (*) http://www-bprc.mps.ohio-state.edu/cgi-bin/hpp?ideal_order.html (*) (*) Elsie Russell Links! Jeff Harrington Links! Music - Art - The Bizarre (*) (*) IdEAL ORDER Psychic TV - All Days But Thursdays(ABC) on CBS Since 1984 (*) (*) BlueStrider MIDI: ftp://ftp.cs.ruu.nl/pub/MIDI/SONGS/MISC/BlueStri.mid (*) From icon-group-sender Tue Jan 17 18:25:59 1995 Received: by cheltenham.cs.arizona.edu; Tue, 17 Jan 1995 12:39:56 MST To: icon-group-l@cs.arizona.edu Date: Tue, 17 Jan 1995 18:25:59 GMT From: goer@quads.uchicago.edu (Richard L. Goerwitz) Message-Id: <1995Jan17.182559.19519@midway.uchicago.edu> Organization: University of Chicago Sender: icon-group-request@cs.arizona.edu References: <1995Jan13.022725.13714@netlabs.com>, <1995Jan14.064053.21850@midway.uchicago.edu>, <1995Jan17.074644.849@netlabs.com> Reply-To: goer@midway.uchicago.edu Subject: Re: HTML Management Project - best lang tcl/perl/rexx? Errors-To: icon-group-errors@cs.arizona.edu In <1995Jan17.074644.849@netlabs.com> lwall@netlabs.com (Larry Wall) writes: > >I can't speak for Icon, though my impression is that Icon development >is relatively moribund, due primarily to the reluctance of its author >to develop Icon further or to interface it with the real world. Icon is just one of those great ideas in language design. All of those scalar vs. array contexts in Perl are simply and effectively replaced in Icon by the notion of a generator. Unlike Perl, where conditionals look for zero or '', Icon uses succeed/fail. The problem with using 0 or '' is that often 0 is meaningful (e.g., where array indexes are involved). So you have to know, in each case, whether to check for zero or something else. Succeed/fail semantics coupled with the notion of a generator make certain operations very, very simple and elegant (e.g., tell me if any element inside this structure is an integer greater than 255, and if so, please assign it the value of 255 - oh, and do it globally, for all elem- ents in that structure): every !a >:= 255 Even the Icon grammar itself is great. You can summarize nearly every- thing you need to know about precedences and evaluation orders in less than a page. And Icon isn't a small language. In the Camel book, you have to hunt around. And in the back you have to weed through a syn- tax summary. As far as string processing goes, Icon has all of the advantages of Snobol, and none of its deficits. Its scanning facilities are much more powerful than regexps, and more flexible to boot (though they are less compact). Of course, I'd be the first to admit that Perl is a better system ad- ministration tool than Icon, and that it interfaces with the outside better. And Perl is certainly more familiar to all of those people do- ing shell programming, sed, awk, etc. And the fact that Perl implements all the POSIX locale stuff (along with discussion of wide and multi- byte characters) makes it the logical choice for future CGI scripts (when HTML 3.0, Unicode, and tags are finally all meshed). Still the very fact that Perl 5 shows so much consolidation demonstrates that even in the supposedly diffuse world of Perl, clean design carries with it a certain weight. So I'm not trying to criticize Perl. Perl is here to stay. And it is destined for much greater popularity than Icon. I'd just like to note that there's something to be said for Icon. It has an important niche. And there are a lot of ideas there that are worth noting. -- Richard L. Goerwitz *** goer@midway.uchicago.edu From icon-group-sender Tue Jan 17 15:11:36 1995 Received: by cheltenham.cs.arizona.edu; Tue, 17 Jan 1995 13:11:48 MST From: Nick Williams Message-Id: <199501172011.PAA22413@ios.com> Subject: Re: HTML Management Project - best lang tcl/perl/rexx? (fwd) To: icon-group@cs.arizona.edu Date: Tue, 17 Jan 1995 15:11:36 -0500 (EST) X-Mailer: ELM [version 2.4 PL23] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1526 Errors-To: icon-group-errors@cs.arizona.edu >In <1995Jan17.074644.849@netlabs.com> lwall@netlabs.com (Larry Wall) writes: > >>I can't speak for Icon, though my impression is that Icon development >>is relatively moribund, due primarily to the reluctance of its author >>to develop Icon further or to interface it with the real world. [speech about Icon's advantages/niceties deleted] >So I'm not trying to criticize Perl. Perl is here to stay. And it is >destined for much greater popularity than Icon. I'd just like to note >that there's something to be said for Icon. It has an important niche. >And there are a lot of ideas there that are worth noting. But, is Icon being developed any further? I for one would be sad to watch it wither away; there's so much to be done! If I could take a sabatical and work on the Icon compiler (which needs a lot of work), I would. Perhaps there's other tasks I could do; I've written a small interface to important system calls such as fork/exec/wait etc. and I could put some more work into it. I'd also like to figure out how to write a vtran for Icon so I could add constructs to Icon (there's one construct I have in mind to help in the coding of setuid programs: as do { ... }). If I can come up with the vtran I'll post this. I realized I've promised this before, but I haven't had the time for it, though I do have a small library of system call interfaces for Icon; it is very simple. >-- > > Richard L. Goerwitz *** goer@midway.uchicago.edu > Nick IOS System Operator (nmw@ios.com) From icon-group-sender Tue Jan 17 18:26:59 1995 Received: by cheltenham.cs.arizona.edu; Tue, 17 Jan 1995 19:31:45 MST To: icon-group-l@cs.arizona.edu Date: 17 Jan 1995 18:26:59 -0700 From: scott@cs.arizona.edu (Scott E Gilbert) Message-Id: <3fhqp3$66e@lectura.CS.Arizona.EDU> Organization: University of Arizona CS Department, Tucson AZ Sender: icon-group-request@cs.arizona.edu References: <3fgd9q$10t@news.halcyon.com> Subject: Re: OK so DeMorgan's Law does work after all, hey, I'm from Delphi Errors-To: icon-group-errors@cs.arizona.edu In article <3fgd9q$10t@news.halcyon.com>, Will Mengarini wrote: [a bunch of good stuff deleted] >It might help to try developing an online reference manual for Icon. This may have some of what you want: http://www.cs.arizona.edu/icon/www/reference.html Hope that helps. -- Scott Gilbert ( scott@cs.arizona.edu ) From icon-group-sender Wed Jan 18 03:43:29 1995 Received: by cheltenham.cs.arizona.edu; Tue, 17 Jan 1995 22:31:48 MST To: icon-group-l@cs.arizona.edu Date: 18 Jan 1995 03:43:29 GMT From: kang@kang.mpce.mq.edu.au (Kang Zhang) Message-Id: <3fi2p1$2vu@sunb.ocs.mq.edu.au> Organization: Macquarie University, Sydney Sender: icon-group-request@cs.arizona.edu Subject: Australian Computer Journal - Special Issue Errors-To: icon-group-errors@cs.arizona.edu Call For Papers AUSTRALIAN COMPUTER JOURNAL Special Issue on Software Visualisation A graphical view delivers higher information content than the corresponding textual presentation. Visual structures and relationships are easier for reasoning and understanding than similar linguistically described structures. Recent advances in interactive computer graphics and window technology have made visualisation an essential tool for software development. The term "software visualisation" refers to the graphical display of characteristics and behaviour of all aspects of software: design and analysis methods, systems, programs and algorithms. The purpose of this special issue of the Australian Computer Journal is to collect and compare different experiences of software visualisation both from fundamental and applied viewpoints. Although not limited to the following, manuscripts are sought from academia and industry on such topics as o Program and algorithm animation o Graphical programming tools and environments o Graph drawing o Parallel program visualisation o Graphical software design and analysis tools o Human factors in software visualisation o Visual models for software engineering o Data structure visualisation Schedule: Deadline for paper (four copies) submission: 19 May 1995 Notification of decision: 31 August 1995 Final manuscript due: 5 October 1995 Publication: November 1995 Paper preparation guidelines can be found in any issue of the journal. Questions regarding the special issue can be directed to either of the following Guest Editors: Prof Peter Eades Dr Kang Zhang Department of Computer Science Department of Computing University of Newcastle Macquarie University Newcastle, NSW 2308 Sydney, NSW 2109 Australia Australia Tel. +61-49-216034 Tel. +61-2-850953 Fax: +61-49-216929 Fax: +61-2-8509551 Email: eades@cs.newcastle.edu.au Email: kang@mpce.mq.edu.au Four copies of the full manuscript should be sent to: Prof Peter Eades, Special Issue on Software Visualisation Department of Computer Science University of Newcastle Newcastle, NSW 2308 Australia From icon-group-sender Wed Jan 18 07:56:25 1995 Received: by cheltenham.cs.arizona.edu; Wed, 18 Jan 1995 02:32:19 MST To: icon-group-l@cs.arizona.edu Date: 18 Jan 1995 07:56:25 GMT From: Will Mengarini Message-Id: <3fihj9$a2v@news.halcyon.com> Organization: Northwest Nexus Inc. Sender: icon-group-request@cs.arizona.edu References: <3eo07m$k8h@edge.ercnet.com>, <3evg4i$jhb@news.halcyon.com>, <1995Jan15.214924.24623@njitgw.njit.edu> Subject: Re: Some Questions Errors-To: icon-group-errors@cs.arizona.edu >>Blake McBride writes: >> >>>I use MS-DOS, Windows 3.1, Windows NT, and Linux on a daily basis. >>>I, therefore, would like to have source for all those environments, >>>however, I don't want to download and keep 4 or more copies of >>>virtually the same files. Is there a _single_ .tar.gz file I >>>can download which containes the entire source tree for all supported >>>platforms? If not can I convince someone to produce such an animal? axd0822@hertz.njit.edu (Adam DePrince) writes: >Get all of the source images. Store all but one as a difference from >the remaining one. This should get you the space savings you need. It would be astonishing to discover that the StringMages of the Icon Project actually maintain their source trees separately, & unless they do, creating our own unified trees by hand should be unnecessary. From icon-group-sender Wed Jan 18 05:54:29 1995 Received: by cheltenham.cs.arizona.edu; Wed, 18 Jan 1995 05:54:30 MST Date: Wed, 18 Jan 1995 05:54:29 MST From: "Ralph Griswold" Message-Id: <199501181254.AA17522@cheltenham.cs.arizona.edu> To: mengarini@delphi.com Subject: Re: Some Questions Cc: icon-group Errors-To: icon-group-errors@cs.arizona.edu The source code for Icon is the same for all platforms. What differs from platform to platform are configuration files, scripts for installation, and so forth. In some cases, there are a lot of these. For example, in the Unix distribution there are over 60 configuration directories for different flavors of Unix. And for MS-DOS and OS/2 there are many directories for configuration for different C compilers. (There's an exception for the Macintosh, where we convert path specifications in include files from the ordinary one to the syntax the Macintosh uses.) Ralph E. Griswold ralph@cs.arizona.edu Department of Computer Science uunet!arizona!ralph The University of Arizona 602-621-6609 (voice) Tucson, AZ 85721 602-621-4246 (fax) From icon-group-sender Tue Jan 24 16:59:07 1995 Received: by cheltenham.cs.arizona.edu; Tue, 24 Jan 1995 13:34:21 MST To: icon-group-l@cs.arizona.edu Date: Tue, 24 Jan 1995 16:59:07 GMT From: btiffin@on.bell.ca (Brian Tiffin) Message-Id: Organization: Bell Sygma Sender: icon-group-request@cs.arizona.edu Subject: Icon V9, under OpenVMS/VAX and Indexed RMS files Errors-To: icon-group-errors@cs.arizona.edu Hi, I've got some code that attempts to take free format user entered string data and look up postal codes. I think I have a useable algorithm to pull out Number Streetname Streettype Direction (the city is 'guessed at' using a telephone number) while skipping over/under the 'garbage'. Now I'd like a way of indexing into our keyed Canada Post data to pull out the actual postal code. Anyone out there ever done any FAB/RAB low level operations from Icon V9? Reading through the file as flat ASCII just doesn't cut it and its way too huge to pull into a TABLE. I'm thinking that I should probably look into the C interface, but I was just wondering if this has been done before. Thanks, Brian Tiffin Centracs Development btiffin@on.bell.ca From icon-group-sender Wed Jan 25 07:12:23 1995 Received: by cheltenham.cs.arizona.edu; Wed, 25 Jan 1995 00:32:30 MST To: icon-group-l@cs.arizona.edu Date: 25 Jan 1995 07:12:23 GMT From: brady@cybernetics.net (Don Brady) Message-Id: <3g4tkn$iei@jabba.cybernetics.net> Organization: Cybernetx, Inc. Sender: icon-group-request@cs.arizona.edu Subject: Double-Byre Characters or Unicode? Errors-To: icon-group-errors@cs.arizona.edu Is there any move to support double-byte character sets and Unicode? These are needed to support Japanese and othr labuages with large numbers of characters. From icon-group-sender Wed Jan 25 10:32:36 1995 Received: by cheltenham.cs.arizona.edu; Wed, 25 Jan 1995 08:35:05 MST From: Nick Williams Message-Id: <199501251532.KAA10476@ios.com> Subject: Re: Icon V9, under OpenVMS/VAX and Indexed RMS files To: btiffin@on.bell.ca (Brian Tiffin) Date: Wed, 25 Jan 1995 10:32:36 -0500 (EST) Cc: icon-group@cs.arizona.edu In-Reply-To: from "Brian Tiffin" at Jan 24, 95 04:59:07 pm X-Mailer: ELM [version 2.4 PL23] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1246 Errors-To: icon-group-errors@cs.arizona.edu >Hi, > I've got some code that attempts to take free format user entered string data and look up postal codes. I think >I have a useable algorithm to pull out Number Streetname Streettype Direction (the city is 'guessed at' using a >telephone number) while skipping over/under the 'garbage'. > Now I'd like a way of indexing into our keyed Canada Post data to pull out the actual postal code. Anyone out there >ever done any FAB/RAB low level operations from Icon V9? Reading through the file as flat ASCII just doesn't cut it >and its way too huge to pull into a TABLE. I'm thinking that I should probably look into the C interface, but I was just >wondering if this has been done before. I'm looking at changing the way Icon tables are implemented to allow different kinds of table access/set methods to be used. It should not be too hard, and there's not much that needs to be changed to allow this; it would involve adding function pointers to the b_table struct for the methods as well as some identification flags/variables, as well as code to check the type of table in all Icon functions/operators that access tables. >Thanks, >Brian Tiffin >Centracs Development >btiffin@on.bell.ca Nick IOS System Operator (nmw@ios.com) From icon-group-sender Thu Jan 26 15:46:33 1995 Received: by cheltenham.cs.arizona.edu; Thu, 26 Jan 1995 09:34:54 MST To: icon-group-l@cs.arizona.edu Date: 26 Jan 95 15:46:33 GMT From: gvw@cs.toronto.edu (Greg Wilson) Message-Id: <1995Jan26.104632.5830@jarvis.cs.toronto.edu> Organization: CS Lab, University of Toronto Sender: icon-group-request@cs.arizona.edu Subject: Icon as scripting language? Errors-To: icon-group-errors@cs.arizona.edu Hello. I'm trying to select a scripting language for use by scientists and engineers. The applications I have in mind are the kind of thing I used to write awk scripts to do --- pulling strings out of files, a simple "du"-like tool that would report the number and size of .o files in a directory tree, and so on. I would like to know: * do people use Icon to do this? * does Icon have a rich interface with the O/S (something better than firing off shell commands as strings, and somehow catching the output)? * can anyone make an informed comparison of Icon and (for example) Perl or Python? * does Icon contain GUI-building facilities (e.g. a Tk interface)? I'd be grateful if you could respond by direct email to gvw@cs.toronto.edu, as I'm not a regular reader of this group. Thanks for your help; I look forward to hearing from you. ======================================================= Gregory V. Wilson gvw@cs.toronto.edu This signature made from 100% recycled pixels. ======================================================= From icon-group-sender Thu Jan 26 23:17:52 1995 Received: by cheltenham.cs.arizona.edu; Thu, 26 Jan 1995 17:33:16 MST To: icon-group-l@cs.arizona.edu Date: Thu, 26 Jan 1995 23:17:52 GMT From: goer@quads.uchicago.edu (Richard L. Goerwitz) Message-Id: <1995Jan26.231752.14462@midway.uchicago.edu> Organization: University of Chicago Sender: icon-group-request@cs.arizona.edu References: <3g4tkn$iei@jabba.cybernetics.net> Reply-To: goer@midway.uchicago.edu Subject: Re: Double-Byre Characters or Unicode? Errors-To: icon-group-errors@cs.arizona.edu brady@cybernetics.net (Don Brady) writes: >Is there any move to support double-byte character sets >and Unicode? These are needed to support Japanese and >othr labuages with large numbers of characters. Not that I can answer your question or anything, but are you looking for multilingual or localization support, or are you simply looking for arbitrary character widths? -- Richard L. Goerwitz *** goer@midway.uchicago.edu From icon-group-sender Wed Jan 25 13:18:47 1995 Received: by cheltenham.cs.arizona.edu; Fri, 27 Jan 1995 05:36:27 MST To: icon-group-l@cs.arizona.edu Date: Wed, 25 Jan 1995 13:18:47 MST From: keving@primenet.com (Kevin Goldstein) Message-Id: Organization: Primenet Sender: icon-group-request@cs.arizona.edu References: <3g4tkn$iei@jabba.cybernetics.net> Subject: Re: Double-Byre Characters or Unicode? Errors-To: icon-group-errors@cs.arizona.edu In article <3g4tkn$iei@jabba.cybernetics.net> brady@cybernetics.net (Don Brady) writes: >From: brady@cybernetics.net (Don Brady) >Subject: Double-Byre Characters or Unicode? >Date: 25 Jan 1995 07:12:23 GMT >Is there any move to support double-byte character sets >and Unicode? These are needed to support Japanese and >othr labuages with large numbers of characters. I agree on the need for this. While I personally don't need Unicode (at least not yet), I think that any language with built-in support for character types that expects to be around for the long haul is going to have to have support for Unicode, and the sooner the better. (There's been a lot of talk in the Perl group lately about Unicode support.) On another subject, why is this newsgroup so quiet? I know there's a newsletter, but it seems to me that a little more activity here might draw in more new users. Just a thought. -Kevin From icon-group-sender Fri Jan 27 16:02:06 1995 Received: by cheltenham.cs.arizona.edu; Fri, 27 Jan 1995 10:39:04 MST To: icon-group-l@cs.arizona.edu Date: 27 Jan 1995 16:02:06 GMT From: Will Mengarini Message-Id: <3gb5du$r2g@news.halcyon.com> Organization: Northwest Nexus Inc. Sender: icon-group-request@cs.arizona.edu References: Subject: Re: Icon V9, under OpenVMS/VAX and Indexed RMS files Errors-To: icon-group-errors@cs.arizona.edu btiffin@on.bell.ca (Brian Tiffin) writes: >I'd like a way of indexing into our keyed Canada Post data >to pull out the actual postal code. [...] Reading through the file as flat >ASCII just doesn't cut it and its way too huge to pull into a TABLE. >I'm thinking that I should probably look into the C interface [...] You probably already have fast query programs for your postal database, including ones that let you make queries from the shell prompt. If I were doing this under MS-DOS, I'd use system() to call such a query program, rather than coding my own function. I'd have it write the query result to a RAMDisk, & I'd have the executable code of the query program on a RAM-cached disk. The only real overhead would be process switching, which would be much faster than any Icon implementation of a database query, & much easier to program. The "C interface", allowing you to code C routines to integrate with your Icon routines, hasn't worked for several years, AFAIK. It's possible to hack the interpreter to put in your own functions, but that's much more difficult than using system(). Always call collect() right before each system() call. From icon-group-sender Fri Jan 27 15:12:45 1995 Received: by cheltenham.cs.arizona.edu; Fri, 27 Jan 1995 13:12:56 MST From: Nick Williams Message-Id: <199501272012.PAA03285@ios.com> Subject: Re: Icon V9, under OpenVMS/VAX and Indexed RMS files (fwd) To: icon-group@cs.arizona.edu Date: Fri, 27 Jan 1995 15:12:45 -0500 (EST) X-Mailer: ELM [version 2.4 PL23] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1474 Errors-To: icon-group-errors@cs.arizona.edu >btiffin@on.bell.ca (Brian Tiffin) writes: >>I'd like a way of indexing into our keyed Canada Post data >>to pull out the actual postal code. [...] Reading through the file as flat >>ASCII just doesn't cut it and its way too huge to pull into a TABLE. >>I'm thinking that I should probably look into the C interface [...] >You probably already have fast query programs for your postal database, >including ones that let you make queries from the shell prompt. >If I were doing this under MS-DOS, I'd use system() to call such a >query program, rather than coding my own function. I'd have it write >the query result to a RAMDisk, & I'd have the executable code of the >query program on a RAM-cached disk. The only real overhead would be >process switching, which would be much faster than any Icon >implementation of a database query, & much easier to program. >The "C interface", allowing you to code C routines to integrate >with your Icon routines, hasn't worked for several years, AFAIK. >It's possible to hack the interpreter to put in your own functions, >but that's much more difficult than using system(). Not true. The C interface works perfectly, at least on the Unix systems I've tested it on. Even it it doesn't work you can always extend the set of functions supported by Icon by writing some RTL code and rebuilding the interpreter or rt.a and rt.db. >Always call collect() right before each system() call. Nick IOS System Operator (nmw@ios.com) From icon-group-sender Fri Jan 27 13:05:07 1995 Received: by cheltenham.cs.arizona.edu; Fri, 27 Jan 1995 15:35:37 MST Date: Fri, 27 Jan 1995 13:05:07 -0600 (CST) From: George Thiruvathukal Subject: help with external C interface To: icon-group@cs.arizona.edu Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@cs.arizona.edu I am developing an interface between Icon and C to use the GNU database manager (gdbm). I have been able to get my code to work properly, but when I am in a generator context, I get a memory violation error. Is there something special you have to do to your functions to ensure they will operate properly in a generator context? I am using icont (Icon translator) and SunOS 4.1.3. Would someone be willing to look at my code? I am planning to contribute this code to the Icon programming library. -George From icon-group-sender Fri Jan 27 00:19:02 1995 Received: by cheltenham.cs.arizona.edu; Fri, 27 Jan 1995 21:33:18 MST To: icon-group-l@cs.arizona.edu Date: Fri, 27 Jan 1995 00:19:02 MST From: keving@primenet.com (Kevin Goldstein) Message-Id: Organization: Primenet Sender: icon-group-request@cs.arizona.edu References: <3g4tkn$iei@jabba.cybernetics.net>, <1995Jan26.231752.14462@midway.uchicago.edu> Subject: Re: Double-Byre Characters or Unicode? Errors-To: icon-group-errors@cs.arizona.edu In article <1995Jan26.231752.14462@midway.uchicago.edu> goer@quads.uchicago.edu (Richard L. Goerwitz) writes: >From: goer@quads.uchicago.edu (Richard L. Goerwitz) >Subject: Re: Double-Byre Characters or Unicode? >Date: Thu, 26 Jan 1995 23:17:52 GMT >brady@cybernetics.net (Don Brady) writes: >>Is there any move to support double-byte character sets >>and Unicode? These are needed to support Japanese and >>othr labuages with large numbers of characters. >Not that I can answer your question or anything, but are >you looking for multilingual or localization support, or >are you simply looking for arbitrary character widths? Personally, I'm not looking for either. But I do hear a lot of people looking for *Unicode* support, which defines a 16-bit wide character set. From icon-group-sender Sat Jan 28 13:49:58 1995 Received: by cheltenham.cs.arizona.edu; Sat, 28 Jan 1995 07:32:56 MST To: icon-group-l@cs.arizona.edu Date: Sat, 28 Jan 1995 13:49:58 GMT From: idealord@dorsai.dorsai.org (Jeff Harrington) Message-Id: Organization: The Dorsai Embassy - New York Sender: icon-group-request@cs.arizona.edu Subject: MS-DOS Compiler Errors-To: icon-group-errors@cs.arizona.edu Thanks for the latest issue of The Icon Newsletter, Icon People! Stupid question, I want to try out the Icon->C compiler. I can't seem to find it at the ftp site. If it's not there, does any know, or can they guess what kinds of problems I'll have attempting to compile the unix C compiler source with DJGPP - the MSDOS Gnu C/C++ compiler? I'd like to do it on my Amiga, too. I've got plenty of ram... Thanks for *any* advice or direction... Jeff Harrington idealord@dorsai.dorsai.org -- (*) New IdEAL ORDER WWW HOME PAGE: (*) (*) http://www-bprc.mps.ohio-state.edu/cgi-bin/hpp?ideal_order.html (*) (*) Elsie Russell Links! Jeff Harrington Links! Music - Art - The Bizarre (*) (*) IdEAL ORDER Psychic TV - All Days But Thursdays(ABC) on CBS Since 1984 (*) (*) BlueStrider MIDI: ftp://ftp.cs.ruu.nl/pub/MIDI/SONGS/MISC/BlueStri.mid (*) From icon-group-sender Sat Jan 28 11:28:56 1995 Received: by cheltenham.cs.arizona.edu; Sat, 28 Jan 1995 11:28:57 MST Date: Sat, 28 Jan 1995 11:28:56 MST From: "Cliff Hathaway" Message-Id: <199501281828.AA09373@cheltenham.cs.arizona.edu> To: icon-group@cs.arizona.edu, idealord@dorsai.dorsai.org Subject: Re: MS-DOS Compiler Errors-To: icon-group-errors@cs.arizona.edu While it's true that the Icon compiler converts Icon source code to C source code as an intermediate step, it uses machine-generated procedure and variable names, making it difficult to follow. The source code for the Icon compiler for MS-DOS is available from ftp.cs.arizona.edu:/icon/packages/msdos/ds.lzh cliff From icon-group-sender Sun Jan 29 17:10:49 1995 Received: by cheltenham.cs.arizona.edu; Sun, 29 Jan 1995 10:33:35 MST To: icon-group-l@cs.arizona.edu Date: Sun, 29 Jan 1995 17:10:49 GMT From: goer@quads.uchicago.edu (Richard L. Goerwitz) Message-Id: <1995Jan29.171049.4191@midway.uchicago.edu> Organization: University of Chicago Sender: icon-group-request@cs.arizona.edu References: , <3gb5du$r2g@news.halcyon.com> Reply-To: goer@midway.uchicago.edu Subject: Re: Icon V9, under OpenVMS/VAX and Indexed RMS files Errors-To: icon-group-errors@cs.arizona.edu mengarini@delphi.com writes: > >You probably already have fast query programs for your postal database, >including ones that let you make queries from the shell prompt. >If I were doing this under MS-DOS, I'd use system() to call such a >query program, rather than coding my own function. I'd have it write >the query result to a RAMDisk, & I'd have the executable code of the >query program on a RAM-cached disk. But this assumes a user has enough memory free for a RAM "disk," and that he or she has set one up. Unless the code is for you alone, and you only expect it to run under DOS, this approach may be more trouble than it's worth. But this is just my feeling.... -- Richard L. Goerwitz *** goer@midway.uchicago.edu From icon-group-sender Mon Jan 30 05:26:11 1995 Received: by cheltenham.cs.arizona.edu; Sun, 29 Jan 1995 22:33:28 MST To: icon-group-l@cs.arizona.edu Date: Mon, 30 Jan 1995 05:26:11 GMT From: goer@quads.uchicago.edu (Richard L. Goerwitz) Message-Id: <1995Jan30.052611.25301@midway.uchicago.edu> Organization: University of Chicago Sender: icon-group-request@cs.arizona.edu References: <3g4tkn$iei@jabba.cybernetics.net>, <1995Jan26.231752.14462@midway.uchicago.edu>, Reply-To: goer@midway.uchicago.edu Subject: Re: Double-Byre Characters or Unicode? Errors-To: icon-group-errors@cs.arizona.edu Kevin Goldstein writes: > >Personally, I'm not looking for either. But I do hear a lot of people looking >for *Unicode* support, which defines a 16-bit wide character set. But what is Unicode support? Do you mean simply that Icon accepts wide characters internally? That it defines wide character IO? Or do you mean that Icon should accept Unicode literals in its source files, via UTF-8 or the like? What about the graphics functions? Should they be Unicode confirmant? And why, BTW, fixate on Unicode? ISO 10646 is also important. And in Asian countries, Unicode is not popular, and probably won't be for a long time, if ever. There is a lot of thought that's going to have to go into just what this all really means. And then someone is going to have to gather an army of people to re- code the Icon run-time system. Otherwise, you can kiss the whole idea goodbye. This actually might make a good research topic. Multilingual and wide character support, as well as multi-byte support, and I/O considera- tions (esp. for visual interfaces) are all going to take some deep and intense thought. -- Richard L. Goerwitz *** goer@midway.uchicago.edu From icon-group-sender Mon Jan 30 09:46:17 1995 Received: by cheltenham.cs.arizona.edu; Mon, 30 Jan 1995 03:33:39 MST To: icon-group-l@cs.arizona.edu Date: 30 Jan 1995 09:46:17 GMT From: brady@cybernetics.net (Don Brady) Message-Id: <3gich9$6oi@jabba.cybernetics.net> Organization: Cybernetx, Inc. Sender: icon-group-request@cs.arizona.edu References: <1995Jan26.231752.14462@midway.uchicago.edu>, , <1995Jan30.052611.25301@midway.uchicago.edu> Subject: Re: Double-Byre Characters or Unicode? Errors-To: icon-group-errors@cs.arizona.edu I agree that I would not focus on Unicode alone. The real requirement is to be able to process Japanese and other languages with large character/symbol sets. I would first support whatever representation schemes are most widely used in the respective countries. (Since large corpuses of text data will already be stored in those formats and be difficult to convert). You might or might not want to supporting DBCS, Shift-JIS, Unicode, etc. The ideal solution would be general enough to support all of the above! I believe that IBM has now made DBCS support a requirement of all of their major languages. IBM Smalltalk and Visual Age and PL/I already offer this support. The most important thing is to be able to support run-time data and dialogs in the formats in question. Programs could still be written in conventional character sets, at least initially. I believe this compromise is often the one chosen for other languages or systems. I agree that quite a bit of research will be needed to better define the requirements (and implications for implementation). You could look and see what IBM and Microsoft and GNU and others have done for their languages. I'd really love to see Icon available for processing Japanese etc. Otherwise I'm going to have to switch back to PL/I or something! From icon-group-sender Mon Jan 30 15:36:49 1995 Received: by cheltenham.cs.arizona.edu; Mon, 30 Jan 1995 09:37:21 MST To: icon-group-l@cs.arizona.edu Date: Mon, 30 Jan 1995 15:36:49 GMT From: goer@quads.uchicago.edu (Richard L. Goerwitz) Message-Id: <1995Jan30.153649.11735@midway.uchicago.edu> Organization: University of Chicago Sender: icon-group-request@cs.arizona.edu References: <3geb4t$cfn@magnum.convex.com>, <3gg0cv$jv8@hahn.informatik.hu-berlin.de> Reply-To: goer@midway.uchicago.edu Subject: Unicode (was Re: Linux, HPFS, and internationalization) Errors-To: icon-group-errors@cs.arizona.edu I'm cross-posting to the Icon newsgroup, because of the recent discussion there of Unicode and internationalization issues. Followups, though, are directed back to comp.os.linux.development.system: In article loewis@informatik.hu-berlin.de (loewis) writes: > >In general, I believe internationalization efforts of Linux should >introduce Unicode wherever reasonable - file names is one of the places. >The question about sorting now is still: according to what rules. When >displaying information to the user, you would like to follow the sorting >rules of the user's native language. In the file system, all that counts >is that you never lose accessability, as you point out. These are two >different things, though. I think that this was IBM's idea when tagging directory entries for code page. They wanted different sort orders for different "locales" (in this case identified with codepages). Just a hunch. One of the problems with Unicode, incidentally, is that despite all the hoopla, information about it is being disseminated very, very slowly. And it is doubtful that Unicode will ever displace standards like Shift- JIS in Asia. Also, note that if localization is a concern (as in the above posting), Unicode isn't a cure-all. Unicode is kind of a super- ISO 8859-1 in the sense that it doesn't tell you what language or locale you're in. So, for example, if I run into an Arabic alif in Unicode, I really don't know whether I'm looking at Arabic, Persian, or Urdu. The problem is the same for the so-called "CKJ" languages, Chinese, Korean, and Japanese. This would be a good time for someone who's worked on Plan 9 to jump in with advice. What would be a sensible way of migrating to Unicode or other standards? Do we use UTF-8 (about which information is even harded to come by than Unicode)? Or do we use some form of wide char I/O, using straight Unicode? Or do we default to UTF-8 for backwards compatibility, but provide facilities for straight Unicode? As usual, I must confess that I'm not a software engineer. I'm in Near Eastern Languages. But I'm following this group because the Linux community seems unusually responsive to internationalization issues, at least on the discussion level. (Apps. don't seem to be moving along in this direction.) Part of the problem is that information isn't all that widely disseminated (at least in the US) about how other scripts and encoding systems work. Programmers just don't have the basic info they need. And few Americans understand how Asian or Middle Eastern or Indian scripts work (the bidirectional wordwrap algorithm, for ex- ample, baffles many of them - not because they're dumb, but because of simple lack of exposure to Arabic, Hebrew, etc.). As a first step, everyone ought to peruse the comp.software.internation- alization FAQ, which at least sets forth how to use ANSI C setlocale. A second step is to buy the Unicode manual, now out of date (but still useful enough): The Unicode Standard Version 1.0 two volumes Addison Wesley, 1990,91 At the end of that volume is a horrendous account of the bi-di wordwrap algorithm that is guaranteed to mystify anyone who has not studied Arabic and/or Hebrew. If anyone gets this far, and wants clean, simple info, please contact me directly. I'll post my own informal, programmer ori- ented description of the bidi algorithm if asked. For UTF-8, check out http://www.stonehand.com/unicode/standard/utf8.html. Basically, it works as follows: * Bits Hex Min Hex Max Byte Sequence in Binary * 7 00000000 0000007f 0vvvvvvv * 11 00000080 000007FF 110vvvvv 10vvvvvv * 16 00000800 0000FFFF 1110vvvv 10vvvvvv 10vvvvvv * 21 00010000 001FFFFF 11110vvv 10vvvvvv 10vvvvvv 10vvvvvv * 26 00200000 03FFFFFF 111110vv 10vvvvvv 10vvvvvv 10vvvvvv 10vvvvvv * 31 04000000 7FFFFFFF 1111110v 10vvvvvv 10vvvvvv 10vvvvvv 10vvvvvv 10vvvvvv * * The UCS value is just the concatenation of the v bits in the multibyte * encoding. When there are multiple ways to encode a value, for example * UCS 0, only the shortest encoding is legal. The idea is that no UTF-8 sequence can be confused with ASCII codes, since the first 128 places (if I understand correctly) constitute a compatibility zone. Note that some space is lost in storage, but compression takes care of this nicely. Internally, one can use whatever one pleases (16-bit chars are sufficient for Unicode). I hope this helps. The Linux community is an interesting, energetic bunch. -- Richard L. Goerwitz *** goer@midway.uchicago.edu From icon-group-sender Mon Jan 30 20:53:55 1995 Received: by cheltenham.cs.arizona.edu; Mon, 30 Jan 1995 18:53:08 MST Date: Mon, 30 Jan 1995 20:53:55 -0400 (EDT) From: Olivier Lefevre Subject: Re: Double-Byre Characters or Unicode? To: icon-group@cs.arizona.edu Message-Id: <01HMGYZ6IF4YY3EO5G@ACFcluster.NYU.EDU> X-Vms-To: IN%"icon-group@cs.arizona.edu" X-Vms-Cc: LEFEVRE Mime-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT Errors-To: icon-group-errors@cs.arizona.edu > I believe that IBM has now made DBCS support a requirement of all > of their major languages. Yes, it has. > IBM Smalltalk and Visual Age and PL/I already offer this support. So does APL2 (as of the latest CSD). Olivier Lefevre NYU Medical School, NYC From icon-group-sender Tue Jan 31 02:15:52 1995 Received: by cheltenham.cs.arizona.edu; Mon, 30 Jan 1995 22:34:42 MST To: icon-group-l@cs.arizona.edu Date: Tue, 31 Jan 1995 02:15:52 GMT From: goer@quads.uchicago.edu (Richard L. Goerwitz) Message-Id: <1995Jan31.021552.7516@midway.uchicago.edu> Organization: University of Chicago Sender: icon-group-request@cs.arizona.edu References: , <1995Jan30.052611.25301@midway.uchicago.edu>, <3gich9$6oi@jabba.cybernetics.net> Reply-To: goer@midway.uchicago.edu Subject: Re: Double-Byre Characters or Unicode? Errors-To: icon-group-errors@cs.arizona.edu Don Brady writes: > >The real requirement is to be able to process Japanese and >other languages with large character/symbol sets. This takes volunteers, resources, etc. I seriously doubt that it will happen for every locale - China, Japan, Korea, India, and so on. It's hard enough, I gather, for the Icon Project to maintain the US-localized versions. So if we are going to talk about alternate encoding schemes, we need to think in terms of what is doable. And we need to think about who will do the do- ing. I confess that since Icon 9.0 I haven't really understood the implementation, despite the fact that I understood version 8 well enough to fool with the run-time system. 9.0 has a lot more capabilities, but it's harder to work on (at least for me it is). -- Richard L. Goerwitz *** goer@midway.uchicago.edu From icon-group-sender Thu Feb 2 14:28:03 1995 Received: by cheltenham.cs.arizona.edu; Thu, 2 Feb 1995 13:27:28 MST Date: Thu, 02 Feb 1995 14:28:03 -0600 (CST) From: Chris Tenaglia | 456-8765 Subject: Novell uses of icon To: icon-group@cs.arizona.edu Message-Id: <01HMKS5FEZJ68WWJ9B@mis.mcw.edu> Organization: Medical College of Wisconsin (Milwaukee, WI) X-Vms-To: IN%"icon-group@cs.arizona.edu" Mime-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT Errors-To: icon-group-errors@cs.arizona.edu I've been using Icon under VAX/VMS for years but I've been getting much more involved in Novell Netware recently. The default product and with some tools called JRB utilities generate good system administration information. Some of it is in several different places, too busy, or not easily printable. We have a large Novell 3.12 LAN and sometimes I'd like to know which users are logged into more than one place. So here's a code segment I use discover this. Output looks like : JSMITH occurs 2 times at 8201::1B4CF10A 5001::8002B251B70 BLOWELL occurs 2 times at 5001::8002B2A8C9B 8201::8002B249A81 NDIAMOND occurs 2 times at 8201::1B4CFCCF 5001::1B4D8F6C BHARDER occurs 2 times at 8201::1B4CD5B1 8201::1B4CFCB7 SOOFER occurs 2 times at 8201::1B4CD7EC 5001::1B4CD521 # # file : usermult.icn # desc : looks for multiple occurences of Novell user logins to see # where they're all coming from # use : userlist/a | iconx usermult # # update by what # 2-feb-1995 tenaglia initial write # procedure main() count := table(0) where := table("") while line := read() do { if match("\r",line) then line[1:53] := "" ident := parse(line,' ')[2] count[ident] +:= 1 where[ident] ||:= parse(line,' []')[3] || "::" || parse(line,' []')[4] || " " } results := sort(count,1) every pair := !results do { if pair[2] > 1 then { write(pair[1]," occurs ",pair[2]," times at ") write(" ",where[pair[1]]) } } end # # parse a string into a list with respect to a delimiter # procedure parse(line,delims) static chars chars := &cset -- delims tokens := [] line ? while tab(upto(chars)) do put(tokens,tab(many(chars))) return tokens end From icon-group-sender Thu Feb 2 14:47:29 1995 Received: by cheltenham.cs.arizona.edu; Thu, 2 Feb 1995 13:44:45 MST Date: Thu, 2 Feb 95 14:47:29 CST From: goer@mithra-orinst.uchicago.edu (Richard L. Goerwitz) Message-Id: <9502022047.AA03087@mithra-orinst.uchicago.edu> To: icon-group@cs.arizona.edu Subject: icon.el file Errors-To: icon-group-errors@cs.arizona.edu I have been unhappy with the latest icon.el file in the Emacs 19.28 distribution, and the one on cs.arizona.edu appears a bit old. Here is a new one, with a bug fixed, and with comments handled a bit more the way Icon programmers typically handle them. Check the variables at the beginning of the file that govern the bracing style if you don't like the original one that came with icon.el. I kind of like things the way the author had them origin- ally, though it's not they way the Icon book does it. Richard Goerwitz ;;; icon.el --- mode for editing Icon code ;; Copyright (C) 1989 Free Software Foundation, Inc. ;; Author: Chris Smith ;; Created: 15 Feb 89 ;; Keywords: languages ;; Hacked by Richard Goerwitz, 2 Feb 1995 ;; This file is part of GNU Emacs. ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. ;;; Commentary: ;; A major mode for editing the Icon programming language. ;; ;; Note: use ;; (autoload 'icon-mode "icon" nil t) ;; (setq auto-mode-alist (cons '("\\.icn$" . icon-mode) auto-mode-alist)) ;; if not permanently installed in your emacs ;;; Code: (defvar icon-mode-abbrev-table nil "Abbrev table in use in Icon-mode buffers.") (define-abbrev-table 'icon-mode-abbrev-table ()) (defvar icon-mode-map () "Keymap used in Icon mode.") (if icon-mode-map () (setq icon-mode-map (make-sparse-keymap)) (define-key icon-mode-map "{" 'electric-icon-brace) (define-key icon-mode-map "}" 'electric-icon-brace) (define-key icon-mode-map "\e\C-h" 'mark-icon-function) (define-key icon-mode-map "\e\C-a" 'beginning-of-icon-defun) (define-key icon-mode-map "\e\C-e" 'end-of-icon-defun) (define-key icon-mode-map "\e\C-q" 'indent-icon-exp) (define-key icon-mode-map "\177" 'backward-delete-char-untabify) (define-key icon-mode-map "\t" 'icon-indent-command)) (defvar icon-mode-syntax-table nil "Syntax table in use in Icon-mode buffers.") (if icon-mode-syntax-table () (setq icon-mode-syntax-table (make-syntax-table)) (modify-syntax-entry ?\\ "\\" icon-mode-syntax-table) (modify-syntax-entry ?# "<" icon-mode-syntax-table) (modify-syntax-entry ?\n ">" icon-mode-syntax-table) (modify-syntax-entry ?$ "." icon-mode-syntax-table) (modify-syntax-entry ?/ "." icon-mode-syntax-table) (modify-syntax-entry ?* "." icon-mode-syntax-table) (modify-syntax-entry ?+ "." icon-mode-syntax-table) (modify-syntax-entry ?- "." icon-mode-syntax-table) (modify-syntax-entry ?= "." icon-mode-syntax-table) (modify-syntax-entry ?% "." icon-mode-syntax-table) (modify-syntax-entry ?< "." icon-mode-syntax-table) (modify-syntax-entry ?> "." icon-mode-syntax-table) (modify-syntax-entry ?& "." icon-mode-syntax-table) (modify-syntax-entry ?| "." icon-mode-syntax-table) (modify-syntax-entry ?\' "\"" icon-mode-syntax-table)) (defconst icon-indent-level 4 "*Indentation of Icon statements with respect to containing block.") (defconst icon-brace-imaginary-offset 0 "*Imagined indentation of a Icon open brace that actually follows a statement.") (defconst icon-brace-offset 0 "*Extra indentation for braces, compared with other text in same context.") (defconst icon-continued-statement-offset 4 "*Extra indent for lines not starting new statements.") (defconst icon-continued-brace-offset 0 "*Extra indent for substatements that start with open-braces. This is in addition to icon-continued-statement-offset.") (defconst icon-auto-newline nil "*Non-nil means automatically newline before and after braces inserted in Icon code.") (defconst icon-tab-always-indent t "*Non-nil means TAB in Icon mode should always reindent the current line, regardless of where in the line point is when the TAB command is used.") (defun icon-mode () "Major mode for editing Icon code. Expression and list commands understand all Icon brackets. Tab indents for Icon code. Paragraphs are separated by blank lines only. Delete converts tabs to spaces as it moves back. \\{icon-mode-map} Variables controlling indentation style: icon-tab-always-indent Non-nil means TAB in Icon mode should always reindent the current line, regardless of where in the line point is when the TAB command is used. icon-auto-newline Non-nil means automatically newline before and after braces inserted in Icon code. icon-indent-level Indentation of Icon statements within surrounding block. The surrounding block's indentation is the indentation of the line on which the open-brace appears. icon-continued-statement-offset Extra indentation given to a substatement, such as the then-clause of an if or body of a while. icon-continued-brace-offset Extra indentation given to a brace that starts a substatement. This is in addition to `icon-continued-statement-offset'. icon-brace-offset Extra indentation for line if it starts with an open brace. icon-brace-imaginary-offset An open brace following other text is treated as if it were this far to the right of the start of its line. Turning on Icon mode calls the value of the variable `icon-mode-hook' with no args, if that value is non-nil." (interactive) (kill-all-local-variables) (use-local-map icon-mode-map) (setq major-mode 'icon-mode) (setq mode-name "Icon") (setq local-abbrev-table icon-mode-abbrev-table) (set-syntax-table icon-mode-syntax-table) (make-local-variable 'paragraph-start) (setq paragraph-start (concat "^$\\|" page-delimiter)) (make-local-variable 'paragraph-separate) (setq paragraph-separate paragraph-start) (make-local-variable 'indent-line-function) (setq indent-line-function 'icon-indent-line) (make-local-variable 'require-final-newline) (setq require-final-newline t) (make-local-variable 'comment-start) (setq comment-start "# ") (make-local-variable 'comment-end) (setq comment-end "") (make-local-variable 'comment-column) (setq comment-column 32) (make-local-variable 'comment-start-skip) (setq comment-start-skip "# *") (make-local-variable 'comment-indent-function) (setq comment-indent-function 'icon-comment-indent) (run-hooks 'icon-mode-hook)) ;; This is used by indent-for-comment to decide how much to ;; indent a comment in Icon code based on its context. (defun icon-comment-indent () (if (looking-at "^#") 0 (save-excursion (skip-chars-backward " \t") (max (if (bolp) 0 (1+ (current-column))) comment-column)))) (defun electric-icon-brace (arg) "Insert character and correct line's indentation." (interactive "P") (let (insertpos) (if (and (not arg) (eolp) (or (save-excursion (skip-chars-backward " \t") (bolp)) (if icon-auto-newline (progn (icon-indent-line) (newline) t) nil))) (progn (insert last-command-char) (icon-indent-line) (if icon-auto-newline (progn (newline) ;; (newline) may have done auto-fill (setq insertpos (- (point) 2)) (icon-indent-line))) (save-excursion (if insertpos (goto-char (1+ insertpos))) (delete-char -1)))) (if insertpos (save-excursion (goto-char insertpos) (self-insert-command (prefix-numeric-value arg))) (self-insert-command (prefix-numeric-value arg))))) (defun icon-indent-command (&optional whole-exp) (interactive "P") "Indent current line as Icon code, or in some cases insert a tab character. If `icon-tab-always-indent' is non-nil (the default), always indent current line. Otherwise, indent the current line only if point is at the left margin or in the line's indentation; otherwise insert a tab. A numeric argument, regardless of its value, means indent rigidly all the lines of the expression starting after point so that this line becomes properly indented. The relative indentation among the lines of the expression are preserved." (if whole-exp ;; If arg, always indent this line as Icon ;; and shift remaining lines of expression the same amount. (let ((shift-amt (icon-indent-line)) beg end) (save-excursion (if icon-tab-always-indent (beginning-of-line)) (setq beg (point)) (forward-sexp 1) (setq end (point)) (goto-char beg) (forward-line 1) (setq beg (point))) (if (> end beg) (indent-code-rigidly beg end shift-amt "#"))) (if (and (not icon-tab-always-indent) (save-excursion (skip-chars-backward " \t") (not (bolp)))) (insert-tab) (icon-indent-line)))) (defun icon-indent-line () "Indent current line as Icon code. Return the amount the indentation changed by." (let ((indent (calculate-icon-indent nil)) beg shift-amt (case-fold-search nil) (pos (- (point-max) (point)))) (beginning-of-line) (setq beg (point)) (cond ((eq indent nil) (setq indent (current-indentation))) ; ((eq indent t) ; (setq indent (calculate-icon-indent-within-comment))) ; ((looking-at "[ \t]*#") ; (setq indent 0)) (t (skip-chars-forward " \t") (if (listp indent) (setq indent (car indent))) (cond ((and (looking-at "else\\b") (not (looking-at "else\\s_"))) (setq indent (save-excursion (icon-backward-to-start-of-if) (current-indentation)))) ((or (= (following-char) ?}) (looking-at "end\\b")) (setq indent (- indent icon-indent-level))) ((= (following-char) ?{) (setq indent (+ indent icon-brace-offset)))))) (skip-chars-forward " \t") (setq shift-amt (- indent (current-column))) (if (zerop shift-amt) (if (> (- (point-max) pos) (point)) (goto-char (- (point-max) pos))) (delete-region beg (point)) (indent-to indent) ;; If initial point was within line's indentation, ;; position after the indentation. Else stay at same point in text. (if (> (- (point-max) pos) (point)) (goto-char (- (point-max) pos)))) shift-amt)) (defun calculate-icon-indent (&optional parse-start) "Return appropriate indentation for current line as Icon code. In usual case returns an integer: the column to indent to. Returns nil if line starts inside a string, t if in a comment." (save-excursion (beginning-of-line) (let ((indent-point (point)) (case-fold-search nil) state containing-sexp toplevel) (if parse-start (goto-char parse-start) (setq toplevel (beginning-of-icon-defun))) (while (< (point) indent-point) (setq parse-start (point)) (setq state (parse-partial-sexp (point) indent-point 0)) (setq containing-sexp (car (cdr state)))) (cond ((or (nth 3 state) (nth 4 state)) ;; return nil or t if should not change this line (nth 4 state)) ((and containing-sexp (/= (char-after containing-sexp) ?{)) ;; line is expression, not statement: ;; indent to just after the surrounding open. (goto-char (1+ containing-sexp)) (current-column)) (t (if toplevel ;; Outside any procedures. (progn (icon-backward-to-noncomment (point-min)) (if (icon-is-continuation-line) icon-continued-statement-offset 0)) ;; Statement level. (if (null containing-sexp) (progn (beginning-of-icon-defun) (setq containing-sexp (point)))) (goto-char indent-point) ;; Is it a continuation or a new statement? ;; Find previous non-comment character. (icon-backward-to-noncomment containing-sexp) ;; Now we get the answer. (if (icon-is-continuation-line) ;; This line is continuation of preceding line's statement; ;; indent icon-continued-statement-offset more than the ;; first line of the statement. (progn (icon-backward-to-start-of-continued-exp containing-sexp) (+ icon-continued-statement-offset (current-column) (if (save-excursion (goto-char indent-point) (skip-chars-forward " \t") (eq (following-char) ?{)) icon-continued-brace-offset 0))) ;; This line starts a new statement. ;; Position following last unclosed open. (goto-char containing-sexp) ;; Is line first statement after an open-brace? (or ;; If no, find that first statement and indent like it. (save-excursion (if (looking-at "procedure\\s ") (forward-sexp 3) (forward-char 1)) (while (progn (skip-chars-forward " \t\n") (looking-at "#")) ;; Skip over comments following openbrace. (forward-line 1)) ;; The first following code counts ;; if it is before the line we want to indent. (and (< (point) indent-point) (current-column))) ;; If no previous statement, ;; indent it relative to line brace is on. ;; For open brace in column zero, don't let statement ;; start there too. If icon-indent-level is zero, ;; use icon-brace-offset + icon-continued-statement-offset ;; instead. ;; For open-braces not the first thing in a line, ;; add in icon-brace-imaginary-offset. (+ (if (and (bolp) (zerop icon-indent-level)) (+ icon-brace-offset icon-continued-statement-offset) icon-indent-level) ;; Move back over whitespace before the openbrace. ;; If openbrace is not first nonwhite thing on the line, ;; add the icon-brace-imaginary-offset. (progn (skip-chars-backward " \t") (if (bolp) 0 icon-brace-imaginary-offset)) ;; Get initial indentation of the line we are on. (current-indentation)))))))))) ;; List of words to check for as the last thing on a line. ;; If cdr is t, next line is a continuation of the same statement, ;; if cdr is nil, next line starts a new (possibly indented) statement. (defconst icon-resword-alist '(("by" . t) ("case" . t) ("create") ("do") ("dynamic" . t) ("else") ("every" . t) ("if" . t) ("global" . t) ("initial" . t) ("link" . t) ("local" . t) ("of") ("record" . t) ("repeat" . t) ("static" . t) ("then") ("to" . t) ("until" . t) ("while" . t))) (defun icon-is-continuation-line () (let* ((ch (preceding-char)) (ch-syntax (char-syntax ch))) (if (eq ch-syntax ?w) (assoc (buffer-substring (progn (forward-word -1) (point)) (progn (forward-word 1) (point))) icon-resword-alist) (not (memq ch '(0 ?\; ?\} ?\{ ?\) ?\] ?\" ?\' ?\n)))))) (defun icon-backward-to-noncomment (lim) (let (opoint stop) (while (not stop) (skip-chars-backward " \t\n\f" lim) (setq opoint (point)) (beginning-of-line) ;;; Bug - nth counts from 0. ; (if (and (print (nth 5 (parse-partial-sexp (point) opoint))) (if (and (nth 4 (parse-partial-sexp (point) opoint)) (< lim (point))) (search-backward "#") (setq stop t))))) (defun icon-backward-to-start-of-continued-exp (lim) (if (memq (preceding-char) '(?\) ?\])) (forward-sexp -1)) (beginning-of-line) (skip-chars-forward " \t") (cond ((<= (point) lim) (goto-char (1+ lim))) ((not (icon-is-continued-line)) 0) ((and (eq (char-syntax (following-char)) ?w) (cdr (assoc (buffer-substring (point) (save-excursion (forward-word 1) (point))) icon-resword-alist))) 0) (t (end-of-line 0) (icon-backward-to-start-of-continued-exp lim)))) (defun icon-is-continued-line () (save-excursion (end-of-line 0) (icon-is-continuation-line))) (defun icon-backward-to-start-of-if (&optional limit) "Move to the start of the last \"unbalanced\" if." (or limit (setq limit (save-excursion (beginning-of-icon-defun) (point)))) (let ((if-level 1) (case-fold-search nil)) (while (not (zerop if-level)) (backward-sexp 1) (cond ((looking-at "else\\b") (setq if-level (1+ if-level))) ((looking-at "if\\b") (setq if-level (1- if-level))) ((< (point) limit) (setq if-level 0) (goto-char limit)))))) (defun mark-icon-function () "Put mark at end of Icon function, point at beginning." (interactive) (push-mark (point)) (end-of-icon-defun) (push-mark (point)) (beginning-of-line 0) (beginning-of-icon-defun)) (defun beginning-of-icon-defun () "Go to the start of the enclosing procedure; return t if at top level." (interactive) (if (re-search-backward "^procedure\\s \\|^end[ \t\n]" (point-min) 'move) (looking-at "e") t)) (defun end-of-icon-defun () (interactive) (if (not (bobp)) (forward-char -1)) (re-search-forward "\\(\\s \\|^\\)end\\(\\s \\|$\\)" (point-max) 'move) (forward-word -1) (forward-line 1)) (defun indent-icon-exp () "Indent each line of the Icon grouping following point." (interactive) (let ((indent-stack (list nil)) (contain-stack (list (point))) (case-fold-search nil) restart outer-loop-done inner-loop-done state ostate this-indent last-sexp at-else at-brace at-do (opoint (point)) (next-depth 0)) (save-excursion (forward-sexp 1)) (save-excursion (setq outer-loop-done nil) (while (and (not (eobp)) (not outer-loop-done)) (setq last-depth next-depth) ;; Compute how depth changes over this line ;; plus enough other lines to get to one that ;; does not end inside a comment or string. ;; Meanwhile, do appropriate indentation on comment lines. (setq innerloop-done nil) (while (and (not innerloop-done) (not (and (eobp) (setq outer-loop-done t)))) (setq ostate state) (setq state (parse-partial-sexp (point) (progn (end-of-line) (point)) nil nil state)) (setq next-depth (car state)) (if (and (car (cdr (cdr state))) (>= (car (cdr (cdr state))) 0)) (setq last-sexp (car (cdr (cdr state))))) (if (or (nth 4 ostate)) (icon-indent-line)) (if (or (nth 3 state)) (forward-line 1) (setq innerloop-done t))) (if (<= next-depth 0) (setq outer-loop-done t)) (if outer-loop-done nil (if (/= last-depth next-depth) (setq last-sexp nil)) (while (> last-depth next-depth) (setq indent-stack (cdr indent-stack) contain-stack (cdr contain-stack) last-depth (1- last-depth))) (while (< last-depth next-depth) (setq indent-stack (cons nil indent-stack) contain-stack (cons nil contain-stack) last-depth (1+ last-depth))) (if (null (car contain-stack)) (setcar contain-stack (or (car (cdr state)) (save-excursion (forward-sexp -1) (point))))) (forward-line 1) (skip-chars-forward " \t") (if (eolp) nil (if (and (car indent-stack) (>= (car indent-stack) 0)) ;; Line is on an existing nesting level. ;; Lines inside parens are handled specially. (if (/= (char-after (car contain-stack)) ?{) (setq this-indent (car indent-stack)) ;; Line is at statement level. ;; Is it a new statement? Is it an else? ;; Find last non-comment character before this line (save-excursion (setq at-else (looking-at "else\\W")) (setq at-brace (= (following-char) ?{)) (icon-backward-to-noncomment opoint) (if (icon-is-continuation-line) ;; Preceding line did not end in comma or semi; ;; indent this line icon-continued-statement-offset ;; more than previous. (progn (icon-backward-to-start-of-continued-exp (car contain-stack)) (setq this-indent (+ icon-continued-statement-offset (current-column) (if at-brace icon-continued-brace-offset 0)))) ;; Preceding line ended in comma or semi; ;; use the standard indent for this level. (if at-else (progn (icon-backward-to-start-of-if opoint) (setq this-indent (current-indentation))) (setq this-indent (car indent-stack)))))) ;; Just started a new nesting level. ;; Compute the standard indent for this level. (let ((val (calculate-icon-indent (if (car indent-stack) (- (car indent-stack)))))) (setcar indent-stack (setq this-indent val)))) ;; Adjust line indentation according to its contents (if (or (= (following-char) ?}) (looking-at "end\\b")) (setq this-indent (- this-indent icon-indent-level))) (if (= (following-char) ?{) (setq this-indent (+ this-indent icon-brace-offset))) ;; Put chosen indentation into effect. (or (= (current-column) this-indent) (progn (delete-region (point) (progn (beginning-of-line) (point))) (indent-to this-indent))) ;; Indent any comment following the text. (or (looking-at comment-start-skip) (if (re-search-forward comment-start-skip (save-excursion (end-of-line) (point)) t) (progn (indent-for-comment) (beginning-of-line)))))))))) ;;; icon.el ends here From icon-group-sender Thu Feb 2 14:51:25 1995 Received: by cheltenham.cs.arizona.edu; Thu, 2 Feb 1995 13:49:04 MST Date: Thu, 2 Feb 95 14:51:25 CST From: goer@mithra-orinst.uchicago.edu (Richard L. Goerwitz) Message-Id: <9502022051.AA03096@mithra-orinst.uchicago.edu> To: icon-group@cs.arizona.edu Subject: hilit19.el Errors-To: icon-group-errors@cs.arizona.edu Here's another hacked elisp file. Hilit19 didn't do preprocessor defines, and didn't know about link statements. It also did not handle continued string literals _ like this. So here's my hacked version. I'm sure more could be done. Richard Goerwitz ;; hilit19.el (Release 2.19) -- customizable highlighting for Emacs19. ;; Copyright (c) 1993 Free Software Foundation, Inc. ;; Hacked by Richard Goerwitz, 2 Feb 1995 ;; ;; Author: Jonathan Stigelman ;; Keywords: faces ;; ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2 of the License, or ;; (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;; ;;; Commentary: ;; Hilit19.el is a customizable highlighting package for Emacs19. It supports ;; not only source code highlighting, but also Info, RMAIL, VM, gnus... ;; Hilit19 knows (or thinks it knows) how to highlight emacs buffers in ;; about 25 different modes. ;; ;; WHERE TO GET THE LATEST VERSIONS OF HILIT19.EL (beta and release), ;; PLUS LOTS OF OTHER *WAY COOL* STUFF VIA ANONYMOUS FTP: ;; ;; netcom.com:/pub/stig/src/{Beta,Release}/hilit19.el.gz ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; TO SUBMIT BUG REPORTS (or feedback of any sort)... ;; ;; M-x hilit-submit-feedback RET ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; hilit19.el,v 2.19 1993/09/08 18:44:10 stig Release ;; ;; LCD Archive Entry: ;; hilit19|Jonathan Stigelman|Stig@netcom.com| ;; Comprehensive (and comparatively fast) regex-based highlighting for Emacs 19| ;; 1993/09/08 18:44:10|Release 2.19|~/packages/hilit19.el.Z| ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; GENERAL OVERVIEW ;; ;; This package installs numerous hooks to colorfully highlight your ;; source code buffers as well as mail and news buffers. Most ;; programming languages have predefined highlighting patterns. ;; Just load hilit19 and files will be automatically highlighted as ;; they're loaded. ;; ;; Rehighlight a buffer by typing C-S-l (control-shift-lowercase-L). ;; ;; If, when you edit the buffer, the coloring gets messed up, just ;; redraw and the coloring will be adjusted. If automatic highlighting ;; in the current buffer has been turned off, then typing C-u C-S-l will ;; force a rehighlight of the entire buffer. ;; ;; Hilit19 can build faces by examining the names that you give to them ;; For example, green/black-bold-italic-underline would be created as ;; a face with a green foreground, and a black background, using a ;; bold-italic font...with underlining for good measure. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; SETUP -- In your .emacs: ;; ;; ;; (cond (window-system ;; (setq hilit-mode-enable-list '(not text-mode) ;; hilit-background-mode 'light ;; hilit-inhibit-hooks nil ;; hilit-inhibit-rebinding nil) ;; ;; (require 'hilit19) ;; )) ;; ;; If you like font-lock-mode and want to use both packages, then you can ;; disable hilit for the modes in which you want to use font-lock by listing ;; said modes in hilit-mode-enable-list. ;; ;; (hilit-translate type 'RoyalBlue ; enable highlighting in C/C++ ;; string nil) ; disable string highlighting ;; ;; To get 100% of the utility of hilit19, you may also have to apply the ;; patches below for info.el and vm5.33L_19/vm-summary.el ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; SETUP -- Are you using the right font for Emacs? ;; ;; Emacs cannot properly find bold and italic fonts unless you specify a ;; verbose X11 font name. If you specify a font for emacs in your ;; .Xdefaults, it *MUST* be specified using the long form of the font name. ;; Here's a good font menu: ;; ;; (setq ;; x-fixed-font-alist ;; '("Font Menu" ;; ("Misc" ;; ("6x12" "-misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-*-1") ;; ("6x13" "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-*-1") ;; ("lucida 13" ;; "-b&h-lucidatypewriter-medium-r-normal-sans-0-0-0-0-m-0-*-1") ;; ("7x13" "-misc-fixed-medium-r-normal--13-120-75-75-c-70-*-1") ;; ("7x14" "-misc-fixed-medium-r-normal--14-130-75-75-c-70-*-1") ;; ("9x15" "-misc-fixed-medium-r-normal--15-140-*-*-c-*-*-1") ;; ("") ;; ("clean 8x8" "-schumacher-clean-medium-r-normal--*-80-*-*-c-*-*-1") ;; ("clean 8x14" "-schumacher-clean-medium-r-normal--*-140-*-*-c-*-*-1") ;; ("clean 8x10" "-schumacher-clean-medium-r-normal--*-100-*-*-c-*-*-1") ;; ("clean 8x16" "-schumacher-clean-medium-r-normal--*-160-*-*-c-*-*-1") ;; ("") ;; ("sony 8x16" "-sony-fixed-medium-r-normal--16-120-100-100-c-80-*-1") ;; ("") ;; ("-- Courier --") ;; ("Courier 10" "-adobe-courier-medium-r-normal--*-100-*-*-m-*-*-1") ;; ("Courier 12" "-adobe-courier-medium-r-normal--*-120-*-*-m-*-*-1") ;; ("Courier 14" "-adobe-courier-medium-r-normal--*-140-*-*-m-*-*-1") ;; ("Courier 18" "-adobe-courier-medium-r-normal--*-180-*-*-m-*-*-1") ;; ("Courier 18-b" "-adobe-courier-bold-r-normal--*-180-*-*-m-*-*-1") ;; ))) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; KNOWN BUGS/TO DO LIST/HELP WANTED/APPLY WITHIN ;; ;; * When more than one size of font is used in different frames, only one ;; font size can have bold & italic properties. ;; ;; * unbalanced, unescaped double quote characters can confuse hilit19. ;; This will be fixed someday, so don't bug me about it. ;; ;; * ALTHOUGH HILIT19 IS FASTER THAN FONT-LOCK-MODE... ;; For various reasons, the speed of the package could still stand to be ;; improved. If you care to do a little profiling and make things tighter... ;; ;; * hilit-toggle-highlight is flaky when auto-rehighlight is neither t nor nil. ;; Does anyone actually USE this? I think I might just remove it. ;; ;; PROJECTS THAT YOU CAN TAKE OVER BECAUSE I DON'T MUCH CARE ABOUT THEM... ;; ;; * Moved hilit-wysiwyg-replace here from my version of man.el, this is not ;; a bug. The bug is that I don't have a reverse operation yet...just a ;; stub Wysiwyg-anything really belongs in a package of it's own. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Thanks to the following people for their input: ;; ebert@enpc.enpc.fr (Rolf EBERT), ada, LaTeX & bibtex highlights ;; Vivek Khera , gnus hooks + random advice & patches ;; brian@athe.WUstl.EDU (Brian Dunford-Shore), prolog highlights ;; John Ladwig , 1st pass nroff highlights ;; campo@sunthpi3.difi.unipi.it (Massimo Campostrini), fortran highlights ;; jayb@laplace.MATH.ColoState.EDU (Jay Bourland), 1st pass dired ;; Yoshio Turner , modula 2 highlights ;; Fritz Knabe , advice & patches ;; Alon Albert , advice & patches ;; dana@thumper.bellcore.com (Dana A. Chee), working on the multi-frame bug ;; derway@ndc.com (Don Erway), for breaking it... ;; moss_r@summer.chem.su.oz.au (Richard Moss), first pass at add-pattern ;; Olivier Lecarme , Pascal & Icon patterns ;; ;; With suggestions and minor regex patches from numerous others... ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; hilit19.el,v ;; Revision 2.19 1993/09/08 18:44:10 stig ;; installed patch for elusive bug in hilit-rehighlight-region that caused ;; hilit-unhighlight-region to hang in an infinite loop. ;; ;; Revision 2.18 1993/08/27 03:51:00 stig ;; minor mods to lisp-mode and c/c++ mode patterns ;; ;; Revision 2.17 1993/08/25 02:19:17 stig ;; work-around for bug in next-overlay-change that caused dired and jargon-mode ;; to hang in an endless loop. Perhaps other modes were doing this too. ;; ;; Revision 2.16 1993/08/22 19:46:00 stig ;; bug fix for next-overlay-change and accompanying change to ;; hilit-unhighlight-region ;; ;; Revision 2.15 1993/08/20 12:16:22 stig ;; minor change to fortran patterns ;; ;; Revision 2.14 1993/08/17 14:12:10 stig ;; added default face mapping for 'formula' which is needed for new latex ;; patterns. ;; ;; twiddled the calendar-mode patterns a bit. ;; ;; Revision 2.13 1993/08/16 04:33:54 stig ;; hilit-set-mode-patterns was screwing up two part patterns. it doesn't now. ;; ;; Revision 2.12 1993/08/16 00:16:41 stig ;; changed references to default-bold-italic to just bold-italic because the ;; font for that face is maintained by emacs. ;; ;; the pattern matcher now starts it's searches from the end of the most ;; recently highlighted region (which is not necessarily the end of the most ;; recently matched regex). ;; ;; multiple errors in pattern matcher now just give an error instead of lots of ;; annoying messages and dings. ;; ;; no longer use vm-summary-mode-hooks. ;; ;; some code moved from hilit-highlight-region to hilit-set-mode-patterns. ;; This will affect you if you pass your patterns directly to ;; hilit-highlight-region....use a pseudo-mode instead. ;; ;; pattern changes to C/C++, latex, texinfo, fortran, nroff, etc. ;; ;; Revision 2.11 1993/08/13 12:12:37 stig ;; removed some crufty commented-out code ;; ;; diverged lisp-mode and emacs-lisp-mode...also added lisp keywords. ;; ;; Revision 2.10 1993/08/13 09:47:06 stig ;; added calendar-mode, icon-mode and pascal-mode patterns ;; ;; commented out hilit-toggle-highlight because I want to phase it out entirely ;; ;; Revision 2.9 1993/08/13 08:44:22 stig ;; added optional case-fold argument to hilit-set-mode-patterns, this case-fold ;; parameter is now stored in hilit-patterns-alist. ;; ;; Revision 2.8 1993/08/12 22:05:03 stig ;; fixed some typos in documentation ;; ;; twiddled some of the color defaults for dark backgrounds ;; ;; always get 'mono color defaults if (not (x-display-color-p)) ;; ;; added hilit-rehighlight-buffer-quietly to dired-after-readin-hook ;; ;; fixed bug in hilit-string-find that mishandled strings of the form: "\\" ;; ;; NEW FUNCTION: hilit-add-mode-pattern... kinda like add-hook for patterns ;; ;; fixed minor pattern bugs for latex-mode and emacs-lisp-mode ;; ;; Revision 2.7 1993/07/30 02:43:01 stig ;; added const to the list of modifiers for C/C++ types ;; ;; Revision 2.6 1993/07/30 00:30:54 stig ;; now permit selection of arbitrary subexpressions for highlighting... ;; fixed keyword patterns for C/C++ using this technique. ;; ;; Revision 2.5 1993/07/28 05:02:56 stig ;; improvements to makefile regular expressions ;; removed about 130 lines just by compacting the big defconst for ;; hilit-face-translation-table into a mapcar and defining a separate table ;; of default faces. ;; ;; Revision 2.4 1993/07/27 14:09:05 stig ;; documented another "known problem" to "head off gripe mail at the pass." ;; ;; Revision 2.3 1993/07/27 02:15:49 stig ;; (hilit-lookup-face-create) incorporated patch which improves it's behavior ;; with more than one frame... Still can't have bold on the same face in two ;; differrent fonts sizes at the same time... ;; ;; Revision 2.2 1993/07/27 02:02:59 stig ;; vastly improved the makefile patterns ;; added hook for mh-show-mode ;; ;; Revision 2.1 1993/07/24 17:46:21 stig ;; Phasing out Info-select-hook... Version 19.18 will use Info-selection-hook. ;; ;; Revision 2.0 1993/07/24 13:50:10 stig ;; better documentation and added the function hilit-submit-feedback. ;; C-S-l (control shift l) repaints the buffer. Other bindings are optional. ;; multi-line highlights no longer cause problems when ;; hilit-auto-rehighlight is 'visible ;; added hilit-predefined-face-list... ;; changed name of hilit-mode-alist to hilit-patterns-alist ;; added hilit-message-quietly to mail-setup-hook ;; added hilit-parser-alist which can be used to apply different patterns to ;; different parts of a buffer. This could be integrated in a far more ;; elegant manner, but it presently serves the purpose of not applying ;; message header patterns to message bodies in mail-mode and it's kin. ;; hilit-set-mode-patterns now takes a list of modes and an optional parse-fn ;; ;;;;;; AND THIS CAN BE APPLIED TO VM 5.33L_19 ;; ;; *** ../site/vm5.33L_19/vm-summary.el Fri Jun 4 22:17:11 1993 ;; --- ./vm-summary.el Tue Jun 22 16:39:30 1993 ;; *************** ;; *** 152,158 **** ;; (insert "->") ;; (delete-char 2) ;; (forward-char -2) ;; ! (and w vm-auto-center-summary (vm-auto-center-summary)))) ;; (and old-window (select-window old-window))))))) ;; ;; (defun vm-mark-for-display-update (message) ;; --- 152,159 ---- ;; (insert "->") ;; (delete-char 2) ;; (forward-char -2) ;; ! (and w vm-auto-center-summary (vm-auto-center-summary)) ;; ! (run-hooks 'vm-summary-pointer-hook))) ;; (and old-window (select-window old-window))))))) ;; ;; (defun vm-mark-for-display-update (message) ;; ;;;;;; ;;; Code: ;; User Options: (defvar hilit-quietly nil "* If non-nil, this inhibits progress indicators during highlighting") (defvar hilit-auto-highlight t "* T if we should highlight all buffers as we find 'em, nil to disable automatic highlighting by the find-file hook.") (defvar hilit-auto-highlight-maxout 60000 ; hilit19 keeps getting bigger... "* auto-highlight is disabled in buffers larger than this") (defvar hilit-auto-rehighlight t "* If this is non-nil, then hilit-redraw and hilit-recenter will also rehighlight part or all of the current buffer. T will rehighlight the whole buffer, a NUMBER will rehighlight that many lines before and after the cursor, and the symbol 'visible' will rehighlight only the visible portion of the current buffer. This variable is buffer-local.") (make-variable-buffer-local 'hilit-auto-rehighlight) (defvar hilit-auto-rehighlight-fallback '(20000 . 100) "* Cons of the form (THRESHOLD . FALLBACK), where FALLBACK is assigned to hilit-auto-rehighlight if the size of a newly opened buffer is larger than THRESHOLD.") (defvar hilit-face-check t "* T slows down highlighting but permits the user to change fonts without losing bold and italic faces... T causes hilit-lookup-face-create to dig through the frame parameters for the current window every time it's called. If you never change fonts in emacs, set this to NIL.") ;; Variables which must be set before loading hilit19. (defvar hilit-inhibit-rebinding nil "If non-nil, this inhibits replacement of recenter, yank, and yank-pop.") (defvar hilit-inhibit-hooks nil "If non-nil, this inhibits installation of hooks for Info, gnus, & vm.") (defvar hilit-background-mode 'light "'mono inhibits color, 'dark or 'light indicate the background brightness.") (defvar hilit-mode-enable-list nil "If a list of modes to exclusively enable or specifically disable. The sense of the list is negated if it begins with the symbol 'not'. Set this variable before you load hilit19. Ex: (perl-mode jargon-mode c-mode) ; just perl, C, and jargon modes (not text-mode) ; all modes except text mode") ;; Variables that are not generally modified directly (defvar hilit-parser-alist nil "alist of major-mode values and parsers called by hilit-rehighlight-buffer. Parsers for a given mode are IGNORED for partial rehighlights...maybe you'd like to make this more universal?") (defvar hilit-patterns-alist nil "alist of major-mode values and default highlighting patterns A highlighting pattern is a list of the form (start end face), where start is a regex, end is either a regex or a match number for start, and face is the name of an entry in hilit-face-translation-table, the name of a face, or nil (which disables the pattern). Each entry in the alist is of the form: (mode . (case-fold pattern [pattern ...])) See the hilit-lookup-face-create documentation for valid face names.") (defvar hilit-predefined-face-list (face-list) "List of faces with which hilit-lookup-face-create will NOT tamper. If hilit19 is dumped into emacs at your site, you may have to set this in your init file.") (eval-when-compile (setq byte-optimize t)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Use this to report bugs: (eval-when-compile (require 'reporter)) ; no compilation gripes (defun hilit-submit-feedback () "Submit feedback on hilit19 to the author: Stig@netcom.com" (interactive) (require 'reporter) (and (y-or-n-p "Do you really want to submit a report on hilit19? ") (reporter-submit-bug-report "Jonathan Stigelman " "hilit19.el (Release 2.19)" (and (y-or-n-p "Do you need to include a dump hilit variables? ") (append '( hilit-quietly hilit-inhibit-hooks hilit-background-mode hilit-mode-enable-list hilit-auto-highlight hilit-auto-highlight-maxout hilit-auto-rehighlight hilit-auto-rehighlight-fallback hilit-face-check ) (and (y-or-n-p "Have you modified the standard patterns? ") (yes-or-no-p "Are your patterns *REALLY* relevant? ") '(hilit-parser-alist hilit-patterns-alist hilit-predefined-face-list )))) (function (lambda () (and (y-or-n-p "Is this a problem with font display? ") (insert "\nFrame Configuration:\n====================\n" (prin1-to-string (frame-configuration-to-register ?F)) "\n" )))) nil (concat "This is (check all that apply, and delete what's irrelevant):\n" " [ ] a _MASSIVE_THANK_YOU_ for writing hilit19.el\n" " [ ] An invitation to attend the next Hackers Conference\n" " [ ] You're a RIGHTEOUS HACKER, what are your rates?\n" " [ ] I've used the force and read the source, but I'M CONFUSED\n" " [ ] a PATCH. (output of 'diff -uw old.el new.el' or 'diff -cw')\n" " [ ] a SERIOUS AND REPRODUCABLE BUG that is not an EMACS bug\n" " - I *swear* that it's not already mentioned in the KNOWN BUGS\n" " - I HAVE CHECKED netcom.com:/pub/stig/src/Beta/hilit19.el.gz\n" " for a newer release that fixes the problem.\n" " >> I HAVE ALSO CHECKED netcom.com:/pub/stig/src/Beta/hl319.el.gz\n" " This is the alpha version...what will become hilit19 (Beta 3.0).\n" "\n" "Hey Stig, I *know* you're busy but...\n")))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; These faces are either a valid face name, or nil ;; if you want to change them, you must do so AFTER hilit19 is loaded (defconst hilit-default-face-table '( ;; used for C/C++, elisp, perl, and Icon (comment firebrick-italic moccasin italic) (include purple Plum1 bold-italic) (define ForestGreen-bold green bold) (defun blue-bold cyan-bold bold-italic) (decl RoyalBlue cyan bold) (type nil yellow nil) (keyword RoyalBlue cyan bold-italic) (label red-underline orange-underlined underline) (string grey40 orange underline) ;; used for Icon (charset grey50 orange underline) ;; some further faces for Ada (struct black-bold white-bold bold) (glob-struct magenta Plum1 default-bold-underline) (named-param DarkGoldenrod Goldenrod underline) ;; and anotherone for LaTeX (crossref DarkGoldenrod Goldenrod underline) (formula Goldenrod DarkGoldenrod underline) ;; compilation buffers (active-error default/pink-bold default/DeepPink-bold default-underline) (error red-bold yellow bold) (warning blue-italic green italic) ;; Makefiles (some faces borrowed from C/C++ too) (rule blue-bold-underline cyan-underline default-bold-underline) ;; VM, GNUS and Text mode (msg-subject blue-bold yellow bold) (msg-from purple-bold green bold) (msg-header firebrick-bold cyan italic) (msg-separator black/tan-bold black/lightblue nil) (msg-quote ForestGreen pink italic) (summary-seen grey40 white nil) (summary-killed grey50 white nil) (summary-Xed OliveDrab2 green nil) (summary-deleted firebrick white italic) (summary-unread RoyalBlue yellow bold) (summary-new blue-bold yellow-bold bold-italic) (summary-current default/skyblue-bold green/dimgrey-bold reverse-default) (gnus-group-unsubscribed grey50 white nil) (gnus-group-empty nil nil nil) (gnus-group-full ForestGreen green italic) (gnus-group-overflowing firebrick red bold-italic) ;; dired mode (dired-directory blue-bold cyan bold) (dired-link firebrick-italic green italic) (dired-ignored ForestGreen moccasin nil) (dired-deleted red-bold-italic orange bold-italic) (dired-marked purple Plum1 nil) ;; Info-mode, and jargon-mode.el and prep.ai.mit.edu:/pub/gnu/jargon* (jargon-entry blue-bold cyan bold) (jargon-xref purple-bold Plum1 italic) (jargon-keyword firebrick-underline yellow underline) ) "alist of default faces (face . (light-default dark-default mono-default)) There is no way for the user to modify this table such that it will have any effect upon the translations used by hilit19. Instead, use the function hilit-translate AFTER hilit19 has been loaded. See also the documentation for hilit-lookup-face-create.") (defconst hilit-face-translation-table (let ((index (or (and (x-display-color-p) (cdr (assq hilit-background-mode '((light . 1) (dark . 2))))) 3))) (mapcar (function (lambda (x) (cons (car x) (nth index x)))) hilit-default-face-table)) "alist that maps symbolic face-names to real face names") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; To translate one face to another... ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmacro hilit-translate (&rest args) "(hilit-translate FROM TO FROM TO ...): translate each face FROM to the value of its TO face. This is like setq for faces. The function hilit-lookup-face-create will repeatedly translate until no more translations for the face exist in the translation table. See the documentation for hilit-lookup-face-create for names of valid faces." (or (zerop (% (length args) 2)) (error "wrong number of args")) (let (cmdl from to) (while args (setq from (car args) to (nth 1 args) args (nthcdr 2 args) cmdl (cons (list 'hilit-associate ''hilit-face-translation-table (list 'quote from) to) cmdl))) (cons 'progn cmdl))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; This function actually translates and then creates the faces... ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun hilit-lookup-face-create (face &optional force) "Get a FACE, or create it if it doesn't exist. In order for it to properly create the face, the followwing naming convention must be used: [reverse-](fgcolor[/bgcolor])[-bold][-italic][-underline] Example: (hilit-lookup-face-create 'comment-face) might create and return 'red Each color is either the name of an X color (see .../X11/lib/X11/rgb.txt), a hexadecimal specification of the form \"hex-[0-9A-Fa-f]+\", or \"default\". An optional argument, FORCE, will cause the face to be recopied from the default...which is probably of use only if you've changed fonts. See the documentation for hilit-translate and hilit-face-translation-table." ;; translate the face ... (let ((trec t) visited) (while trec (cond ((memq face visited) (error "face translation loop: %S" visited)) (t (setq visited (cons face visited) trec (assq face hilit-face-translation-table)) (and trec (setq face (cdr trec))))))) ;; make the face if we need to... (let* ((fn (symbol-name face)) (frame (selected-frame)) (basefont (cdr (assq 'font (frame-parameters frame)))) error fgcolor bgcolor) (cond ((or (null face) (memq face hilit-predefined-face-list)) ;; do nothing if the face is nil or if it's predefined. ) ((or force (not (memq face (face-list))) (and hilit-face-check (not (string= (get face 'basefont) basefont)))) (copy-face 'default 'scratch-face) (if (string-match "^reverse-?" fn) (progn (invert-face 'scratch-face) (setq fn (substring fn (match-end 0))))) ;; parse foreground color (if (string-match "^\\(hex-\\)?\\([A-Za-z0-9]+\\)" fn) (setq fgcolor (concat (if (match-beginning 1) "#") (substring fn (match-beginning 2) (match-end 2))) fn (substring fn (match-end 0))) (error "bad face name %S" face)) ;; parse background color (if (string-match "^/\\(hex-\\)?\\([A-Za-z0-9]+\\)" fn) (setq bgcolor (concat (and (match-beginning 1) "#") (substring fn (match-beginning 2) (match-end 2))) fn (substring fn (match-end 0)))) (and (string= "default" fgcolor) (setq fgcolor nil)) (and (string= "default" bgcolor) (setq bgcolor nil)) ;; catch errors if we can't allocate the color(s) (condition-case nil (progn (set-face-foreground 'scratch-face fgcolor) (set-face-background 'scratch-face bgcolor) (copy-face 'scratch-face face) (put face 'basefont basefont)) (error (message "couldn't allocate color for '%s'" (symbol-name face)) (setq face 'default) (setq error t))) (or error ;; don't bother w/ bold or italic if we didn't get the color ;; we wanted, but ignore errors making the face bold or italic ;; if the font isn't available, there's nothing to do about it... (progn (set-face-font face nil frame) (set-face-underline-p face (string-match "underline" fn)) (if (string-match ".*bold" fn) (progn ;; first, fix up this frame's face (make-face-bold face frame 'noerr) ;; now, fix up the face from the global list (set-face-font face (face-font face frame) t))) (if (string-match ".*italic" fn) (progn ;; first, fix up this frame's face (make-face-italic face frame 'noerr) ;; now, fix up the face from the global list (set-face-font face (face-font face frame) t))) )) ))) face) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Region Highlight/Unhighlight code (Both overlay and text-property versions) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defsubst hilit-region-set-face (start end face-name &optional prio prop) "Highlight region from START to END using FACE and, optionally, PRIO. The optional 5th arg, PROP is a property to set instead of 'hilit." (let ((overlay (make-overlay start end))) (overlay-put overlay 'face face-name) (overlay-put overlay (or prop 'hilit) t) (and prio (overlay-put overlay 'priority prio)))) (defun hilit-unhighlight-region (start end &optional quietly) "Unhighlights the region from START to END, optionally in a QUIET way" (interactive "r") (or quietly hilit-quietly (message "Unhighlighting")) (let ((lstart 0)) (while (and start (> start lstart) (< start end)) (mapcar (function (lambda (ovr) (and (overlay-get ovr 'hilit) (delete-overlay ovr)))) (overlays-at start)) (setq lstart start start (next-overlay-change start)))) (or quietly hilit-quietly (message "Done unhighlighting"))) ;;;; These functions use text properties instead of overlays. Text properties ;;;; are copied through kill and yank...which might be convenient, but is not ;;;; terribly efficient as of 19.12, ERGO it's been disabled ;; ;;(defsubst hilit-region-set-face (start end face-name &optional prio prop) ;; "Highlight region from START to END using FACE and, optionally, PRIO. ;;The optional 5th arg, PROP is a property to set instead of 'hilit." ;; (put-text-property start end 'face face-name) ;; ) ;; ;;(defun hilit-unhighlight-region (start end &optional quietly) ;; "Unhighlights the region from START to END, optionally in a QUIET way" ;; (interactive "r") ;; (let ((buffer-read-only nil) ;; (bm (buffer-modified-p))) ;; (remove-text-properties start end '(face)) ;; (set-buffer-modified-p bm))) ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Pattern Application code and user functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun hilit-highlight-region (start end &optional patterns quietly) "Highlights the area of the buffer between START and END (the region when interactive). Without the optional PATTERNS argument, the pattern for major-mode is used. If PATTERNS is a symbol, then the patterns associated with that symbol are used. QUIETLY suppresses progress messages if non-nil." (interactive "r") (cond ((null patterns) (setq patterns (cdr (assq major-mode hilit-patterns-alist)))) ((symbolp patterns) (setq patterns (cdr (assq patterns hilit-patterns-alist))))) ;; txt prop: (setq patterns (reverse patterns)) (let ((case-fold-search (car patterns)) (prio (1- (length patterns))) ;; txt prop: (buffer-read-only nil) ;; txt prop: (bm (buffer-modified-p)) p pstart pend face mstart (puke-count 0)) ;; txt prop: (unwind-protect (setq patterns (cdr patterns)) ; remove case-fold from head of pattern (save-excursion (save-restriction (narrow-to-region start end) (while patterns (setq p (car patterns)) (setq pstart (car p) pend (nth 1 p) face (hilit-lookup-face-create (nth 2 p))) (if (not face) ; skipped if nil nil (or quietly hilit-quietly (message "highlighting %d: %s%s" prio pstart (if (stringp pend) (concat " ... " pend) ""))) (goto-char (point-min)) (condition-case msg (cond ((symbolp pstart) ;; inner loop -- special function to find pattern (let (region) (while (setq region (funcall pstart pend)) (hilit-region-set-face (car region) (cdr region) face prio)))) ((stringp pend) ;; inner loop -- regex-start ... regex-end (while (re-search-forward pstart nil t nil) (goto-char (setq mstart (match-beginning 0))) (if (re-search-forward pend nil t nil) (hilit-region-set-face mstart (match-end 0) face prio) (forward-char 1)))) ((numberp pend) ;; inner loop -- just one regex to match whole pattern (while (re-search-forward pstart nil t nil) (goto-char (match-end pend)) (hilit-region-set-face (match-beginning pend) (match-end pend) face prio))) (t (error "malformed pattern"))) (error (if (> (setq puke-count (1+ puke-count)) 1) (error msg) (message "Error: '%s'" msg) (ding) (sit-for 4))))) (setq prio (1- prio) patterns (cdr patterns))) )) (or quietly hilit-quietly (message "")) ; "Done highlighting" ;; txt prop: (set-buffer-modified-p bm)) ; unwind protection )) (defun hilit-rehighlight-region (start end &optional quietly) "Re-highlights the region, optionally in a QUIET way" (interactive "r") (save-restriction (widen) (setq start (apply 'min start (mapcar 'overlay-start (overlays-at start))) end (apply 'max end (mapcar 'overlay-end (overlays-at end)))) (hilit-unhighlight-region start end quietly) (hilit-highlight-region start end nil quietly))) (defun hilit-rehighlight-buffer (&optional quietly) "Re-highlights the buffer, optionally in a QUIET way" (interactive "") (let ((parse-fn (cdr (assq major-mode hilit-parser-alist)))) (if parse-fn (funcall parse-fn quietly) (hilit-rehighlight-region (point-min) (point-max) quietly))) nil) (defun hilit-rehighlight-buffer-quietly () (hilit-rehighlight-buffer t)) (defun hilit-rehighlight-message (quietly) "Highlight a buffer containing a news article or mail message." (save-excursion (goto-char (point-min)) (re-search-forward "^$" nil 'noerr) (hilit-unhighlight-region (point-min) (point-max) quietly) (hilit-highlight-region (point-min) (point) 'msg-header quietly) (hilit-highlight-region (point) (point-max) 'msg-body quietly))) (defalias 'hilit-highlight-buffer 'hilit-rehighlight-buffer) ;; Well, I want to remove this function...there's one sure way to find out if ;; anyone uses it or not...and that's to comment it out. ;; ;; (defun hilit-toggle-highlight (arg) ;; "Locally toggle highlighting. With arg, forces highlighting off." ;; (interactive "P") ;; ;; FIXME -- this loses numeric information in hilit-auto-rehighlight ;; (setq hilit-auto-rehighlight ;; (and (not arg) (not hilit-auto-rehighlight))) ;; (if hilit-auto-rehighlight ;; (hilit-rehighlight-buffer) ;; (hilit-unhighlight-region (point-min) (point-max))) ;; (message "Rehighlighting is set to %s" hilit-auto-rehighlight)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; HOOKS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun hilit-find-file-hook () "Find-file hook for hilit package. See the variable hilit-auto-highlight." (cond ((and hilit-auto-highlight (assq major-mode hilit-patterns-alist)) (if (> buffer-saved-size (car hilit-auto-rehighlight-fallback)) (setq hilit-auto-rehighlight (cdr hilit-auto-rehighlight-fallback))) (if (> buffer-saved-size hilit-auto-highlight-maxout) nil (hilit-rehighlight-buffer) (set-buffer-modified-p nil))))) (defun hilit-repaint-command (arg) "Rehighlights according to the value of hilit-auto-rehighlight, or the prefix argument if that is specified. \t\\[hilit-repaint-command]\t\trepaint according to hilit-auto-rehighlight \t^U \\[hilit-repaint-command]\trepaint entire buffer \t^U - \\[hilit-repaint-command]\trepaint visible portion of buffer \t^U n \\[hilit-repaint-command]\trepaint n lines to either side of point" (interactive "P") (let (st en quietly) (or arg (setq arg hilit-auto-rehighlight)) (cond ((or (eq arg 'visible) (eq arg '-)) (setq st (window-start) en (window-end) quietly t)) ((numberp arg) (setq st (save-excursion (forward-line (- arg)) (point)) en (save-excursion (forward-line arg) (point)))) (arg (hilit-rehighlight-buffer))) (if st (hilit-rehighlight-region st en quietly)))) (defun hilit-recenter (arg) "Recenter, then rehighlight according to hilit-auto-rehighlight. If called with an unspecified prefix argument (^U but no number), then a rehighlight of the entire buffer is forced." (interactive "P") (recenter arg) ;; force display update (sit-for 0) (hilit-repaint-command (consp arg))) (defun hilit-yank (arg) "Yank with rehighlighting" (interactive "*P") (let ((transient-mark-mode nil)) (yank arg) (and hilit-auto-rehighlight (hilit-rehighlight-region (region-beginning) (region-end) t)) (setq this-command 'yank))) (defun hilit-yank-pop (arg) "Yank-pop with rehighlighting" (interactive "*p") (let ((transient-mark-mode nil)) (yank-pop arg) (and hilit-auto-rehighlight (hilit-rehighlight-region (region-beginning) (region-end) t)) (setq this-command 'yank))) ;;; this line highlighting stuff is untested. play with it only if you feel ;;; adventurous...don't ask me to fix it...though you're welcome to. -- Stig ;; ;; (defun hilit-rehighlight-line-quietly (&rest args) ;; "Quietly rehighlight just this line. ;; Useful as an after change hook in VM/gnus summary buffers and dired buffers. ;; If only there were an after-change-function, that is..." ;; (save-excursion ;; (push-mark nil t) ;; (hilit-rehighlight-yank-region) ;; (and orig-achange-function (apply orig-achange-function args)))) ;; ;; (defun hilit-install-line-hooks () ;; (make-variable-buffer-local 'after-change-function) ;; (make-local-variable 'orig-achange-function) ;; (setq orig-achange-function after-change-function) ;; (setq after-change-function 'hilit-rehighlight-line-quietly)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Wysiwyg Stuff... take it away and build a whole package around it! ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; ; For the Jargon-impaired, WYSIWYG === What You See Is What You Get ;; ; Sure, it sucks to type. Oh, well. ;; (defun hilit-wysiwyg-replace () ;; "Replace overstruck text with normal text that's been overlayed with the ;; appropriate text attribute. Suitable for a find-file hook." ;; (save-excursion ;; (goto-char (point-min)) ;; (let ((wysb (hilit-lookup-face-create 'wysiwyg-bold)) ;; (wysu (hilit-lookup-face-create 'wysiwyg-underline)) ;; (bmod (buffer-modified-p))) ;; (while (re-search-forward "\\(.\b.\\)+" nil t) ;; (let ((st (match-beginning 0)) (en (match-end 0))) ;; (goto-char st) ;; (if (looking-at "_") ;; (hilit-region-set-face st en wysu 100 'wysiwyg) ;; (hilit-region-set-face st en wysb 100 'wysiwyg)) ;; (while (and (< (point) en) (looking-at ".\b")) ;; (replace-match "") (forward-char)) ;; )) ;; (set-buffer-modified-p bmod)))) ;; ;; ; is this more appropriate as a write-file-hook or a write-contents-hook? ;; (defun hilit-wysiwyg-write-repair () ;; "Replace wysiwyg overlays with overstrike text." ;; (message "*sigh* hilit-wysiwyg-write-repair not implemented yet") ;; ;; For efficiency, this hook should copy the current buffer to a scratch ;; buffer and do it's overstriking there. Overlays are not copied, so it'll ;; be necessary to hop back and forth. This is OK since you're not fiddling ;; with--making or deleting--any overlays. THEN write the new buffer, ;; delete it, and RETURN T. << important ;; ;; Just so you know...there is already an emacs function called ;; underline-region that does underlining. I think that the thing to do is ;; extend that to do overstriking as well. ;; ;; (while (< start end) ;; (mapcar (function (lambda (ovr) ;; (and (overlay-get ovr 'hilit) (delete-overlay ovr)))) ;; (overlays-at start)) ;; (setq start (next-overlay-change start))) ;; nil) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Initialization. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (and (not hilit-inhibit-rebinding) window-system (progn (substitute-key-definition 'yank 'hilit-yank (current-global-map)) (substitute-key-definition 'yank-pop 'hilit-yank-pop (current-global-map)) (substitute-key-definition 'recenter 'hilit-recenter (current-global-map)))) (global-set-key [?\C-\S-l] 'hilit-repaint-command) (and window-system (add-hook 'find-file-hooks 'hilit-find-file-hook t)) (eval-when-compile (require 'gnus)) ; no compilation gripes (and (not hilit-inhibit-hooks) window-system (condition-case c (progn ;; BUFFER highlights... (mapcar (function (lambda (hook) (add-hook hook 'hilit-rehighlight-buffer-quietly))) '( Info-selection-hook ;; runs too early vm-summary-mode-hooks vm-summary-pointer-hook vm-preview-message-hook vm-show-message-hook gnus-article-prepare-hook gnus-summary-prepare-hook gnus-group-prepare-hook rmail-show-message-hook mail-setup-hook mh-show-mode-hook dired-after-readin-hook )) ;; rehighlight only visible part of summary buffer for speed. (add-hook 'gnus-mark-article-hook (function (lambda () (or (memq gnus-current-article gnus-newsgroup-marked) (gnus-summary-mark-as-read gnus-current-article)) (gnus-summary-set-current-mark) (save-excursion (set-buffer gnus-summary-buffer) (hilit-rehighlight-region (window-start) (window-end) t) )))) ;; only need prepare article hook ;; ;; (add-hook 'gnus-select-article-hook ;; '(lambda () (save-excursion ;; (set-buffer gnus-article-buffer) ;; (hilit-rehighlight-buffer)))) ) (error (message "Error loading highlight hooks: %s" c) (ding) (sit-for 1)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Default patterns for various modes. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; do I need this? I changed the defconst to a defvar because defconst is ;;; inappropriate, but I don't know why I wanted hilit-patterns-alist to be ;;; reset on every reload... (setq hilit-patterns-alist nil) (defun hilit-associate (alist key val) "creates, or destructively replaces, the pair (key . val) in alist" (let ((oldentry (assq key (eval alist)))) (if oldentry (setcdr oldentry val) (set alist (cons (cons key val) (eval alist)))))) (defun hilit-set-mode-patterns (modelist patterns &optional parse-fn case-fold) "Sets the default highlighting patterns for MODE to PATTERNS. See the variable hilit-mode-enable-list. Takes optional arguments PARSE-FN and CASE-FOLD." ;; change pattern (mapcar (function (lambda (p) (and (stringp (car p)) (null (nth 1 p)) (setcar (cdr p) 0)))) patterns) (setq patterns (cons case-fold patterns)) (or (consp modelist) (setq modelist (list modelist))) (let (ok (flip (eq (car hilit-mode-enable-list) 'not))) (mapcar (function (lambda (m) (setq ok (or (null hilit-mode-enable-list) (memq m hilit-mode-enable-list))) (and flip (setq ok (not ok))) (and ok (progn (and parse-fn (hilit-associate 'hilit-parser-alist m parse-fn)) (hilit-associate 'hilit-patterns-alist m patterns))))) modelist))) (defun hilit-add-pattern (pstart pend face &optional mode first) "Highlight pstart with face for the current major-mode. Optionally, place the new pattern first in the pattern list" (interactive "sPattern start regex: \nsPattern end regex (default none): \nxFace: ") (and (equal pstart "") (error "Must specify starting regex")) (cond ((equal pend "") (setq pend 0)) ((string-match "^[0-9]+$" pend) (setq pend (string-to-int pend)))) (or mode (setq mode major-mode)) (let ((old-patterns (cdr (assq mode hilit-patterns-alist))) (new-pat (list pstart pend face))) (cond ((not old-patterns) (hilit-set-mode-patterns mode (list new-pat))) (first (setcdr old-patterns (cons new-pat (cdr old-patterns)))) (t (nconc old-patterns (list new-pat))))) (and (interactive-p) (hilit-rehighlight-buffer))) (defun hilit-string-find (qchar) "looks for a string and returns (start . end) or NIL. The argument QCHAR is the character that would precede a character constant double quote. Finds strings delimited by double quotes. The first double quote may not be preceded by QCHAR and the closing double quote may not be preceded by an odd number of backslashes." (let (st en) (while (and (search-forward "\"" nil t) (eq qchar (char-after (1- (setq st (match-beginning 0))))))) (while (and (search-forward "\"" nil t) (save-excursion (setq en (point)) (forward-char -1) (skip-chars-backward "\\\\") (forward-char 1) (not (zerop (% (- en (point)) 2)))))) (and en (cons st en)))) ;; return types on same line... ;; ("^[a-zA-z].*\\(\\w\\|[$_]\\)+\\s *\\(\\(\\w\\|[$_]\\)+\\s *((\\|(\\)[^)]*)+" nil defun) ;; On another note, a working pattern for grabbing function definitions for C is ;; ;; ("^[a-zA-Z_]+.*[;{]$" nil ForestGreen) ; global defns ( start at col 1 ) ;; ("^[a-zA-Z_]+.*(" ")" defun) ;; ; defuns assumed to start at col 1, not with # or { ;; ;; this will make external declarations/definitions green, and function ;; definitions the defun face. Hmmm - seems to work for me anyway. (let ((comments '(("/\\*" "\\*/" comment))) (c++-comments '(("//.*$" nil comment) ("^/.*$" nil comment))) (strings '((hilit-string-find ?' string))) (preprocessor '(("^#[ \t]*\\(undef\\|define\\).*$" "[^\\]$" define) ("^#.*$" nil include)))) (hilit-set-mode-patterns '(c-mode c++-c-mode elec-c-mode) (append comments strings preprocessor '( ;; function decls are expected to have types on the previous line ("^\\(\\w\\|[$_]\\)+\\s *\\(\\(\\w\\|[$_]\\)+\\s *((\\|(\\)[^)]*)+" nil defun) ("^\\(typedef\\|struct\\|union\\|enum\\).*$" nil decl) ;; datatype -- black magic regular expression ("[ \n\t({]\\(\\(const\\|register\\|volatile\\|unsigned\\|extern\\|static\\)\\s +\\)*\\(\\(\\w\\|[$_]\\)+_t\\|float\\|double\\|void\\|char\\|short\\|int\\|long\\|FILE\\|\\(\\(struct\\|union\\|enum\\)\\([ \t]+\\(\\w\\|[$_]\\)*\\)\\)\\)\\(\\s +\\*+)?\\|[ \n\t;()]\\)" nil type) ;; key words ("[^_]\\<\\(return\\|goto\\|if\\|else\\|case\\|default\\|switch\\|break\\|continue\\|while\\|do\\|for\\)\\>[^_]" 1 keyword) ))) (hilit-set-mode-patterns 'c++-mode (append comments c++-comments strings preprocessor '( ;; function decls are expected to have types on the previous line ("^\\(\\(\\w\\|[$_]\\)+::\\)?\\(\\w\\|[$_]\\)+\\s *\\(\\(\\w\\|[$_]\\)+\\s *((\\|(\\)[^)]*)+" nil defun) ("^\\(\\(\\w\\|[$_]\\)+[ \t]*::[ \t]*\\)?\\(\\(\\w\\|[$_]\\)+\\|operator.*\\)\\s *\\(\\(\\w\\|[$_]\\)+\\s *((\\|(\\)[^)]*)+" nil defun) ("^\\(template\\|typedef\\|struct\\|union\\|class\\|enum\\|public\\|private\\|protected\\).*$" nil decl) ;; datatype -- black magic regular expression ("[ \n\t({]\\(\\(const\\|register\\|volatile\\|unsigned\\|extern\\|static\\)\\s +\\)*\\(\\(\\w\\|[$_]\\)+_t\\|float\\|double\\|void\\|char\\|short\\|int\\|long\\|FILE\\|\\(\\(struct\\|union\\|enum\\|class\\)\\([ \t]+\\(\\w\\|[$_]\\)*\\)\\)\\)\\(\\s +\\*+)?\\|[ \n\t;()]\\)" nil type) ;; key words ("[^_]\\<\\(return\\|goto\\|if\\|else\\|case\\|default\\|switch\\|break\\|continue\\|while\\|do\\|for\\|public\\|protected\\|private\\|delete\\|new\\)\\>[^_]" 1 keyword))))) (hilit-set-mode-patterns 'perl-mode '(("\\s #.*$" nil comment) ("^#.*$" nil comment) ("\"[^\\\"]*\\(\\\\\\(.\\|\n\\)[^\\\"]*\\)*\"" nil string) ("^\\(__....?__\\|\\s *\\sw+:\\)" nil label) ("^require.*$" nil include) ("^package.*$" nil decl) ("^\\s *sub\\s +\\(\\w\\|[_']\\)+" nil defun) ("\\b\\(do\\|if\\|unless\\|while\\|until\\|else\\|elsif\\|for\\|foreach\\|continue\\|next\\|redo\\|last\\|goto\\|return\\|die\\|exit\\)\\b" nil keyword))) (hilit-set-mode-patterns 'ada-mode '(;; comments ("--.*$" nil comment) ;; main structure ("[ \t\n]procedure[ \t]" "\\([ \t]\\(is\\|renames\\)\\|);\\)" glob-struct) ("[ \t\n]task[ \t]" "[ \t]is" glob-struct) ("[ \t\n]function[ \t]" "return[ \t]+[A-Za-z_0-9]+[ \t]*\\(is\\|;\\|renames\\)" glob-struct) ("[ \t\n]package[ \t]" "[ \t]\\(is\\|renames\\)" glob-struct) ;; if there is nothing before "private", it is part of the structure ("^[ \t]*private[ \t\n]" nil glob-struct) ;; if there is no indentation before the "end", then it is most ;; probably the end of the package ("^end.*$" ";" glob-struct) ;; program structure -- "null", "delay" and "terminate" omitted ("[ \n\t]\\(in\\|out\\|select\\|if\\|else\\|case\\|when\\|and\\|or\\|not\\|accept\\|loop\\|do\\|then\\|elsif\\|else\\|for\\|while\\|exit\\)[ \n\t;]" nil struct) ;; block structure ("[ \n\t]\\(begin\\|end\\|declare\\|exception\\|generic\\|raise\\|return\\|package\\|body\\)[ \n\t;]" nil struct) ;; type declaration ("^[ \t]*\\(type\\|subtype\\).*$" ";" decl) ("[ \t]+is record.*$" "end record;" decl) ;; "pragma", "with", and "use" are close to C cpp directives ("^[ \t]*\\(with\\|pragma\\|use\\)" ";" include) ;; nice for named parameters, but not so beautiful in case statements ("[A-Za-z_0-9.]+[ \t]*=>" nil named-param) ;; string constants probably not everybody likes this one ("\"" ".*\"" string))) (hilit-set-mode-patterns 'fortran-mode '(("^[*Cc].*$" nil comment) ("'[^'\n]*'" nil string) ("\\(^[ \t]*[0-9]+\\|[ \t]continue[ \t\n]\\|format\\)" nil define) ("[ \t]\\(do\\|do[ \t]*[0-9]+\\|go[ \t]*to[ \t]*[0-9]+\\|end[ \t]*do\\|if\\|else[ \t]*if\\|then\\|else\\|end[ \t]*if\\)[ \t\n(]" nil define) ("[ \t]\\(call\\|program\\|subroutine\\|function\\|stop\\|return\\|end\\|include\\)[ \t\n]" nil include) ("[ \t]\\(parameter[\t\n ]*([^)]*)\\|data\\|save\\|common[ \t\n]*/[^/]*/\\)" nil decl) ("^ ." nil type) ("implicit[ \t]*none" nil decl) ("\\([ \t]\\|implicit[ \t]*\\)\\(dimension\\|integer\\|real\\|double[ \t]*precision\\|character\\|logical\\|complex\\|double[ \t]*complex\\)\\([*][0-9]*\\|[ \t\n]\\)" nil keyword) ) nil 'case-insensitive) (hilit-set-mode-patterns '(m2-mode modula-2-mode) '(("(\\*" "\\*)" comment) (hilit-string-find ?\\ string) ("^[ \t]*PROCEDURE[ \t]+\\w+[^ \t(;]*" nil defun) ("\\<\\(RECORD\\|ARRAY\\|OF\\|POINTER\\|TO\\|BEGIN\\|END\\|FOR\\|IF\\|THEN\\|ELSE\\|ELSIF\\|CASE\\|WHILE\\|DO\\|MODULE\\|FROM\\|RETURN\\|IMPORT\\|EXPORT\\|VAR\\|LOOP\\|UNTIL\\|\\DEFINITION\\|IMPLEMENTATION\\|AND\\|OR\\|NOT\\|CONST\\|TYPE\\|QUALIFIED\\)\\>" nil keyword) ) nil 'case-insensitive) (hilit-set-mode-patterns 'prolog-mode '(("/\\*" "\\*/" comment) ("%.*$" nil comment) (":-" nil defun) ("!" nil label) ("\"[^\\\"]*\\(\\\\\\(.\\|\n\\)[^\\\"]*\\)*\"" nil string) ("\\b\\(is\\|mod\\)\\b" nil keyword) ("\\(->\\|-->\\|;\\|==\\|\\\\==\\|=<\\|>=\\|<\\|>\\|=\\|\\\\=\\|=:=\\|=\\\.\\\.\\|\\\\\\\+\\)" nil decl) ("\\(\\\[\\||\\|\\\]\\)" nil include))) (hilit-set-mode-patterns '( LaTeX-mode japanese-LaTeX-mode SliTeX-mode japanese-SliTeX-mode FoilTeX-mode latex-mode ) '( ;; comments ("[^\\]%.*$" nil comment) ;; the following two match \foo[xx]{xx} or \foo*{xx} or \foo{xx} ("\\\\\\(sub\\)*\\(paragraph\\|section\\)\\(\*\\|\\[.*\\]\\)?{" "}" keyword) ("\\\\\\(chapter\\|part\\)\\(\*\\|\\[.*\\]\\)?{" "}" keyword) ("\\\\footnote\\(mark\\|text\\)?{" "}" keyword) ("\\\\[a-z]+box" nil keyword) ("\\\\\\(v\\|h\\)space\\(\*\\)?{" "}" keyword) ;; (re-)define new commands/environments/counters ("\\\\\\(re\\)?new\\(environment\\|command\\){" "}" defun) ("\\\\new\\(length\\|theorem\\|counter\\){" "}" defun) ;; various declarations/definitions ("\\\\\\(setlength\\|settowidth\\|addtolength\\|setcounter\\|addtocounter\\)" nil define) ("\\\\\\(title\\|author\\|date\\|thanks\\){" "}" define) ("\\\\documentstyle\\(\\[.*\\]\\)?{" "}" decl) ("\\\\\\(begin\\|end\\|nofiles\\|includeonly\\){" "}" decl) ("\\\\\\(raggedright\\|makeindex\\|makeglossary\\|maketitle\\)\\b" nil decl) ("\\\\\\(pagestyle\\|thispagestyle\\|pagenumbering\\){" "}" decl) ("\\\\\\(normalsize\\|small\\|footnotesize\\|scriptsize\\|tiny\\|large\\|Large\\|LARGE\\|huge\\|Huge\\)\\b" nil decl) ("\\\\\\(appendix\\|tableofcontents\\|listoffigures\\|listoftables\\)\\b" nil decl) ("\\\\\\(bf\\|em\\|it\\|rm\\|sf\\|sl\\|ss\\|tt\\)\\b" nil decl) ;; label-like things ("\\\\item\\(\\[[^]]*\\]\\)?" nil label) ("\\\\caption\\(\\[[^]]*\\]\\)?{" "}" label) ;; formulas ("\\\\(" "\\\\)" formula) ; \( \) ("\\\\\\[" "\\\\\\]" formula) ; \[ \] ("[^$]\\($\\($[^$]*\\$\\|[^$]*\\)\\$\\)" 1 formula) ; '$...$' or '$$...$$' ;; things that bring in external files ("\\\\\\(include\\|input\\|bibliography\\){" "}" include) ;; "wysiwyg" emphasis -- these don't work with nested expressions ;; ("{\\\\\\(em\\|it\\|sl\\)" "}" italic) ;; ("{\\\\bf" "}" bold) ("``" "''" string) ;; things that do some sort of cross-reference ("\\\\\\(\\(no\\)?cite\\|\\(page\\)?ref\\|label\\|index\\|glossary\\){" "}" crossref) )) (hilit-set-mode-patterns 'bibtex-mode '(;;(";.*$" nil comment) ("%.*$" nil comment) ("@[a-zA-Z]+" nil keyword) ("{[ \t]*[-a-z:_A-Z0-9]+," nil label) ; is wrong sometimes ("^[ \t]*[a-zA-Z]+[ \t]*=" nil define))) (hilit-set-mode-patterns 'compilation-mode '( ("^[-_.\"A-Za-z0-9]+\\(:\\|, line \\)[0-9]+: warning:.*$" nil warning) ("^[-_.\"A-Za-z0-9]+\\(:\\|, line \\)[0-9]+:.*$" nil error) )) (hilit-set-mode-patterns 'makefile-mode '(("^#.*$" nil comment) ("[^$]#.*$" nil comment) ;; rules ("^[^ \t\n]*%[^ \t\n]*[ \t]*::?[ \t]*[^ \t\n]*[ \t]*\\(#.*\\)?$" nil rule) ("^[.][A-Za-z][A-Za-z]?\..*$" nil rule) ;; variable definition ("^[_A-Za-z0-9]+[ \t]*\+?=" nil define) ("\\( \\|:=\\)[_A-Za-z0-9]+[ \t]*\\+=" nil define) ;; variable references ("\\$\\([^ \t\n{(]\\|[{(]@?[_A-Za-z0-9:.,%/=]+[)}]\\)" nil keyword) ("^[A-Za-z0-9.,/_-]+[ \t]*:.*$" nil defun) ("^include " nil include))) (let* ((header-patterns '(("^Subject:.*$" nil msg-subject) ("^From:.*$" nil msg-from) ("^--text follows this line--$" nil msg-separator) ("^[A-Za-z][A-Za-z0-9-]+:" nil msg-header))) (body-patterns '(("^\\(In article\\|[ \t]*\\w*[]<>}|]\\).*$" nil msg-quote))) (message-patterns (append header-patterns body-patterns))) (hilit-set-mode-patterns 'msg-header header-patterns) (hilit-set-mode-patterns 'msg-body body-patterns) (hilit-set-mode-patterns '(vm-mode text-mode mail-mode rmail-mode gnus-article-mode news-reply-mode mh-show-mode) message-patterns 'hilit-rehighlight-message)) (hilit-set-mode-patterns 'gnus-group-mode '(("^U.*$" nil gnus-group-unsubscribed) ("^ +[01]?[0-9]:.*$" nil gnus-group-empty) ("^ +[2-9][0-9]:.*$" nil gnus-group-full) ("^ +[0-9][0-9][0-9]+:.*$" nil gnus-group-overflowing))) (hilit-set-mode-patterns 'gnus-summary-mode '(("^D +[0-9]+: \\[.*$" nil summary-seen) ("^K +[0-9]+: \\[.*$" nil summary-killed) ("^X +[0-9]+: \\[.*$" nil summary-Xed) ("^- +[0-9]+: \\[.*$" nil summary-unread) ("^. +[0-9]+:\\+\\[.*$" nil summary-current) ("^ +[0-9]+: \\[.*$" nil summary-new) )) (hilit-set-mode-patterns 'vm-summary-mode '(("^ .*$" nil summary-seen) ("^->.*$" nil summary-current) ("^ D.*$" nil summary-deleted) ("^ U.*$" nil summary-unread) ("^ N.*$" nil summary-new))) ;;; this will match only comments w/ an even (zero is even) number of quotes... ;;; which is still inadequate because it matches comments in multi-line strings ;;; how anal do you want to get about never highlighting comments in strings? ;;; I could twiddle with this forever and still it wouldn't be perfect. ;;; (";\\([^\"\n]*\"[^\"\n]*\"\\)*[^\"\n]*$" nil comment) (hilit-set-mode-patterns '(emacs-lisp-mode lisp-interaction-mode) '( (";.*" nil comment) ;;; This almost works...but I think I'll stick with the parser function ;;;("[^?]\\(\"\\(\"\\||\\([^\"]+\\|[\\]\\([\\][\\]\\)*\"\\)*\"\\)\\)" 1 string) (hilit-string-find ?\\ string) ("^\\s *(def\\(un\\|macro\\|advice\\|alias\\|subst\\)[ \t\n]" "\\()\\|nil\\)" defun) ("^\\s *(defvar\\s +\\S +" nil decl) ("^\\s *(defconst\\s +\\S +" nil define) ("^\\s *(\\(provide\\|require\\|\\(auto\\)?load\\).*$" nil include) ("\\s *\\&\\(rest\\|optional\\)\\s *" nil keyword) ("(\\(let\\*?\\|cond\\|if\\|or\\|and\\|map\\(car\\|concat\\)\\|prog[n1*]?\\|while\\|lambda\\|function\\|set\\([qf]\\|car\\|cdr\\)?\\|nconc\\|eval-when-compile\\|condition-case\\|unwind-protect\\|catch\\|throw\\|error\\)[ \t\n]" 1 keyword) )) (hilit-set-mode-patterns '(lisp-mode ilisp-mode) '( (";.*" nil comment) ("#|" "|#" comment) ;;; This almost works...but I think I'll stick with the parser function ;;;("[^?]\\(\"\\(\"\\||\\([^\"]+\\|[\\]\\([\\][\\]\\)*\"\\)*\"\\)\\)" 1 string) (hilit-string-find ?\\ string) ;; this is waaaaaaaay too slow ;; ("^\\s *(def\\(un\\|macro\\|advice\\|alias\\|method\\|subst\\)\\s \\S +[ \t\n]+\\(nil\\|(\\(([^()]*)\\|[^()]+\\)*)\\)" nil defun) ("^\\s *(def\\(un\\|macro\\|advice\\|subst\\|method\\)\\s " "\\()\\|nil\\)" defun) ("^\\s *(\\(def\\(var\\|type\\|parameter\\)\\|declare\\)\\s +\\S +" nil decl) ("^\\s *(def\\(const\\(ant\\)?\\|class\\|struct\\)\\s \\S +[ \t\n]+\\((\\(([^()]*)\\|[^()]+\\)*)\\)?" nil define) ("^\\s *(\\(provide\\|require\\|\\(auto\\)?load\\).*$" nil include) ("[ \t]\\&\\(key\\|rest\\|optional\\|aux\\)\\s *" nil keyword) ("(\\(let\\*?\\|locally\\|cond\\|if\\*?\\|or\\|and\\|map\\(car\\|c[ao]n\\)?\\|prog[nv1*]?\\|while\\|when\\|unless\\|do\\(\\*\\|list\\|times\\)\\|lambda\\|function\\|values\\|set\\([qf]\\|car\\|cdr\\)?\\|rplac[ad]\\|nconc\\|block\\|go\\|return\\(-from\\)?\\|[ec]?\\(type\\)?case\\|multiple-value-\\(bind\\|setq\\|list\\|call\\|prog1\\)\\|unwind-protect\\|handler-case\\|catch\\|throw\\|eval-when\\(-compile\\)?\\)[ \t\n]" 1 keyword) )) (hilit-set-mode-patterns 'plain-tex-mode '(("^%%.*$" nil comment) ("{\\\\em\\([^}]+\\)}" nil comment) ("\\(\\\\\\w+\\)" nil keyword) ("{\\\\bf\\([^}]+\\)}" nil keyword) ("^[ \t\n]*\\\\def[\\\\@]\\(\\w+\\)" nil defun) ("\\\\\\(begin\\|end\\){\\([A-Za-z0-9\\*]+\\)}" nil defun) ;; ("[^\\\\]\\$\\([^$]*\\)\\$" nil string) ("\\$\\([^$]*\\)\\$" nil string) )) ;; Reasonable extensions would include smarter parameter handling for such ;; things as the .IX and .I macros, which alternate the handling of following ;; arguments. (hilit-set-mode-patterns 'nroff-mode '(("^\\.[\\\][\\\"].*$" nil comment) ("^\\.so .*$" nil include) ("^\\.[ST]H.*$" nil defun) ;; ("^[^\\.].*\"[^\\\"]*\\(\\\\\\(.\\)[^\\\"]*\\)*\"" nil string) ("\"" "[^\\]\"" string) ("^\\.[A-Z12\\\\].*$" nil define) ("\\([\\\][^ ]*\\)" nil keyword) ("^\\.[A-Z].*$" nil keyword)) nil 'case-insensitive) (hilit-set-mode-patterns 'texinfo-mode '(("^\\(@c\\|@comment\\)\\>.*$" nil comment) ("@\\(emph\\|strong\\|b\\|i\\){[^}]+}" nil comment) ;; seems broken ;; ("\\$[^$]*\\$" nil string) ("@\\(file\\|kbd\\|key\\){[^}]+}" nil string) ("^\\*.*$" nil defun) ("@\\(if\\w+\\|format\\|item\\)\\b.*$" nil defun) ("@end +[A-Za-z0-9]+[ \t]*$" nil defun) ("@\\(samp\\|code\\|var\\){[^}]+}" nil defun) ("@\\w+\\({[^}]+}\\)?" nil keyword) )) (hilit-set-mode-patterns 'dired-mode (append '(("^D.*$" nil dired-deleted) ("^\\*.*$" nil dired-marked) ("^ d.*$" nil dired-directory) ("^ l.*$" nil dired-link) ("^ -.*#.*#$" nil dired-ignored)) (list (cons (concat "^ .*\\(" (mapconcat 'regexp-quote completion-ignored-extensions "\\|") "\\)$") '(nil dired-ignored))))) (hilit-set-mode-patterns 'jargon-mode '(("^:[^:]*:" nil jargon-entry) ("{[^}]*}+" nil jargon-xref))) (hilit-set-mode-patterns 'Info-mode '(("^\\* [^:]+:+" nil jargon-entry) ("\\*[Nn]ote\\b[^:]+:+" nil jargon-xref) (" \\(Next\\|Prev\\|Up\\):" nil jargon-xref) ("- \\(Variable\\|Function\\|Macro\\|Command\\|Special Form\\|User Option\\):.*$" nil jargon-keyword))) ; lisp manual (hilit-set-mode-patterns 'calendar-mode '(("[A-Z][a-z]+ [0-9]+" nil define) ; month and year ("S M Tu W Th F S" nil label) ; week days ("[0-9]+\\*" nil defun) ; holidays ("[0-9]+\\+" nil comment) ; diary days )) (hilit-set-mode-patterns 'pascal-mode '(("(\\*" "\\*)" comment) ("{" "}" comment) ;; Doesn't work when there are strings in comments.... ;; ("'[^']*'" nil string) ("^#.*$" nil include) ("^[ \t]*\\(procedure\\|function\\)[ \t]+\\w+[^ \t(;]*" nil defun) ("\\<\\(program\\|begin\\|end\\)\\>" nil defun) ("\\<\\(external\\|forward\\)\\>" nil include) ("\\<\\(label\\|const\\|type\\|var\\)\\>" nil define) ("\\<\\(record\\|array\\|file\\)\\>" nil type) ("\\<\\(of\\|to\\|for\\|if\\|then\\|else\\|case\\|while\\|do\\|until\\|and\\|or\\|not\\|with\\|repeat\\)\\>" nil keyword) ) nil 'case-insensitive) (hilit-set-mode-patterns 'icon-mode '(("#.*$" nil comment) ("\"\\([^\\\"]*\\(\\\\.[^\\\"]*\\)*_\n[ \t\n]*\\)*[^\\\"]*\\(\\\\.[^\\\"]*\\)*\"" nil string) ;; charsets: these do not work because of a conflict with strings ;;("'[^\\']*\\(\\\\.[^\\']*\\)*'" nil charset) ("^[ \t]*procedure[ \t]+[A-Za-z_0-9]+[ \t]*(" ")" defun) ("^[ \t]*record.*(" ")" include) ("^[ \t]*\\(\\$include.*$\\|\\(global\\|link\\|invocable\\)[ \t\n]+[A-Za-z_0-9]+\\([ \t\n]*,[ \t\n]*[A-Za-z_0-9]+\\)*\\)" nil include) ("^[ \t]*\\(local\\|static\\)[ \t\n]+[A-Za-z_0-9]+\\([ \t\n]*,[ \t\n]*[A-Za-z_0-9]+\\)*" nil decl) ("\\<\\(initial\\|end\\)\\>" nil glob-struct) ("^\\$[ \t]*\\(undef\\|define\\).*$" "[^\\]$" define) ("\\<\\(while\\|until\\|return\\|every\\|if\\|then\\|else\\|to\\|case\\|of\\|suspend\\|create\\|do\\|repeat\\|break\\)\\>" nil keyword) )) ;; as you can see, I had two similar problems for Pascal and Icon. In ;; Pascal, strings are delimited with ' and an embedded quote is doubled, ;; thus string syntax would be extremely simple. However, if a string ;; occurs within a comment, the following text is considered a string. ;; ;; In Icon, strings are similar to C ones, but there are also charsets, ;; delimited with simple quotes. I could not manage to use both regexps at ;; the same time. ;; ;; The problem I have with my patterns for Icon is that this language ;; has a string similar constant to the C one (but a string can be cut ;; on several lines, if terminated by an underscore and continued with ;; initial blanks, like this: ;; "This is a somewhat long _ ;; string, written on three _ ;; succesive lines" ;; in order to insert a double quote in a string, you have to escape it ;; with a \), but also a character set constant (named a charset), which ;; uses single quotes instead of double ones. It would seem intuitive to ;; highlight both constants in the same way. (provide 'hilit19) ;;; hilit19 ends here. From icon-group-sender Thu Feb 2 22:36:49 1995 Received: by cheltenham.cs.arizona.edu; Thu, 2 Feb 1995 17:17:23 MST To: icon-group-l@cs.arizona.edu Date: 2 Feb 1995 22:36:49 GMT From: mdmcdo01@terra.spd.louisville.edu (Mark D. McDonald) Message-Id: <3grmq1$qn7@hermes.louisville.edu> Organization: University of Louisville, Louisville KY USA Sender: icon-group-request@cs.arizona.edu Subject: emacs and icon Errors-To: icon-group-errors@cs.arizona.edu Has anyone customized emacs to easily compile (interpret) an icon program (that is in the current buffer)? It is easy enough to redefine the compile-command variable to "icont", however, I would like something like icont file-buffer-name of course the variable (or symbol?) file-buffer-name would need to be evaluated before the command was passed to the operating system. Anybody willing to send me a clue? Incidentally, I use emacs and icon on a unix system *and* a dos system (at home). Thanks for any help. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ mark d. mcdonald | mdmcdo01@starbase.spd.louisville.edu ~ ~ speed scientific school | phone: (812) 738-7194 ~ ~ university of louisville | ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ GE/GMU d H s+:++ g++ p0 au--- a w+ v- c+++ UH+++ P---(Icon>+++) L E+ ~ ~ N++ W---------------- M V po+++ Y++ t++ tv- e+++ u+++(---) f-- n--- ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ mark d. mcdonald | mdmcdo01@starbase.spd.louisville.edu ~ ~ speed scientific school | phone: (812) 738-7194 ~ ~ university of louisville | ~ From icon-group-sender Sat Feb 4 17:23:24 1995 Received: by cheltenham.cs.arizona.edu; Sat, 4 Feb 1995 16:20:37 MST Date: Sat, 4 Feb 95 17:23:24 CST From: goer@mithra-orinst.uchicago.edu (Richard L. Goerwitz) Message-Id: <9502042323.AA08253@mithra-orinst.uchicago.edu> To: icon-group@cs.arizona.edu Subject: Icon in CGI scripts Errors-To: icon-group-errors@cs.arizona.edu Several people have asked about use of Icon in HTTP-style CGI scripts. It seems to me that Icon is a good way of decoding the results of form requests. The problem that Icon cannot handle UTF-8 and/or Unicode is not really a problem, in that even when HTML starts using these as possible charset types, ISO 8859-1 will still be universally accepted, and UTF-8 es- sentially subsumes it (or does it only subsume ASCII - I for- get). In any case, Icon will work well. So here's a sample script that can serve as a template. Please post additions and ex- pansions or corrections.... Richard Goerwitz ============================================================== procedure main(a) local i, cl, n, name_tbl cl := integer(getenv("CONTENT_LENGTH")) name_tbl := table() # # output a minimal header, terminated by two newlines # write("Content-type: text/html\x0A\x0A") # # check that the request is correctly formatted; output # error message if it's not # getenv("REQUEST_METHOD") == "POST" | { writes("

error: METHOD must = \"POST\"

") exit(1) } getenv("CONTENT_TYPE") == "application/x-www-form-urlencoded" | { writes("

error: this script is for decoding form results only

") exit(1) } # # enter name=value lines as key/value pairs in name_tbl # while line := makeline(&input, "&", cl) do { line := unescape_url(map(line), "+", " ") line ? { n := tab(find("=")) move(1) if not (/name_tbl[n] := tab(0)) then { writes("

error: duplicate field name, ", n, "

") exit(1) } } } # # Output results. # writes("

Query Results

\x0A") writes("

You submitted the following name/value pairs:

\x0A") writes("
    \x0A") every k := key(name_tbl) do writes("
  • ", name_tbl[k]," = ", name_tbl[k], "\x0A") writes("
\x0A") exit(0) end # # concatenate series' of non-ampersands into lines; stop # when you have read the number of characters in cl (arg # 3) # procedure makeline(f, stop_c, cl) local line, c static c_count initial c_count := 0 line := "" while c := reads(f) do { if (c_count +:= 1) > cl then break if c == stop_c then break line ||:= c } return "" ~== line end # # turn &xx (where xx are hex digits) into an integer; # output the character with that internal integer value # procedure unescape_url(url) local new_url new_url := "" url ? { while new_url ||:= tab(find("%")) & move(1) do new_url ||:= char(hex(move(2))) | tab(0) new_url ||:= tab(0) } return new_url end # # Bob Alexander's hex->integer code (overkill here) # procedure hex(s) local a,c a := 0 every c := !map(s) do a := ior(find(c,"0123456789abcdef") - 1, ishift(a,4)) | fail return a end # # procedure hexstring(i,n,lowercase) local s, hexchars, sign i := integer(i) | runerr(101, i) sign := "" if i = 0 then s := "0" else { if /n & i < 0 then { sign := "-" i := -i } hexchars := if \lowercase then "0123456789abcdef" else "0123456789ABCDEF" s := "" until i = (0 | -1) do { s := hexchars[iand(i,15) + 1] || s i := ishift(i,-4) } } if \n > *s then s := right(s,n,if i >= 0 then "0" else hexchars[16]) return sign || s end From icon-group-sender Sat Feb 4 14:10:41 1995 Received: by cheltenham.cs.arizona.edu; Sat, 4 Feb 1995 17:11:13 MST From: Phil Bralich To: icon-group@cs.arizona.edu Subject: More on NLP Content-Length: 5080 Message-Id: <95Feb4.141048hst.5994@uhunix2.uhcc.Hawaii.Edu> Date: Sat, 4 Feb 1995 14:10:41 -1000 Errors-To: icon-group-errors@cs.arizona.edu To the readers: I have recently sent out several email inquiries to various list services that I subscribe to in an attempt to learn why we do not see more software that can relate to the complexities of human grammar. That is, I was trying to learn why don't we see better grammar checkers, more translation software, and more sophisticated language tutoring software. If there were a theory of syntax that could be programmed at all wouldn't there also be a swarm of programs being offered by researchers and graduate students from around the world? Wouldn't we be arguing about the merits of "LFG-Linguist 3.1" vs "GB-Linguist 2.0." And wouldn't we be arguing about the merits of one theories labelled bracketing versus another's? Further, other areas that might use language interfaces such as games and program internal "help facilities" are also quite primitive. Granted, the difficulties of trying to get a program to account for pro- -blems of meaning have occupied programmers for years, but this in itself is not sufficient enough explanation for why we do not see more results in areas that require a program to exhibit a sophisticated understanding of the structure of human language. Which brings me to the point of this query. To improve my understanding of this problem and perhaps to generate some meaningful dialog about this problem, I would like to propose the following list of what we should minimally expect of a program or a theory of syntax that claims to be able to handle the structure of human language. I would like to invite readers to add to the list or to point out which areas have already been adequately handled. If an area is adequately handled, I would like information on how to receive the software that is available. I divide this list into three basic areas: 1) minimum requirements for linguists, 2) minimum requirements for grammar checkers, foreign language tutoring software, and other more secular uses of syntax, and 3) minimum requirements for translation technology. I. Minimum requirements for linguists. A program or a theory of syntax that is to be programmed must minimally be able to: 1) provide a full labelled bracketing of any string (including information about intermediate and maximal level nodes). 2) provide the parts of speech of all items in a string 3) provide the parts of a sentence (subject, direct object, etc) of a string 4) provide acceptability judgements for sentences that can be parsed (e.g. John1 likes himself2 is parsable but unacceptable). 5) provide judgements about Topicalized sentences, fronted wh questions,Tough-movement sentences, relative clauses, noun clauses, Cleft and Pseudo-Cleft sentences, Pied-Piping, the complex NP constraint, Control sentences, Parasitic Gap sentences, Island Conditions, the That Trace Effect, the coreferrence requirements of pronouns and reciprocals, and Strong and Weak Crossover effects. 6) perhaps provide explanations for why particular parses fail. II. Minimum requirements for grammar checkers, foreign language tutoring software, and other more secular uses of syntax. A program or theory of syntax that is to be of value in these areas should minimally: 1) provide information about part of speech 2) provide information about part of sentence (subject, object, etc) 3) provide demonstrations of grammatical constructions e.g. make passivesentences from active and active from passive, make questions from statements, join two sentences into one using a variety of conjunctions, transitions and prepositions. 4) provide judgements about errors in the production of sentences 5) provide information about types of clauses: subordinate/main, adverb, noun etc. 6) provide information about sentence type e.g. simple, complex, compound, etc. 7) analyze punctuation of words, phrases, and clauses (including coordination). Minimum requirements for translation technology: 1) provide a correct parse for the subject language and provide a grammatically correct sentence in the target language. 2) provide acceptability judgements and other grammar checking of sentences in both languages. 3) be able to do convert some sentences in both languages: e.g. statement to question, active to passive and so on. This list might be short in many ways, but I think it illustrates my point. There is a lot more that could be happening in the realm of computational syntax, but it is not happening. If I am overly pessimistic, I would like to know where I can find software that can do the above. I will post all responses to the list as a summary. Also, if anyone would like to add to this list, I will keep track of the responses and post them to the list. Also, if someone can explain what prevents these developments I would appreciate that as well. Phil Bralich bralich@uhccux.uhcc.Hawaii.edu From icon-group-sender Sat Feb 4 20:43:44 1995 Received: by cheltenham.cs.arizona.edu; Sat, 4 Feb 1995 19:40:58 MST Date: Sat, 4 Feb 95 20:43:44 CST From: goer@mithra-orinst.uchicago.edu (Richard L. Goerwitz) Message-Id: <9502050243.AA08637@mithra-orinst.uchicago.edu> To: icon-group@cs.arizona.edu Subject: more Icon, CGI Errors-To: icon-group-errors@cs.arizona.edu Another invitation to Icon users interested in the Web and CGI scripts.... Not all clients implement mailto, so if you want, say, for people reading an article you wrote to be able to mail you comments from a form, you need a form and a CGI script to do this. Here are ex- amples of both. Appended below, immediately after my signature, is a short HTML form. After that is an Icon program that does the mailing. It is simple, and probably could be improved in many ways. I provide it here merely as an example. Naturally, the mailing addresses and hard-coded system files will need to be changed. Name the form anything you want. Compile the Icon program and put it into the cgi-bin directory. I recall when I first installed the executable running into problems with version 8 of Icon. Version 9, though, worked fine. Anyone wanting to take a look at how the form works can just jump to the end of one of the following documents. I tend to put an HREF to the comments form at the end of docs I place online. http://oi.uchicago.edu:1080/pub/stuff/accents/accents.html http://oi.uchicago.edu:1080/pub/papers/goerwitz/sbl94talk/sbl94talk.html Richard Goerwitz =============================== cut here ========================= Feedback Form

Feedback Form

This form offers a quick, easy way of forwarding comments back to me. Just fill out the fields below, and then click on the "mail comments" button near the end.

E-mail: Your name:

Paper title:

Comments you would like to offer:

If you prefer, send your comments to me manually, using your local system mailer


Richard L. Goerwitz, goer@midway.uchicago.edu
================================ cut here ========================== ############################################################################ # # File: forward_comments.icn # # Subject: Program to forward comments sent via a fillout form # # Author: Richard L. Goerwitz # # $Revision$ # ############################################################################ $define MYADDRESS "goer@midway.uchicago.edu" procedure main(a) local i, cl, n, name_tbl, f, sender, comments, nam, subj cl := integer(getenv("CONTENT_LENGTH")) name_tbl := table() # # output a minimal header, terminated by two newlines # write("Content-type: text/html\x0A\x0A") # # check that the request is correctly formatted; output # error message if it's not # getenv("REQUEST_METHOD") == "POST" | { writes("

error: METHOD must = \"POST\"

") exit(1) } getenv("CONTENT_TYPE") == "application/x-www-form-urlencoded" | { writes("

error: this script is for decoding form results only

") exit(1) } # # enter name=value lines as key/value pairs in name_tbl # while line := makeline(&input, "&", cl) do { line := unescape_url(map(line, "+", " ")) line ? { n := tab(find("=")) move(1) if not (/name_tbl[n] := tab(0)) then { writes("

error: duplicate field name, ", n, "

") exit(1) } } } writes("Feedback Submission Results") writes("") writes("

Feedback submission results:

") # # Collect the mailing address of the sender & his or her comments # sender := ("" ~== \name_tbl["sender"]) | { writes("

error: you forgot to give your e-mail address

") exit(2) } comments := ("" ~== \name_tbl["comments"]) | { writes("

error: no comments found!

") exit(2) } nam := ("" ~== \name_tbl["name"]) | "(unknown)" title := ("" ~== \name_tbl["title"]) | "(unspecified)" subj := "comments from " || nam || " (" || sender || ") regarding " || title # # Send off comments using system mailer # f := open("Mail -s '"|| subj ||"' "|| MYADDRESS, "pw") | { writes("

error: mailer offline

") exit(3) } write(f, comments) close(f) # # Report results to the comment-er # writes("

Your comments have been successfully forwarded.

") writes("

Here is the text of what you sent:

") writes("
", comments, "

") writes("

Thanks for your input,

") writes("

Richard Goerwitz

" || MYADDRESS || "

") writes("") exit(0) end # # concatenate series of non-ampersands into lines; stop # when you have read the number of characters in cl (arg # 3); stop_c is going to be "&" # procedure makeline(f, stop_c, cl) local line, c static c_count initial c_count := 0 line := "" while c := reads(f) do { if (c_count +:= 1) > cl then break if c == stop_c then break line ||:= c } return "" ~== line end # # turn &xx (where xx are hex digits) into an integer; # output the character with that internal integer value # procedure unescape_url(url) local new_url new_url := "" url ? { while new_url ||:= tab(find("%")) & move(1) do new_url ||:= char(hex(move(2))) | tab(0) new_url ||:= tab(0) } return new_url end # # Bob Alexander's hex->integer code (overkill here) # procedure hex(s) local a,c a := 0 every c := !map(s) do a := ior(find(c,"0123456789abcdef") - 1, ishift(a,4)) | fail return a end # # procedure hexstring(i,n,lowercase) local s, hexchars, sign i := integer(i) | runerr(101, i) sign := "" if i = 0 then s := "0" else { if /n & i < 0 then { sign := "-" i := -i } hexchars := if \lowercase then "0123456789abcdef" else "0123456789ABCDEF" s := "" until i = (0 | -1) do { s := hexchars[iand(i,15) + 1] || s i := ishift(i,-4) } } if \n > *s then s := right(s,n,if i >= 0 then "0" else hexchars[16]) return sign || s end From icon-group-sender Sun Feb 5 01:52:54 1995 Received: by cheltenham.cs.arizona.edu; Sun, 5 Feb 1995 00:50:08 MST Date: Sun, 5 Feb 95 01:52:54 CST From: goer@mithra-orinst.uchicago.edu (Richard L. Goerwitz) Message-Id: <9502050752.AA09862@mithra-orinst.uchicago.edu> To: icon-group@cs.arizona.edu Subject: sockets for Icon? Errors-To: icon-group-errors@cs.arizona.edu Has anyone incorporated any socket code into the Icon run-time system, or else into any compatible C libraries? Just curious. Would be nice if Icon supported some form of interprocess communication. The "pipe" option to open() has always been nice on systems that support it, but it only works one way. Neither pipes not sockets are totally portable, of course. But what with all of the TCP/IP-orinted software out there, and what with daemons and servers becoming a more common way to imple- ment certain things, I'd bet that someone has thought about how sockets might fit into Icon.... Just curious. Richard Goerwitz goer@midway.uchicago.edu From icon-group-sender Sun Feb 5 03:11:48 1995 Received: by cheltenham.cs.arizona.edu; Sun, 5 Feb 1995 02:11:58 MST Date: Sun, 5 Feb 1995 03:11:48 -0600 From: jeffery@runner.jpl.utsa.edu (Clinton L. Jeffery) Message-Id: <9502050911.AA29485@runner.utsa.edu> To: goer@mithra-orinst.uchicago.edu Cc: icon-group@cs.arizona.edu In-Reply-To: <9502050752.AA09862@mithra-orinst.uchicago.edu> (goer@mithra-orinst.uchicago.edu) Subject: Re: sockets for Icon? Content-Length: 1219 Errors-To: icon-group-errors@cs.arizona.edu (Richard L. Goerwitz writes:) Has anyone incorporated any socket code into the Icon run-time system, or else into any compatible C libraries? This is asked so often, it needs to go into the FAQ. To my knowledge, interprocess communication's been done before by numerous people. Brian Keefe, for example, wrote some simple demo functions for socket access. I think Gregg Townsend's done an IPC example for the version 9 loadfunc() facility. IPC is not yet ubiquitous for Icon because language design is hard when the requirements are simplicity, generality, portability, and power. Doing It Right will take a lot of effort. I have a dream of doing interprocess communication "right", which for Icon means defining a small set of OS-independent, network-independent functions that seamlessly fit in with the rest of the language. But in order to get from here to there we have to start with a clean & simple interface and loadfunc() is the easiest way to prototype it without a lot of run-time system expertise. I'd be happy to help anyone (or a group) working on a serious IPC interface; I can advise on run-time system issues and language design, but my implementation cycles are otherwise committed. From icon-group-sender Sun Feb 5 12:35:20 1995 Received: by cheltenham.cs.arizona.edu; Sun, 5 Feb 1995 06:16:09 MST To: icon-group-l@cs.arizona.edu Date: 5 Feb 1995 12:35:20 GMT From: ruiter@ruls41.fsw.LeidenUniv.nl (Jan-Peter de Ruiter) Message-Id: <3h2gm8$bur@highway.LeidenUniv.nl> Organization: Leiden University, The Netherlands Sender: icon-group-request@cs.arizona.edu References: <3grmq1$qn7@hermes.louisville.edu> Subject: Re: emacs and icon Errors-To: icon-group-errors@cs.arizona.edu Mark D. McDonald (mdmcdo01@terra.spd.louisville.edu) wrote: : Has anyone customized emacs to easily compile (interpret) an icon program : (that is in the current buffer)? Try adding the following code to your .emacs file. It puts the current filename as a default input name to the icont interpreter, and also adds a regexp so that you can jump to the line in your icon program containing your error. I hope the (long) lines will not be cut off by your newsreader. If so, tell me and I'll resend it in a more intelligent way. Cheers, JP ;; begin code (autoload 'icon-mode "icon.el") ;; assumes you have icon.el (setq icon-mode-hook '(lambda () (progn (make-local-variable 'compile-command) (setq compile-command (concat "icont " (file-name-nondirectory buffer-file-name))) (make-local-variable 'compilation-error-regexp-alist) (setq compilation-error-regexp-alist '(("\\(File \\)\\([^;]+\\)\\(; Line \\)\\([0-9]+\\)\\( # \\)\\(.*$\\)" 2 4)))))) ;; end code From icon-group-sender Sun Feb 5 11:51:09 1995 Received: by cheltenham.cs.arizona.edu; Sun, 5 Feb 1995 10:48:23 MST Date: Sun, 5 Feb 95 11:51:09 CST From: goer@mithra-orinst.uchicago.edu (Richard L. Goerwitz) Message-Id: <9502051751.AA10095@mithra-orinst.uchicago.edu> To: icon-group@cs.arizona.edu Subject: sockets, loadfunc, etc. Errors-To: icon-group-errors@cs.arizona.edu Sometimes I wish I could live two different lives - one as a CS groupie, and another in my own field. Sigh. As far as loadfunc goes, my observation was - when I first saw it - that its arguments were in reverse order. Library first, then function. The problem is that, in order to fully load a function, and resolve all references external to the function (including global variables) often requires iterative loads of multiple libraries and functions. The GNU DLD system, as I re- call, does things this way. So, as far as loadfunc is concern- ed, this means that it should take a function as its first arg, then a variable-length list of libraries. Loadfunc, as it stands now, also appears to lean heavily on fea- tures specific to just a few Unix platforms. Things may have changed, and I may not be understanding properly. This ain't my area, as I noted above. And certainly no one ex- pects people like you, Clint, or Ralph, Gregg, etc., to cater to every feature request. I really wish I had thetbasic ability just to roll up my sleeves and work on the implementation myself, but I don't any more. I guess the deeper question with loadfunc, sockets, and every- thing else like this, is not so much how one extends Icon to be all things to all people. The question is how to provide a simple, elegant, portable method of hooking Icon into platform- specific utilities, libraries, and OS features. We obviously can't exect sockets under DOS or many other such (minimal) op- erating systems. And there's really no point in extending Icon just for Unix. Yet loadfunc, as far as I know, is also very platform-specific (relying, as noted, on what I believe to be a not-widely-implemented feature of certain commercial Unix systems), so even under Unix it's not possible to offer sockets via an external interface. Either way, that is, we are stuck (having either to design a large new module for the run-time system, or use a platform-specific loadfunc tool). The same problem, of course, comes up with wider modules like the windowing system. Sure, it's great to have a windowing sys- tem that works with a number of different platforms. But this places a heavy, heavy implementation burden on the Icon Project. One that has not yet been met. In a way, I wonder how it *can* be met. You are human, after all. Yet I know that I personally could no longer tack on an interface between, say, Icon and Motif or a curses library (though I did create an interface to the curses functions for 8.0, it was primitive, and I was never happy with the way it went into Icon). And, just to continue this line of thought a moment, I wonder what happens as changes occur in areas like internationalization. Motif 2.0 is becoming multilingual. You can now display mixed- language text. On the Mac there is WorldScript. Under NT there is some primitive Unicode support. It is crazy to think that a few Icon programmers can duplicate all of this functionality. Or that they would even want to. It's like doing sockets. The goal should be to provide a generalized method of interfacing Icon with platform-specific features and tools, without placing the burden of implementation entirely on guys like you. I don't want to imply, BTW, that graphics are bad. This idea was and is really neat. But ultimately I think what we really want is a pretty lean core Icon run-time system. I fear with all the complexity of 9.0 and graphics that implementation will become so difficult that development will essentially stall. Worse yet, it will become well nigh impossible to find volun- teers to work on Icon. I actually used to be able to do that myself. Clint, you and Gregg probably remember with some amuse- ment at how I worked through the initial code for getch() and kbhit() for Unix (thanks for the help, BTW). But the point is that, at version 8.0, even a dummy like me could do this sort of thing. So to end this over-long posting, the question of Icon's future, I think, doesn't have so much to do with thinking through how to do things like sockets in an elegant and platform-independent fashion. Rather, it has more to do with how to avoid doing such things - but yet of providing facilities for dummies like me to access facilities already present in our OS for doing them. Take this posting for what, if anything, it's worth. And feel free to flame me if I don't seem to understand what is going on. Your friend (and a long-time, devoted Icon programmer), Richard Goerwitz From icon-group-sender Sun Feb 5 12:31:37 1995 Received: by cheltenham.cs.arizona.edu; Sun, 5 Feb 1995 11:33:29 MST Date: Sun, 5 Feb 95 12:31:37 CST From: johnp@utafll.uta.edu (John Paolillo) Message-Id: <9502052031.AA20302@utafll.uta.edu> To: icon-group@cs.arizona.edu Subject: sockets, loadfunc, etc and the future of icon Errors-To: icon-group-errors@cs.arizona.edu I'd like to second some of the comments in Richard Goerwitz's posting. I found this to be a good summary of my feelings: "the question of Icon's future, I think, doesn't have so much to do with thinking through how to do things like sockets in an elegant and platform-independent fashion. Rather, it has more to do with how to avoid doing such things - but yet of providing facilities for dummies like me to access facilities already present in our OS for doing them." There are many things that I would like to do on my platform of choice (mac, mostly for economic reasons -- would you run 9.0 on an ailing sun 3?) that involve inter-applications communication. As things presently stand, there is no straightforward way to do this. I can actually work through schemes where with existing utilities I could even use icon in a cgi application with MacHTTP, but the method would be so horrid and backward and complicated I could certainly not do that and get tenure at the same time (I'm also not in CS). I am left to hoping and waiting for the next update (it has been some time since we've seen one for the mac, and ProIcon, the only really usable one on the mac, is dead). I wondered too about the windowing and graphics. It wasn't what I really wanted to see next (though I would have fallen all over "system()"). Perhaps there could be a way to "modularize" Icon's design, so that the "lean core Icon run-time system" is available more uniformly across platforms, and so that peripheral and platform-dependant features could be implemented as desired/needed. John C. Paolillo Linguistics Program University of Texas at Arlington From icon-group-sender Sun Feb 5 13:43:56 1995 Received: by cheltenham.cs.arizona.edu; Sun, 5 Feb 1995 12:44:02 MST Date: Sun, 5 Feb 1995 13:43:56 -0600 From: jeffery@runner.jpl.utsa.edu (Clinton L. Jeffery) Message-Id: <9502051943.AA05130@runner.utsa.edu> To: goer@mithra-orinst.uchicago.edu Cc: icon-group@cs.arizona.edu In-Reply-To: <9502051751.AA10095@mithra-orinst.uchicago.edu> (goer@mithra-orinst.uchicago.edu) Subject: Re: sockets, loadfunc, etc. Content-Length: 2788 Errors-To: icon-group-errors@cs.arizona.edu [Richard Goerwitz states:] Loadfunc, as it stands now, also appears to lean heavily on features specific to just a few Unix platforms. I just don't see this as being true. What is true is that dynamic loading is in general our best hope of providing you guys with your "lean core runtime system" and letting you extend it. I think most modern operating systems provide a dynamic loading facility (.dll's on DOS and OS/2, .lib's on Amigas, .so's on UNIX...). loadfunc() is not UNIX specific, but like the graphics interface, it must be implemented on each OS before it is available there. Implementing it on most OS'es is trivial compared with implementing graphics. [Richard goes on to write ..."the point is that, at version 8.0, even a dummy like me could do this sort of thing."] I am a bit tired of hearing that "Version 8 was so easy to extend that even I could extend it, but I can never do that with Version 9". Version 8 was hard to extend, Version 9 is in many ways easier. In Version 8 if your extension had any interesting use of memory, interfacing it to the garbage collector was a nightmare. In Version 9 this is much cleaner. In Version 8 if you wanted to extend it your only choice was to relink your iconx, making public distribution of your extension unlikely. In Version 9, you can add it as a built-in to iconx or write some C code for loadfunc(). [John Paolillo agrees, seconding Richard's request that we "provide facilities for dummies like me to access facilities already present in our OS for doing them."] The bottom line is that for the kinds of features you've been asking for lately, like multi-byte character support or Macintosh OSA support, there is NO MAGIC BULLET. There is no way the features can be implemented without a small army of programmers, even if it is supported in a given OS. The Icon community has to either pay for it to happen, or find a sponsor, or implement it ourselves. Should I be organizing an RTL training seminar, or an on-line RTL tutorial group? I'd be willing to donate money to an Icon "internationalization endowment fund", but it will take a lot of resources. If anyone wants to come spend a few weeks or months to work on Icon, or wants to do an Icon-related graduate degree, I'd be happy to do what I can. :-) I appreciate how frustrating it is to love an obscure language that happens to be designed better than so many popular languages with heavy industry backing. The question is: how much do you love Icon? Enough to live with its limitations and use it when its appropriate? Or enough to do something yourself to make Icon better or support its development, besides posting news? Clint Jeffery cjeffery@cs.arizona.edu, jeffery@ringer.cs.utsa.edu The University of Texas at San Antonio From icon-group-sender Sun Feb 5 19:34:53 1995 Received: by cheltenham.cs.arizona.edu; Sun, 5 Feb 1995 19:34:55 MST Date: Sun, 5 Feb 1995 19:34:53 -0700 From: Gregg Townsend Message-Id: <199502060234.TAA23332@baskerville.CS.Arizona.EDU> To: icon-group@baskerville Subject: Re: sockets, loadfunc, etc. Content-Length: 871 Errors-To: icon-group-errors@cs.arizona.edu The loadfunc interface is part of the current operating systems from Digital, Sun, and Silicon Graphics (at least). I'll be surprised if it doesn't show up on other systems eventually. In the Unix source of Icon, the directory ipl/packs/loadfunc contains a tconnect() function that is sufficient to let you implement, say, a news reader in Icon using loadfunc. A very simple telnet program is included there as an example. If you're designing a new program that needs interprocess communication under Unix, and you're not constrained by an existing interface, named pipes may be a good solution. They can be created by a system() call from Icon and then read and written just like any other type of file. Gregg Townsend / Computer Science Dept / Univ of Arizona / Tucson, AZ 85721 +1 602 621 4325 gmt@cs.arizona.edu 110 57 16 W / 32 13 45 N / +758m