diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2008-10-13 20:53:33 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2008-10-13 20:53:33 +0000 |
commit | 8e286580df3e8b7ca7e4e5486eb4cd162cf86180 (patch) | |
tree | 4bbf4994c048154103e8741c8d65270b4c4a5c38 | |
parent | 28c1518dc93984a96b373daafef1ff07c88d62fb (diff) |
xedit 1.1.1
50 files changed, 5830 insertions, 1478 deletions
diff --git a/app/xedit/AUTHORS b/app/xedit/AUTHORS index e69de29bb..65e5b4cdd 100644 --- a/app/xedit/AUTHORS +++ b/app/xedit/AUTHORS @@ -0,0 +1,143 @@ +(Original author based on manpage) +Chris D. Peterson, MIT X Consortium +commands.c +util.c +xedit.c +xedit.h + + +------------------------------------------------------------------------ +Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +xedit: +hook.c +hash.c +ispell.c +lisp.c +options.c +tags.c +util.h + +xedit lisp interface: +lisp/bytecode.c +lisp/bytecode.h +lisp/compile.c +lisp/core.c +lisp/core.h +lisp/debugger.c +lisp/debugger.h +lisp/format.c +lisp/format.h +lisp/internal.h +lisp/io.c +lisp/io.h +lisp/hash.c +lisp/hash.h +lisp/helper.c +lisp/helper.h +lisp/lisp.c +lisp/lisp.h +lisp/math.c +lisp/math.h +lisp/mathimp.c +lisp/package.c +lisp/package.h +lisp/pathname.c +lisp/pathname.h +lisp/private.h +lisp/read.c +lisp/read.h +lisp/regex.c +lisp/regex.h +lisp/require.c +lisp/require.h +lisp/stream.c +lisp/stream.h +lisp/string.c +lisp/string.h +lisp/struct.c +lisp/struct.h +lisp/time.c +lisp/time.h +lisp/write.c +lisp/write.h +lisp/xedit.c +lisp/xedit.h + +bignum math library: +lisp/mp/mp.h +lisp/mp/mpr.c +lisp/mp/mpi.c +lisp/mp/mp.c + +command line lisp interpreter: +lisp/lsp.c + +regex library: +lisp/re/re.c +lisp/re/re.h +lisp/re/reo.c +lisp/re/rep.h +lisp/re/rec.c +lisp/re/tests.c +lisp/re/tests.txt + +source files to test the lisp interpreter: +lisp/test/widgets.lsp +lisp/test/list.lsp +lisp/test/hello.lsp +lisp/test/regex.lsp +lisp/test/stream.lsp +lisp/test/math.lsp + +lisp binary modules: +lisp/modules/psql.c +lisp/modules/x11.c +lisp/modules/xaw.c +lisp/modules/xt.c + +lisp source modules: +lisp/modules/indent.lsp +lisp/modules/lisp.lsp +lisp/modules/syntax.lsp +lisp/modules/xedit.lsp + +lisp syntax highlight and indentation rules definitions: +lisp/modules/progmodes/c.lsp +lisp/modules/progmodes/html.lsp +lisp/modules/progmodes/imake.lsp +lisp/modules/progmodes/lisp.lsp +lisp/modules/progmodes/make.lsp +lisp/modules/progmodes/man.lsp +lisp/modules/progmodes/patch.lsp +lisp/modules/progmodes/rpm.lsp +lisp/modules/progmodes/sgml.lsp +lisp/modules/progmodes/sh.lsp +lisp/modules/progmodes/xconf.lsp +lisp/modules/progmodes/xlog.lsp +lisp/modules/progmodes/xrdb.lsp + + +------------------------------------------------------------------------ +Files required when compiling with xprint support: + +(Based on Copyright notice) +Roland Mainz <roland.mainz@nrubsig.org> +xedit: +print.c +print.h +printdialog.c +printdialog.h +printdialogprivates.h + + +------------------------------------------------------------------------ +Files required for systems that don't have the required calls in the +standard libraries: + +(Based on Copyright notice) +Jan-Simon Pendry +realpath.c + +(No author information, using CVS tag) +David Dawes <dawes@XFree86.Org> +strcasecmp.c diff --git a/app/xedit/COPYING b/app/xedit/COPYING index 7f33cbfd2..4e8370655 100644 --- a/app/xedit/COPYING +++ b/app/xedit/COPYING @@ -1,12 +1,176 @@ -This is a stub file. This package has not yet had its complete licensing -information compiled. Please see the individual source files for details on -your rights to use and modify this software. -Please submit updated COPYING files to the Xorg bugzilla: +Copyright (c) 1987, 1993 + The Regents of the University of California. All rights reserved. -https://bugs.freedesktop.org/enter_bug.cgi?product=xorg +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by the University of + California, Berkeley and its contributors. +4. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. -All licensing questions regarding this software should be directed at the -Xorg mailing list: +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. -http://lists.freedesktop.org/mailman/listinfo/xorg + + + + +Copyright (c) 1994 + The Regents of the University of California. All rights reserved. + +This code is derived from software contributed to Berkeley by +Jan-Simon Pendry. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by the University of + California, Berkeley and its contributors. +4. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + + + + + + COPYRIGHT 1987 + DIGITAL EQUIPMENT CORPORATION + MAYNARD, MASSACHUSETTS + ALL RIGHTS RESERVED. + +THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND +SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION. +DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR +ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. + +IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT RIGHTS, +APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN ADDITION TO THAT +SET FORTH ABOVE. + + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided +that the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of Digital Equipment Corporation not be +used in advertising or publicity pertaining to distribution of the software +without specific, written prior permission. + + + + + +Copyright 2004 Roland Mainz <roland.mainz@nrubsig.org> + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + + + + +Copyright (c) 1999-2002 by The XFree86 Project, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Except as contained in this notice, the name of the XFree86 Project shall +not be used in advertising or otherwise to promote the sale, use or other +dealings in this Software without prior written authorization from the +XFree86 Project. + + + + + +Copyright (c) 2007 Paulo Cesar Pereira de Andrade + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next +paragraph) shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/app/xedit/ChangeLog b/app/xedit/ChangeLog index 690509d44..1b8750af2 100644 --- a/app/xedit/ChangeLog +++ b/app/xedit/ChangeLog @@ -1,65 +1,736 @@ -2006-04-26 Adam Jackson <ajax@freedesktop.org> +commit bc470a831ee3c8d5aa254661122187048f245c92 +Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +Date: Wed Jul 30 18:52:32 2008 -0300 - * configure.ac: - Bump to 1.0.2 + Update to xedit 1.1.0. -2006-04-03 Adam Jackson <ajax@freedesktop.org> +commit fb6c60031936bdaaeb808fb61b3073bdb058607a +Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +Date: Thu Jul 10 16:38:09 2008 -0300 - * Makefile.am: - Bug #6480: Cygwin build fix. (Yaakov Selkowitz) + Update file type pattern matching. + + Consider a file ending in .l a lisp source file. + Allow an arbitrary number of bytes following the filename for xconf + and xlog modes. + Don't use make mode for "Imakefile". Require a slash before [Mm]akefile.*. -2005-12-20 Kevin E. Martin <kem-at-freedesktop-dot-org> +commit ed21e75c45e92c4c52f80bdb5fba0e17f5afaca1 +Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +Date: Tue Jul 8 18:53:50 2008 -0300 - * configure.ac: - Update package version for X11R7 release. + CancelFindFile is almost the same as XeditFocus, and could be merged in a + same Xt action. For the moment, automatically leave line_edit in XeditFocus. + + There is one other bug that should be fixed, that I am trying to repeat + (having the same file loaded twice when using tags) before a new release. + + Thre is also a problem in Xaw when deleting large amounts of selections + that crashes xedit, aparently due to Xaw Text widget doing some wrong math + and attempting to allocate a huge chunk of memory. -2005-12-14 Kevin E. Martin <kem-at-freedesktop-dot-org> +commit c23ce2ff2439f09d00dc2c226562d44f02ca591a +Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +Date: Sat May 10 21:38:23 2008 -0300 - * configure.ac: - Update package version number for final X11R7 release candidate. + Fix an off by one error check that can lead to an infinite loop. + + This can happen when using the line edit mode to search&replace regexes. -2005-12-07 Kevin E. Martin <kem-at-freedesktop-dot-org> +commit 2b4ebe868b660a69800dc5fe801bbcc05ccaefac +Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +Date: Sat May 10 21:36:36 2008 -0300 - * Makefile.am: - * configure.ac: - Change to use the app-defaults default dir configured in libXt. + Warn if a newer version of a file exists before overwritting it. -2005-12-06 Kevin E. Martin <kem-at-freedesktop-dot-org> +commit 0b8304c49ab2958bc2b4ef7286467a71faa38f41 +Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +Date: Sat Apr 12 17:43:04 2008 -0300 - * Makefile.am: - Change *man_SOURCES ==> *man_PRE to fix autotools warnings. + Add python mode. + + This mode adds syntax highlight and automatic indentation. + Unlike most other modes with automatic indentation, this mode most + only reads one line back to figure the proper indentation. + Some features include: + o When the first character in a line is typped, it automatically + moves it to the proper tab stop. + o Increments one indentation level if line ends in ':'. + o Properly handle vector/hash table declarations. -2005-12-03 Kevin E. Martin <kem-at-freedesktop-dot-org> +commit 614563884d2b19e514af233089e392127c4f4027 +Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +Date: Sun Mar 16 20:51:25 2008 -0300 - * configure.ac: - Update package version number for X11R7 RC3 release. + Compile warning fixes. + + Add parenthesis around a test where after macro expansion it looked like + boolexpr==boolres==boolres. + "Ansifiy" a function without arguments. -2005-11-19 Alan Coopersmith <alan.coopersmith@sun.com> +commit 60643e8f0dcd86e65400160c0a6e264e7a2a081c +Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +Date: Tue Mar 11 22:28:04 2008 -0300 - * configure.ac: - Add dependency on xp module when building with Xprint support. + Support multiple make jobs. + + Minor patch to avoid requiring xedit to have some special rule in a + buildsystem that defaults to something like "make -j 16". -2005-11-09 Kevin E. Martin <kem-at-freedesktop-dot-org> +commit ee636f8565931f8d897b6c8c07eb08d41695778c +Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +Date: Tue Mar 11 21:52:58 2008 -0300 - * configure.ac: - Update package version number for X11R7 RC2 release. + Fix an incorrect buffer size calculation and allocation. -2005-10-18 Kevin E. Martin <kem-at-freedesktop-dot-org> +commit 5bd8082a9788a1b5343eb03400944a03e4250577 +Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +Date: Wed Mar 12 21:59:34 2008 -0300 - * configure.ac: - Update package version number for RC1 release. + Add perl and "auto tools" modes. + + Auto mode has only syntax highlight mode; needs some tweaking to + ignore "'" characters where they are allowed, i.e. usually descriptions. + Perl mode has syntax highlight and indentation support. May need + some tweaking for some files where it may parse back too much lines before + assuming the indentation is correct. -2005-10-16 Kevin E. Martin <kem-at-freedesktop-dot-org> +commit a17bf690a8f80f252c3a831c79d6e8d11ce8d66c +Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +Date: Tue Mar 11 21:51:57 2008 -0300 - * Makefile.am: Change man sources from xedit.1 to xedit.man to - allow the man page to be processed. Move man page to top level - dir to pass check-tarball test. + Add support for scrolling textwindow with mouse wheel. -2005-10-05 Kevin E. Martin <kem-at-freedesktop-dot-org> +commit b1dd01f67a48785678209b90c1b0e4f44621c146 +Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +Date: Wed Mar 12 21:53:48 2008 -0300 - * Makefile.am: Add missing files to EXTRA_DIST + Add a tags interface to xedit. + + To use the tags, first create a tags file with a command like "ctags -R". + The interface can be disabled with resources, see the updated man page. + Tag files are searched descending to the root directory. + Multiple tags files are properly handled, and multiple symbol definitions + can be searched. -2005-09-27 Adam Jackson <ajax@freedesktop.org> +commit 3468f9f2cb65294771e1095a14b7263ae0a6a043 +Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +Date: Tue Mar 11 21:50:13 2008 -0300 - * Makefile.am: - Don't override ${lispdir}, automake predefines it. + Update syntax highlight table and some minor tweaks including: + + o Don't cause an warning due to an unused variable after macro expansion + in some indentation tables. + o Properly handle c++ style comments in preprocessor lines. Also highlight + strings and character constants. + o Change color of "quote" property in lisp mode. This is mainly due to + an undesirable side effect of using the same XrmQuark in different + syntax highlight definitions, causing the first one to be used, and + later defined ones to be ignored. + +commit 371c42ab955357d586cf4501762f6e9cf1be53b8 +Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +Date: Tue Mar 11 21:49:14 2008 -0300 + + Add support to enter line number in command line. + + This works the same way as for vi, i.e. "xedit file +num" will load + file and move cursor to line "num". + +commit cb30367f10f2e38065d336d331afdc50900de76d +Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +Date: Tue Mar 11 21:48:58 2008 -0300 + + Generic lisp interface bug fixes including: + + o Allow calling disassemble in all function types + o Don't limit amount of bytes to generate a hash table + o Allow "unreadable" symbol names to be keywords + +commit 953664369cc66ba17c7b9c1939fd9d7f6c6137ad +Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +Date: Tue Mar 11 21:48:39 2008 -0300 + + Fix several problems in the line edit mode. + + Also allow replacing control characters in the replace pattern as well + as nul characters. + +commit a2c47d3487aaf4667926195ba3f5b05b94626daf +Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +Date: Tue Mar 11 21:46:58 2008 -0300 + + Fix several generic bugs including: + + o Several memory read/write errors. + o Implement smarter XeditPrintf that will show how many times a text + has been printed. + o Check all arguments to XeditPrintf to ensure the '%' character cannot + be sent to it. + o Some minor reindentation to code that still had the original 2 spaces + indentation. + +commit a1949714b99a502a57b3dd7a99e619c10211d9fc +Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +Date: Tue Mar 11 21:46:38 2008 -0300 + + Make ispell interface work correctly again. + + This new interface should work properly with asciiSrc and multiSrc widgets, + i.e. single byte and multibyte. + Also added an empty dictionary entry that is understood by aspell as the + "default" dictionary. + Code is also more robust to detect aspell exiting too early. + +commit f1d58be104f4020ef718a542d7f5ca72cd1f531b +Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +Date: Tue Mar 11 21:44:25 2008 -0300 + + Readd support for *international resource and default to false. + + This allows several features, like syntax highlight and indentation, + turned off to be enabled again. + +commit 7d5dbf4a19ec6bbd36784f5d7307629b69dda873 +Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +Date: Wed Mar 12 21:52:30 2008 -0300 + + Add a generic hash table interface to replace the other implementations. + +commit 2f7992eaefb19f23c127e15624ba38208c03439b +Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +Date: Tue Mar 11 21:43:04 2008 -0300 + + Update build for sane defaults. + + Check for existing system functions. + Don't add test program sources with main functions to libraries. + Build test programs. + +commit 19e3f51f9758e2708fb4abfa364b346591089bcd +Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +Date: Tue Mar 11 21:41:45 2008 -0300 + + Add updated/meaningful README, COPYING and AUTHORS files. + +commit 618a07e8131f49bbda77d2cfe5832218a561a5c8 +Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +Date: Tue Jul 1 18:17:44 2008 -0300 + + Fix a bug in the regex library + + The bug causes the regex parser to enter an infinite loop with certain + special patterns with alternatives. Test cases also added to ensure + the bug will be triggered by the tests if it is somehow reinstantiated. + + Also testing commit to xedit git repository. + +commit 946b5b745d9d326799a23f7210b799e1b690643d +Author: James Cloos <cloos@jhcloos.com> +Date: Thu Dec 6 16:37:12 2007 -0500 + + Replace static ChangeLog with dist-hook to generate from git log + +commit dd27b05c49b6e747203c83a96ca812993b2a2def +Author: James Cloos <cloos@jhcloos.com> +Date: Mon Sep 3 05:51:19 2007 -0400 + + Add *~ to .gitignore to skip patch/emacs droppings + +commit e582ba82e04632157c8a7ead56b62da7ba0eddfe +Author: James Cloos <cloos@jhcloos.com> +Date: Thu Aug 23 19:24:44 2007 -0400 + + Rename .cvsignore to .gitignore + +commit baafaa1dee42640d15f4e74ff43b0ee3343de940 +Author: Adam Jackson <ajax@nwnk.net> +Date: Wed Apr 26 23:39:19 2006 +0000 + + Bump to 1.0.2 + +commit 86e42e7030394b58d9b16eddd9ccc90efa3a11b2 +Author: Adam Jackson <ajax@nwnk.net> +Date: Mon Apr 3 19:42:16 2006 +0000 + + Bug #6480: Cygwin build fix. (Yaakov Selkowitz) + +commit beae4e7a8875dfe3bdae54bd3f48b922a8f8a3c1 +Author: Kevin E Martin <kem@kem.org> +Date: Wed Dec 21 02:29:49 2005 +0000 + + Update package version for X11R7 release. + +commit ac432c05b782f4d97943de23b97d4b3878e8fe02 +Author: Adam Jackson <ajax@nwnk.net> +Date: Mon Dec 19 16:22:43 2005 +0000 + + Stub COPYING files + +commit 814ad517c4de7dfecbc51636e00a62289af45a8f +Author: Kevin E Martin <kem@kem.org> +Date: Thu Dec 15 00:24:06 2005 +0000 + + Update package version number for final X11R7 release candidate. + +commit e70ce0696695b7e6d627d046c19c3b6c9a8ce3da +Author: Kevin E Martin <kem@kem.org> +Date: Wed Dec 7 16:17:59 2005 +0000 + + Change to use the app-defaults default dir configured in libXt. + +commit 6090b669a399c4663517b845d76945c6c2f97ef9 +Author: Kevin E Martin <kem@kem.org> +Date: Tue Dec 6 22:48:21 2005 +0000 + + Change *man_SOURCES ==> *man_PRE to fix autotools warnings. + +commit 2abc4c46f8d89aa95262db207f7796ee4ee2e2ea +Author: Kevin E Martin <kem@kem.org> +Date: Sat Dec 3 05:49:19 2005 +0000 + + Update package version number for X11R7 RC3 release. + +commit 83a772ee412acc4cea221e1eb416dfb641f074ed +Author: Alan Coopersmith <Alan.Coopersmith@sun.com> +Date: Mon Nov 28 22:01:41 2005 +0000 + + Change *mandir targets to use new *_MAN_DIR variables set by xorg-macros.m4 + update to fix bug #5167 (Linux prefers *.1x man pages in man1 subdir) + +commit 08e9327b251c7bebf85befe0c927ed82183ac874 +Author: Eric Anholt <anholt@freebsd.org> +Date: Mon Nov 21 10:35:00 2005 +0000 + + Another pass at .cvsignores for apps. + +commit e63cf486fac692f01a5717da970eaee2b711acec +Author: Eric Anholt <anholt@freebsd.org> +Date: Sun Nov 20 22:08:52 2005 +0000 + + Add/improve .cvsignore files for apps. + +commit 312e176e35cb16b7ea2ab4ea706132786a4aa511 +Author: Alan Coopersmith <Alan.Coopersmith@sun.com> +Date: Sun Nov 20 04:13:45 2005 +0000 + + Add dependency on xp module when building with Xprint support. + +commit cd2d0c1372d85eba2c097c652004f97eb0821cd1 +Author: Kevin E Martin <kem@kem.org> +Date: Wed Nov 9 21:09:20 2005 +0000 + + Update package version number for X11R7 RC2 release. + +commit 0d4e6039465c3ecadaf76c0558ecc77931c0aa54 +Author: Alan Hourihane <alanh@fairlite.demon.co.uk> +Date: Fri Oct 28 15:45:02 2005 +0000 + + build fix + +commit 4f20443995b7e8b90058be829bbbbad8f5f8c935 +Author: Adam Jackson <ajax@nwnk.net> +Date: Sun Oct 23 20:03:47 2005 +0000 + + Bug #1860: Prevent walking off the end of the scan_types array. + +commit 83ba7062d74bb228ba9daddd1f4524dee905d4f2 +Author: Alan Hourihane <alanh@fairlite.demon.co.uk> +Date: Fri Oct 21 08:18:25 2005 +0000 + + remove redundant include + +commit d9db7305c78e1b93c9b15f73356b8afd5cb26709 +Author: Alan Hourihane <alanh@fairlite.demon.co.uk> +Date: Thu Oct 20 18:24:27 2005 +0000 + + programs/xedit/xedit.h + //bugs.freedesktop.org/show_bug.cgi?id=790) + +commit 54c3139890ae810b4c18eed15c82303917bcb2b9 +Author: Kevin E Martin <kem@kem.org> +Date: Wed Oct 19 02:47:53 2005 +0000 + + Update package version number for RC1 release. + +commit 3dbe6f823ce929fee91555933312c2ad81c6f371 +Author: Alan Coopersmith <Alan.Coopersmith@sun.com> +Date: Tue Oct 18 00:32:55 2005 +0000 + + Change default install dir for app-default files from + $(sysconfdir)/X11/app-defaults to $(libdir)/X11/app-defaults to match + the monolith & allow localization + +commit cd4bfca48225f3eb78095f4437be8667c9dde5a6 +Author: Alan Coopersmith <Alan.Coopersmith@sun.com> +Date: Mon Oct 17 23:56:22 2005 +0000 + + Use @APP_MAN_SUFFIX@ instead of $(APP_MAN_SUFFIX) in macro substitutions to + work better with BSD make + +commit 636d350681f43816c658e09704242e0cad31de56 +Author: Kevin E Martin <kem@kem.org> +Date: Sun Oct 16 06:06:57 2005 +0000 + + Change man sources from xedit.1 to xedit.man to allow the man page to be + processed. Move man page to top level dir to pass check-tarball test. + +commit 47709c7118e6280221931189019a3fab1bfdc691 +Author: Alan Coopersmith <Alan.Coopersmith@sun.com> +Date: Fri Oct 14 00:25:44 2005 +0000 + + Use sed to fill in variables in man page + +commit 1c94f8dbcfcf16a01e792942632d0a89df6d0768 +Author: Kevin E Martin <kem@kem.org> +Date: Wed Oct 5 03:27:56 2005 +0000 + + Add missing files to EXTRA_DIST + +commit ebd7eea10cf5add145b0428e953fce3691b8423a +Author: Adam Jackson <ajax@nwnk.net> +Date: Wed Sep 28 03:04:23 2005 +0000 + + Don't override , automake predefines it. + +commit dad8235ff737556e2eaa645a5d7b48641eba270a +Author: Kristian Høgsberg <krh@redhat.com> +Date: Tue Sep 27 20:20:36 2005 +0000 + + Only add -DINCLUDE_XPRINT_SUPPORT if the Xaw version supports it. + +commit bc2182af2f8d9455f9caeb686b71cae4ff1bc0bc +Author: Matthieu Herrb <matthieu.herrb@laas.fr> +Date: Sun Aug 28 17:58:39 2005 +0000 + + Install the lisp files. + +commit d0691d15ae7cf68c8a617322a2a4a77d36c704d1 +Author: Kevin E Martin <kem@kem.org> +Date: Fri Jul 29 21:22:32 2005 +0000 + + Various changes preparing packages for RC0: + - Verify and update package version numbers as needed + - Implement versioning scheme + - Change bug address to point to bugzilla bug entry form + - Disable loadable i18n in libX11 by default (use --enable-loadable-i18n to + reenable it) + - Fix makedepend to use pkgconfig and pass distcheck + - Update build script to build macros first + - Update modular Xorg version + +commit aebfa8db8c0069d4474841414012b7f19ec14d53 +Author: Matthieu Herrb <matthieu.herrb@laas.fr> +Date: Sat Jul 23 16:12:58 2005 +0000 + + Fix DEP_* reference + +commit d9d6a51c74d055e93b2fb8450ef9de162e35945f +Author: Matthieu Herrb <matthieu.herrb@laas.fr> +Date: Sat Jul 23 16:12:33 2005 +0000 + + - fix DEP_* references + - fix GNU-make only rule for app-defaults + +commit 0842c698bd90b2f47d808d47b37912a7a0e3ba78 +Author: Adam Jackson <ajax@nwnk.net> +Date: Wed Jul 20 19:31:52 2005 +0000 + + Use a unique token for PKG_CHECK_MODULES. Otherwise, if you use a global + configure cache, you cache it, and the cached value is probably wrong. + +commit c46761f286f8c9a41ee0e510211b5ed667a78479 +Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> +Date: Tue Jul 12 18:45:46 2005 +0000 + + - lib/lbxutil/lbxutil.pc.in: link to lbxutil, not Xfixes + - symlink.sh: add xedit.h, add xedit/lis/mp directory, add xfs + - xc/programs/xedit: include "lisp/../xedit.h" instead of xedit/xedit.h + - Change include of "foo.h" to <X11/.../foo.h> in various places in + xc/programs/lbxproxy and xc/programs/xfs + - add build system for xfs + - add forgotten lbxproxytrans.c file + +commit fc1f512d7cd7876f79190511315fe219667b2e81 +Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> +Date: Tue Jul 12 17:41:52 2005 +0000 + + Build system for xprint + +commit 6bc36c6c67fed984af4f60224a7ea693d1b7d217 +Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> +Date: Wed Apr 20 16:18:03 2005 +0000 + + Move variable declaration to top. Makes gcc2 happy. + +commit 33c2d047571cd4ebce2eb630515fc33aa3f05b98 +Author: Roland Mainz <roland.mainz@nrubsig.org> +Date: Mon Apr 11 01:06:15 2005 +0000 + + xc/programs/Xserver/Xprint/attributes.c + xc/programs/glxgears/glxgears.c + xc/programs/xdbedizzy/xdbedizzy.c + xc/programs/xedit/Imakefile + xc/programs/xedit/Xedit-xprint.ad + xc/programs/xedit/util.c + xc/programs/xedit/xedit.h + xc/programs/xlogo/print.c + xc/programs/xlogo/xlogo.c + xc/programs/xlogo/xlogo.h + xc/programs/xman/Imakefile + xc/programs/xman/print.h + xc/programs/xmore/Imakefile + xc/programs/xmore/print.c + xc/programs/xmore/print.h + xc/programs/xmore/printdialog.c + xc/programs/xphelloworld/xpawhelloworld/xpawhelloworld.c + xc/programs/xphelloworld/xphelloworld/xphelloworld.c + xc/programs/xphelloworld/xpsimplehelloworld/xpsimplehelloworld.c + xc/programs/xphelloworld/xpxmhelloworld/xpxmhelloworld.c + //bugs.freedesktop.org/show_bug.cgi?id=790) attachment #2379 + (https://bugs.freedesktop.org/attachment.cgi?id=2379) Implement support + client+Xserver support for passing output (stdout+stderr) of the + spooler command started by the Xprint server back to the application + using the "xp-spooler-command-results" XPJobAttr attribute + (applications can fetch the attribute value after the XPEndJobNotify + event was received; more details can be found in + http://xprint.mozdev.org/docs/dtprint_fspec.ps). + +commit bd31ddba0725738848be8298a7b1dd691c103fa3 +Author: Egbert Eich <eich@suse.de> +Date: Mon Apr 4 10:17:07 2005 +0000 + + Fixed sentinels in Xt, editres and xedit to reduce number of warnings with + gcc4 (Andreas Schwab). + +commit dfb0b2dac20f575a7be260895f2847daeeacb819 +Author: Roland Mainz <roland.mainz@nrubsig.org> +Date: Mon Jan 3 01:06:36 2005 +0000 + + xc/lib/XprintAppUtil/xpapputil.c + xc/lib/XprintAppUtil/xpapputil.h + xc/lib/XprintUtil/xprintutil.c + xc/lib/XprintUtil/xprintutil.h + xc/programs/glxgears/glxgears.c + xc/programs/xdbedizzy/xdbedizzy.c + xc/programs/xedit/Xedit-xprint.ad + xc/programs/xedit/commands.c + xc/programs/xlogo/print.c + xc/programs/xlsfonts/xlsfonts.c + xc/programs/xlsfonts/xlsfonts.man + xc/programs/xlsfonts/xlsfonts.sgml + xc/programs/xman/Xman-xprint.ad + xc/programs/xman/handler.c + xc/programs/xman/print.c + xc/programs/xman/print.h + xc/programs/xmore/XMore.ad + xc/programs/xmore/print.c + xc/programs/xmore/print.h + xc/programs/xmore/printdialog.c + xc/programs/xmore/printdialog.h + xc/programs/xmore/printdialogprivates.h + xc/programs/xmore/xmore.c + xc/programs/xphelloworld/xpawhelloworld/xpawhelloworld.c + xc/programs/xphelloworld/xphelloworld/xphelloworld.c + xc/programs/xphelloworld/xpsimplehelloworld/xpsimplehelloworld.c + xc/programs/xphelloworld/xpxmhelloworld/xpxmhelloworld.c + xc/programs/xphelloworld/xpxthelloworld/xpxthelloworld.c + xc/programs/xplsprinters/xplsprinters.c + //bugs.freedesktop.org/show_bug.cgi?id=1706) attachment #1615 + (https://bugs.freedesktop.org/attachment.cgi?id=1615): XprintUtils + 2004/Q3 update. This adds various new features to the XprintUtils + library including support for page resolutions where + X_resolution!=Y_resolution, listfonts-mode control and initial + framework for the COLORSPACE extension. Patch by Roland Mainz + <roland.mainz@nrubsig.org> and Julien Lafon <julien.lafon@gmail.com>. + +commit 5581ed55c6918f69786d63e9a401f9d8b33a66d2 +Author: Markus Kuhn <Markus.Kuhn@cl.cam.ac.uk> +Date: Sat Dec 4 00:43:16 2004 +0000 + + Encoding of numerous files changed to UTF-8 + +commit 4d6b4556b8517ac36d6f87837dfb936872581b12 +Author: Roland Mainz <roland.mainz@nrubsig.org> +Date: Tue Oct 12 22:46:40 2004 +0000 + + Fix for https://freedesktop.org/bugzilla/show_bug.cgi?id=1601 - Fix + problems with wrong page counts in xedit&co. when a global "*geometry" + resource was overriding the internal geometry management used by + XawPrintShell(=usually adjust to current page size, the resource was + turning this into a static value). (Original patch by Felix Schulte + <felix.schulte@gmail.com>) + +commit 98e553431586c07fe0534c01c0a6e1b15ddc8958 +Author: Egbert Eich <eich@suse.de> +Date: Tue Sep 21 17:57:40 2004 +0000 + + Merged over libXpm security fix provided by Chris Evans, Matthieu Herrb and + Alan Coopersmith from release 6.8.1. + Fail during initialization with error if font/fontset is not set for + widget. This prevents a sig11 later when the non-existent font/fontset + structs are referenced. + Check if xf86Info.kbdProc pointer is really set before calling it on abort + as this pointer won't be set if the new modular keyboard driver is used + (Matthias Hopf). + Added new libs to the bindist control files. + Removed inclusion of unnecessary kernel header on Linux. This may fail in + an -ansi environment. + +commit 3981cffbb6f4f4fe4227481c51083063a9ea995e +Author: Kevin E Martin <kem@kem.org> +Date: Thu Sep 2 08:40:32 2004 +0000 + + Restore xman and xedit changes that were previously reverted, and make + Xprint support optional (Bug #1273, Roland Mainz). + +commit 6b12ddbb33c8722e50e7f69f456ba0ba72b76ddd +Author: Kristian Høgsberg <krh@redhat.com> +Date: Mon Aug 16 16:36:16 2004 +0000 + + As discussed and agreed on on the release-wranglers meeting of August 16, + I'm committing the patch from bug #1060 to back out unconditional + Xprint functionality. + Back out Xprint changes. + Revert xman to CVS of June 5, revert xlogo to CVS of May 8, revert xedit to + CVS of April 25, to back out unconditional Xprint support. + Fix up Xprint config logic to be like the rest of the extensions: + BuildXprint is a one-stop option for disabling everything Xprint + related. XprtServer controls building Xprt, BuildXprintLib controls + building Xprint libs and BuildXprintClients controls building clients + related to Xprint. BuiltXprint defaults to YES and the other options + respects relevant settings, i.e. BuildServer and BuildServersOnly. + Build Xaw regardless of BuildXprintLib setting. + Only build xphelloworld, xplsprinters and xprehashprinterlist when + BuildXprintClients it YES. Disable building xmore, it has always + supported XawPrintShell. + Make Xprint support depend on BuildXprintLib. + +commit d980ac394b3f828ce3c03d5894218d712d7b2846 +Author: Roland Mainz <roland.mainz@nrubsig.org> +Date: Thu Jul 29 00:40:35 2004 +0000 + + Fix for https://freedesktop.org/bugzilla/show_bug.cgi?id=938 - Update + XawPrintShell per feedback and review comments. + +commit d88d25361d5c03e126f040d08c4e005494ca9bfe +Author: Roland Mainz <roland.mainz@nrubsig.org> +Date: Tue Jun 8 02:44:35 2004 +0000 + + Fix for http://freedesktop.org/bugzilla/show_bug.cgi?id=668 - Add print + support to xman + +commit cf44083fa20c4f39a89a63ced16974c832039325 +Author: Roland Mainz <roland.mainz@nrubsig.org> +Date: Sun May 30 22:44:01 2004 +0000 + + Fix for http://freedesktop.org/bugzilla/show_bug.cgi?id=695 - Add print + support to Xedit + +commit 3b70888a54396c1b5ab67be863b189c7b8775695 +Author: Roland Mainz <roland.mainz@nrubsig.org> +Date: Sun May 30 00:52:30 2004 +0000 + + Fix for http://freedesktop.org/bugzilla/show_bug.cgi?id=693 - XMore and + XawPrintDialog work-in-progress, fixing various problems and adding + framework for i18n. + +commit aa3ab858ee6f5e51e0816dac708142bbcc38da5b +Author: Roland Mainz <roland.mainz@nrubsig.org> +Date: Mon May 24 03:17:44 2004 +0000 + + Fix for http://pdx.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=611 - + Adding simple text viewer (xmore) + +commit 5d7513ad1d0c061f97373b684d669ebf98d7867e +Author: Egbert Eich <eich@suse.de> +Date: Thu May 6 17:31:17 2004 +0000 + + BugZilla #601: Fixing makedepend choking on floating point exception + because CHAR_BIT is defined to __CHAR_BIT__ which is a compiler + intrinsic define. BugZilla #605: Fixing build on IA64 which is broken + due to the inclusion of the kernel header asm/page.h. Kernel headers + however don't work with + -ansi. The inclusion of asm/page.h can however savely be removed as it + there are plenty of other ways to determine the page size. + +commit 9f5d0de96f079e84c648a0173bffac8ec2c3bef5 +Author: Egbert Eich <eich@suse.de> +Date: Fri Apr 23 19:54:46 2004 +0000 + + Merging XORG-CURRENT into trunk + +commit 91547cc15f41faa1a55f2d764f67abd24777e9be +Author: Egbert Eich <eich@suse.de> +Date: Sun Mar 14 08:35:19 2004 +0000 + + Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004 + +commit 8293776acb1b916f1f7199e975bae4d370668243 +Author: Egbert Eich <eich@suse.de> +Date: Wed Mar 3 12:13:05 2004 +0000 + + Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004 + +commit b7c2da33938e1091850181d827a9ef6f51575883 +Author: Egbert Eich <eich@suse.de> +Date: Thu Feb 26 13:36:24 2004 +0000 + + readding XFree86's cvs IDs + +commit e502fd1629139ee9e5df1f0bdeb454710ab6adfa +Author: Egbert Eich <eich@suse.de> +Date: Thu Feb 26 09:24:06 2004 +0000 + + Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004 + +commit dc1aded02ad02936526d5528b6504121cf86e1b1 +Author: Kaleb Keithley <kaleb@freedesktop.org> +Date: Mon Feb 23 20:35:39 2004 +0000 + + Import most of XFree86 4.4RC3. This import excludes files which have the + new license. If we want to, later we can import 4.4RC3 again and pick + up the files that have the new license, but for now the vendor branch + is "pure." + +commit 71331fcaaca36aadf8f4857526a4ca2162b71df4 +Author: Egbert Eich <eich@suse.de> +Date: Thu Jan 29 08:09:08 2004 +0000 + + Importing vendor version xf86-012804-2330 on Thu Jan 29 00:06:33 PST 2004 + +commit 39a948f028c2e3cb3083d7d2f847acbd27facc23 +Author: Kaleb Keithley <kaleb@freedesktop.org> +Date: Fri Dec 19 20:55:55 2003 +0000 + + XFree86 4.3.99.902 (RC 2) + +commit 54593d8ebb341f7c2a0321fbf4207d7848b44a7f +Author: Kaleb Keithley <kaleb@freedesktop.org> +Date: Fri Dec 19 20:55:55 2003 +0000 + + Initial revision + +commit 0912e16e368c939d60f7b1400a247c6e5f080ff6 +Author: Kaleb Keithley <kaleb@freedesktop.org> +Date: Thu Dec 4 22:03:48 2003 +0000 + + XFree86 4.3.99.901 (RC 1) + +commit 10dc4a2c37597e02c12a9df3e9dba02a73bfc11b +Author: Kaleb Keithley <kaleb@freedesktop.org> +Date: Tue Nov 25 19:29:12 2003 +0000 + + XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks + +commit 8ae60bfe8a4b233100f5128859c76239e5789f70 +Author: Kaleb Keithley <kaleb@freedesktop.org> +Date: Fri Nov 14 16:49:22 2003 +0000 + + XFree86 4.3.0.1 + +commit 0a193e032ba1ecf3f003e027e833dc9d274cb740 +Author: Kaleb Keithley <kaleb@freedesktop.org> +Date: Fri Nov 14 16:49:22 2003 +0000 + + Initial revision diff --git a/app/xedit/Makefile.am b/app/xedit/Makefile.am index e2acfbb5f..db9a4e7c5 100644 --- a/app/xedit/Makefile.am +++ b/app/xedit/Makefile.am @@ -19,11 +19,9 @@ # TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -XEDITDIR = ${libdir}/X11/xedit -xedit_lispdir = ${XEDITDIR}/lisp - bin_PROGRAMS = xedit noinst_LIBRARIES = liblisp.a libre.a libmp.a +noinst_PROGRAMS = lisp/lsp lisp/re/tests # # libmp.a @@ -40,8 +38,7 @@ libmp_a_SOURCES = \ # liblisp.a # -liblisp_a_CFLAGS = -I$(top_srcdir)/lisp/re -I$(top_srcdir)/lisp/mp -DLISP -DLISPDIR=\"$(xedit_lispdir)\" $(XEDIT_CFLAGS) -liblisp_a_LIBADD = libmp.a +liblisp_a_CFLAGS = -I$(top_srcdir)/lisp/re -I$(top_srcdir)/lisp/mp -DLISP -DLISPDIR=\"$(LISPDIR)\" $(PKGDEPS_CFLAGS) liblisp_a_SOURCES = \ lisp/bytecode.c \ lisp/bytecode.h \ @@ -60,7 +57,6 @@ liblisp_a_SOURCES = \ lisp/io.h \ lisp/lisp.c \ lisp/lisp.h \ - lisp/lsp.c \ lisp/math.c \ lisp/math.h \ lisp/package.c \ @@ -87,6 +83,10 @@ liblisp_a_SOURCES = \ lisp/xedit.c \ lisp/xedit.h +if NEED_UNSETENV +liblisp_a_SOURCES += lisp/env.c +endif + # # libre.a # @@ -97,29 +97,37 @@ libre_a_SOURCES = \ lisp/re/rec.c \ lisp/re/re.h \ lisp/re/reo.c \ - lisp/re/rep.h \ - lisp/re/tests.c + lisp/re/rep.h # # xedit # - -xedit_CFLAGS = $(XEDIT_CFLAGS) -I$(top_srcdir)/lisp/re -D_BSD_SOURCE -DXEDIT -xedit_LDADD = libre.a liblisp.a libmp.a $(XEDIT_LIBS) -lm +xedit_DEPENDENCIES = liblisp.a libmp.a libre.a +xedit_CFLAGS = $(PKGDEPS_CFLAGS) -I$(top_srcdir)/lisp/re -D_BSD_SOURCE -DXEDIT +xedit_LDADD = -L. -lre -llisp -lmp $(PKGDEPS_LIBS) -lm xedit_SOURCES = \ commands.c \ + hash.c \ hook.c \ ispell.c \ lisp.c \ options.c \ - realpath.c \ - strcasecmp.c \ + tags.c \ util.c \ + util.h \ xedit.c \ xedit.h -if XAW_USE_XPRINT +if NEED_REALPATH +xedit_SOURCES += realpath.c +endif + +if NEED_STRCASECMP +xedit_SOURCES += strcasecmp.c +endif + +if USE_XPRINT xedit_CFLAGS += -DINCLUDE_XPRINT_SUPPORT xedit_SOURCES += \ @@ -130,13 +138,36 @@ xedit_SOURCES += \ print.h endif +# lisp/lsp +lisp_lsp_DEPENDENCIES = liblisp.a libre.a libmp.a +lisp_lsp_CFLAGS = -I$(top_srcdir)/lisp/re -I$(top_srcdir)/lisp/mp -DLISP -DLISPDIR=\"@LISPDIR@\" -D_BSD_SOURCE +lisp_lsp_LDADD = -L. -llisp -lre -lmp -lm +lisp_lsp_SOURCES = \ + hash.c \ + lisp/lsp.c + +if NEED_REALPATH +lisp_lsp_SOURCES += realpath.c +endif + +if NEED_STRCASECMP +lisp_lsp_SOURCES += strcasecmp.c +endif + +# re/tests +lisp_re_tests_DEPENDENCIES = libre.a +lisp_re_tests_CFLAGS = -I$(top_srcdir)/lisp/re -D_BSD_SOURCE +lisp_re_tests_LDADD = -L. -lre +lisp_re_tests_SOURCES = lisp/re/tests.c + + # App default files (*.ad) APPDEFAULTFILES = \ Xedit-color \ Xedit -if XAW_USE_XPRINT +if USE_XPRINT Xedit.ad: cp $(top_srcdir)/Xedit-xprint.ad Xedit.ad else @@ -154,20 +185,24 @@ appdefault_DATA = $(APPDEFAULTFILES) CLEANFILES = $(APPDEFAULTFILES) Xedit.ad -# Note that xedit_lispdir is defined above -dist_xedit_lisp_DATA = ${srcdir}/lisp/modules/lisp.lsp \ +lispdir = $(LISPDIR) +dist_lisp_DATA = ${srcdir}/lisp/modules/lisp.lsp \ ${srcdir}/lisp/modules/xedit.lsp \ ${srcdir}/lisp/modules/syntax.lsp \ ${srcdir}/lisp/modules/indent.lsp -progmodesdir = $(xedit_lispdir)/progmodes -dist_progmodes_DATA = ${srcdir}/lisp/modules/progmodes/c.lsp \ +progmodesdir = $(LISPDIR)/progmodes +dist_progmodes_DATA = \ + ${srcdir}/lisp/modules/progmodes/auto.lsp \ + ${srcdir}/lisp/modules/progmodes/c.lsp \ ${srcdir}/lisp/modules/progmodes/html.lsp \ ${srcdir}/lisp/modules/progmodes/imake.lsp \ ${srcdir}/lisp/modules/progmodes/lisp.lsp \ ${srcdir}/lisp/modules/progmodes/make.lsp \ ${srcdir}/lisp/modules/progmodes/man.lsp \ ${srcdir}/lisp/modules/progmodes/patch.lsp \ + ${srcdir}/lisp/modules/progmodes/perl.lsp \ + ${srcdir}/lisp/modules/progmodes/python.lsp \ ${srcdir}/lisp/modules/progmodes/rpm.lsp \ ${srcdir}/lisp/modules/progmodes/sgml.lsp \ ${srcdir}/lisp/modules/progmodes/sh.lsp \ @@ -233,3 +268,13 @@ SUFFIXES += .$(APP_MAN_SUFFIX) .man .man.$(APP_MAN_SUFFIX): sed $(MAN_SUBSTS) < $< > $@ + +EXTRA_DIST += ChangeLog +MAINTAINERCLEANFILES = ChangeLog + +.PHONY: ChangeLog + +ChangeLog: + (GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2) + +dist-hook: ChangeLog diff --git a/app/xedit/Makefile.in b/app/xedit/Makefile.in index b67ec5a1e..6fe8af7e0 100644 --- a/app/xedit/Makefile.in +++ b/app/xedit/Makefile.in @@ -60,16 +60,22 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = xedit$(EXEEXT) -@XAW_USE_XPRINT_TRUE@am__append_1 = -DINCLUDE_XPRINT_SUPPORT -@XAW_USE_XPRINT_TRUE@am__append_2 = \ -@XAW_USE_XPRINT_TRUE@ print.c \ -@XAW_USE_XPRINT_TRUE@ printdialog.c \ -@XAW_USE_XPRINT_TRUE@ printdialog.h \ -@XAW_USE_XPRINT_TRUE@ printdialogprivates.h \ -@XAW_USE_XPRINT_TRUE@ print.h - -DIST_COMMON = README $(am__configure_deps) $(dist_progmodes_DATA) \ - $(dist_xedit_lisp_DATA) $(srcdir)/Makefile.am \ +noinst_PROGRAMS = lisp/lsp$(EXEEXT) lisp/re/tests$(EXEEXT) +@NEED_UNSETENV_TRUE@am__append_1 = lisp/env.c +@NEED_REALPATH_TRUE@am__append_2 = realpath.c +@NEED_STRCASECMP_TRUE@am__append_3 = strcasecmp.c +@USE_XPRINT_TRUE@am__append_4 = -DINCLUDE_XPRINT_SUPPORT +@USE_XPRINT_TRUE@am__append_5 = \ +@USE_XPRINT_TRUE@ print.c \ +@USE_XPRINT_TRUE@ printdialog.c \ +@USE_XPRINT_TRUE@ printdialog.h \ +@USE_XPRINT_TRUE@ printdialogprivates.h \ +@USE_XPRINT_TRUE@ print.h + +@NEED_REALPATH_TRUE@am__append_6 = realpath.c +@NEED_STRCASECMP_TRUE@am__append_7 = strcasecmp.c +DIST_COMMON = README $(am__configure_deps) $(dist_lisp_DATA) \ + $(dist_progmodes_DATA) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ compile config.guess config.sub depcomp install-sh missing @@ -87,18 +93,30 @@ LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru liblisp_a_AR = $(AR) $(ARFLAGS) -liblisp_a_DEPENDENCIES = libmp.a +liblisp_a_LIBADD = +am__liblisp_a_SOURCES_DIST = lisp/bytecode.c lisp/bytecode.h \ + lisp/core.c lisp/core.h lisp/debugger.c lisp/debugger.h \ + lisp/format.c lisp/format.h lisp/hash.c lisp/hash.h \ + lisp/helper.c lisp/helper.h lisp/internal.h lisp/io.c \ + lisp/io.h lisp/lisp.c lisp/lisp.h lisp/math.c lisp/math.h \ + lisp/package.c lisp/package.h lisp/pathname.c lisp/pathname.h \ + lisp/private.h lisp/read.c lisp/read.h lisp/regex.c \ + lisp/regex.h lisp/require.c lisp/require.h lisp/stream.c \ + lisp/stream.h lisp/string.c lisp/string.h lisp/struct.c \ + lisp/struct.h lisp/time.c lisp/time.h lisp/write.c \ + lisp/write.h lisp/xedit.c lisp/xedit.h lisp/env.c +@NEED_UNSETENV_TRUE@am__objects_1 = liblisp_a-env.$(OBJEXT) am_liblisp_a_OBJECTS = liblisp_a-bytecode.$(OBJEXT) \ liblisp_a-core.$(OBJEXT) liblisp_a-debugger.$(OBJEXT) \ liblisp_a-format.$(OBJEXT) liblisp_a-hash.$(OBJEXT) \ liblisp_a-helper.$(OBJEXT) liblisp_a-io.$(OBJEXT) \ - liblisp_a-lisp.$(OBJEXT) liblisp_a-lsp.$(OBJEXT) \ - liblisp_a-math.$(OBJEXT) liblisp_a-package.$(OBJEXT) \ - liblisp_a-pathname.$(OBJEXT) liblisp_a-read.$(OBJEXT) \ - liblisp_a-regex.$(OBJEXT) liblisp_a-require.$(OBJEXT) \ - liblisp_a-stream.$(OBJEXT) liblisp_a-string.$(OBJEXT) \ - liblisp_a-struct.$(OBJEXT) liblisp_a-time.$(OBJEXT) \ - liblisp_a-write.$(OBJEXT) liblisp_a-xedit.$(OBJEXT) + liblisp_a-lisp.$(OBJEXT) liblisp_a-math.$(OBJEXT) \ + liblisp_a-package.$(OBJEXT) liblisp_a-pathname.$(OBJEXT) \ + liblisp_a-read.$(OBJEXT) liblisp_a-regex.$(OBJEXT) \ + liblisp_a-require.$(OBJEXT) liblisp_a-stream.$(OBJEXT) \ + liblisp_a-string.$(OBJEXT) liblisp_a-struct.$(OBJEXT) \ + liblisp_a-time.$(OBJEXT) liblisp_a-write.$(OBJEXT) \ + liblisp_a-xedit.$(OBJEXT) $(am__objects_1) liblisp_a_OBJECTS = $(am_liblisp_a_OBJECTS) libmp_a_AR = $(AR) $(ARFLAGS) libmp_a_LIBADD = @@ -108,26 +126,38 @@ libmp_a_OBJECTS = $(am_libmp_a_OBJECTS) libre_a_AR = $(AR) $(ARFLAGS) libre_a_LIBADD = am_libre_a_OBJECTS = libre_a-re.$(OBJEXT) libre_a-rec.$(OBJEXT) \ - libre_a-reo.$(OBJEXT) libre_a-tests.$(OBJEXT) + libre_a-reo.$(OBJEXT) libre_a_OBJECTS = $(am_libre_a_OBJECTS) am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appdefaultdir)" \ - "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(progmodesdir)" \ - "$(DESTDIR)$(xedit_lispdir)" + "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(lispdir)" \ + "$(DESTDIR)$(progmodesdir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) -PROGRAMS = $(bin_PROGRAMS) -am__xedit_SOURCES_DIST = commands.c hook.c ispell.c lisp.c options.c \ - realpath.c strcasecmp.c util.c xedit.c xedit.h print.c \ - printdialog.c printdialog.h printdialogprivates.h print.h -@XAW_USE_XPRINT_TRUE@am__objects_1 = xedit-print.$(OBJEXT) \ -@XAW_USE_XPRINT_TRUE@ xedit-printdialog.$(OBJEXT) -am_xedit_OBJECTS = xedit-commands.$(OBJEXT) xedit-hook.$(OBJEXT) \ - xedit-ispell.$(OBJEXT) xedit-lisp.$(OBJEXT) \ - xedit-options.$(OBJEXT) xedit-realpath.$(OBJEXT) \ - xedit-strcasecmp.$(OBJEXT) xedit-util.$(OBJEXT) \ - xedit-xedit.$(OBJEXT) $(am__objects_1) +PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) +am__lisp_lsp_SOURCES_DIST = hash.c lisp/lsp.c realpath.c strcasecmp.c +@NEED_REALPATH_TRUE@am__objects_2 = lisp_lsp-realpath.$(OBJEXT) +@NEED_STRCASECMP_TRUE@am__objects_3 = lisp_lsp-strcasecmp.$(OBJEXT) +am_lisp_lsp_OBJECTS = lisp_lsp-hash.$(OBJEXT) lisp_lsp-lsp.$(OBJEXT) \ + $(am__objects_2) $(am__objects_3) +lisp_lsp_OBJECTS = $(am_lisp_lsp_OBJECTS) +am__dirstamp = $(am__leading_dot)dirstamp +am_lisp_re_tests_OBJECTS = lisp_re_tests-tests.$(OBJEXT) +lisp_re_tests_OBJECTS = $(am_lisp_re_tests_OBJECTS) +am__xedit_SOURCES_DIST = commands.c hash.c hook.c ispell.c lisp.c \ + options.c tags.c util.c util.h xedit.c xedit.h realpath.c \ + strcasecmp.c print.c printdialog.c printdialog.h \ + printdialogprivates.h print.h +@NEED_REALPATH_TRUE@am__objects_4 = xedit-realpath.$(OBJEXT) +@NEED_STRCASECMP_TRUE@am__objects_5 = xedit-strcasecmp.$(OBJEXT) +@USE_XPRINT_TRUE@am__objects_6 = xedit-print.$(OBJEXT) \ +@USE_XPRINT_TRUE@ xedit-printdialog.$(OBJEXT) +am_xedit_OBJECTS = xedit-commands.$(OBJEXT) xedit-hash.$(OBJEXT) \ + xedit-hook.$(OBJEXT) xedit-ispell.$(OBJEXT) \ + xedit-lisp.$(OBJEXT) xedit-options.$(OBJEXT) \ + xedit-tags.$(OBJEXT) xedit-util.$(OBJEXT) \ + xedit-xedit.$(OBJEXT) $(am__objects_4) $(am__objects_5) \ + $(am__objects_6) xedit_OBJECTS = $(am_xedit_OBJECTS) am__DEPENDENCIES_1 = -xedit_DEPENDENCIES = libre.a liblisp.a libmp.a $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I. -I$(srcdir) -I. depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -136,9 +166,10 @@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(liblisp_a_SOURCES) $(libmp_a_SOURCES) $(libre_a_SOURCES) \ - $(xedit_SOURCES) -DIST_SOURCES = $(liblisp_a_SOURCES) $(libmp_a_SOURCES) \ - $(libre_a_SOURCES) $(am__xedit_SOURCES_DIST) + $(lisp_lsp_SOURCES) $(lisp_re_tests_SOURCES) $(xedit_SOURCES) +DIST_SOURCES = $(am__liblisp_a_SOURCES_DIST) $(libmp_a_SOURCES) \ + $(libre_a_SOURCES) $(am__lisp_lsp_SOURCES_DIST) \ + $(lisp_re_tests_SOURCES) $(am__xedit_SOURCES_DIST) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -147,10 +178,10 @@ am__vpath_adj = case $$p in \ am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; appdefaultDATA_INSTALL = $(INSTALL_DATA) appmanDATA_INSTALL = $(INSTALL_DATA) +dist_lispDATA_INSTALL = $(INSTALL_DATA) dist_progmodesDATA_INSTALL = $(INSTALL_DATA) -dist_xedit_lispDATA_INSTALL = $(INSTALL_DATA) -DATA = $(appdefault_DATA) $(appman_DATA) $(dist_progmodes_DATA) \ - $(dist_xedit_lisp_DATA) +DATA = $(appdefault_DATA) $(appman_DATA) $(dist_lisp_DATA) \ + $(dist_progmodes_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -202,6 +233,7 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LISPDIR = @LISPDIR@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ @@ -209,6 +241,12 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ +NEED_REALPATH_FALSE = @NEED_REALPATH_FALSE@ +NEED_REALPATH_TRUE = @NEED_REALPATH_TRUE@ +NEED_STRCASECMP_FALSE = @NEED_STRCASECMP_FALSE@ +NEED_STRCASECMP_TRUE = @NEED_STRCASECMP_TRUE@ +NEED_UNSETENV_FALSE = @NEED_UNSETENV_FALSE@ +NEED_UNSETENV_TRUE = @NEED_UNSETENV_TRUE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -217,20 +255,16 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKGDEPS_CFLAGS = @PKGDEPS_CFLAGS@ +PKGDEPS_LIBS = @PKGDEPS_LIBS@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ -TMP_XAW_CFLAGS = @TMP_XAW_CFLAGS@ -TMP_XAW_LIBS = @TMP_XAW_LIBS@ +USE_XPRINT_FALSE = @USE_XPRINT_FALSE@ +USE_XPRINT_TRUE = @USE_XPRINT_TRUE@ VERSION = @VERSION@ -XAW_USE_XPRINT_FALSE = @XAW_USE_XPRINT_FALSE@ -XAW_USE_XPRINT_TRUE = @XAW_USE_XPRINT_TRUE@ -XEDIT_CFLAGS = @XEDIT_CFLAGS@ -XEDIT_LIBS = @XEDIT_LIBS@ -XPRINT_UTIL_CFLAGS = @XPRINT_UTIL_CFLAGS@ -XPRINT_UTIL_LIBS = @XPRINT_UTIL_LIBS@ ac_ct_CC = @ac_ct_CC@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ @@ -271,8 +305,6 @@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -XEDITDIR = ${libdir}/X11/xedit -xedit_lispdir = ${XEDITDIR}/lisp noinst_LIBRARIES = liblisp.a libre.a libmp.a # @@ -289,53 +321,18 @@ libmp_a_SOURCES = \ # # liblisp.a # -liblisp_a_CFLAGS = -I$(top_srcdir)/lisp/re -I$(top_srcdir)/lisp/mp -DLISP -DLISPDIR=\"$(xedit_lispdir)\" $(XEDIT_CFLAGS) -liblisp_a_LIBADD = libmp.a -liblisp_a_SOURCES = \ - lisp/bytecode.c \ - lisp/bytecode.h \ - lisp/core.c \ - lisp/core.h \ - lisp/debugger.c \ - lisp/debugger.h \ - lisp/format.c \ - lisp/format.h \ - lisp/hash.c \ - lisp/hash.h \ - lisp/helper.c \ - lisp/helper.h \ - lisp/internal.h \ - lisp/io.c \ - lisp/io.h \ - lisp/lisp.c \ - lisp/lisp.h \ - lisp/lsp.c \ - lisp/math.c \ - lisp/math.h \ - lisp/package.c \ - lisp/package.h \ - lisp/pathname.c \ - lisp/pathname.h \ - lisp/private.h \ - lisp/read.c \ - lisp/read.h \ - lisp/regex.c \ - lisp/regex.h \ - lisp/require.c \ - lisp/require.h \ - lisp/stream.c \ - lisp/stream.h \ - lisp/string.c \ - lisp/string.h \ - lisp/struct.c \ - lisp/struct.h \ - lisp/time.c \ - lisp/time.h \ - lisp/write.c \ - lisp/write.h \ - lisp/xedit.c \ - lisp/xedit.h - +liblisp_a_CFLAGS = -I$(top_srcdir)/lisp/re -I$(top_srcdir)/lisp/mp -DLISP -DLISPDIR=\"$(LISPDIR)\" $(PKGDEPS_CFLAGS) +liblisp_a_SOURCES = lisp/bytecode.c lisp/bytecode.h lisp/core.c \ + lisp/core.h lisp/debugger.c lisp/debugger.h lisp/format.c \ + lisp/format.h lisp/hash.c lisp/hash.h lisp/helper.c \ + lisp/helper.h lisp/internal.h lisp/io.c lisp/io.h lisp/lisp.c \ + lisp/lisp.h lisp/math.c lisp/math.h lisp/package.c \ + lisp/package.h lisp/pathname.c lisp/pathname.h lisp/private.h \ + lisp/read.c lisp/read.h lisp/regex.c lisp/regex.h \ + lisp/require.c lisp/require.h lisp/stream.c lisp/stream.h \ + lisp/string.c lisp/string.h lisp/struct.c lisp/struct.h \ + lisp/time.c lisp/time.h lisp/write.c lisp/write.h lisp/xedit.c \ + lisp/xedit.h $(am__append_1) # # libre.a @@ -346,18 +343,31 @@ libre_a_SOURCES = \ lisp/re/rec.c \ lisp/re/re.h \ lisp/re/reo.c \ - lisp/re/rep.h \ - lisp/re/tests.c + lisp/re/rep.h # # xedit # -xedit_CFLAGS = $(XEDIT_CFLAGS) -I$(top_srcdir)/lisp/re -D_BSD_SOURCE \ - -DXEDIT $(am__append_1) -xedit_LDADD = libre.a liblisp.a libmp.a $(XEDIT_LIBS) -lm -xedit_SOURCES = commands.c hook.c ispell.c lisp.c options.c realpath.c \ - strcasecmp.c util.c xedit.c xedit.h $(am__append_2) +xedit_DEPENDENCIES = liblisp.a libmp.a libre.a +xedit_CFLAGS = $(PKGDEPS_CFLAGS) -I$(top_srcdir)/lisp/re -D_BSD_SOURCE \ + -DXEDIT $(am__append_4) +xedit_LDADD = -L. -lre -llisp -lmp $(PKGDEPS_LIBS) -lm +xedit_SOURCES = commands.c hash.c hook.c ispell.c lisp.c options.c \ + tags.c util.c util.h xedit.c xedit.h $(am__append_2) \ + $(am__append_3) $(am__append_5) + +# lisp/lsp +lisp_lsp_DEPENDENCIES = liblisp.a libre.a libmp.a +lisp_lsp_CFLAGS = -I$(top_srcdir)/lisp/re -I$(top_srcdir)/lisp/mp -DLISP -DLISPDIR=\"@LISPDIR@\" -D_BSD_SOURCE +lisp_lsp_LDADD = -L. -llisp -lre -lmp -lm +lisp_lsp_SOURCES = hash.c lisp/lsp.c $(am__append_6) $(am__append_7) + +# re/tests +lisp_re_tests_DEPENDENCIES = libre.a +lisp_re_tests_CFLAGS = -I$(top_srcdir)/lisp/re -D_BSD_SOURCE +lisp_re_tests_LDADD = -L. -lre +lisp_re_tests_SOURCES = lisp/re/tests.c # App default files (*.ad) APPDEFAULTFILES = \ @@ -367,21 +377,24 @@ APPDEFAULTFILES = \ SUFFIXES = .ad .$(APP_MAN_SUFFIX) .man appdefault_DATA = $(APPDEFAULTFILES) CLEANFILES = $(APPDEFAULTFILES) Xedit.ad $(appman_DATA) - -# Note that xedit_lispdir is defined above -dist_xedit_lisp_DATA = ${srcdir}/lisp/modules/lisp.lsp \ +lispdir = $(LISPDIR) +dist_lisp_DATA = ${srcdir}/lisp/modules/lisp.lsp \ ${srcdir}/lisp/modules/xedit.lsp \ ${srcdir}/lisp/modules/syntax.lsp \ ${srcdir}/lisp/modules/indent.lsp -progmodesdir = $(xedit_lispdir)/progmodes -dist_progmodes_DATA = ${srcdir}/lisp/modules/progmodes/c.lsp \ +progmodesdir = $(LISPDIR)/progmodes +dist_progmodes_DATA = \ + ${srcdir}/lisp/modules/progmodes/auto.lsp \ + ${srcdir}/lisp/modules/progmodes/c.lsp \ ${srcdir}/lisp/modules/progmodes/html.lsp \ ${srcdir}/lisp/modules/progmodes/imake.lsp \ ${srcdir}/lisp/modules/progmodes/lisp.lsp \ ${srcdir}/lisp/modules/progmodes/make.lsp \ ${srcdir}/lisp/modules/progmodes/man.lsp \ ${srcdir}/lisp/modules/progmodes/patch.lsp \ + ${srcdir}/lisp/modules/progmodes/perl.lsp \ + ${srcdir}/lisp/modules/progmodes/python.lsp \ ${srcdir}/lisp/modules/progmodes/rpm.lsp \ ${srcdir}/lisp/modules/progmodes/sgml.lsp \ ${srcdir}/lisp/modules/progmodes/sh.lsp \ @@ -397,7 +410,7 @@ EXTRA_DIST = Xedit-color.ad Xedit-xprint.ad Xedit-noxprint.ad \ lisp/re/tests.txt lisp/test/hello.lsp lisp/test/list.lsp \ lisp/test/math.lsp lisp/test/psql-1.lsp lisp/test/psql-2.lsp \ lisp/test/psql-3.lsp lisp/test/regex.lsp lisp/test/stream.lsp \ - lisp/test/widgets.lsp $(appman_PRE) + lisp/test/widgets.lsp $(appman_PRE) ChangeLog appmandir = $(APP_MAN_DIR) appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@) SED = sed @@ -418,6 +431,7 @@ MAN_SUBSTS = \ -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \ -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' +MAINTAINERCLEANFILES = ChangeLog all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am @@ -511,6 +525,21 @@ uninstall-binPROGRAMS: clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + +clean-noinstPROGRAMS: + -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) +lisp/$(am__dirstamp): + @$(mkdir_p) lisp + @: > lisp/$(am__dirstamp) +lisp/lsp$(EXEEXT): $(lisp_lsp_OBJECTS) $(lisp_lsp_DEPENDENCIES) lisp/$(am__dirstamp) + @rm -f lisp/lsp$(EXEEXT) + $(LINK) $(lisp_lsp_LDFLAGS) $(lisp_lsp_OBJECTS) $(lisp_lsp_LDADD) $(LIBS) +lisp/re/$(am__dirstamp): + @$(mkdir_p) lisp/re + @: > lisp/re/$(am__dirstamp) +lisp/re/tests$(EXEEXT): $(lisp_re_tests_OBJECTS) $(lisp_re_tests_DEPENDENCIES) lisp/re/$(am__dirstamp) + @rm -f lisp/re/tests$(EXEEXT) + $(LINK) $(lisp_re_tests_LDFLAGS) $(lisp_re_tests_OBJECTS) $(lisp_re_tests_LDADD) $(LIBS) xedit$(EXEEXT): $(xedit_OBJECTS) $(xedit_DEPENDENCIES) @rm -f xedit$(EXEEXT) $(LINK) $(xedit_LDFLAGS) $(xedit_OBJECTS) $(xedit_LDADD) $(LIBS) @@ -524,12 +553,12 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-bytecode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-core.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-debugger.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-env.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-format.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-hash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-helper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-io.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-lisp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-lsp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-math.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-package.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-pathname.Po@am__quote@ @@ -548,8 +577,13 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libre_a-re.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libre_a-rec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libre_a-reo.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libre_a-tests.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lisp_lsp-hash.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lisp_lsp-lsp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lisp_lsp-realpath.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lisp_lsp-strcasecmp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lisp_re_tests-tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xedit-commands.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xedit-hash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xedit-hook.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xedit-ispell.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xedit-lisp.Po@am__quote@ @@ -558,6 +592,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xedit-printdialog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xedit-realpath.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xedit-strcasecmp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xedit-tags.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xedit-util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xedit-xedit.Po@am__quote@ @@ -687,20 +722,6 @@ liblisp_a-lisp.obj: lisp/lisp.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-lisp.obj `if test -f 'lisp/lisp.c'; then $(CYGPATH_W) 'lisp/lisp.c'; else $(CYGPATH_W) '$(srcdir)/lisp/lisp.c'; fi` -liblisp_a-lsp.o: lisp/lsp.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-lsp.o -MD -MP -MF "$(DEPDIR)/liblisp_a-lsp.Tpo" -c -o liblisp_a-lsp.o `test -f 'lisp/lsp.c' || echo '$(srcdir)/'`lisp/lsp.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblisp_a-lsp.Tpo" "$(DEPDIR)/liblisp_a-lsp.Po"; else rm -f "$(DEPDIR)/liblisp_a-lsp.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lisp/lsp.c' object='liblisp_a-lsp.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-lsp.o `test -f 'lisp/lsp.c' || echo '$(srcdir)/'`lisp/lsp.c - -liblisp_a-lsp.obj: lisp/lsp.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-lsp.obj -MD -MP -MF "$(DEPDIR)/liblisp_a-lsp.Tpo" -c -o liblisp_a-lsp.obj `if test -f 'lisp/lsp.c'; then $(CYGPATH_W) 'lisp/lsp.c'; else $(CYGPATH_W) '$(srcdir)/lisp/lsp.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblisp_a-lsp.Tpo" "$(DEPDIR)/liblisp_a-lsp.Po"; else rm -f "$(DEPDIR)/liblisp_a-lsp.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lisp/lsp.c' object='liblisp_a-lsp.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-lsp.obj `if test -f 'lisp/lsp.c'; then $(CYGPATH_W) 'lisp/lsp.c'; else $(CYGPATH_W) '$(srcdir)/lisp/lsp.c'; fi` - liblisp_a-math.o: lisp/math.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-math.o -MD -MP -MF "$(DEPDIR)/liblisp_a-math.Tpo" -c -o liblisp_a-math.o `test -f 'lisp/math.c' || echo '$(srcdir)/'`lisp/math.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblisp_a-math.Tpo" "$(DEPDIR)/liblisp_a-math.Po"; else rm -f "$(DEPDIR)/liblisp_a-math.Tpo"; exit 1; fi @@ -869,6 +890,20 @@ liblisp_a-xedit.obj: lisp/xedit.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-xedit.obj `if test -f 'lisp/xedit.c'; then $(CYGPATH_W) 'lisp/xedit.c'; else $(CYGPATH_W) '$(srcdir)/lisp/xedit.c'; fi` +liblisp_a-env.o: lisp/env.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-env.o -MD -MP -MF "$(DEPDIR)/liblisp_a-env.Tpo" -c -o liblisp_a-env.o `test -f 'lisp/env.c' || echo '$(srcdir)/'`lisp/env.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblisp_a-env.Tpo" "$(DEPDIR)/liblisp_a-env.Po"; else rm -f "$(DEPDIR)/liblisp_a-env.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lisp/env.c' object='liblisp_a-env.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-env.o `test -f 'lisp/env.c' || echo '$(srcdir)/'`lisp/env.c + +liblisp_a-env.obj: lisp/env.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-env.obj -MD -MP -MF "$(DEPDIR)/liblisp_a-env.Tpo" -c -o liblisp_a-env.obj `if test -f 'lisp/env.c'; then $(CYGPATH_W) 'lisp/env.c'; else $(CYGPATH_W) '$(srcdir)/lisp/env.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblisp_a-env.Tpo" "$(DEPDIR)/liblisp_a-env.Po"; else rm -f "$(DEPDIR)/liblisp_a-env.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lisp/env.c' object='liblisp_a-env.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-env.obj `if test -f 'lisp/env.c'; then $(CYGPATH_W) 'lisp/env.c'; else $(CYGPATH_W) '$(srcdir)/lisp/env.c'; fi` + libmp_a-mp.o: lisp/mp/mp.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp_a_CFLAGS) $(CFLAGS) -MT libmp_a-mp.o -MD -MP -MF "$(DEPDIR)/libmp_a-mp.Tpo" -c -o libmp_a-mp.o `test -f 'lisp/mp/mp.c' || echo '$(srcdir)/'`lisp/mp/mp.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp_a-mp.Tpo" "$(DEPDIR)/libmp_a-mp.Po"; else rm -f "$(DEPDIR)/libmp_a-mp.Tpo"; exit 1; fi @@ -953,19 +988,75 @@ libre_a-reo.obj: lisp/re/reo.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libre_a_CFLAGS) $(CFLAGS) -c -o libre_a-reo.obj `if test -f 'lisp/re/reo.c'; then $(CYGPATH_W) 'lisp/re/reo.c'; else $(CYGPATH_W) '$(srcdir)/lisp/re/reo.c'; fi` -libre_a-tests.o: lisp/re/tests.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libre_a_CFLAGS) $(CFLAGS) -MT libre_a-tests.o -MD -MP -MF "$(DEPDIR)/libre_a-tests.Tpo" -c -o libre_a-tests.o `test -f 'lisp/re/tests.c' || echo '$(srcdir)/'`lisp/re/tests.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libre_a-tests.Tpo" "$(DEPDIR)/libre_a-tests.Po"; else rm -f "$(DEPDIR)/libre_a-tests.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lisp/re/tests.c' object='libre_a-tests.o' libtool=no @AMDEPBACKSLASH@ +lisp_lsp-hash.o: hash.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_lsp_CFLAGS) $(CFLAGS) -MT lisp_lsp-hash.o -MD -MP -MF "$(DEPDIR)/lisp_lsp-hash.Tpo" -c -o lisp_lsp-hash.o `test -f 'hash.c' || echo '$(srcdir)/'`hash.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lisp_lsp-hash.Tpo" "$(DEPDIR)/lisp_lsp-hash.Po"; else rm -f "$(DEPDIR)/lisp_lsp-hash.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hash.c' object='lisp_lsp-hash.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_lsp_CFLAGS) $(CFLAGS) -c -o lisp_lsp-hash.o `test -f 'hash.c' || echo '$(srcdir)/'`hash.c + +lisp_lsp-hash.obj: hash.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_lsp_CFLAGS) $(CFLAGS) -MT lisp_lsp-hash.obj -MD -MP -MF "$(DEPDIR)/lisp_lsp-hash.Tpo" -c -o lisp_lsp-hash.obj `if test -f 'hash.c'; then $(CYGPATH_W) 'hash.c'; else $(CYGPATH_W) '$(srcdir)/hash.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lisp_lsp-hash.Tpo" "$(DEPDIR)/lisp_lsp-hash.Po"; else rm -f "$(DEPDIR)/lisp_lsp-hash.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hash.c' object='lisp_lsp-hash.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libre_a_CFLAGS) $(CFLAGS) -c -o libre_a-tests.o `test -f 'lisp/re/tests.c' || echo '$(srcdir)/'`lisp/re/tests.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_lsp_CFLAGS) $(CFLAGS) -c -o lisp_lsp-hash.obj `if test -f 'hash.c'; then $(CYGPATH_W) 'hash.c'; else $(CYGPATH_W) '$(srcdir)/hash.c'; fi` -libre_a-tests.obj: lisp/re/tests.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libre_a_CFLAGS) $(CFLAGS) -MT libre_a-tests.obj -MD -MP -MF "$(DEPDIR)/libre_a-tests.Tpo" -c -o libre_a-tests.obj `if test -f 'lisp/re/tests.c'; then $(CYGPATH_W) 'lisp/re/tests.c'; else $(CYGPATH_W) '$(srcdir)/lisp/re/tests.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libre_a-tests.Tpo" "$(DEPDIR)/libre_a-tests.Po"; else rm -f "$(DEPDIR)/libre_a-tests.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lisp/re/tests.c' object='libre_a-tests.obj' libtool=no @AMDEPBACKSLASH@ +lisp_lsp-lsp.o: lisp/lsp.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_lsp_CFLAGS) $(CFLAGS) -MT lisp_lsp-lsp.o -MD -MP -MF "$(DEPDIR)/lisp_lsp-lsp.Tpo" -c -o lisp_lsp-lsp.o `test -f 'lisp/lsp.c' || echo '$(srcdir)/'`lisp/lsp.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lisp_lsp-lsp.Tpo" "$(DEPDIR)/lisp_lsp-lsp.Po"; else rm -f "$(DEPDIR)/lisp_lsp-lsp.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lisp/lsp.c' object='lisp_lsp-lsp.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libre_a_CFLAGS) $(CFLAGS) -c -o libre_a-tests.obj `if test -f 'lisp/re/tests.c'; then $(CYGPATH_W) 'lisp/re/tests.c'; else $(CYGPATH_W) '$(srcdir)/lisp/re/tests.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_lsp_CFLAGS) $(CFLAGS) -c -o lisp_lsp-lsp.o `test -f 'lisp/lsp.c' || echo '$(srcdir)/'`lisp/lsp.c + +lisp_lsp-lsp.obj: lisp/lsp.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_lsp_CFLAGS) $(CFLAGS) -MT lisp_lsp-lsp.obj -MD -MP -MF "$(DEPDIR)/lisp_lsp-lsp.Tpo" -c -o lisp_lsp-lsp.obj `if test -f 'lisp/lsp.c'; then $(CYGPATH_W) 'lisp/lsp.c'; else $(CYGPATH_W) '$(srcdir)/lisp/lsp.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lisp_lsp-lsp.Tpo" "$(DEPDIR)/lisp_lsp-lsp.Po"; else rm -f "$(DEPDIR)/lisp_lsp-lsp.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lisp/lsp.c' object='lisp_lsp-lsp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_lsp_CFLAGS) $(CFLAGS) -c -o lisp_lsp-lsp.obj `if test -f 'lisp/lsp.c'; then $(CYGPATH_W) 'lisp/lsp.c'; else $(CYGPATH_W) '$(srcdir)/lisp/lsp.c'; fi` + +lisp_lsp-realpath.o: realpath.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_lsp_CFLAGS) $(CFLAGS) -MT lisp_lsp-realpath.o -MD -MP -MF "$(DEPDIR)/lisp_lsp-realpath.Tpo" -c -o lisp_lsp-realpath.o `test -f 'realpath.c' || echo '$(srcdir)/'`realpath.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lisp_lsp-realpath.Tpo" "$(DEPDIR)/lisp_lsp-realpath.Po"; else rm -f "$(DEPDIR)/lisp_lsp-realpath.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='realpath.c' object='lisp_lsp-realpath.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_lsp_CFLAGS) $(CFLAGS) -c -o lisp_lsp-realpath.o `test -f 'realpath.c' || echo '$(srcdir)/'`realpath.c + +lisp_lsp-realpath.obj: realpath.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_lsp_CFLAGS) $(CFLAGS) -MT lisp_lsp-realpath.obj -MD -MP -MF "$(DEPDIR)/lisp_lsp-realpath.Tpo" -c -o lisp_lsp-realpath.obj `if test -f 'realpath.c'; then $(CYGPATH_W) 'realpath.c'; else $(CYGPATH_W) '$(srcdir)/realpath.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lisp_lsp-realpath.Tpo" "$(DEPDIR)/lisp_lsp-realpath.Po"; else rm -f "$(DEPDIR)/lisp_lsp-realpath.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='realpath.c' object='lisp_lsp-realpath.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_lsp_CFLAGS) $(CFLAGS) -c -o lisp_lsp-realpath.obj `if test -f 'realpath.c'; then $(CYGPATH_W) 'realpath.c'; else $(CYGPATH_W) '$(srcdir)/realpath.c'; fi` + +lisp_lsp-strcasecmp.o: strcasecmp.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_lsp_CFLAGS) $(CFLAGS) -MT lisp_lsp-strcasecmp.o -MD -MP -MF "$(DEPDIR)/lisp_lsp-strcasecmp.Tpo" -c -o lisp_lsp-strcasecmp.o `test -f 'strcasecmp.c' || echo '$(srcdir)/'`strcasecmp.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lisp_lsp-strcasecmp.Tpo" "$(DEPDIR)/lisp_lsp-strcasecmp.Po"; else rm -f "$(DEPDIR)/lisp_lsp-strcasecmp.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='strcasecmp.c' object='lisp_lsp-strcasecmp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_lsp_CFLAGS) $(CFLAGS) -c -o lisp_lsp-strcasecmp.o `test -f 'strcasecmp.c' || echo '$(srcdir)/'`strcasecmp.c + +lisp_lsp-strcasecmp.obj: strcasecmp.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_lsp_CFLAGS) $(CFLAGS) -MT lisp_lsp-strcasecmp.obj -MD -MP -MF "$(DEPDIR)/lisp_lsp-strcasecmp.Tpo" -c -o lisp_lsp-strcasecmp.obj `if test -f 'strcasecmp.c'; then $(CYGPATH_W) 'strcasecmp.c'; else $(CYGPATH_W) '$(srcdir)/strcasecmp.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lisp_lsp-strcasecmp.Tpo" "$(DEPDIR)/lisp_lsp-strcasecmp.Po"; else rm -f "$(DEPDIR)/lisp_lsp-strcasecmp.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='strcasecmp.c' object='lisp_lsp-strcasecmp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_lsp_CFLAGS) $(CFLAGS) -c -o lisp_lsp-strcasecmp.obj `if test -f 'strcasecmp.c'; then $(CYGPATH_W) 'strcasecmp.c'; else $(CYGPATH_W) '$(srcdir)/strcasecmp.c'; fi` + +lisp_re_tests-tests.o: lisp/re/tests.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_re_tests_CFLAGS) $(CFLAGS) -MT lisp_re_tests-tests.o -MD -MP -MF "$(DEPDIR)/lisp_re_tests-tests.Tpo" -c -o lisp_re_tests-tests.o `test -f 'lisp/re/tests.c' || echo '$(srcdir)/'`lisp/re/tests.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lisp_re_tests-tests.Tpo" "$(DEPDIR)/lisp_re_tests-tests.Po"; else rm -f "$(DEPDIR)/lisp_re_tests-tests.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lisp/re/tests.c' object='lisp_re_tests-tests.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_re_tests_CFLAGS) $(CFLAGS) -c -o lisp_re_tests-tests.o `test -f 'lisp/re/tests.c' || echo '$(srcdir)/'`lisp/re/tests.c + +lisp_re_tests-tests.obj: lisp/re/tests.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_re_tests_CFLAGS) $(CFLAGS) -MT lisp_re_tests-tests.obj -MD -MP -MF "$(DEPDIR)/lisp_re_tests-tests.Tpo" -c -o lisp_re_tests-tests.obj `if test -f 'lisp/re/tests.c'; then $(CYGPATH_W) 'lisp/re/tests.c'; else $(CYGPATH_W) '$(srcdir)/lisp/re/tests.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lisp_re_tests-tests.Tpo" "$(DEPDIR)/lisp_re_tests-tests.Po"; else rm -f "$(DEPDIR)/lisp_re_tests-tests.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lisp/re/tests.c' object='lisp_re_tests-tests.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_re_tests_CFLAGS) $(CFLAGS) -c -o lisp_re_tests-tests.obj `if test -f 'lisp/re/tests.c'; then $(CYGPATH_W) 'lisp/re/tests.c'; else $(CYGPATH_W) '$(srcdir)/lisp/re/tests.c'; fi` xedit-commands.o: commands.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-commands.o -MD -MP -MF "$(DEPDIR)/xedit-commands.Tpo" -c -o xedit-commands.o `test -f 'commands.c' || echo '$(srcdir)/'`commands.c; \ @@ -981,6 +1072,20 @@ xedit-commands.obj: commands.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-commands.obj `if test -f 'commands.c'; then $(CYGPATH_W) 'commands.c'; else $(CYGPATH_W) '$(srcdir)/commands.c'; fi` +xedit-hash.o: hash.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-hash.o -MD -MP -MF "$(DEPDIR)/xedit-hash.Tpo" -c -o xedit-hash.o `test -f 'hash.c' || echo '$(srcdir)/'`hash.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xedit-hash.Tpo" "$(DEPDIR)/xedit-hash.Po"; else rm -f "$(DEPDIR)/xedit-hash.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hash.c' object='xedit-hash.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-hash.o `test -f 'hash.c' || echo '$(srcdir)/'`hash.c + +xedit-hash.obj: hash.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-hash.obj -MD -MP -MF "$(DEPDIR)/xedit-hash.Tpo" -c -o xedit-hash.obj `if test -f 'hash.c'; then $(CYGPATH_W) 'hash.c'; else $(CYGPATH_W) '$(srcdir)/hash.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xedit-hash.Tpo" "$(DEPDIR)/xedit-hash.Po"; else rm -f "$(DEPDIR)/xedit-hash.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hash.c' object='xedit-hash.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-hash.obj `if test -f 'hash.c'; then $(CYGPATH_W) 'hash.c'; else $(CYGPATH_W) '$(srcdir)/hash.c'; fi` + xedit-hook.o: hook.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-hook.o -MD -MP -MF "$(DEPDIR)/xedit-hook.Tpo" -c -o xedit-hook.o `test -f 'hook.c' || echo '$(srcdir)/'`hook.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xedit-hook.Tpo" "$(DEPDIR)/xedit-hook.Po"; else rm -f "$(DEPDIR)/xedit-hook.Tpo"; exit 1; fi @@ -1037,33 +1142,19 @@ xedit-options.obj: options.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-options.obj `if test -f 'options.c'; then $(CYGPATH_W) 'options.c'; else $(CYGPATH_W) '$(srcdir)/options.c'; fi` -xedit-realpath.o: realpath.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-realpath.o -MD -MP -MF "$(DEPDIR)/xedit-realpath.Tpo" -c -o xedit-realpath.o `test -f 'realpath.c' || echo '$(srcdir)/'`realpath.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xedit-realpath.Tpo" "$(DEPDIR)/xedit-realpath.Po"; else rm -f "$(DEPDIR)/xedit-realpath.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='realpath.c' object='xedit-realpath.o' libtool=no @AMDEPBACKSLASH@ +xedit-tags.o: tags.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-tags.o -MD -MP -MF "$(DEPDIR)/xedit-tags.Tpo" -c -o xedit-tags.o `test -f 'tags.c' || echo '$(srcdir)/'`tags.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xedit-tags.Tpo" "$(DEPDIR)/xedit-tags.Po"; else rm -f "$(DEPDIR)/xedit-tags.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tags.c' object='xedit-tags.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-realpath.o `test -f 'realpath.c' || echo '$(srcdir)/'`realpath.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-tags.o `test -f 'tags.c' || echo '$(srcdir)/'`tags.c -xedit-realpath.obj: realpath.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-realpath.obj -MD -MP -MF "$(DEPDIR)/xedit-realpath.Tpo" -c -o xedit-realpath.obj `if test -f 'realpath.c'; then $(CYGPATH_W) 'realpath.c'; else $(CYGPATH_W) '$(srcdir)/realpath.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xedit-realpath.Tpo" "$(DEPDIR)/xedit-realpath.Po"; else rm -f "$(DEPDIR)/xedit-realpath.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='realpath.c' object='xedit-realpath.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-realpath.obj `if test -f 'realpath.c'; then $(CYGPATH_W) 'realpath.c'; else $(CYGPATH_W) '$(srcdir)/realpath.c'; fi` - -xedit-strcasecmp.o: strcasecmp.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-strcasecmp.o -MD -MP -MF "$(DEPDIR)/xedit-strcasecmp.Tpo" -c -o xedit-strcasecmp.o `test -f 'strcasecmp.c' || echo '$(srcdir)/'`strcasecmp.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xedit-strcasecmp.Tpo" "$(DEPDIR)/xedit-strcasecmp.Po"; else rm -f "$(DEPDIR)/xedit-strcasecmp.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='strcasecmp.c' object='xedit-strcasecmp.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-strcasecmp.o `test -f 'strcasecmp.c' || echo '$(srcdir)/'`strcasecmp.c - -xedit-strcasecmp.obj: strcasecmp.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-strcasecmp.obj -MD -MP -MF "$(DEPDIR)/xedit-strcasecmp.Tpo" -c -o xedit-strcasecmp.obj `if test -f 'strcasecmp.c'; then $(CYGPATH_W) 'strcasecmp.c'; else $(CYGPATH_W) '$(srcdir)/strcasecmp.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xedit-strcasecmp.Tpo" "$(DEPDIR)/xedit-strcasecmp.Po"; else rm -f "$(DEPDIR)/xedit-strcasecmp.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='strcasecmp.c' object='xedit-strcasecmp.obj' libtool=no @AMDEPBACKSLASH@ +xedit-tags.obj: tags.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-tags.obj -MD -MP -MF "$(DEPDIR)/xedit-tags.Tpo" -c -o xedit-tags.obj `if test -f 'tags.c'; then $(CYGPATH_W) 'tags.c'; else $(CYGPATH_W) '$(srcdir)/tags.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xedit-tags.Tpo" "$(DEPDIR)/xedit-tags.Po"; else rm -f "$(DEPDIR)/xedit-tags.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tags.c' object='xedit-tags.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-strcasecmp.obj `if test -f 'strcasecmp.c'; then $(CYGPATH_W) 'strcasecmp.c'; else $(CYGPATH_W) '$(srcdir)/strcasecmp.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-tags.obj `if test -f 'tags.c'; then $(CYGPATH_W) 'tags.c'; else $(CYGPATH_W) '$(srcdir)/tags.c'; fi` xedit-util.o: util.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-util.o -MD -MP -MF "$(DEPDIR)/xedit-util.Tpo" -c -o xedit-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c; \ @@ -1093,6 +1184,34 @@ xedit-xedit.obj: xedit.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-xedit.obj `if test -f 'xedit.c'; then $(CYGPATH_W) 'xedit.c'; else $(CYGPATH_W) '$(srcdir)/xedit.c'; fi` +xedit-realpath.o: realpath.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-realpath.o -MD -MP -MF "$(DEPDIR)/xedit-realpath.Tpo" -c -o xedit-realpath.o `test -f 'realpath.c' || echo '$(srcdir)/'`realpath.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xedit-realpath.Tpo" "$(DEPDIR)/xedit-realpath.Po"; else rm -f "$(DEPDIR)/xedit-realpath.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='realpath.c' object='xedit-realpath.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-realpath.o `test -f 'realpath.c' || echo '$(srcdir)/'`realpath.c + +xedit-realpath.obj: realpath.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-realpath.obj -MD -MP -MF "$(DEPDIR)/xedit-realpath.Tpo" -c -o xedit-realpath.obj `if test -f 'realpath.c'; then $(CYGPATH_W) 'realpath.c'; else $(CYGPATH_W) '$(srcdir)/realpath.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xedit-realpath.Tpo" "$(DEPDIR)/xedit-realpath.Po"; else rm -f "$(DEPDIR)/xedit-realpath.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='realpath.c' object='xedit-realpath.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-realpath.obj `if test -f 'realpath.c'; then $(CYGPATH_W) 'realpath.c'; else $(CYGPATH_W) '$(srcdir)/realpath.c'; fi` + +xedit-strcasecmp.o: strcasecmp.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-strcasecmp.o -MD -MP -MF "$(DEPDIR)/xedit-strcasecmp.Tpo" -c -o xedit-strcasecmp.o `test -f 'strcasecmp.c' || echo '$(srcdir)/'`strcasecmp.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xedit-strcasecmp.Tpo" "$(DEPDIR)/xedit-strcasecmp.Po"; else rm -f "$(DEPDIR)/xedit-strcasecmp.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='strcasecmp.c' object='xedit-strcasecmp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-strcasecmp.o `test -f 'strcasecmp.c' || echo '$(srcdir)/'`strcasecmp.c + +xedit-strcasecmp.obj: strcasecmp.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-strcasecmp.obj -MD -MP -MF "$(DEPDIR)/xedit-strcasecmp.Tpo" -c -o xedit-strcasecmp.obj `if test -f 'strcasecmp.c'; then $(CYGPATH_W) 'strcasecmp.c'; else $(CYGPATH_W) '$(srcdir)/strcasecmp.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xedit-strcasecmp.Tpo" "$(DEPDIR)/xedit-strcasecmp.Po"; else rm -f "$(DEPDIR)/xedit-strcasecmp.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='strcasecmp.c' object='xedit-strcasecmp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-strcasecmp.obj `if test -f 'strcasecmp.c'; then $(CYGPATH_W) 'strcasecmp.c'; else $(CYGPATH_W) '$(srcdir)/strcasecmp.c'; fi` + xedit-print.o: print.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-print.o -MD -MP -MF "$(DEPDIR)/xedit-print.Tpo" -c -o xedit-print.o `test -f 'print.c' || echo '$(srcdir)/'`print.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xedit-print.Tpo" "$(DEPDIR)/xedit-print.Po"; else rm -f "$(DEPDIR)/xedit-print.Tpo"; exit 1; fi @@ -1155,6 +1274,23 @@ uninstall-appmanDATA: echo " rm -f '$(DESTDIR)$(appmandir)/$$f'"; \ rm -f "$(DESTDIR)$(appmandir)/$$f"; \ done +install-dist_lispDATA: $(dist_lisp_DATA) + @$(NORMAL_INSTALL) + test -z "$(lispdir)" || $(mkdir_p) "$(DESTDIR)$(lispdir)" + @list='$(dist_lisp_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(dist_lispDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(lispdir)/$$f'"; \ + $(dist_lispDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(lispdir)/$$f"; \ + done + +uninstall-dist_lispDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_lisp_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(lispdir)/$$f'"; \ + rm -f "$(DESTDIR)$(lispdir)/$$f"; \ + done install-dist_progmodesDATA: $(dist_progmodes_DATA) @$(NORMAL_INSTALL) test -z "$(progmodesdir)" || $(mkdir_p) "$(DESTDIR)$(progmodesdir)" @@ -1172,23 +1308,6 @@ uninstall-dist_progmodesDATA: echo " rm -f '$(DESTDIR)$(progmodesdir)/$$f'"; \ rm -f "$(DESTDIR)$(progmodesdir)/$$f"; \ done -install-dist_xedit_lispDATA: $(dist_xedit_lisp_DATA) - @$(NORMAL_INSTALL) - test -z "$(xedit_lispdir)" || $(mkdir_p) "$(DESTDIR)$(xedit_lispdir)" - @list='$(dist_xedit_lisp_DATA)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(dist_xedit_lispDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(xedit_lispdir)/$$f'"; \ - $(dist_xedit_lispDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(xedit_lispdir)/$$f"; \ - done - -uninstall-dist_xedit_lispDATA: - @$(NORMAL_UNINSTALL) - @list='$(dist_xedit_lisp_DATA)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(xedit_lispdir)/$$f'"; \ - rm -f "$(DESTDIR)$(xedit_lispdir)/$$f"; \ - done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -1268,6 +1387,9 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ @@ -1369,7 +1491,7 @@ check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(DATA) config.h installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appdefaultdir)" "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(progmodesdir)" "$(DESTDIR)$(xedit_lispdir)"; do \ + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appdefaultdir)" "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(lispdir)" "$(DESTDIR)$(progmodesdir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am @@ -1393,14 +1515,17 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f lisp/$(am__dirstamp) + -rm -f lisp/re/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-noinstLIBRARIES \ - mostlyclean-am + clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) @@ -1420,7 +1545,7 @@ info: info-am info-am: install-data-am: install-appdefaultDATA install-appmanDATA \ - install-dist_progmodesDATA install-dist_xedit_lispDATA + install-dist_lispDATA install-dist_progmodesDATA install-exec-am: install-binPROGRAMS @@ -1450,38 +1575,45 @@ ps: ps-am ps-am: uninstall-am: uninstall-appdefaultDATA uninstall-appmanDATA \ - uninstall-binPROGRAMS uninstall-dist_progmodesDATA \ - uninstall-dist_xedit_lispDATA uninstall-info-am + uninstall-binPROGRAMS uninstall-dist_lispDATA \ + uninstall-dist_progmodesDATA uninstall-info-am .PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ - clean-binPROGRAMS clean-generic clean-noinstLIBRARIES ctags \ - dist dist-all dist-bzip2 dist-gzip dist-shar dist-tarZ \ - dist-zip distcheck distclean distclean-compile \ - distclean-generic distclean-hdr distclean-tags distcleancheck \ - distdir distuninstallcheck dvi dvi-am html html-am info \ - info-am install install-am install-appdefaultDATA \ - install-appmanDATA install-binPROGRAMS install-data \ - install-data-am install-dist_progmodesDATA \ - install-dist_xedit_lispDATA install-exec install-exec-am \ + clean-binPROGRAMS clean-generic clean-noinstLIBRARIES \ + clean-noinstPROGRAMS ctags dist dist-all dist-bzip2 dist-gzip \ + dist-hook dist-shar dist-tarZ dist-zip distcheck distclean \ + distclean-compile distclean-generic distclean-hdr \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-appdefaultDATA install-appmanDATA install-binPROGRAMS \ + install-data install-data-am install-dist_lispDATA \ + install-dist_progmodesDATA install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-appdefaultDATA uninstall-appmanDATA \ - uninstall-binPROGRAMS uninstall-dist_progmodesDATA \ - uninstall-dist_xedit_lispDATA uninstall-info-am + uninstall-binPROGRAMS uninstall-dist_lispDATA \ + uninstall-dist_progmodesDATA uninstall-info-am -@XAW_USE_XPRINT_TRUE@Xedit.ad: -@XAW_USE_XPRINT_TRUE@ cp $(top_srcdir)/Xedit-xprint.ad Xedit.ad -@XAW_USE_XPRINT_FALSE@Xedit.ad: -@XAW_USE_XPRINT_FALSE@ cp $(top_srcdir)/Xedit-noxprint.ad Xedit.ad +@USE_XPRINT_TRUE@Xedit.ad: +@USE_XPRINT_TRUE@ cp $(top_srcdir)/Xedit-xprint.ad Xedit.ad +@USE_XPRINT_FALSE@Xedit.ad: +@USE_XPRINT_FALSE@ cp $(top_srcdir)/Xedit-noxprint.ad Xedit.ad .ad: cp $< $@ .man.$(APP_MAN_SUFFIX): sed $(MAN_SUBSTS) < $< > $@ + +.PHONY: ChangeLog + +ChangeLog: + (GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2) + +dist-hook: ChangeLog # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/app/xedit/README b/app/xedit/README index e69de29bb..4188af34d 100644 --- a/app/xedit/README +++ b/app/xedit/README @@ -0,0 +1,604 @@ + Xedit is a simple text editor for X. + + Please check xedit(1) for information about resources and configurable + options. + + The authors file should list the original authors of all files, but + unfortunately most collaborators and people that changed portions of the + code is not listed. + + + List of default keyboard commands. + Uppercase letters means both, uppercase and lowercase. + Lowercase letter usually means Shift key is not pressed. + C- Means Control key. + M- Means Meta key. + Usually Alt key has the same effect. + S- Means Shift key. + + C-A Move cursor to beginning of line. + C-B or Left + Move cursor backwards one character. + C-C Insert CUT_BUFFER0 selection at cursor position. + C-D Delete next character. + C-E Move cursor to end of line. + C-F or Right + Move cursor forwards one character. + C-G Keyboard reset. + Use it to switch direction in the Undo stack, i.e. switch between + Undo and Redo. + It can also be used to stop the lisp interpreter if it is executing + code. + C-H Deletes character before cursor. + C-J Adds a newline and indent. + If the current buffer is the *scratch* buffer, it will work + like C-X,C-E, but print the lisp output directly to the scratch + buffer. Examples: + (list 1 2 3) C-J will print (1 2 3) and move the cursor to + the next line. + C-K Deletes text from cursor position to end of line. + C-L Redraw text window. + C-M Adds a newline. + C-N or Down + Move cursor to next line. + C-O Adds one newline at cursor position without moving cursor. + C-P or Up + Move cursor to previous line. + C-R Opens search dialog, searching backwards. + C-S Opens search dialog, searching forwards. + C-T Transpose characters. + C-U Starts multiply mode. + Multiply mode means that most keyboard commands will be repeated + by its parameter. After pressing C-U type a number, that can be + negative. Examples: + C-U 10 C-F will move the cursor 10 characters forwards + C-U -10 C-F will move the cursor 10 characters backwards + If no number is specified, or if the number zero is specified, + the default value is 4. + C-V or PageDown + Move cursor to next page. + C-W Kills current selection. + C-W is also useful when there is no active selection, to return to + the previous position the left mouse was clicked in the text window. + C-Y Inserts SECONDARY selection. + This usually means text delete with commands other than by just + pressing Backspace or Delete (that can be multiplied) + C-Z Scroll one line up. + M-B or C-Left + Move cursor backwards one word. + C-Left only moves over alphabetic or numeric characters + M-C Capitalize word under cursor position, or next word. + M-F or C-Right + Move cursor forwards one word. + C-Right only moves over alphabetic or numeric characters. + M-I Opens a dialog prompting for a file name to be inserted at the + cursor position. + (This isn't very user friendly, this is a cavemen interface, you will + love it, you will never use it). + M-K Kills text from cursor position to end of paragraph. + M-L Downcase word at cursor position or next word. + M-Q Format paragraph. + Xedit interfaces Xaw code that allows several types of text + formatting. To use it, you need to Select "Auto Fill" in the + "Edit Menu" and select values for "Break Columns". After that, + Select "Edit Menu"->"Justification" for the available options. + Text typed will usually be automatically corrected, but if you + need to change text in the middle of a previous line, use M-Q + to reformat, and C-_ to undo if required. + Examples of text: + + This text with align + left and break + columns at 20 and + 40. + + This text with align + right and break + columns at 25 and + 45. Remember that + Auto Fill must be + selected. And it may + be required to press + M-Q when going back + to edit previous + lines. + + This text with align center + and break columns at 40 and + 70. A good tip is to make sure + there are empty lines before + and after the aligned text, so + that M-Q will not format more + text than it should. + + This text with full align, + note that it will spread the + words to fully fill the + configured break columns, in + this case 15 and 45. Also note + that it doesn't remove any + extra indentation from the + first line. This may be + considered a bug or feature, + but it doesn't respect 2 + spaces after an '.' dot. And + it doesn't align the last line + of text. + + This text with Auto Fill disabled. When Auto Fill is disabled, tabs are +usually preserved, like this, and this. But it +will basically format the text to not be larger than the text widget screen +width and. But it the screen is scrolled horizontally, it will not work as +expected, the advantage over the above interface is that is considers font +characters width, while the other interface assumes fixed width characters. + + Notice that "auto formatting" with Auto Fill mode is done when + pressing enter, but information isn't saved per paragraph, so + if values of align or break columns are changed, trying to edit + a text block with different configuration will not give the expected + results. + Also notice that lines starting with non printable characters aren't + automatically formatted. This is helpful for some editing modes + where symbols can be used before lines in a paragraph. If you don't + need this feature, usually pressing Space or Tab is enough to put the + cursor at the proper position. + M-U Upcase word at cursor position or next word. + M-V or PageUp + Move cursor to previous page. + M-Y Kill ring yank feature. Basically it will circulate over all + text that has been cut in the current session. Keep pressing it + until happy :-) + M-Z Scrolls one line down. + M-D Kill word at cursor position or next word. + S-M-D Delete word at cursor position or next word. + Does not go to the kill ring. + M-H or M-Delete or M-Backspace. + Kill word at cursor position or previous word. + S-M-H or S-M-Delete or S-M-Backspace + Delete word at cursor position or previous word. + Does not go to the kill ring. + M-. Find definition/declaration of symbol string of selected text, and/or + finds next tag when more than one definition exists for the symbol. + M-< or Home + Move cursor to beginning of file. + M-> or End + Move cursor to end of file. + M-] or C-Down + Move cursor to next paragraph. + M-[ or C-Up + Move cursor to previous paragraph. + C-_ or C-X,U + Undo. + If enabled in the given textwidget. Not enabled by default in the + message window and filename window, or any of the other text widgets + in the several available dialogs. + C-\ or C-Kanji + Reconnect Input Method. + In international mode (probably broken interface). + S-Insert + Insert PRIMARY selection from CUT_BUFFER0. + C-Q + Followed by any character, will insert the next typed character + useful to insert control characters. For example C-Q,C-L will + insert ^L at the cursor position. + LeftMouseButton + When pressed marks the start of a PRIMARY selection at CUTBUFFER0 + When moved while pressed extends the selection. + MiddleMouseButton + When pressed, inserts the PRIMARY selection at CUTBUFFER0 at + the cursor position. + RightMouseButton + Can be used to adjust a selection done with LeftMouseButton. + C-A,Tab + If the loaded file has a indentation rules file, C or Lisp, xedit + will reindent the line. Also, entering a fresh character on a + newline should be enough to move the cursor to the proper position. + To override it, you may need to use the C-U to multiply the action, + as it will only indent if only one character was added. + C-X,C-C or (Pressing the Quit button) + Exits xedit. + If there are unsaved files, a message will be printed asking to + "exit" again, or save the files. + C-X,C-E + Execute lisp expression before the cursor position. + C-X,C-F + Changes keyboard input focus to the filename text input window. + In this mode, pressing Tab will try to complete the filename + being typed. + When more than one match exists, pressing Tab again will display + the directory navigation window. + The initial search path usually is the basename of the file loaded + in the current textwindow, or currently directory from where + xedit was started if the *scratch* is the current "buffer". + The character ~ can be used as a shortcut for the home directory + and ~username will be replaced by the home directory of "username" + if it exists. + C-X,C-S or (Pressing the Save button) + Saves the file in the current text window. + C-X,Tab + Indents the current paragraph. + Use the C-U modifier to specify the number of spaces to insert + or remove if the C-U parameter is negative. + C-X,0 + Deletes the current window. + The file being edited is not unloaded. + C-X,1 + Deletes the other window. + The file being edited is not unloaded. + C-X,2 + Splits vertically the current window. + C-X,3 + Splits vertically the current window. + C-X,b + Switch the contents of the current window to the next file in + the list of loaded files. + C-X,d + Displays the directory listing window. + In this window, it is possible to navigate in the file system + to choose a file to edit. + Usually, this is the same as pressing C-X,C-F,Tab + See C-X,C-F for more information. + C-X,k + Unloads the file being edited. + If the file has not been saved, a message will be displayed, + asking to either press C-X,k again, or save the file + The *scratch* buffer cannot be killed and will always + prints a warning when exiting xedit. This is the expected behavior. + C-X,o + Switch input focus to the other window, making it the current one + If the editor doesn't have splited windows, this command is ignored. + Insert + Switches between insert and overwrite mode. + In overwrite mode text is typed over existing file contents, + only extending the file contents when typing at the end of + a line (or file). + Escape + Enters the line edit mode. + In this mode it is possible to use regex expressions to search and + replace the contents of the file loaded in the current text window. + Refer to the xedit(1) manpage for more information of the regex + expression format. + Note that the regex used by xedit isn't IEEE Std 1003.2 compliant, + and not compliant with most regex implementations in that it doesn't + support some complex search patterns, usually involving patterns + like ((.*)+)? that may require too much restarts or have several + correct interpretations for multiple matches. Also, it always does + minimal matching, and it is not configurable like in pcre, example: + searching "a1a1a1" with the pattern "(.*)\d" will find "a1" and + not "a1a1a1" as could be expected. + Please refer to lisp/re/README for more information on the supported + regex expressions. + C-LeftMouseButton + Displays the "File Menu" from where it is possible to select a + new file to be edited in the current window. + C-MiddleMouseButton + Displays the "Edit Menu" that usually has the following options: + +------------------+-------------+ + | Wrapping -> | Never | + | | Line | + | | Word | + | Auto Fill +-------------+ + | +-------------+ + | Justification -> | Left | + | | Right | + | | Center | + | | Full | + | +-------------+ + | Break Columns... | + | +-------------+ + | Scrollbars -> | Vertical | + | | Horizontal | + | +-------------+ + | +-------------+ + | Edit Mode -> | Plain/None | + | | C/C++ | + | | Lisp/Scheme | + | | X imake | + | | Makefile | + | | Unix shell | + | | SGML | + | | HTML | + | | Man page | + | | X resource | + | | XF86Config | + | | RPM spec | + | | XFree86 log | + | | Patch file | + +------------------+-------------+ + "Wrapping" is disabled if "Auto Fill" is enabled. + "Justification" and "Break Columns..." are enabled if "Auto Fill" + is also enabled. + "Edit Mode" lists the available syntax highlight and indentation + rules defined. + Note that most of these options don't work in "international" mode. + Several xedit interfaces works only with 8 bits encodings, and + doesn't properly handle UTF-8. + C-RightMouseButton + Displays the "Option Menu". + Currently the only option is an Ispell frontend. + FourthMouseButton (usually also moving up the mouse wheel) + Scroll one line down + FifthMouseButton (usually also moving down the mouse wheel) + Scroll one line up + + + + There is also some documentation in lisp/README, lisp/TODO, + lisp/re/README, lisp/re/tests.txt, and comments/justifications/wishlists for + the cases the interpreter fail to give the proper result for a given test. + + The lisp interpreter implements most of a standard COMMON LISP + environment, but the compiler generates only byte code and not everything + can be compiled, in those cases the interpreter does the work. Examples are + constructs involving UNWIND-PROTECT or any kind of jump outside of the + current function body. + + For more information please consult any COMMON LISP documentation or + tutorial. + + + + Simple tutorial on writing a "foolang" syntax highlight mode for xedit. + + Create a file called foolang.lsp + Add: + -- + (require "syntax") + (require "indent") + (in-package "XEDIT") + -- + to foolang.lsp + Check the available files if you want a custom property, or to know about + the available ones. One example is: + -- + (defsynprop *prop-foolang* + "foolang" + :font "fixed" + :foreground "rgb:a/b/c" + :background "rgb:1/2/3" + :underline t + :overstrike t) + -- + Check lisp/modules/xedit.lsp for the other options, like subscript, + superscript and/or combining XLFD properties. + Create a syntax definition for foolang. Check the definition of defsyntax in + lisp/modules/syntax.lsp for more details. One example for foolang is: + -- + (defsyntax *foolang-mode* :foolang nil nil nil + ;; use the sample property created for foolang whenever the string + ;; foolang is found at the toplevel + (syntoken "\\<foolang\\>" :property *prop-foolang*) + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; process C style comments + (syntoken "/*" :nospec t :begin :comment :contained t) + ;; contained is an option to not "export" this definition to child + ;; tables + + (syntable :comment *prop-comment* #'default-indent + ;; #'default-indent means a very simple indent that follows indentation + ;; of previous line. Use nil for no indentation + + ;; Don't start a new table, instead flag as an error if nested + (syntoken "/*" :nospec t :property *prop-error*) + ;; :nospec t sets the RE_NOSPEC flag for the regex, i.e. searches + ;; a literal string, and * will not be a special character + + (syntoken "XXX|TODO|FIXME" :property *prop-annotation*) + ;; just to make it easier to flag some important comment + + (syntoken "*/" :nospec t :switch -1) + ;; The :switch argument is the number of tables to "pop", in + ;; this case, we are at table :comment, and :switch -1 returns + ;; to table :foolang, that is the "root" table + ) + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Process lisp comments that can nest + (syntable :lisp-comment *prop-comment* nil + + ;; Start a comment, possibly nested + (syntoken "#|" :nospec t :begin :lisp-comment) + + ;; Returns to previous comment in stack or to main :foolang table + (syntoken "|#" :nospec t :switch -1) + + ;; For easier flagging important comments + (syntoken "XXX|FIXME|TODO" :property *prop-annotation*) + ) + + ;; This is usually in the end of the list, but can be anywhere, + ;; just that if it isn't at the end, conflicting rules are resolved + ;; by declaration order + (synaugment :lisp-comment) + ;; Adds the :lisp-comment table to :foolang table + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Lisp like strings that don't need a \ at the end of the line + (syntable :lisp-string *prop-string* nil + ;; ignore a escaped " in the middle of the string + (syntoken "\\\\.") + ;; Note that no options are used, just keep using the current + ;; property. Unfortunately, backslashes must be escaped twice. + ;; Once for the lisp reader and once for the regex compiler. + + (syntoken "\"" :nospec: t :switch -1) + ;; :nospec is used just to create a faster regex. switch -1 + ;; returns to the previous syntax table. It isn't an error to + ;; try to go down the "root" table, but if that happens, it + ;; probably means either wrong syntax definition of malformed input. + ) + + (synaugment :lisp-string) + ;; Adds the :lisp-string table to :foolang table + ;; Note that since there isn't a rule to start a string in the + ;; :lisp-string table, it cannot nest, maybe because the ending + ;; character is the starting character ? :-)) + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; C style string rules + (syntable :string *prop-string* nil + ;; Ignore escaped characters + (syntoken "\\\\.") + + ;; Match, most, printf arguments. + (syntoken "%%|%([+-]?\\d+)?(l?[deEfgiouxX]|[cdeEfgiopsuxX])" + :property *prop-format*) + ;; Just for fun. This makes easier to see printf formats in strings + ;; *prop-format* is *prop-string* with the :underline option + + (syntoken "\\\\$") + ;; a backslash extends the string to the next line + + ;; A nonscaped " inside a string finishes it, since this table doesn't + ;; have sub tables, and cannot nest, should return to :foolang table + ;; from here + (syntoken "\"" :nospec t :switch -1) + + ;; This token rule starts a new table called :error because end of line + ;; has been matched. Note that it is defined last, so that a line + ;; ending with " or \ will be processed first. + (syntoken ".?$" :begin :error) + + (synaugment :string) + ;; Adds the :string table to :foolang table + + ;; This table is used by :string, but could be shared for other patterns + ;; like characters constants, etc. + ;; It uses :switch -2 because it is started inside the :string table, + ;; but it is also a table, so, pops two tables from the table stack + (syntable :error *prop-error* nil + (syntoken "^.*$" :switch -2) + ) + ) + -- + + Indentation rules are significantly more complex. I suggest looking at + lisp/modules/indent.lsp for the macros and function definitions; + and lisp/modules/progmodes/lisp.lsp and lisp/modules/progmodes/c.lsp for two + sample implementations of indentation for Lisp/Scheme and C/C++ + respectively. + + Note also that indentation is parsed backwards, what can cause some + confusion, and make "visualization" of order or precedence of evaluation for + rules harder to understand. + + A simple indentation rules definition for foolang could be: + + -- + (defindent *foolang-mode-indent* :foolang + ;; This must be the first token and usually the only token matching + ;; BOL (Beginning of Line) + (indtoken "^\\s*" :indent + :code (or *offset* (setq *offset* (+ *ind-offset* *ind-length*)))) + ;; the keyword :indent is a pattern put on a list when there is + ;; a match, so that later patterns can be "reduced" by some other + ;; rule, i.e.: (:indent :indent) could be reduced to (:indent) + + (indtoken "//.*$" nil) + ;; C++ style comment. Returning nil instead of a token basically + ;; ignores the token, as it should not enter the reduction pattern + ;; list + + ;; Sample C comment pattern + (indtoken "*/" :ccomment :nospec t :begin :comment) + ;; Note that the indaugment macro doesn't need to be used, and actually + ;; would be an error. In this example, the indentation compiler checks + ;; the :begin :comment and handles it internally, as it already needs + ;; to check for things like typos, unreachable labels, detectable + ;; non resolving rules, etc. There is runtime check also, so it should + ;; never enter an infinite loop when trying to resolve reduction rules. + ;; Check lisp/modules/indent.lsp:(compile-indent-table) for the + ;; implementation and more comments. + + ;; Indentation rules also have stacked tables + (indtable :comment + (indtoken "/*" :ocomment :nospec t :switch -1)) + ;; Note that the name is :ocomment (open comment), but that the + ;; the table is finished when matching the open comment pattern + + ;; A simple initialization of a variable used by the indentation rules + (indinit (parens 0)) + ;; This variable can be declared anywhere in the body of defindent, + ;; It will be properly moved to a "variables declaration section" + ;; when expanding and compiling the table. + + (indtoken "(" :oparen :nospec t :code (incf parens)) + (indtoken ")" :cparen :nospec t :code (decf parens)) + ;; These two tokes add the patterns :oparen and :cparen to the + ;; "pattern list", and also have code to remember the balancing + ;; of parenthesis. + + + ;; One of the simplest reduction rules :-) + (indreduce nil + t + ((:comment))) + ;; Once the boundings of a comment are found, just ignore it, like + ;; what was done with the // pattern, but in that case, the boundings + ;; were readily available. + ;; The t (True) parameter means that this rule is always evaluated, + ;; but conditional code may be used, and implicit code may be added + ;; to the end of the indreduce macro. + ;; Since it is a macro, code can be compiled to optimized bytecode + ;; after the macro is expanded. + + (indinit (indent 0)) + ;; Note that there is a special *indent* variable that should hold the + ;; proper indentation value, but it may be required to "overwrite" + ;; without forgetting that value, for things like: + ;; + ;; foo(bar(baz(blah + ;; ^ ^ + ;; | | + ;; indent | + ;; effective indentation to be used + ;; + ;; where it is desirable to align the code in the next line with the + ;; last open parenthesis. + + + Since the interface is, unfortunately, complex enough to not expect + casual users to have something like a $HOME/.xedit file, if you want to add + new modes, please check lisp/modules/xedit.lsp:*auto-modes* + + There is some documentation about the variable. It should be possible to + change/update the variable from the lisp interface in the *scratch* buffer, + but for safety, it is suggested that if you add new rules, you should + restart xedit after it. Also note that there is compiled code in + lisp/xedit.c that expects that variable to follow an specific format. + + You may notice that several .lsp files aren't "properly indented"; this + is because the lisp indentation rules file was made long after most of the + other files were done, and it was considered a bad practice to gratuitously + reindent all files. + + + + At the time of this writing, the ispell interface should be again + functional, but it may be required to use some old ispell program to handle + non utf8 text. But it should work properly for the english language, and in + international mode, should work with any language. But there are problems in + international mode not fixed. + + I (Paulo Cesar) considered several times to extend the normal + textwidget to handle utf8, but this is probably a lot of work/time badly + spent and I prefer to work on other personal projects, but still xedit is + the editor I use for programming. The XPRINT support unfortunately is broken + due to it. Note that xedit, like pretty much any other Xaw application can + be linked against Xaw with XPRINT support. In the case of xedit, a flag + could be used, like the "international" variable to, at runtime, disable all + the related code, if required. + + Also at the time of this writing, the tags interface was added, as well + as several other bug fixes. The tags interface is documented in the manpage, + but the action shortcut may not be clear. The default shortcut is M-. . + There is no support for more than one tags file, or changing the tags file + at runtime. But the code should be easy to adapt for this case, as all + related functions receive pointers to the appropriate structures. One option + could be to descend from the directory of the loaded file searching for a + tags file, and then associate the file with the tags definition, if it isn't + already loaded. Shouldn't be hard to implement. For "inter project" files, + it should be better to have one xedit window per "project", i.e. searching + the definition of something like a libc symbol should probably be done in + another xedit window. diff --git a/app/xedit/Xedit-noxprint.ad b/app/xedit/Xedit-noxprint.ad index 16334a3c9..b626bf34a 100644 --- a/app/xedit/Xedit-noxprint.ad +++ b/app/xedit/Xedit-noxprint.ad @@ -5,7 +5,7 @@ *enableBackups: True *backupNameSuffix: ~ *changedBitmap: xlogo11 -*international: True +*international: False *hints:\ Use Control-S and Control-R to Search.\n\ @@ -39,7 +39,9 @@ Use Control-X,k to close file being edited.\n\ Use Control-X,o to switch to another splitted window.\n\ Use Control-X,u to undo. Control-G to switch between Undo and Redo.\n\ Use Insert to toggle Overwrite mode.\n\ -Use Control-G to interrupt the lisp subprocess +Use Control-G to interrupt the lisp subprocess.\n\ +Use Escape to enter or leave regex search and replace mode.\n\ +Use Alt-. to search tags for the selected symbol or find the next match. *formWindow*defaultDistance: 2 *formWindow.?.borderWidth: 0 @@ -201,6 +203,7 @@ m<Key>I: no-op(r) <Ctrl>X,!<Key>u:undo()\n\ <Ctrl>G: xedit-keyboard-reset()\n\ <Ctrl>J: xedit-print-lisp-eval()\n\ +:m<Key>.: tags()\n\ <Key>Tab: insert-char()\n\ !l @Num_Lock<Key>b:insert-char()\n\ !l <Key>b: insert-char()\n\ @@ -235,7 +238,9 @@ c l @Num_Lock<Btn3Down>:xedit-focus() popup-menu(optionsMenu)\n\ c @Num_Lock<Btn3Down>:xedit-focus() popup-menu(optionsMenu)\n\ c l<Btn3Down>:xedit-focus() popup-menu(optionsMenu)\n\ c<Btn3Down>: xedit-focus() popup-menu(optionsMenu)\n\ -<Btn1Down>: xedit-focus() select-start() +<Btn1Down>: xedit-focus() select-start()\n\ +<Btn4Down>: scroll-one-line-down()\n\ +<Btn5Down>: scroll-one-line-up() *filename.?.pieceSize: 256 *filename.translations: #override \ @@ -257,7 +262,8 @@ c<Key>G: cancel-find-file()\n\ !*ispell.dictionary: br !*ispell.dictionaries: br american americanmed+ english !*ispell*br.wordChars: áéíóúçÁÉÍÓÚÇàÀâêôÂÊÔüÜãõÃÕ- -!*ispell.ispellCommand: /usr/local/bin/ispell -B -m +*ispell.ispellCommand: /usr/bin/aspell -B -m +*ispell.lookCommand: /bin/egrep !*ispell*text.skipLines: .# *ispell.geometry: 0x0 diff --git a/app/xedit/Xedit-xprint.ad b/app/xedit/Xedit-xprint.ad index cb8445f76..34ed4e918 100644 --- a/app/xedit/Xedit-xprint.ad +++ b/app/xedit/Xedit-xprint.ad @@ -239,7 +239,9 @@ c l @Num_Lock<Btn3Down>:xedit-focus() popup-menu(optionsMenu)\n\ c @Num_Lock<Btn3Down>:xedit-focus() popup-menu(optionsMenu)\n\ c l<Btn3Down>:xedit-focus() popup-menu(optionsMenu)\n\ c<Btn3Down>: xedit-focus() popup-menu(optionsMenu)\n\ -<Btn1Down>: xedit-focus() select-start() +<Btn1Down>: xedit-focus() select-start()\n\ +<Btn4Down>: scroll-one-line-down()\n\ +<Btn5Down>: scroll-one-line-up() *filename.?.pieceSize: 256 *filename.translations: #override \ @@ -261,7 +263,8 @@ c<Key>G: cancel-find-file()\n\ !*ispell.dictionary: br !*ispell.dictionaries: br american americanmed+ english !*ispell*br.wordChars: áéíóúçÁÉÍÓÚÇàÀâêôÂÊÔüÜãõÃÕ- -!*ispell.ispellCommand: /usr/local/bin/ispell -B -m +*ispell.ispellCommand: /usr/bin/aspell -B -m +*ispell.lookCommand: /bin/egrep !*ispell*text.skipLines: .# *ispell.geometry: 0x0 diff --git a/app/xedit/aclocal.m4 b/app/xedit/aclocal.m4 index ba73d2149..e7bd1a8cd 100644 --- a/app/xedit/aclocal.m4 +++ b/app/xedit/aclocal.m4 @@ -740,6 +740,34 @@ AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) +# Copyright (C) 1999, 2000, 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_PROG_CC_C_O +# -------------- +# Like AC_PROG_CC_C_O, but changed for automake. +AC_DEFUN([AM_PROG_CC_C_O], +[AC_REQUIRE([AC_PROG_CC_C_O])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` +if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +]) + # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 @@ -995,72 +1023,6 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR -dnl Copyright 2005 Red Hat, Inc -dnl -dnl Permission to use, copy, modify, distribute, and sell this software and its -dnl documentation for any purpose is hereby granted without fee, provided that -dnl the above copyright notice appear in all copies and that both that -dnl copyright notice and this permission notice appear in supporting -dnl documentation. -dnl -dnl The above copyright notice and this permission notice shall be included -dnl in all copies or substantial portions of the Software. -dnl -dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -dnl OTHER DEALINGS IN THE SOFTWARE. -dnl -dnl Except as contained in this notice, the name of the copyright holders shall -dnl not be used in advertising or otherwise to promote the sale, use or -dnl other dealings in this Software without prior written authorization -dnl from the copyright holders. -dnl - -# XAW_CHECK_XPRINT_SUPPORT() -# -------------------------- -# Adds --enable/disable-xprint and selects the appropriate version of the Xaw -# library. If neither --enable-xprint nor --disable-xprint are given, -# the presence of an Xaw with Xprint support will be auto detected - -AC_DEFUN([XAW_CHECK_XPRINT_SUPPORT],[ - AC_ARG_ENABLE(xprint, AC_HELP_STRING([--enable-xprint], [Enable XPrint support]), - [use_xprint=$enableval],[use_xprint=auto]) - if test "x$use_xprint" = "xyes"; then - TMP_CHECK1=xaw8 - TMP_CHECK2= - xaw_use_xprint=yes - elif test "x$use_xprint" = "xno"; then - TMP_CHECK1=xaw7 - TMP_CHECK2= - xaw_use_xprint=no - else - TMP_CHECK1=xaw8 - TMP_CHECK2=xaw7 - xaw_use_xprint=yes - fi - - PKG_CHECK_MODULES(TMP_XAW, $TMP_CHECK1, success=yes, success=no) - if [[ ! -z $TMP_CHECK2 ]] ; then - if test $success = no ; then - PKG_CHECK_MODULES(TMP_XAW, $TMP_CHECK2, success=yes, success=no) - xaw_use_xprint=no - fi - fi - - if test "x$success" = "xyes"; then - $1_CFLAGS=$TMP_XAW_CFLAGS - $1_LIBS=$TMP_XAW_LIBS - - AM_CONDITIONAL([XAW_USE_XPRINT], [test "x$xaw_use_xprint" = "xyes"]) - else - AC_MSG_ERROR([No suitable version of Xaw found]) - fi -]) - dnl dnl Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved. dnl @@ -1108,7 +1070,7 @@ AC_DEFUN([XORG_MACROS_VERSION],[ XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'` XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`] AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}]) - [XORG_MACROS_version=1.1.5 + [XORG_MACROS_version=1.1.6 XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'` XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`] if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then @@ -1257,7 +1219,11 @@ AC_DEFUN([XORG_CHECK_LINUXDOC],[ XORG_SGML_PATH=$prefix/share/sgml HAVE_DEFS_ENT= -AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes]) +if test x"$cross_compiling" = x"yes" ; then + HAVE_DEFS_ENT=no +else + AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes]) +fi AC_PATH_PROG(LINUXDOC, linuxdoc) AC_PATH_PROG(PS2PDF, ps2pdf) @@ -1529,14 +1495,14 @@ AC_DEFUN([XORG_RELEASE_VERSION],[ AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], [`echo $PACKAGE_VERSION | cut -d . -f 1`], [Major version of this package]) - PVM=`echo $PACKAGE_VERSION | cut -d . -f 2` + PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` if test "x$PVM" = "x"; then PVM="0" fi AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], [$PVM], [Minor version of this package]) - PVP=`echo $PACKAGE_VERSION | cut -d . -f 3` + PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` if test "x$PVP" = "x"; then PVP="0" fi diff --git a/app/xedit/commands.c b/app/xedit/commands.c index 7fa14d17d..6940d732b 100644 --- a/app/xedit/commands.c +++ b/app/xedit/commands.c @@ -67,6 +67,11 @@ static void AddDoubleClickCallback(Widget, Bool); static Bool ReallyDoLoad(char*, char*); static char *makeBackupName(String, String, unsigned); +/* + * External + */ +extern void _XawTextShowPosition(TextWidget); + extern Widget scratch, texts[3], labels[3]; static Boolean double_click = FALSE; @@ -75,6 +80,7 @@ static Boolean double_click = FALSE; #define DC_CLOBBER 3 #define DC_KILL 4 #define DC_SAVE 5 +#define DC_NEWER 6 static int dc_state; /* Function Name: AddDoubleClickCallback(w) @@ -209,7 +215,16 @@ int rename (from, to) void SaveFile(Widget w, XEvent *event, String *params, Cardinal *num_params) { - DoSave(w, NULL, NULL); + if (line_edit) { + /* Don't try to save buffer with regex string. + * Call CancelFindFile() to leave line_edit mode. + */ + XeditPrintf("Save: Leaving line edit mode -- nothing saved.\n"); + CancelFindFile(w, event, params, num_params); + Feep(); + } + else + DoSave(w, NULL, NULL); } /*ARGSUSED*/ @@ -218,48 +233,36 @@ DoSave(Widget w, XtPointer client_data, XtPointer call_data) { String name = GetString(filenamewindow); String filename = ResolveName(name); - char buf[BUFSIZ]; FileAccess file_access; xedit_flist_item *item; Boolean exists; Widget source = XawTextGetSource(textwindow); + char buffer[BUFSIZ]; + struct stat st; + static char *nothing_saved = " -- nothing saved.\n"; if (!filename) { - XeditPrintf("Save: Can't resolve pathname -- nothing saved.\n"); - Feep(); - return; + XmuSnprintf(buffer, sizeof(buffer), "%s%s", + "Save: Can't resolve pathname", nothing_saved); + goto error; } else if (*name == '\0') { - XeditPrintf("Save: No filename specified -- nothing saved.\n"); - Feep(); - return; - } - else { - struct stat st; - - if (stat(filename, &st) == 0 && !S_ISREG(st.st_mode)) { - XmuSnprintf(buf, sizeof(buf), - "Save: file %s is not a regular file -- nothing saved.\n", - name); - XeditPrintf(buf); - Feep(); - return; - } + XmuSnprintf(buffer, sizeof(buffer), "%s%s", + "Save: No filename specified", nothing_saved); + goto error; } item = FindTextSource(NULL, filename); if (item != NULL && item->source != source) { if (!double_click || (dc_state && dc_state != DC_LOADED)) { - XmuSnprintf(buf, sizeof(buf), - "Save: file %s is already loaded, " - "Save again to unload it -- nothing saved.\n", - name); - XeditPrintf(buf); + XmuSnprintf(buffer, sizeof(buffer), "%s%s%s%s", + "Save: file ", name, " is already loaded, " + "Save again to unload it", nothing_saved); Feep(); double_click = TRUE; dc_state = DC_LOADED; AddDoubleClickCallback(XawTextGetSource(textwindow), True); - return; + goto error; } KillTextSource(item); item = FindTextSource(source = XawTextGetSource(textwindow), NULL); @@ -268,32 +271,45 @@ DoSave(Widget w, XtPointer client_data, XtPointer call_data) } else if (item && !(item->flags & CHANGED_BIT)) { if (!double_click || (dc_state && dc_state != DC_SAVE)) { - XeditPrintf("Save: No changes need to be saved, " - "Save again to override.\n"); + XmuSnprintf(buffer, sizeof(buffer), "%s%s", + "Save: No changes need to be saved, " + "save again to override", nothing_saved); Feep(); double_click = TRUE; dc_state = DC_SAVE; AddDoubleClickCallback(XawTextGetSource(textwindow), True); - return; + goto error; } double_click = FALSE; dc_state = 0; } file_access = CheckFilePermissions(filename, &exists); + if (exists) { + if (stat(filename, &st) != 0) { + XmuSnprintf(buffer, sizeof(buffer), "%s%s%s", + "Save: cannot stat ", name, nothing_saved); + goto error; + } + else if (!S_ISREG(st.st_mode)) { + XmuSnprintf(buffer, sizeof(buffer), "%s%s%s%s", + "Save: file ", name, "is not a regular file", + nothing_saved); + goto error; + } + } + if (!item || strcmp(item->filename, filename)) { if (file_access == WRITE_OK && exists) { if (!double_click || (dc_state && dc_state != DC_CLOBBER)) { - XmuSnprintf(buf, sizeof(buf), - "Save: file %s already exists, " - "Save again to overwrite it -- nothing saved.\n", - name); - XeditPrintf(buf); + XmuSnprintf(buffer, sizeof(buffer), "%s%s%s%s", + "Save: file ", name, " already exists, " + "save again to override", nothing_saved); Feep(); double_click = TRUE; dc_state = DC_CLOBBER; AddDoubleClickCallback(XawTextGetSource(textwindow), True); - return; + goto error; } double_click = FALSE; dc_state = 0; @@ -301,94 +317,111 @@ DoSave(Widget w, XtPointer client_data, XtPointer call_data) if (!item) item = FindTextSource(source, NULL); } - - if (app_resources.enableBackups && exists) { - char backup_file[BUFSIZ]; - - if (makeBackupName(backup_file, filename, sizeof(backup_file)) == NULL - || rename(filename, backup_file) != 0) { - XmuSnprintf(buf, sizeof(buf),"error backing up file: %s\n", - filename); - XeditPrintf(buf); + + if (app_resources.enableBackups && exists) { + char backup_file[BUFSIZ]; + + if (makeBackupName(backup_file, filename, sizeof(backup_file)) == NULL + || rename(filename, backup_file) != 0) { + XeditPrintf("Error backing up file: %s\n", filename); + } } - } - - switch( file_access = MaybeCreateFile(filename)) { - case NO_READ: - case READ_OK: - XmuSnprintf(buf, sizeof(buf), - "File %s could not be opened for writing.\n", name); - Feep(); - break; - case WRITE_OK: - if ( XawAsciiSaveAsFile(source, filename) ) { - int i; - Arg args[1]; - char label_buf[BUFSIZ]; - - /* Keep file protection mode */ - if (item && item->mode) - chmod(filename, item->mode); - - XmuSnprintf(label_buf, sizeof(label_buf), - "%s Read - Write", name); - XtSetArg(args[0], XtNlabel, label_buf); - for (i = 0; i < 3; i++) - if (XawTextGetSource(texts[i]) == source) - XtSetValues(labels[i], args, 1); - - XmuSnprintf(buf, sizeof(buf), "Saved file: %s\n", name); - - if (item && item->source != scratch) { - XtSetArg(args[0], XtNlabel, filename); - XtSetValues(item->sme, args, 1); - - XtSetArg(args[0], XtNeditType, XawtextEdit); - XtSetValues(item->source, args, 1); - - XtFree(item->name); - XtFree(item->filename); - item->name = XtNewString(name); - item->filename = XtNewString(filename); - item->flags = EXISTS_BIT; - } - else { - item = flist.itens[0]; - XtRemoveCallback(scratch, XtNcallback, SourceChanged, - (XtPointer)item); - item->source = scratch = - XtVaCreateWidget("textSource", - multiSrcObjectClass, - topwindow, - XtNtype, XawAsciiFile, - XtNeditType, XawtextEdit, - NULL, NULL); - ResetSourceChanged(item); - XtAddCallback(scratch, XtNcallback, SourceChanged, - (XtPointer)item); - - item = AddTextSource(source, name, filename, EXISTS_BIT, - file_access); - XtAddCallback(item->source, XtNcallback, SourceChanged, - (XtPointer)item); - } - item->flags |= EXISTS_BIT; - ResetSourceChanged(item); - } - else { - XmuSnprintf(buf, sizeof(buf), "Error saving file: %s\n", name); - Feep(); - } - break; - default: - XmuSnprintf(buf, sizeof(buf), "%s %s", - "Internal function MaybeCreateFile()", - "returned unexpected value.\n"); - Feep(); - break; - } - XeditPrintf(buf); + switch (file_access = MaybeCreateFile(filename)) { + case NO_READ: + case READ_OK: + XeditPrintf("File %s could not be opened for writing.\n", name); + Feep(); + break; + case WRITE_OK: + if (item && item->mtime && exists && item->mtime < st.st_mtime) { + if (!double_click || (dc_state && dc_state != DC_NEWER)) { + XmuSnprintf(buffer, sizeof(buffer), "%s%s", + "Save: Newer file exists, " + "save again to override", nothing_saved); + Feep(); + double_click = TRUE; + dc_state = DC_NEWER; + AddDoubleClickCallback(XawTextGetSource(textwindow), True); + goto error; + } + double_click = FALSE; + dc_state = 0; + } + + if (XawAsciiSaveAsFile(source, filename)) { + int i; + Arg args[1]; + + XmuSnprintf(buffer, sizeof(buffer), + "%s Read - Write", name); + XtSetArg(args[0], XtNlabel, buffer); + for (i = 0; i < 3; i++) + if (XawTextGetSource(texts[i]) == source) + XtSetValues(labels[i], args, 1); + + XeditPrintf("Saved file: %s\n", name); + + if (item && item->source != scratch) { + XtSetArg(args[0], XtNlabel, filename); + XtSetValues(item->sme, args, 1); + + XtSetArg(args[0], XtNeditType, XawtextEdit); + XtSetValues(item->source, args, 1); + + XtFree(item->name); + XtFree(item->filename); + item->name = XtNewString(name); + item->filename = XtNewString(filename); + item->flags = EXISTS_BIT; + } + else { + item = flist.itens[0]; + XtRemoveCallback(scratch, XtNcallback, SourceChanged, + (XtPointer)item); + item->source = scratch = + XtVaCreateWidget("textSource", international ? + multiSrcObjectClass : + asciiSrcObjectClass, + topwindow, + XtNtype, XawAsciiFile, + XtNeditType, XawtextEdit, + NULL, NULL); + ResetSourceChanged(item); + XtAddCallback(scratch, XtNcallback, SourceChanged, + (XtPointer)item); + + item = AddTextSource(source, name, filename, EXISTS_BIT, + file_access); + XtAddCallback(item->source, XtNcallback, SourceChanged, + (XtPointer)item); + } + + /* Keep file protection mode */ + if (item->mode) + chmod(filename, item->mode); + + /* Remember time of last modification */ + if (stat(filename, &st) == 0) + item->mtime = st.st_mtime; + + item->flags |= EXISTS_BIT; + ResetSourceChanged(item); + } + else { + XeditPrintf("Error saving file: %s\n", name); + Feep(); + } + break; + default: + Feep(); + break; + } + + return; +error: + XeditPrintf("%s", buffer); + Feep(); } /*ARGSUSED*/ @@ -401,12 +434,17 @@ DoLoad(Widget w, XtPointer client_data, XtPointer call_data) } } +Bool +LoadFileInTextwindow(char *name, char *resolved_name) +{ + return (ReallyDoLoad(name, resolved_name)); +} + static Bool ReallyDoLoad(char *name, char *filename) { Arg args[5]; Cardinal num_args = 0; - char buf[BUFSIZ]; xedit_flist_item *item; Widget source = XawTextGetSource(textwindow); @@ -455,37 +493,28 @@ ReallyDoLoad(char *name, char *filename) switch( file_access = CheckFilePermissions(filename, &exists) ) { case NO_READ: if (exists) - XmuSnprintf(buf, sizeof(buf), "File %s, %s", name, - "exists, and could not be opened for reading.\n"); + XeditPrintf("File %s, %s", name, + "exists, and could not be opened for reading.\n"); else - XmuSnprintf(buf, sizeof(buf), "File %s %s %s", name, + XeditPrintf("File %s %s %s", name, "does not exist, and", - "the directory could not be opened for writing.\n"); + "the directory could not be opened for writing.\n"); - XeditPrintf(buf); Feep(); return (False); case READ_OK: XtSetArg(args[num_args], XtNeditType, XawtextRead); num_args++; - XmuSnprintf(buf, sizeof(buf), "File %s opened READ ONLY.\n", - name); + XeditPrintf("File %s opened READ ONLY.\n", name); break; case WRITE_OK: XtSetArg(args[num_args], XtNeditType, XawtextEdit); num_args++; - XmuSnprintf(buf, sizeof(buf), "File %s opened read - write.\n", - name); + XeditPrintf("File %s opened read - write.\n", name); break; default: - XmuSnprintf(buf, sizeof(buf), "%s %s", - "Internal function MaybeCreateFile()", - "returned unexpected value.\n"); - XeditPrintf(buf); Feep(); return (False); } - XeditPrintf(buf); - if (exists) { flags = EXISTS_BIT; XtSetArg(args[num_args], XtNstring, filename); num_args++; @@ -495,8 +524,9 @@ ReallyDoLoad(char *name, char *filename) XtSetArg(args[num_args], XtNstring, NULL); num_args++; } - source = XtVaCreateWidget("textSource", - multiSrcObjectClass, + source = XtVaCreateWidget("textSource", international ? + multiSrcObjectClass : + asciiSrcObjectClass, topwindow, XtNtype, XawAsciiFile, XtNeditType, XawtextEdit, @@ -509,8 +539,10 @@ ReallyDoLoad(char *name, char *filename) if (exists && file_access == WRITE_OK) { struct stat st; - if (stat(filename, &st) == 0) + if (stat(item->filename, &st) == 0) { item->mode = st.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); + item->mtime = st.st_mtime; + } } SwitchTextSource(item); ResetSourceChanged(item); @@ -727,14 +759,23 @@ KillFile(Widget w, XEvent *event, String *params, Cardinal *num_params) void FindFile(Widget w, XEvent *event, String *params, Cardinal *num_params) { - char *string = GetString(filenamewindow); - char *slash = NULL; + char *string; + char *slash; XawTextBlock block; XawTextPosition end = XawTextSourceScan(XawTextGetSource(filenamewindow), 0, XawstAll, XawsdRight, 1, True); - if (string) - slash = strrchr(string, '/'); + if (!line_edit) { + string = GetString(filenamewindow); + if (string) + slash = strrchr(string, '/'); + } + else { + string = ""; + slash = NULL; + line_edit = False; + } + block.firstPos = 0; block.format = FMT8BIT; block.ptr = string; @@ -744,7 +785,6 @@ FindFile(Widget w, XEvent *event, String *params, Cardinal *num_params) XawTextReplace(filenamewindow, 0, end, &block); XawTextSetInsertionPoint(filenamewindow, end); XtSetKeyboardFocus(topwindow, filenamewindow); - line_edit = False; } /*ARGSUSED*/ @@ -776,6 +816,9 @@ CancelFindFile(Widget w, XEvent *event, String *params, Cardinal *num_params) XtSetArg(args[0], XtNstring, NULL); XtSetValues(filenamewindow, args, 1); + /* XXX This probably should be done by the TextWidget, i.e. notice + * if the cursor became inivisible due to an horizontal scroll */ + _XawTextShowPosition((TextWidget)filenamewindow); if (XtIsManaged(XtParent(dirwindow))) SwitchDirWindow(False); @@ -891,7 +934,6 @@ FileCompletion(Widget w, XEvent *event, String *params, Cardinal *num_params) strncpy(fname, slash2 + 1, sizeof(fname) - 1); fname[sizeof(fname) - 1] = '\0'; save = XtRealloc(save, slen - diff + hlen + 2); - (void)memmove(&save[hlen], slash2, slen - diff + 1); (void)memmove(save, home, hlen); save[hlen] = '/'; strcpy(&save[hlen + 1], fname); @@ -935,11 +977,11 @@ FileCompletion(Widget w, XEvent *event, String *params, Cardinal *num_params) mlen = 0; match[0] = '\0'; - (void)readdir(dir); /* "." */ - (void)readdir(dir); /* ".." */ while ((ent = readdir(dir)) != NULL) { unsigned d_namlen = strlen(ent->d_name); + if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0) + continue; if (d_namlen >= len && strncmp(ent->d_name, file_name, len) == 0) { char *tmp = &(ent->d_name[len]), *mat = match; struct stat st; @@ -994,7 +1036,7 @@ FileCompletion(Widget w, XEvent *event, String *params, Cardinal *num_params) closedir(dir); changed = mlen != 0; - if (n_matches) { + if (first || n_matches) { Bool free_matches = True, add_slash = n_matches == 1 && isdir && !slash; if (mlen && has_dot && match[mlen - 1] == '.') diff --git a/app/xedit/config.h.in b/app/xedit/config.h.in index 1ca40928b..630752401 100644 --- a/app/xedit/config.h.in +++ b/app/xedit/config.h.in @@ -1,5 +1,8 @@ /* config.h.in. Generated from configure.ac by autoheader. */ +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +#undef NO_MINUS_C_MINUS_O + /* Name of package */ #undef PACKAGE diff --git a/app/xedit/configure b/app/xedit/configure index eed853bc5..35b281797 100644 --- a/app/xedit/configure +++ b/app/xedit/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for xedit 1.0.2. +# Generated by GNU Autoconf 2.59 for xedit 1.1.1. # # Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>. # @@ -269,11 +269,11 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='xedit' PACKAGE_TARNAME='xedit' -PACKAGE_VERSION='1.0.2' -PACKAGE_STRING='xedit 1.0.2' +PACKAGE_VERSION='1.1.1' +PACKAGE_STRING='xedit 1.1.1' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB PKG_CONFIG ac_pt_PKG_CONFIG TMP_XAW_CFLAGS TMP_XAW_LIBS XAW_USE_XPRINT_TRUE XAW_USE_XPRINT_FALSE XPRINT_UTIL_CFLAGS XPRINT_UTIL_LIBS XEDIT_CFLAGS XEDIT_LIBS APPDEFS_CFLAGS APPDEFS_LIBS appdefaultdir build build_cpu build_vendor build_os host host_cpu host_vendor host_os APP_MAN_SUFFIX LIB_MAN_SUFFIX FILE_MAN_SUFFIX MISC_MAN_SUFFIX DRIVER_MAN_SUFFIX ADMIN_MAN_SUFFIX APP_MAN_DIR LIB_MAN_DIR FILE_MAN_DIR MISC_MAN_DIR DRIVER_MAN_DIR ADMIN_MAN_DIR LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB PKG_CONFIG ac_pt_PKG_CONFIG USE_XPRINT_TRUE USE_XPRINT_FALSE PKGDEPS_CFLAGS PKGDEPS_LIBS LISPDIR NEED_REALPATH_TRUE NEED_REALPATH_FALSE NEED_STRCASECMP_TRUE NEED_STRCASECMP_FALSE NEED_UNSETENV_TRUE NEED_UNSETENV_FALSE APPDEFS_CFLAGS APPDEFS_LIBS appdefaultdir build build_cpu build_vendor build_os host host_cpu host_vendor host_os APP_MAN_SUFFIX LIB_MAN_SUFFIX FILE_MAN_SUFFIX MISC_MAN_SUFFIX DRIVER_MAN_SUFFIX ADMIN_MAN_SUFFIX APP_MAN_DIR LIB_MAN_DIR FILE_MAN_DIR MISC_MAN_DIR DRIVER_MAN_DIR ADMIN_MAN_DIR LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -734,22 +734,14 @@ ac_env_PKG_CONFIG_set=${PKG_CONFIG+set} ac_env_PKG_CONFIG_value=$PKG_CONFIG ac_cv_env_PKG_CONFIG_set=${PKG_CONFIG+set} ac_cv_env_PKG_CONFIG_value=$PKG_CONFIG -ac_env_TMP_XAW_CFLAGS_set=${TMP_XAW_CFLAGS+set} -ac_env_TMP_XAW_CFLAGS_value=$TMP_XAW_CFLAGS -ac_cv_env_TMP_XAW_CFLAGS_set=${TMP_XAW_CFLAGS+set} -ac_cv_env_TMP_XAW_CFLAGS_value=$TMP_XAW_CFLAGS -ac_env_TMP_XAW_LIBS_set=${TMP_XAW_LIBS+set} -ac_env_TMP_XAW_LIBS_value=$TMP_XAW_LIBS -ac_cv_env_TMP_XAW_LIBS_set=${TMP_XAW_LIBS+set} -ac_cv_env_TMP_XAW_LIBS_value=$TMP_XAW_LIBS -ac_env_XPRINT_UTIL_CFLAGS_set=${XPRINT_UTIL_CFLAGS+set} -ac_env_XPRINT_UTIL_CFLAGS_value=$XPRINT_UTIL_CFLAGS -ac_cv_env_XPRINT_UTIL_CFLAGS_set=${XPRINT_UTIL_CFLAGS+set} -ac_cv_env_XPRINT_UTIL_CFLAGS_value=$XPRINT_UTIL_CFLAGS -ac_env_XPRINT_UTIL_LIBS_set=${XPRINT_UTIL_LIBS+set} -ac_env_XPRINT_UTIL_LIBS_value=$XPRINT_UTIL_LIBS -ac_cv_env_XPRINT_UTIL_LIBS_set=${XPRINT_UTIL_LIBS+set} -ac_cv_env_XPRINT_UTIL_LIBS_value=$XPRINT_UTIL_LIBS +ac_env_PKGDEPS_CFLAGS_set=${PKGDEPS_CFLAGS+set} +ac_env_PKGDEPS_CFLAGS_value=$PKGDEPS_CFLAGS +ac_cv_env_PKGDEPS_CFLAGS_set=${PKGDEPS_CFLAGS+set} +ac_cv_env_PKGDEPS_CFLAGS_value=$PKGDEPS_CFLAGS +ac_env_PKGDEPS_LIBS_set=${PKGDEPS_LIBS+set} +ac_env_PKGDEPS_LIBS_value=$PKGDEPS_LIBS +ac_cv_env_PKGDEPS_LIBS_set=${PKGDEPS_LIBS+set} +ac_cv_env_PKGDEPS_LIBS_value=$PKGDEPS_LIBS ac_env_APPDEFS_CFLAGS_set=${APPDEFS_CFLAGS+set} ac_env_APPDEFS_CFLAGS_value=$APPDEFS_CFLAGS ac_cv_env_APPDEFS_CFLAGS_set=${APPDEFS_CFLAGS+set} @@ -766,7 +758,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures xedit 1.0.2 to adapt to many kinds of systems. +\`configure' configures xedit 1.1.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -832,7 +824,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xedit 1.0.2:";; + short | recursive ) echo "Configuration of xedit 1.1.1:";; esac cat <<\_ACEOF @@ -843,11 +835,13 @@ Optional Features: (and sometimes confusing) to the casual installer --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors - --enable-xprint Enable XPrint support + --enable-xprint Compile with xprint support (default: disabled) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-lispdir=PATH Directory to install lisp files (default: + $libdir/X11/xedit/lisp) --with-release-version=STRING Use release version string in package name @@ -859,14 +853,10 @@ Some influential environment variables: CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> PKG_CONFIG path to pkg-config utility - TMP_XAW_CFLAGS - C compiler flags for TMP_XAW, overriding pkg-config - TMP_XAW_LIBS - linker flags for TMP_XAW, overriding pkg-config - XPRINT_UTIL_CFLAGS - C compiler flags for XPRINT_UTIL, overriding pkg-config - XPRINT_UTIL_LIBS - linker flags for XPRINT_UTIL, overriding pkg-config + PKGDEPS_CFLAGS + C compiler flags for PKGDEPS, overriding pkg-config + PKGDEPS_LIBS + linker flags for PKGDEPS, overriding pkg-config APPDEFS_CFLAGS C compiler flags for APPDEFS, overriding pkg-config APPDEFS_LIBS @@ -971,7 +961,7 @@ fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -xedit configure 1.0.2 +xedit configure 1.1.1 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. @@ -985,7 +975,7 @@ cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by xedit $as_me 1.0.2, which was +It was created by xedit $as_me 1.1.1, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -1583,7 +1573,7 @@ fi # Define the identity of the package. PACKAGE='xedit' - VERSION='1.0.2' + VERSION='1.1.1' cat >>confdefs.h <<_ACEOF @@ -2845,6 +2835,109 @@ else fi +if test "x$CC" != xcc; then + echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5 +echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5 +echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6 +fi +set dummy $CC; ac_cc=`echo $2 | + sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +# Make sure it works both with $CC and with simple cc. +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='$CC -c conftest.$ac_ext -o conftest.$ac_objext >&5' +if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + test -f conftest.$ac_objext && { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; +then + eval ac_cv_prog_cc_${ac_cc}_c_o=yes + if test "x$CC" != xcc; then + # Test first that cc exists at all. + if { ac_try='cc -c conftest.$ac_ext >&5' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_try='cc -c conftest.$ac_ext -o conftest.$ac_objext >&5' + if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + test -f conftest.$ac_objext && { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; + then + # cc works too. + : + else + # cc exists but doesn't like -o. + eval ac_cv_prog_cc_${ac_cc}_c_o=no + fi + fi + fi +else + eval ac_cv_prog_cc_${ac_cc}_c_o=no +fi +rm -f conftest* + +fi +if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + +cat >>confdefs.h <<\_ACEOF +#define NO_MINUS_C_MINUS_O 1 +_ACEOF + +fi + +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: @@ -3005,8 +3098,6 @@ else fi -# Checks for pkg-config packages - if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then @@ -3112,43 +3203,40 @@ echo "${ECHO_T}no" >&6 fi - # Check whether --enable-xprint or --disable-xprint was given. +# Check whether --enable-xprint or --disable-xprint was given. if test "${enable_xprint+set}" = set; then enableval="$enable_xprint" - use_xprint=$enableval + enable_xprint=$enableval else - use_xprint=auto + enable_xprint=no fi; - if test "x$use_xprint" = "xyes"; then - TMP_CHECK1=xaw8 - TMP_CHECK2= - xaw_use_xprint=yes - elif test "x$use_xprint" = "xno"; then - TMP_CHECK1=xaw7 - TMP_CHECK2= - xaw_use_xprint=no - else - TMP_CHECK1=xaw8 - TMP_CHECK2=xaw7 - xaw_use_xprint=yes - fi +if test x$enable_xprint = xyes; then + USE_XPRINT_TRUE= + USE_XPRINT_FALSE='#' +else + USE_XPRINT_TRUE='#' + USE_XPRINT_FALSE= +fi + +if test x$enable_xprint = xyes; then + pkg_failed=no -echo "$as_me:$LINENO: checking for TMP_XAW" >&5 -echo $ECHO_N "checking for TMP_XAW... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking for PKGDEPS" >&5 +echo $ECHO_N "checking for PKGDEPS... $ECHO_C" >&6 if test -n "$PKG_CONFIG"; then - if test -n "$TMP_XAW_CFLAGS"; then - pkg_cv_TMP_XAW_CFLAGS="$TMP_XAW_CFLAGS" + if test -n "$PKGDEPS_CFLAGS"; then + pkg_cv_PKGDEPS_CFLAGS="$PKGDEPS_CFLAGS" else if test -n "$PKG_CONFIG" && \ - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$TMP_CHECK1\"") >&5 - ($PKG_CONFIG --exists --print-errors "$TMP_CHECK1") 2>&5 + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xprintutil xp xaw8\"") >&5 + ($PKG_CONFIG --exists --print-errors "xprintutil xp xaw8") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - pkg_cv_TMP_XAW_CFLAGS=`$PKG_CONFIG --cflags "$TMP_CHECK1" 2>/dev/null` + pkg_cv_PKGDEPS_CFLAGS=`$PKG_CONFIG --cflags "xprintutil xp xaw8" 2>/dev/null` else pkg_failed=yes fi @@ -3157,16 +3245,16 @@ else pkg_failed=untried fi if test -n "$PKG_CONFIG"; then - if test -n "$TMP_XAW_LIBS"; then - pkg_cv_TMP_XAW_LIBS="$TMP_XAW_LIBS" + if test -n "$PKGDEPS_LIBS"; then + pkg_cv_PKGDEPS_LIBS="$PKGDEPS_LIBS" else if test -n "$PKG_CONFIG" && \ - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$TMP_CHECK1\"") >&5 - ($PKG_CONFIG --exists --print-errors "$TMP_CHECK1") 2>&5 + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xprintutil xp xaw8\"") >&5 + ($PKG_CONFIG --exists --print-errors "xprintutil xp xaw8") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - pkg_cv_TMP_XAW_LIBS=`$PKG_CONFIG --libs "$TMP_CHECK1" 2>/dev/null` + pkg_cv_PKGDEPS_LIBS=`$PKG_CONFIG --libs "xprintutil xp xaw8" 2>/dev/null` else pkg_failed=yes fi @@ -3185,139 +3273,82 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - TMP_XAW_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$TMP_CHECK1"` + PKGDEPS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xprintutil xp xaw8"` else - TMP_XAW_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$TMP_CHECK1"` + PKGDEPS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xprintutil xp xaw8"` fi # Put the nasty error message in config.log where it belongs - echo "$TMP_XAW_PKG_ERRORS" >&5 + echo "$PKGDEPS_PKG_ERRORS" >&5 - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - success=no -elif test $pkg_failed = untried; then - success=no -else - TMP_XAW_CFLAGS=$pkg_cv_TMP_XAW_CFLAGS - TMP_XAW_LIBS=$pkg_cv_TMP_XAW_LIBS - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - success=yes -fi - if [ ! -z $TMP_CHECK2 ] ; then - if test $success = no ; then - -pkg_failed=no -echo "$as_me:$LINENO: checking for TMP_XAW" >&5 -echo $ECHO_N "checking for TMP_XAW... $ECHO_C" >&6 + { { echo "$as_me:$LINENO: error: Package requirements (xprintutil xp xaw8) were not met: -if test -n "$PKG_CONFIG"; then - if test -n "$TMP_XAW_CFLAGS"; then - pkg_cv_TMP_XAW_CFLAGS="$TMP_XAW_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$TMP_CHECK2\"") >&5 - ($PKG_CONFIG --exists --print-errors "$TMP_CHECK2") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - pkg_cv_TMP_XAW_CFLAGS=`$PKG_CONFIG --cflags "$TMP_CHECK2" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried -fi -if test -n "$PKG_CONFIG"; then - if test -n "$TMP_XAW_LIBS"; then - pkg_cv_TMP_XAW_LIBS="$TMP_XAW_LIBS" - else - if test -n "$PKG_CONFIG" && \ - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$TMP_CHECK2\"") >&5 - ($PKG_CONFIG --exists --print-errors "$TMP_CHECK2") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - pkg_cv_TMP_XAW_LIBS=`$PKG_CONFIG --libs "$TMP_CHECK2" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried -fi +$PKGDEPS_PKG_ERRORS +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. +Alternatively, you may set the environment variables PKGDEPS_CFLAGS +and PKGDEPS_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" >&5 +echo "$as_me: error: Package requirements (xprintutil xp xaw8) were not met: -if test $pkg_failed = yes; then +$PKGDEPS_PKG_ERRORS -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - TMP_XAW_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$TMP_CHECK2"` - else - TMP_XAW_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$TMP_CHECK2"` - fi - # Put the nasty error message in config.log where it belongs - echo "$TMP_XAW_PKG_ERRORS" >&5 +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - success=no +Alternatively, you may set the environment variables PKGDEPS_CFLAGS +and PKGDEPS_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" >&2;} + { (exit 1); exit 1; }; } elif test $pkg_failed = untried; then - success=no -else - TMP_XAW_CFLAGS=$pkg_cv_TMP_XAW_CFLAGS - TMP_XAW_LIBS=$pkg_cv_TMP_XAW_LIBS - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - success=yes -fi - xaw_use_xprint=no - fi - fi + { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. - if test "x$success" = "xyes"; then - XEDIT_CFLAGS=$TMP_XAW_CFLAGS - XEDIT_LIBS=$TMP_XAW_LIBS +Alternatively, you may set the environment variables PKGDEPS_CFLAGS +and PKGDEPS_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>. +See \`config.log' for more details." >&5 +echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. +Alternatively, you may set the environment variables PKGDEPS_CFLAGS +and PKGDEPS_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. -if test "x$xaw_use_xprint" = "xyes"; then - XAW_USE_XPRINT_TRUE= - XAW_USE_XPRINT_FALSE='#' +To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } else - XAW_USE_XPRINT_TRUE='#' - XAW_USE_XPRINT_FALSE= + PKGDEPS_CFLAGS=$pkg_cv_PKGDEPS_CFLAGS + PKGDEPS_LIBS=$pkg_cv_PKGDEPS_LIBS + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + : fi - - else - { { echo "$as_me:$LINENO: error: No suitable version of Xaw found" >&5 -echo "$as_me: error: No suitable version of Xaw found" >&2;} - { (exit 1); exit 1; }; } - fi - -if test "x$xaw_use_xprint" = "xyes" ; then +else pkg_failed=no -echo "$as_me:$LINENO: checking for XPRINT_UTIL" >&5 -echo $ECHO_N "checking for XPRINT_UTIL... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking for PKGDEPS" >&5 +echo $ECHO_N "checking for PKGDEPS... $ECHO_C" >&6 if test -n "$PKG_CONFIG"; then - if test -n "$XPRINT_UTIL_CFLAGS"; then - pkg_cv_XPRINT_UTIL_CFLAGS="$XPRINT_UTIL_CFLAGS" + if test -n "$PKGDEPS_CFLAGS"; then + pkg_cv_PKGDEPS_CFLAGS="$PKGDEPS_CFLAGS" else if test -n "$PKG_CONFIG" && \ - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xprintutil xp\"") >&5 - ($PKG_CONFIG --exists --print-errors "xprintutil xp") 2>&5 + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xaw7\"") >&5 + ($PKG_CONFIG --exists --print-errors "xaw7") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - pkg_cv_XPRINT_UTIL_CFLAGS=`$PKG_CONFIG --cflags "xprintutil xp" 2>/dev/null` + pkg_cv_PKGDEPS_CFLAGS=`$PKG_CONFIG --cflags "xaw7" 2>/dev/null` else pkg_failed=yes fi @@ -3326,16 +3357,16 @@ else pkg_failed=untried fi if test -n "$PKG_CONFIG"; then - if test -n "$XPRINT_UTIL_LIBS"; then - pkg_cv_XPRINT_UTIL_LIBS="$XPRINT_UTIL_LIBS" + if test -n "$PKGDEPS_LIBS"; then + pkg_cv_PKGDEPS_LIBS="$PKGDEPS_LIBS" else if test -n "$PKG_CONFIG" && \ - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xprintutil xp\"") >&5 - ($PKG_CONFIG --exists --print-errors "xprintutil xp") 2>&5 + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xaw7\"") >&5 + ($PKG_CONFIG --exists --print-errors "xaw7") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - pkg_cv_XPRINT_UTIL_LIBS=`$PKG_CONFIG --libs "xprintutil xp" 2>/dev/null` + pkg_cv_PKGDEPS_LIBS=`$PKG_CONFIG --libs "xaw7" 2>/dev/null` else pkg_failed=yes fi @@ -3354,33 +3385,33 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - XPRINT_UTIL_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xprintutil xp"` + PKGDEPS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xaw7"` else - XPRINT_UTIL_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xprintutil xp"` + PKGDEPS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xaw7"` fi # Put the nasty error message in config.log where it belongs - echo "$XPRINT_UTIL_PKG_ERRORS" >&5 + echo "$PKGDEPS_PKG_ERRORS" >&5 - { { echo "$as_me:$LINENO: error: Package requirements (xprintutil xp) were not met: + { { echo "$as_me:$LINENO: error: Package requirements (xaw7) were not met: -$XPRINT_UTIL_PKG_ERRORS +$PKGDEPS_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. -Alternatively, you may set the environment variables XPRINT_UTIL_CFLAGS -and XPRINT_UTIL_LIBS to avoid the need to call pkg-config. +Alternatively, you may set the environment variables PKGDEPS_CFLAGS +and PKGDEPS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&5 -echo "$as_me: error: Package requirements (xprintutil xp) were not met: +echo "$as_me: error: Package requirements (xaw7) were not met: -$XPRINT_UTIL_PKG_ERRORS +$PKGDEPS_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. -Alternatively, you may set the environment variables XPRINT_UTIL_CFLAGS -and XPRINT_UTIL_LIBS to avoid the need to call pkg-config. +Alternatively, you may set the environment variables PKGDEPS_CFLAGS +and PKGDEPS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&2;} { (exit 1); exit 1; }; } @@ -3389,8 +3420,8 @@ elif test $pkg_failed = untried; then is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. -Alternatively, you may set the environment variables XPRINT_UTIL_CFLAGS -and XPRINT_UTIL_LIBS to avoid the need to call pkg-config. +Alternatively, you may set the environment variables PKGDEPS_CFLAGS +and PKGDEPS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>. @@ -3399,25 +3430,353 @@ echo "$as_me: error: The pkg-config script could not be found or is too old. Ma is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. -Alternatively, you may set the environment variables XPRINT_UTIL_CFLAGS -and XPRINT_UTIL_LIBS to avoid the need to call pkg-config. +Alternatively, you may set the environment variables PKGDEPS_CFLAGS +and PKGDEPS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else - XPRINT_UTIL_CFLAGS=$pkg_cv_XPRINT_UTIL_CFLAGS - XPRINT_UTIL_LIBS=$pkg_cv_XPRINT_UTIL_LIBS + PKGDEPS_CFLAGS=$pkg_cv_PKGDEPS_CFLAGS + PKGDEPS_LIBS=$pkg_cv_PKGDEPS_LIBS echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 : fi +fi + + +# Check whether --with-lispdir or --without-lispdir was given. +if test "${with_lispdir+set}" = set; then + withval="$with_lispdir" + lispdir="$withval" +else + lispdir=${libdir}/X11/xedit/lisp +fi; +LISPDIR=$lispdir + + + +echo "$as_me:$LINENO: checking for realpath" >&5 +echo $ECHO_N "checking for realpath... $ECHO_C" >&6 +if test "${ac_cv_func_realpath+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define realpath to an innocuous variant, in case <limits.h> declares realpath. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define realpath innocuous_realpath + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char realpath (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef realpath + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char realpath (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_realpath) || defined (__stub___realpath) +choke me +#else +char (*f) () = realpath; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != realpath; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_realpath=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_realpath=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_realpath" >&5 +echo "${ECHO_T}$ac_cv_func_realpath" >&6 +if test $ac_cv_func_realpath = yes; then + : +else + have_realpath=yes +fi + + + +if test x$have_realpath = xyes; then + NEED_REALPATH_TRUE= + NEED_REALPATH_FALSE='#' +else + NEED_REALPATH_TRUE='#' + NEED_REALPATH_FALSE= +fi + +echo "$as_me:$LINENO: checking for strcasecmp" >&5 +echo $ECHO_N "checking for strcasecmp... $ECHO_C" >&6 +if test "${ac_cv_func_strcasecmp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define strcasecmp to an innocuous variant, in case <limits.h> declares strcasecmp. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define strcasecmp innocuous_strcasecmp + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char strcasecmp (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef strcasecmp + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strcasecmp (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_strcasecmp) || defined (__stub___strcasecmp) +choke me +#else +char (*f) () = strcasecmp; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != strcasecmp; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_strcasecmp=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_strcasecmp=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_strcasecmp" >&5 +echo "${ECHO_T}$ac_cv_func_strcasecmp" >&6 +if test $ac_cv_func_strcasecmp = yes; then + : +else + have_strcasecmp=yes +fi - XEDIT_CFLAGS="$XEDIT_CFLAGS $XPRINT_UTIL_CFLAGS" - XEDIT_LIBS="$XEDIT_LIBS $XPRINT_UTIL_LIBS" + + +if test x$have_strcasecmp = xyes; then + NEED_STRCASECMP_TRUE= + NEED_STRCASECMP_FALSE='#' +else + NEED_STRCASECMP_TRUE='#' + NEED_STRCASECMP_FALSE= fi +echo "$as_me:$LINENO: checking for unsetenv" >&5 +echo $ECHO_N "checking for unsetenv... $ECHO_C" >&6 +if test "${ac_cv_func_unsetenv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define unsetenv to an innocuous variant, in case <limits.h> declares unsetenv. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define unsetenv innocuous_unsetenv + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char unsetenv (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef unsetenv + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char unsetenv (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_unsetenv) || defined (__stub___unsetenv) +choke me +#else +char (*f) () = unsetenv; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != unsetenv; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_unsetenv=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_unsetenv=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_unsetenv" >&5 +echo "${ECHO_T}$ac_cv_func_unsetenv" >&6 +if test $ac_cv_func_unsetenv = yes; then + : +else + have_unsetenv=yes +fi + + + +if test x$have_unsetenv = xyes; then + NEED_UNSETENV_TRUE= + NEED_UNSETENV_FALSE='#' +else + NEED_UNSETENV_TRUE='#' + NEED_UNSETENV_FALSE= +fi + + @@ -3680,7 +4039,7 @@ cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1` _ACEOF - PVM=`echo $PACKAGE_VERSION | cut -d . -f 2` + PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` if test "x$PVM" = "x"; then PVM="0" fi @@ -3689,7 +4048,7 @@ cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION_MINOR $PVM _ACEOF - PVP=`echo $PACKAGE_VERSION | cut -d . -f 3` + PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` if test "x$PVP" = "x"; then PVP="0" fi @@ -3813,10 +4172,31 @@ echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi -if test -z "${XAW_USE_XPRINT_TRUE}" && test -z "${XAW_USE_XPRINT_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"XAW_USE_XPRINT\" was never defined. +if test -z "${USE_XPRINT_TRUE}" && test -z "${USE_XPRINT_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"USE_XPRINT\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"USE_XPRINT\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${NEED_REALPATH_TRUE}" && test -z "${NEED_REALPATH_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"NEED_REALPATH\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"NEED_REALPATH\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${NEED_STRCASECMP_TRUE}" && test -z "${NEED_STRCASECMP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"NEED_STRCASECMP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"NEED_STRCASECMP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${NEED_UNSETENV_TRUE}" && test -z "${NEED_UNSETENV_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"NEED_UNSETENV\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"XAW_USE_XPRINT\" was never defined. +echo "$as_me: error: conditional \"NEED_UNSETENV\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi @@ -4091,7 +4471,7 @@ _ASBOX } >&5 cat >&5 <<_CSEOF -This file was extended by xedit $as_me 1.0.2, which was +This file was extended by xedit $as_me 1.1.1, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4154,7 +4534,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -xedit config.status 1.0.2 +xedit config.status 1.1.1 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" @@ -4397,14 +4777,17 @@ s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@PKG_CONFIG@,$PKG_CONFIG,;t t s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t -s,@TMP_XAW_CFLAGS@,$TMP_XAW_CFLAGS,;t t -s,@TMP_XAW_LIBS@,$TMP_XAW_LIBS,;t t -s,@XAW_USE_XPRINT_TRUE@,$XAW_USE_XPRINT_TRUE,;t t -s,@XAW_USE_XPRINT_FALSE@,$XAW_USE_XPRINT_FALSE,;t t -s,@XPRINT_UTIL_CFLAGS@,$XPRINT_UTIL_CFLAGS,;t t -s,@XPRINT_UTIL_LIBS@,$XPRINT_UTIL_LIBS,;t t -s,@XEDIT_CFLAGS@,$XEDIT_CFLAGS,;t t -s,@XEDIT_LIBS@,$XEDIT_LIBS,;t t +s,@USE_XPRINT_TRUE@,$USE_XPRINT_TRUE,;t t +s,@USE_XPRINT_FALSE@,$USE_XPRINT_FALSE,;t t +s,@PKGDEPS_CFLAGS@,$PKGDEPS_CFLAGS,;t t +s,@PKGDEPS_LIBS@,$PKGDEPS_LIBS,;t t +s,@LISPDIR@,$LISPDIR,;t t +s,@NEED_REALPATH_TRUE@,$NEED_REALPATH_TRUE,;t t +s,@NEED_REALPATH_FALSE@,$NEED_REALPATH_FALSE,;t t +s,@NEED_STRCASECMP_TRUE@,$NEED_STRCASECMP_TRUE,;t t +s,@NEED_STRCASECMP_FALSE@,$NEED_STRCASECMP_FALSE,;t t +s,@NEED_UNSETENV_TRUE@,$NEED_UNSETENV_TRUE,;t t +s,@NEED_UNSETENV_FALSE@,$NEED_UNSETENV_FALSE,;t t s,@APPDEFS_CFLAGS@,$APPDEFS_CFLAGS,;t t s,@APPDEFS_LIBS@,$APPDEFS_LIBS,;t t s,@appdefaultdir@,$appdefaultdir,;t t diff --git a/app/xedit/configure.ac b/app/xedit/configure.ac index c421a79db..165eb338e 100644 --- a/app/xedit/configure.ac +++ b/app/xedit/configure.ac @@ -22,27 +22,45 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ([2.57]) -AC_INIT(xedit,[1.0.2], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xedit) +AC_INIT(xedit,[1.1.1], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xedit) AM_INIT_AUTOMAKE([dist-bzip2]) AM_MAINTAINER_MODE AM_CONFIG_HEADER(config.h) AC_PROG_CC +AM_PROG_CC_C_O AC_PROG_INSTALL AC_PROG_RANLIB +PKG_PROG_PKG_CONFIG -# Checks for pkg-config packages -XAW_CHECK_XPRINT_SUPPORT(XEDIT) -if test "x$xaw_use_xprint" = "xyes" ; then - PKG_CHECK_MODULES(XPRINT_UTIL, xprintutil xp) - - XEDIT_CFLAGS="$XEDIT_CFLAGS $XPRINT_UTIL_CFLAGS" - XEDIT_LIBS="$XEDIT_LIBS $XPRINT_UTIL_LIBS" +AC_ARG_ENABLE(xprint, + AS_HELP_STRING([--enable-xprint], + [Compile with xprint support (default: disabled)]), + [enable_xprint=$enableval], [enable_xprint=no]) +AM_CONDITIONAL(USE_XPRINT, test x$enable_xprint = xyes) +if test x$enable_xprint = xyes; then + PKG_CHECK_MODULES(PKGDEPS, xprintutil xp xaw8) +else + PKG_CHECK_MODULES(PKGDEPS, xaw7) fi -AC_SUBST(XEDIT_CFLAGS) -AC_SUBST(XEDIT_LIBS) +AC_ARG_WITH(lispdir, AS_HELP_STRING([--with-lispdir=PATH], + [Directory to install lisp files (default: $libdir/X11/xedit/lisp)]), + [ lispdir="$withval"], + [ lispdir=${libdir}/X11/xedit/lisp ]) +LISPDIR=$lispdir +AC_SUBST(LISPDIR) + +AC_CHECK_FUNC(realpath, [], [have_realpath=yes]) +AM_CONDITIONAL(NEED_REALPATH, test x$have_realpath = xyes) +AC_CHECK_FUNC(strcasecmp, [], [have_strcasecmp=yes]) +AM_CONDITIONAL(NEED_STRCASECMP, test x$have_strcasecmp = xyes) +AC_CHECK_FUNC(unsetenv, [], [have_unsetenv=yes]) +AM_CONDITIONAL(NEED_UNSETENV, test x$have_unsetenv = xyes) + +AC_SUBST(PKGDEPS_CFLAGS) +AC_SUBST(PKGDEPS_LIBS) PKG_CHECK_MODULES(APPDEFS, xt) appdefaultdir=$(pkg-config --variable=appdefaultdir xt) diff --git a/app/xedit/hash.c b/app/xedit/hash.c new file mode 100644 index 000000000..4f3e14a78 --- /dev/null +++ b/app/xedit/hash.c @@ -0,0 +1,322 @@ +/* + * Copyright (c) 2007,2008 Paulo Cesar Pereira de Andrade + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Author: Paulo Cesar Pereira de Andrade + */ + +#include "util.h" +#include <stdlib.h> +#include <string.h> + +/* + * This is a very simplified and adapted version of the hash tables I am + * using in a personal project. It was added to try to have a single hash + * table implementation in xedit. The lisp (for user code) version was not + * converted, but the following hastables have been converted: + * ispell.c - list of replace and ignore words + * hook.c - list of auto replace words + * internal lisp data structures: + * atoms + * strings + * packages + * opaque types + * also, all code traversing hash tables is now using + * hash_iter_first() and hash_iter_next() + * conversion isn't as good as I originally wanted, code is using hash_check + * instead of hash_get, but this is due to the code not having a basic + * { void *data; int length; } object to store string like objects + * + * Also, this hash table implementation was added mainly for the tags + * support. + */ + +/* + * Prototypes + */ +static int hash_equal(hash_table *hash, hash_key *left, hash_key *right); +static unsigned int hash_data(char *value, unsigned int length); +static unsigned int hash_value(hash_key *key); + + +/* + * Implementation + */ +static int +hash_equal(hash_table *hash, hash_key *left, hash_key *right) +{ + if (left->length == right->length) { + if (left == right) + return (1); + if (hash->compare) + return (hash->compare(left, right)); + return (memcmp(left->value, right->value, left->length) == 0); + } + + return (0); +} + +static unsigned int +hash_data(char *value, unsigned int length) +{ + char *ptr; + unsigned int i, key; + + for (i = key = 0, ptr = value; i < length; i++) + key = (key << (key & 1)) ^ ptr[i]; + + return (key); +} + +static unsigned int +hash_value(hash_key *key) +{ + return (hash_data(key->value, key->length)); +} + +hash_table * +hash_new(unsigned int length, hash_compare compare) +{ + hash_table *hash; + + hash = calloc(1, sizeof(hash_table)); + if (hash) { + hash->entries = calloc(length, sizeof(hash_entry *)); + if (hash->entries) { + hash->length = length; + hash->compare = compare; + hash->iter.offset = -1; + } + else { + free(hash); + hash = (hash_table *)0; + } + } + + return (hash); +} + +hash_entry * +hash_put(hash_table *hash, hash_entry *entry) +{ + unsigned int key; + hash_entry *prev, *ptr; + + /* Offset in hash table vector for this entry */ + key = hash_value(entry->key) % hash->length; + + /* We hope this is nil for most calls */ + ptr = hash->entries[key]; + + /* Check if clashed with another entry */ + for (prev = ptr; ptr; prev = ptr, ptr = ptr->next) { + /* Replace current entry */ + if (hash_equal(hash, entry->key, ptr->key)) { + /* If not trying to readd same value */ + if (entry != ptr) { + if (ptr == prev) + hash->entries[key] = entry; + else + prev->next = entry; + entry->next = ptr->next; + /* Finished */ + } + else + ptr = (hash_entry *)0; + goto hash_put_done; + } + } + + /* Add new entry */ + if (prev == (hash_entry *)0) + /* If no entry in offset */ + hash->entries[key] = entry; + else + /* Add to end of clashing list */ + prev->next = entry; + entry->next = (hash_entry *)0; + + /* Increase sum of entries counter*/ + ++hash->count; + +hash_put_done: + /* ptr will be nil if no entry was replaced, of tried to add + * again an entry already in the hash table */ + return (ptr); +} + +hash_entry * +hash_get(hash_table *hash, hash_key *name) +{ + unsigned int key; + hash_entry *entry; + + key = hash_value(name) % hash->length; + for (entry = hash->entries[key]; entry; entry = entry->next) { + if (hash_equal(hash, name, entry->key)) { + + return (entry); + } + } + + return ((hash_entry *)0); +} + +hash_entry * +hash_check(hash_table *hash, char *name, unsigned int length) +{ + unsigned int key; + hash_entry *entry; + + key = hash_data(name, length) % hash->length; + for (entry = hash->entries[key]; entry; entry = entry->next) { + if (length == entry->key->length && + memcmp(name, entry->key->value, length) == 0) { + + return (entry); + } + } + + return ((hash_entry *)0); +} + +hash_entry * +hash_rem_no_free(hash_table *hash, hash_entry *entry) +{ + unsigned int key; + hash_entry *ptr, *prev; + + key = hash_value(entry->key) % hash->length; + for (ptr = prev = hash->entries[key]; ptr; prev = ptr, ptr = ptr->next) { + if (ptr == entry) { + --hash->count; + if (ptr == prev) + hash->entries[key] = ptr->next; + else + prev->next = ptr->next; + break; + } + } + + if (ptr && ptr == hash->iter.entry) + hash->iter.entry = ptr->next; + + /* If entry wasn't in hash table ptr will be nil */ + return (ptr); +} + +void +hash_rem(hash_table *hash, hash_entry *entry) +{ + entry = hash_rem_no_free(hash, entry); + if (entry) { + free(entry->key->value); + free(entry->key); + free(entry); + } +} + +void +hash_rehash(hash_table *hash, unsigned int length) +{ + unsigned int i, key; + hash_entry *entry, *next, **entries; + + entries = (hash_entry **)calloc(length, sizeof(hash_entry *)); + if (entries) { + /* Populate the new table, note that clashes are now in reverse order */ + for (i = 0; i < hash->length; i++) { + for (entry = hash->entries[i]; entry; entry = next) { + next = entry->next; + key = hash_value(entry->key) % length; + entry->next = entries[key]; + entries[key] = entry; + } + } + + /* Finish updating hash table */ + free(hash->entries); + hash->entries = entries; + hash->length = length; + } + hash->iter.offset = -1; +} + +hash_entry * +hash_iter_first(hash_table *hash) +{ + hash->iter.offset = 0; + hash->iter.entry = (hash_entry *)0; + + return (hash_iter_next(hash)); +} + +hash_entry * +hash_iter_next(hash_table *hash) +{ + if (hash->iter.offset >= 0) { + if (hash->iter.entry) { + if ((hash->iter.entry = hash->iter.entry->next)) + return (hash->iter.entry); + ++hash->iter.offset; + } + for (; hash->iter.offset < hash->length; hash->iter.offset++) { + if ((hash->iter.entry = hash->entries[hash->iter.offset])) + return (hash->iter.entry); + } + hash->iter.entry = (hash_entry *)0; + hash->iter.offset = -1; + } + + return ((hash_entry *)0); +} + +void +hash_clr(hash_table *hash) +{ + unsigned int i; + hash_entry *entry, *next; + + /* Extra data should be free'd with the iterator */ + for (i = 0; i < hash->length; i++) { + entry = hash->entries[i]; + if (entry) { + for (next = entry; entry; entry = next) { + next = entry->next; + free(entry->key->value); + free(entry->key); + free(entry); + } + hash->entries[i] = (hash_entry *)0; + } + } + + hash->count = 0; + hash->iter.offset = -1; +} + +void +hash_del(hash_table *hash) +{ + hash_clr(hash); + free(hash->entries); + free(hash); +} diff --git a/app/xedit/hook.c b/app/xedit/hook.c index 13a8b94df..7dd6da0da 100644 --- a/app/xedit/hook.c +++ b/app/xedit/hook.c @@ -39,6 +39,7 @@ #include "xedit.h" #include "re.h" +#include "util.h" #include <stdlib.h> #include <string.h> #include <ctype.h> @@ -46,11 +47,11 @@ /* * Types */ -typedef struct _ReplaceList { - char *word; +typedef struct _ReplaceEntry { + hash_key *word; + struct _ReplaceEntry *next; char *replace; - struct _ReplaceList *next; -} ReplaceList; +} ReplaceEntry; typedef enum { SubstituteDisabled, @@ -69,6 +70,8 @@ typedef struct _EditInfo { /* String and flags used to compile regex */ char pattern[64]; + char subst_pattern[64]; + int pat_length; int flags; /* Substitution buffer */ @@ -108,7 +111,7 @@ static void SubstituteCallback(Widget, XtPointer, XtPointer); * Initialization */ #define STRTBLSZ 11 -static ReplaceList *replace_list[STRTBLSZ]; +static hash_table *replace_hash; static EditInfo einfo; extern Widget scratch; @@ -191,6 +194,8 @@ StartAutoReplace(void) if (!replace || !*replace) return (False); + replace_hash = hash_new(STRTBLSZ, NULL); + left = XtMalloc(llen = 256); right = XtMalloc(rlen = 256); while (*replace) { @@ -247,34 +252,26 @@ StartAutoReplace(void) static char * ReplacedWord(char *word, char *replace) { - ReplaceList *list; - int ii = 0; - char *pp = word; - - while (*pp) - ii = (ii << 1) ^ *pp++; - if (ii < 0) - ii = -ii; - ii %= STRTBLSZ; - for (list = replace_list[ii]; list; list = list->next) - if (strcmp(list->word, word) == 0) { - if (replace) { - XtFree(list->replace); - list->replace = XtNewString(replace); - } - return (list->replace); - } - - if (!replace) - return (NULL); - - list = XtNew(ReplaceList); - list->word = XtNewString(word); - list->replace = XtNewString(replace); - list->next = replace_list[ii]; - replace_list[ii] = list; + int length; + ReplaceEntry *entry; + + length = strlen(word); + entry = (ReplaceEntry *)hash_check(replace_hash, word, length); + if (entry == NULL && replace != NULL) { + entry = XtNew(ReplaceEntry); + entry->word = XtNew(hash_key); + entry->word->value = XtNewString(word); + entry->word->length = length; + entry->next = NULL; + entry->replace = XtNewString(replace); + hash_put(replace_hash, (hash_entry *)entry); + } + else if (replace) { + XtFree(entry->replace); + entry->replace = XtNewString(replace); + } - return (list->replace); + return (entry ? entry->replace : NULL); } static void @@ -388,7 +385,7 @@ LineEditAction(Widget w, XEvent *event, String *params, Cardinal *num_params) { XawTextBlock block; - if (True) { + if (international) { /* XXX FIXME */ fprintf(stderr, "LineEditAction: Not working in international mode.\n"); return; @@ -405,10 +402,6 @@ LineEditAction(Widget w, XEvent *event, String *params, Cardinal *num_params) line_edit = True; } -#define LSCAN(from, count, include) \ - XawTextSourceScan(source, from, XawstEOL, XawsdLeft, count, include) -#define RSCAN(from, count, include) \ - XawTextSourceScan(source, from, XawstEOL, XawsdRight, count, include) void LineEdit(Widget w) { @@ -762,8 +755,9 @@ LineEdit(Widget w) /* Need to (re)compile regular expression pattern? */ if ((!!(einfo.flags & RE_ICASE) ^ icase) || - strlen(einfo.pattern) < length || - strncmp(pstart, einfo.pattern, length)) { + einfo.pat_length != length || + memcmp(pstart, einfo.pattern, + length > einfo.pat_length ? einfo.pat_length : length)) { compile = 1; memcpy(einfo.pattern, pstart, length); einfo.pattern[length] = '\0'; @@ -799,45 +793,40 @@ LineEdit(Widget w) /* Check bounds to work on */ if (replace) { - int i, csubst; + int i, j, ch; /* Check number of required match results and remove/parse backslashes */ - memcpy(einfo.subst, rstart, einfo.slen = rend - rstart); + einfo.slen = rend - rstart; einfo.sref = 0; einfo.soff = offset; - for (i = 0; i < einfo.slen - 1; i++) { - if (einfo.subst[i] == '\\') { - csubst = -1; - switch (einfo.subst[i + 1]) { - case '0': csubst = '\0'; break; - case 'a': csubst = '\b'; break; - case 'b': csubst = '\b'; break; - case 'f': csubst = '\f'; break; - case 'n': csubst = '\n'; break; - case 'r': csubst = '\r'; break; - case 't': csubst = '\t'; break; - case 'v': csubst = '\v'; break; - case '1': case '2': case '3': - case '4': case '5': case '6': - case '7': case '8': case '9': - ++i; - if (einfo.subst[i] - '0' > einfo.sref) - einfo.sref = einfo.subst[i] - '0'; - break; + for (i = j = 0; i < einfo.slen; i++) { + ch = rstart[i]; + if (ch == '\\') { + ++i; + switch (rstart[i]) { + case '0': ch = '\0'; break; + case 'a': ch = '\a'; break; + case 'b': ch = '\b'; break; + case 'f': ch = '\f'; break; + case 'n': ch = '\n'; break; + case 'r': ch = '\r'; break; + case 't': ch = '\t'; break; + case 'v': ch = '\v'; break; + case '1': case '2': case '3': + case '4': case '5': case '6': + case '7': case '8': case '9': + einfo.subst[j++] = '\\'; + if (rstart[i] - '0' > einfo.sref) + einfo.sref = rstart[i] - '0'; + /* FALLTHROUGH */ default: - csubst = einfo.subst[i + 1]; + ch = rstart[i]; break; } - if (csubst >= 0) { - memmove(einfo.subst + i, einfo.subst + i + 1, - einfo.slen - i); - einfo.subst[i] = csubst; - --einfo.slen; - ++i; - csubst = -1; - } } + einfo.subst[j++] = ch; } + einfo.slen = j; } else if (einfo.widget != w) { /* Just a flag for backward search */ @@ -847,8 +836,36 @@ LineEdit(Widget w) /* Compile pattern if required */ if (compile) { + int ch; + char *eptr, *pptr; + + /* Parse backslashes */ + pptr = einfo.subst_pattern; + for (eptr = einfo.pattern, ch = *eptr++; ch; ch = *eptr++) { + if (ch == '\\') { + switch (*eptr) { + case '0': ch = '\0'; einfo.flags |= RE_PEND; break; + case 'a': ch = '\a'; break; + case 'b': ch = '\b'; break; + case 'f': ch = '\f'; break; + case 'n': ch = '\n'; break; + case 'r': ch = '\r'; break; + case 't': ch = '\t'; break; + case 'v': ch = '\v'; break; + default: break; + } + if (ch != '\\') + ++eptr; + } + *pptr++ = ch; + } + *pptr = '\0'; + refree(&einfo.regex); - if ((ecode = recomp(&einfo.regex, einfo.pattern, einfo.flags)) != 0) + /* Allow nuls in search regex */ + einfo.regex.re_endp = pptr; + ecode = recomp(&einfo.regex, einfo.subst_pattern, einfo.flags); + if (ecode) goto print; } @@ -917,7 +934,9 @@ confirm_label: } memcpy(einfo.line, block.ptr, block.length); length = block.length; - for (position += length; position < to; position += length) { + for (position += length; + position < to && block.length; + position += block.length) { XawTextSourceRead(source, position, &block, to - position); memcpy(einfo.line + length, block.ptr, block.length); length += block.length; @@ -927,29 +946,39 @@ confirm_label: /* Execute expression */ einfo.mats[0].rm_so = 0; - einfo.mats[0].rm_eo = to - from - !(from == to || to == last); - ecode = reexec(&einfo.regex, line, - einfo.sref + 1, &einfo.mats[0], flags); + einfo.mats[0].rm_eo = to - from; - if (replace && einfo.mats[0].rm_so == einfo.mats[0].rm_eo) - /* Ignore empty matches */ - ecode = RE_NOMATCH; + /* If not last line or if it ends in a newline */ + if (to != from) { + if (to < last || (to > from && line[einfo.mats[0].rm_eo - 1] == '\n')) + --einfo.mats[0].rm_eo; - if (ecode == 0 && confirm && - (einfo.soff == O_ALL || nth == einfo.soff)) { - einfo.end = from + einfo.mats[0].rm_eo; - einfo.start = from + einfo.mats[0].rm_so; - XawTextSetInsertionPoint(w, einfo.end); - XawTextSetSelection(w, einfo.start, einfo.end); + ecode = reexec(&einfo.regex, line, + einfo.sref + 1, &einfo.mats[0], flags); - einfo.state = SubstituteAsk; - einfo.from = from; - einfo.to = to; - einfo.first = first; - einfo.last = last; - einfo.text_line = line; - break; + if (replace && einfo.mats[0].rm_so == einfo.mats[0].rm_eo) + /* Ignore empty matches */ + ecode = RE_NOMATCH; + + if (ecode == 0 && confirm && + (einfo.soff == O_ALL || nth == einfo.soff)) { + einfo.end = from + einfo.mats[0].rm_eo; + einfo.start = from + einfo.mats[0].rm_so; + XawTextSetInsertionPoint(w, einfo.end); + XawTextSetSelection(w, einfo.start, einfo.end); + + einfo.state = SubstituteAsk; + einfo.from = from; + einfo.to = to; + einfo.first = first; + einfo.last = last; + einfo.text_line = line; + break; + } } + else + /* Check bellow will update offsets */ + ecode = RE_NOMATCH; substitute_label: if (ecode == 0) { @@ -1091,6 +1120,7 @@ no_substitute_label: else XtSetArg(args[0], XtNstring, NULL); XtSetValues(filenamewindow, args, 1); + line_edit = False; } return; @@ -1103,7 +1133,7 @@ print: reerror(ecode, &einfo.regex, buffer + length, sizeof(buffer) - length - 2); strcat(buffer, "\n"); - XeditPrintf(buffer); + XeditPrintf("%s", buffer); refree(&einfo.regex); einfo.state = SubstituteDisabled; Feep(); @@ -1164,8 +1194,7 @@ fail: ptr = "Unknown error"; break; } - XmuSnprintf(buffer, sizeof(buffer), "Error: %s.\n", ptr); - XeditPrintf(buffer); + XeditPrintf("Error: %s.\n", ptr); } if (redisplay) XawTextEnableRedisplay(w); diff --git a/app/xedit/ispell.c b/app/xedit/ispell.c index 9a554d617..842927c2e 100644 --- a/app/xedit/ispell.c +++ b/app/xedit/ispell.c @@ -27,15 +27,17 @@ * Author: Paulo César Pereira de Andrade */ -/* $XdotOrg: app/xedit/ispell.c,v 1.7 2005/04/04 10:17:07 eich Exp $ */ +/* $XdotOrg: xc/programs/xedit/ispell.c,v 1.6 2004/12/04 00:43:13 kuhn Exp $ */ /* $XFree86: xc/programs/xedit/ispell.c,v 1.19 2002/10/19 20:04:20 herrb Exp $ */ #include "xedit.h" +#include "util.h" #include <stdlib.h> #include <unistd.h> #include <fcntl.h> #include <signal.h> #include <ctype.h> +#include <locale.h> #include <errno.h> #include <sys/types.h> #include <sys/wait.h> @@ -133,17 +135,19 @@ struct _ispell { struct _ispell_format *format_info; }; -typedef struct _ReplaceList { - char *word; - char *replace; - struct _ReplaceList *next; -} ReplaceList; +typedef struct _ReplaceEntry ReplaceEntry; +struct _ReplaceEntry { + hash_key *word; + ReplaceEntry*next; + char *replace; +}; -typedef struct _IgnoreList { - char *word; - int add; - struct _IgnoreList *next; -} IgnoreList; +typedef struct _IgnoreEntry IgnoreEntry; +struct _IgnoreEntry { + hash_key *word; + IgnoreEntry *next; + int add; +}; /* * Prototypes @@ -169,6 +173,7 @@ static void IspellSetSensitive(Bool); static void IspellSetStatus(char*); static void IspellSetTerseMode(Bool); static Bool IspellStartProcess(void); +static Bool IspellCheckProcess(void); static Bool IspellEndProcess(Bool, Bool); static void LookIspell(Widget, XtPointer, XtPointer); static void PopdownIspell(Widget, XtPointer, XtPointer); @@ -194,8 +199,8 @@ static struct _ispell ispell; #define RSTRTBLSZ 23 #define ISTRTBLSZ 71 -static ReplaceList *replace_list[RSTRTBLSZ]; -static IgnoreList *ignore_list[ISTRTBLSZ]; +static hash_table *replace_hash; +static hash_table *ignore_hash; #ifndef XtCStatus #define XtCStatus "Status" @@ -441,71 +446,59 @@ IspellCheckUndo(void) static char * IspellReplacedWord(char *word, char *replace) { - ReplaceList *list; - int ii = 0; - char *pp = word; - - while (*pp) - ii = (ii << 1) ^ *pp++; - if (ii < 0) - ii = -ii; - ii %= RSTRTBLSZ; - for (list = replace_list[ii]; list; list = list->next) - if (strcmp(list->word, word) == 0) { - if (replace) { - XtFree(list->replace); - list->replace = XtNewString(replace); - } - return (list->replace); - } - - if (!replace) - return (NULL); + int word_len; + hash_key *word_key; + ReplaceEntry *entry; + + word_len = strlen(word); + entry = (ReplaceEntry *)hash_check(replace_hash, word, word_len); + if (entry == NULL) { + word_key = XtNew(hash_key); + word_key->value = XtNewString(word); + word_key->length = word_len; + entry = XtNew(ReplaceEntry); + entry->word = word_key; + entry->replace = NULL; + entry->next = NULL; + hash_put(replace_hash, (hash_entry *)entry); + } - list = XtNew(ReplaceList); - list->word = XtNewString(word); - list->replace = XtNewString(replace); - list->next = replace_list[ii]; - replace_list[ii] = list; + if (replace) { + XtFree(entry->replace); + entry->replace = XtNewString(replace); + } - return (list->replace); + return (entry->replace); } static Bool IspellDoIgnoredWord(char *word, int cmd, int add) { - IgnoreList *list, *prev; - int ii = 0; - char *pp = word; - - while (*pp) - ii = (ii << 1) ^ *pp++; - if (ii < 0) - ii = -ii; - ii %= ISTRTBLSZ; - for (prev = list = ignore_list[ii]; list; prev = list, list = list->next) - if (strcmp(list->word, word) == 0) { - if (cmd == REMOVE) { - XtFree(list->word); - prev->next = list->next; - XtFree((char*)list); - if (prev == list) - ignore_list[ii] = NULL; - return (True); - } - return (cmd == CHECK); - } + int word_len; + hash_key *word_key; + IgnoreEntry *entry; + + word_len = strlen(word); + entry = (IgnoreEntry *)hash_check(ignore_hash, word, word_len); + if (entry == NULL) { + if (cmd != ADD) + return (False); - if (cmd != ADD) - return (False); + word_key = XtNew(hash_key); + word_key->value = XtNewString(word); + word_key->length = word_len; + entry = XtNew(IgnoreEntry); + entry->word = word_key; + entry->add = add; + entry->next = NULL; + hash_put(ignore_hash, (hash_entry *)entry); - list = XtNew(IgnoreList); - list->word = XtNewString(word); - list->add = add; - list->next = ignore_list[ii]; - ignore_list[ii] = list; + return (True); + } + else if (cmd == REMOVE) + hash_rem(ignore_hash, (hash_entry *)entry); - return (True); + return (cmd == CHECK); } static Bool @@ -938,7 +931,10 @@ IspellSend(void) return (-1); } for (i = 0; i < block.length; i++) { - wctomb(mb, ((wchar_t*)block.ptr)[i]); + if (international) + wctomb(mb, ((wchar_t*)block.ptr)[i]); + else + mb[0] = block.ptr[i]; if (amplen) { if (amplen + 2 >= sizeof(ampbuf)) { if (!ispell.terse_mode) @@ -1036,7 +1032,10 @@ IspellSend(void) return (-1); } for (i = 0; i < block.length; i++) { - wctomb(mb, ((wchar_t*)block.ptr)[i]); + if (international) + wctomb(mb, ((wchar_t*)block.ptr)[i]); + else + mb[0] = block.ptr[i]; if (amplen) { if (amplen + 2 >= sizeof(ampbuf)) { if (!ispell.terse_mode) @@ -1322,14 +1321,26 @@ IspellStartProcess(void) { if (!ispell.pid) { int len; - char *command; + char format[32]; + static char *command; ispell.source = XawTextGetSource(ispell.ascii); - len = strlen(ispell.cmd) + strlen(ispell.dictionary) + - strlen(ispell.wchars) + 16; + if (command) + XtFree(command); + + strcpy(format, "%s -a"); + len = strlen(ispell.cmd) + 4; + if (ispell.dictionary && *ispell.dictionary) { + len += strlen(ispell.dictionary) + 6; + strcat(format, " -d '%s'"); + if (ispell.wchars && *ispell.wchars) { + len += strlen(ispell.wchars + 6); + strcat(format, " -w '%s'"); + } + } command = XtMalloc(len); - XmuSnprintf(command, len, "%s -a -d '%s' -w '%s'", + XmuSnprintf(command, len, format, ispell.cmd, ispell.dictionary, ispell.wchars); pipe(ispell.ifd); @@ -1343,7 +1354,9 @@ IspellStartProcess(void) close(ispell.ofd[1]); close(ispell.ifd[0]); close(ispell.ifd[1]); - execl("/bin/sh", "sh", "-c", command, (void *)NULL); + if (!international) + setlocale(LC_ALL, "ISO-8859-1"); + execl("/bin/sh", "sh", "-c", command, NULL); exit(-127); } else if (ispell.pid < 0) { @@ -1373,44 +1386,48 @@ PopdownIspell(Widget w, XtPointer client_data, XtPointer call_data) } static Bool +IspellCheckProcess(void) +{ + int status; + + if (ispell.pid) { + waitpid(ispell.pid, &status, WNOHANG); + if (WIFEXITED(status)) { + ispell.pid = 0; + } + else + return (True); + } + + return (False); +} + +static Bool IspellEndProcess(Bool killit, Bool killundo) { ispell.source = NULL; if (ispell.pid) { - IgnoreList *il, *pil, *nil; - int i; + IgnoreEntry *ientry; + ReplaceEntry *rentry; /* insert added words in private dictionary */ - for (i = 0; i < ISTRTBLSZ; i++) { - pil = il = ignore_list[i]; - while (il) { - if (il->add) { - nil = il->next; - if (il == pil) - ignore_list[i] = nil; - else - pil->next = nil; - if (il->add == UNCAP) - write(ispell.ofd[1], "&", 1); - else - write(ispell.ofd[1], "*", 1); - write(ispell.ofd[1], il->word, strlen(il->word)); - write(ispell.ofd[1], "\n", 1); - XtFree(il->word); - XtFree((char*)il); - il = nil; - } + for (ientry = (IgnoreEntry *)hash_iter_first(ignore_hash); + ientry; + ientry = (IgnoreEntry *)hash_iter_next(ignore_hash)) { + if (ientry->add) { + if (ientry->add == UNCAP) + write(ispell.ofd[1], "&", 1); else - il = il->next; - pil = il; + write(ispell.ofd[1], "*", 1); + write(ispell.ofd[1], ientry->word->value, ientry->word->length); + write(ispell.ofd[1], "\n", 1); } } write(ispell.ofd[1], "#\n", 2); /* save dictionary */ + hash_clr(ignore_hash); if (killit) { - ReplaceList *rl, *prl; - XtRemoveInput(ispell.id); close(ispell.ofd[0]); @@ -1430,27 +1447,13 @@ IspellEndProcess(Bool killit, Bool killundo) XtFree(ispell.buf); ispell.buf = NULL; - for (i = 0; i < RSTRTBLSZ; i++) { - prl = rl = replace_list[i]; - while (prl) { - rl = rl->next; - XtFree(prl->word); - XtFree(prl->replace); - XtFree((char*)prl); - prl = rl; - } - replace_list[i] = NULL; - } - for (i = 0; i < ISTRTBLSZ; i++) { - pil = il = ignore_list[i]; - while (pil) { - il = il->next; - XtFree(pil->word); - XtFree((char*)pil); - pil = il; - } - ignore_list[i] = NULL; + /* forget about replace matches */ + for (rentry = (ReplaceEntry *)hash_iter_first(replace_hash); + rentry; + rentry = (ReplaceEntry *)hash_iter_next(replace_hash)) { + XtFree(rentry->replace); } + hash_clr(replace_hash); } if (killundo) @@ -1560,12 +1563,18 @@ ReplaceIspell(Widget w, XtPointer client_data, XtPointer call_data) char mb[sizeof(wchar_t)]; if (XawTextSourceRead(ispell.source, pos - 1, &check, 1) > 0) { - wctomb(mb, *(wchar_t*)check.ptr); + if (international) + wctomb(mb, *(wchar_t*)check.ptr); + else + mb[0] = check.ptr[0]; do_replace = !isalpha(*mb) && *mb && !strchr(ispell.wchars, *mb); } if (do_replace && XawTextSourceRead(ispell.source, pos + search.length, &check, 1) > 0) { - wctomb(mb, *(wchar_t*)check.ptr); + if (international) + wctomb(mb, *(wchar_t*)check.ptr); + else + mb[0] = check.ptr[0]; do_replace = !isalpha(*mb) && *mb && !strchr(ispell.wchars, *mb); } if (do_replace) { @@ -1957,8 +1966,10 @@ ChangeDictionaryIspell(Widget w, XtPointer client_data, XtPointer call_data) return; if (!ispell.lock) { - Feep(); - return; + if (IspellCheckProcess()) { + Feep(); + return; + } } for (tmp = ispell.dict_info; tmp; tmp = tmp->next) @@ -2024,6 +2035,7 @@ InitIspell(void) Atom delete_window; char *str, *list; XtResource dict_res; + ispell_dict *dict, *prev_dict; int i; static XtResource text_res[] = { {"skipLines", "Skip", XtRString, sizeof(char*), @@ -2033,6 +2045,9 @@ InitIspell(void) if (ispell.shell) return (False); + replace_hash = hash_new(RSTRTBLSZ, NULL); + ignore_hash = hash_new(ISTRTBLSZ, NULL); + ispell.shell = XtCreatePopupShell("ispell", transientShellWidgetClass, topwindow, NULL, 0); @@ -2169,36 +2184,43 @@ InitIspell(void) dict_res.default_addr = ""; list = XtNewString(ispell.dict_list); - for (str = strtok(list, " \t,"); str; str = strtok(NULL, " \t,")) { - ispell_dict *dic = XtNew(ispell_dict); - dic->sme = XtCreateManagedWidget(str, smeBSBObjectClass, - ispell.dictMenu, NULL, 0); - XtGetApplicationResources(dic->sme, (XtPointer)dic, &dict_res, + /* Create first empty entry */ + dict = XtNew(ispell_dict); + dict->sme = XtCreateManagedWidget("", smeBSBObjectClass, + ispell.dictMenu, NULL, 0); + dict->wchars = ""; + XtAddCallback(dict->sme, XtNcallback, ChangeDictionaryIspell, + (XtPointer)dict); + ispell.dict_info = prev_dict = dict; + + for (str = strtok(list, " \t,"); str; str = strtok(NULL, " \t,")) { + dict = XtNew(ispell_dict); + dict->sme = XtCreateManagedWidget(str, smeBSBObjectClass, + ispell.dictMenu, NULL, 0); + XtGetApplicationResources(dict->sme, (XtPointer)dict, &dict_res, 1, NULL, 0); - XtAddCallback(dic->sme, XtNcallback, ChangeDictionaryIspell, - (XtPointer)dic); - dic->next = NULL; - if (!ispell.dict_info) - ispell.dict_info = dic; - else { - ispell_dict *tmp = ispell.dict_info; - - for (; tmp->next; tmp = tmp->next) - ; - tmp->next = dic; - } - if (strcmp(str, ispell.dictionary) == 0) { + XtAddCallback(dict->sme, XtNcallback, ChangeDictionaryIspell, + (XtPointer)dict); + prev_dict->next = dict; + prev_dict = dict; + dict->next = NULL; + } + XtFree(list); + + for (dict = ispell.dict_info; dict; dict = dict->next) { + if (strcmp(XtName(dict->sme), ispell.dictionary) == 0) { Arg args[1]; XtSetArg(args[0], XtNleftBitmap, flist.pixmap); - XtSetValues(dic->sme, args, 1); - XtSetArg(args[0], XtNlabel, str); + XtSetValues(dict->sme, args, 1); + XtSetArg(args[0], XtNlabel, XtName(dict->sme)); XtSetValues(ispell.dict, args, 1); - ispell.wchars = dic->wchars; + ispell.wchars = dict->wchars; + break; } } - XtFree(list); + delete_window = XInternAtom(XtDisplay(ispell.shell), "WM_DELETE_WINDOW", False); XSetWMProtocols(XtDisplay(ispell.shell), XtWindow(ispell.shell), &delete_window, 1); diff --git a/app/xedit/lisp/bytecode.c b/app/xedit/lisp/bytecode.c index 3e824d251..cc7d1c5b4 100644 --- a/app/xedit/lisp/bytecode.c +++ b/app/xedit/lisp/bytecode.c @@ -551,6 +551,8 @@ Lisp_Disassemble(LispBuiltin *builtin) name = bytecode = NULL; switch (OBJECT_TYPE(function)) { + case LispFunction_t: + function = function->data.atom->object; case LispAtom_t: name = function; atom = function->data.atom; @@ -627,8 +629,8 @@ Lisp_Disassemble(LispBuiltin *builtin) for (i = 0; i < alist->normals.num_symbols; i++) { LispWriteChar(NIL, i ? ',' : ':'); LispWriteChar(NIL, ' '); - LispWriteStr(NIL, ATOMID(alist->normals.symbols[i]), - strlen(ATOMID(alist->normals.symbols[i]))); + LispWriteStr(NIL, ATOMID(alist->normals.symbols[i])->value, + ATOMID(alist->normals.symbols[i])->length); } LispWriteChar(NIL, '\n'); @@ -639,8 +641,8 @@ Lisp_Disassemble(LispBuiltin *builtin) for (i = 0; i < alist->optionals.num_symbols; i++) { LispWriteChar(NIL, i ? ',' : ':'); LispWriteChar(NIL, ' '); - LispWriteStr(NIL, ATOMID(alist->optionals.symbols[i]), - strlen(ATOMID(alist->optionals.symbols[i]))); + LispWriteStr(NIL, ATOMID(alist->optionals.symbols[i])->value, + ATOMID(alist->optionals.symbols[i])->length); } LispWriteChar(NIL, '\n'); @@ -657,8 +659,8 @@ Lisp_Disassemble(LispBuiltin *builtin) if (alist->rest) { LispWriteStr(NIL, "Rest argument: ", 15); - LispWriteStr(NIL, ATOMID(alist->rest), - strlen(ATOMID(alist->rest))); + LispWriteStr(NIL, ATOMID(alist->rest)->value, + ATOMID(alist->rest)->length); LispWriteChar(NIL, '\n'); } else @@ -666,6 +668,7 @@ Lisp_Disassemble(LispBuiltin *builtin) } if (bytecode) { + Atom_id id; char *ptr; int *offsets[4]; int i, done, j, sym0, sym1, con0, con1, bui0, byt0, strd, strf; @@ -724,11 +727,11 @@ Lisp_Disassemble(LispBuiltin *builtin) * and called as XSTRING(atom->object) * it would also print the package name were the symbol was first defined, * but for local variables, only the symbol string is important. */ -#define XSTRING(string) string ? string : "#<UNBOUND>" +#define XSTRING(key) key ? key->value : "#<UNBOUND>" for (i = 0; i < num_symbols; i++) { sprintf(buffer, "Symbol %d = %s\n", - i, XSTRING(symbols[i]->string)); + i, XSTRING(symbols[i]->key)); LispWriteStr(NIL, buffer, strlen(buffer)); } for (i = 0; i < num_builtins; i++) { @@ -756,24 +759,24 @@ Lisp_Disassemble(LispBuiltin *builtin) for (i = 0; i < alist->normals.num_symbols; i++, j++) { sprintf(buffer, "%d = ", j); LispWriteStr(NIL, buffer, strlen(buffer)); - ptr = alist->normals.symbols[i]->data.atom->string; - LispWriteStr(NIL, ptr, strlen(ptr)); + id = alist->normals.symbols[i]->data.atom->key; + LispWriteStr(NIL, id->value, id->length); LispWriteChar(NIL, '\n'); } for (i = 0; i < alist->optionals.num_symbols; i++, j++) { sprintf(buffer, "%d = ", j); LispWriteStr(NIL, buffer, strlen(buffer)); - ptr = alist->optionals.symbols[i]->data.atom->string; - LispWriteStr(NIL, ptr, strlen(ptr)); + id = alist->optionals.symbols[i]->data.atom->key; + LispWriteStr(NIL, id->value, id->length); LispWriteChar(NIL, '\n'); if (alist->optionals.sforms[i]) { sprintf(buffer, "%d = ", j); len1 = strlen(buffer); LispWriteStr(NIL, buffer, len1); - ptr = alist->optionals.sforms[i]->data.atom->string; - len2 = strlen(ptr); - LispWriteStr(NIL, ptr, len2); + id = alist->optionals.sforms[i]->data.atom->key; + len2 = id->length; + LispWriteStr(NIL, id->value, len2); LispWriteChars(NIL, ' ', 28 - (len1 + len2)); LispWriteStr(NIL, "; sform\n", 9); j++; @@ -785,24 +788,24 @@ Lisp_Disassemble(LispBuiltin *builtin) len1 = strlen(buffer); LispWriteStr(NIL, buffer, len1); if (alist->keys.keys[i]) { - ptr = alist->keys.keys[i]->data.atom->string; - len2 = strlen(ptr); - LispWriteStr(NIL, ptr, strlen(ptr)); + id = alist->keys.keys[i]->data.atom->key; + len2 = id->length; + LispWriteStr(NIL, id->value, id->length); LispWriteChars(NIL, ' ', 28 - (len1 + len2)); LispWriteStr(NIL, "; special key", 14); } else { - ptr = alist->keys.symbols[i]->data.atom->string; - LispWriteStr(NIL, ptr, strlen(ptr)); + id = alist->keys.symbols[i]->data.atom->key; + LispWriteStr(NIL, id->value, id->length); } LispWriteChar(NIL, '\n'); if (alist->keys.sforms[i]) { sprintf(buffer, "%d = ", j); len1 = strlen(buffer); LispWriteStr(NIL, buffer, len1); - ptr = alist->keys.sforms[i]->data.atom->string; - len2 = strlen(ptr); - LispWriteStr(NIL, ptr, len2); + id = alist->keys.sforms[i]->data.atom->key; + len2 = id->length; + LispWriteStr(NIL, id->value, len2); LispWriteChars(NIL, ' ', 28 - (len1 + len2)); LispWriteStr(NIL, "; sform\n", 9); j++; @@ -813,9 +816,9 @@ Lisp_Disassemble(LispBuiltin *builtin) sprintf(buffer, "%d = ", j); len1 = strlen(buffer); LispWriteStr(NIL, buffer, len1); - ptr = alist->rest->data.atom->string; - len2 = strlen(ptr); - LispWriteStr(NIL, ptr, len2); + id = alist->rest->data.atom->key; + len2 = id->length; + LispWriteStr(NIL, id->value, len2); LispWriteChar(NIL, '\n'); j++; } @@ -824,9 +827,9 @@ Lisp_Disassemble(LispBuiltin *builtin) sprintf(buffer, "%d = ", j); len1 = strlen(buffer); LispWriteStr(NIL, buffer, len1); - ptr = alist->auxs.symbols[i]->data.atom->string; - len2 = strlen(ptr); - LispWriteStr(NIL, ptr, len2); + id = alist->auxs.symbols[i]->data.atom->key; + len2 = id->length; + LispWriteStr(NIL, id->value, len2); LispWriteChars(NIL, ' ', 28 - (len1 + len2)); LispWriteStr(NIL, "; aux\n", 7); } @@ -1116,7 +1119,7 @@ integer: for (; strf >= 0; strf--) fields = CDR(fields); strcpy(ptr, " "); ptr += 2; - strcpy(ptr, CAR(fields)->data.atom->string); + strcpy(ptr, CAR(fields)->data.atom->key->value); ptr += strlen(ptr); } if (strd >= 0) { @@ -1154,11 +1157,11 @@ integer: /* Symbols */ if (sym0 >= 0) { strcpy(ptr, " "); ptr += 2; - strcpy(ptr, XSTRING(symbols[sym0]->string)); + strcpy(ptr, XSTRING(symbols[sym0]->key)); ptr += strlen(ptr); if (sym1 >= 0) { strcpy(ptr, " "); ptr += 2; - strcpy(ptr, XSTRING(symbols[sym1]->string)); + strcpy(ptr, XSTRING(symbols[sym1]->key)); ptr += strlen(ptr); } } @@ -1658,7 +1661,7 @@ LinkWarnUnused(LispCom *com, CodeBlock *block) if (!(block->variables.flags[i] & (VARIABLE_USED | VARIABLE_ARGUMENT))) { ++com->warnings; LispWarning("the variable %s is unused", - block->variables.symbols[i]->string); + block->variables.symbols[i]->key->value); } } @@ -3274,7 +3277,7 @@ let_argument: * atom->constant field. */ atom = symbols[*stream++]; atom->offset = lisp__data.env.length; - lisp__data.env.names[lisp__data.env.length] = atom->string; + lisp__data.env.names[lisp__data.env.length] = atom->key; lisp__data.env.values[lisp__data.env.length++] = reg0; NEXT_OPCODE(); @@ -3282,7 +3285,7 @@ OPCODE_LABEL(XBC_LETX): letx_argument: atom = symbols[*stream++]; atom->offset = lisp__data.env.length; - lisp__data.env.names[lisp__data.env.length] = atom->string; + lisp__data.env.names[lisp__data.env.length] = atom->key; lisp__data.env.values[lisp__data.env.length++] = reg0; lisp__data.env.head++; NEXT_OPCODE(); @@ -3290,14 +3293,14 @@ letx_argument: OPCODE_LABEL(XBC_LET_NIL): atom = symbols[*stream++]; atom->offset = lisp__data.env.length; - lisp__data.env.names[lisp__data.env.length] = atom->string; + lisp__data.env.names[lisp__data.env.length] = atom->key; lisp__data.env.values[lisp__data.env.length++] = NIL; NEXT_OPCODE(); OPCODE_LABEL(XBC_LETX_NIL): atom = symbols[*stream++]; atom->offset = lisp__data.env.length; - lisp__data.env.names[lisp__data.env.length] = atom->string; + lisp__data.env.names[lisp__data.env.length] = atom->key; lisp__data.env.values[lisp__data.env.length++] = NIL; lisp__data.env.head++; NEXT_OPCODE(); @@ -3445,7 +3448,7 @@ OPCODE_LABEL(XBC_SETSYM): /* atom->dyn and atom->constant are exclusive, no * need to check if variable declared as constant. */ if (atom->offset < lisp__data.env.head && - lisp__data.env.names[atom->offset] == atom->string) + lisp__data.env.names[atom->offset] == atom->key) lisp__data.env.values[atom->offset] = reg0; else { if (atom->watch) @@ -3468,7 +3471,7 @@ OPCODE_LABEL(XBC_SETSYM): LispPackage *pack; LispWarning("the variable %s was not declared", - atom->string); + atom->key->value); LispSetAtomObjectProperty(atom, reg0); pack = atom->package->data.package.package; if (pack->glb.length >= pack->glb.space) @@ -3482,7 +3485,7 @@ OPCODE_LABEL(XBC_SETSYM): atom = symbols[*stream++]; \ if (atom->dyn) { \ if (atom->offset < lisp__data.env.head && \ - lisp__data.env.names[atom->offset] == atom->string) \ + lisp__data.env.names[atom->offset] == atom->key) \ reg0 = lisp__data.env.values[atom->offset]; \ else { \ reg0 = atom->property->value; \ @@ -3631,12 +3634,12 @@ OPCODE_LABEL(XBC_STRUCT): offset = *stream++; reg1 = constants[*stream++]; if (!STRUCTP(reg0) || reg0->data.struc.def != reg1) { - char *name = ATOMID(CAR(reg1)); + char *name = ATOMID(CAR(reg1))->value; for (reg1 = CDR(reg1); offset; offset--) reg1 = CDR(reg1); LispDestroy("%s-%s: %s is not a %s", - name, ATOMID(CAR(reg1)), STROBJ(reg0), name); + name, ATOMID(CAR(reg1))->value, STROBJ(reg0), name); } for (reg0 = reg0->data.struc.fields; offset; offset--) reg0 = CDR(reg0); diff --git a/app/xedit/lisp/compile.c b/app/xedit/lisp/compile.c index 6058c67a0..829baea85 100644 --- a/app/xedit/lisp/compile.c +++ b/app/xedit/lisp/compile.c @@ -1175,7 +1175,7 @@ ComAddVariable(LispCom *com, LispObj *symbol, LispObj *value) { LispAtom *atom = symbol->data.atom; - if (atom && atom->string && !com->macro) { + if (atom && atom->key && !com->macro) { int i, length = com->block->variables.length; i = BuildTablePointer(atom, (void***)&com->block->variables.symbols, @@ -1216,7 +1216,7 @@ ComGetVariable(LispCom *com, LispObj *symbol) } offset = name->offset; - id = name->string; + id = name->key; base = lisp__data.env.lex; i = lisp__data.env.head - 1; @@ -1238,7 +1238,7 @@ ComGetVariable(LispCom *com, LispObj *symbol) if (!name->a_object) { ++com->warnings; LispWarning("variable %s is neither declared nor bound", - name->string); + name->key->value); } /* Not found, resolve <symbol> at run time */ @@ -1645,7 +1645,7 @@ rest_label: constantp = 0; } - string = builtin ? ATOMID(name) : NULL; + string = builtin ? ATOMID(name)->value : NULL; /* XXX FIXME should have a flag indicating if function call * change the &REST arguments even if it is a constant list * (or if the returned value may be changed). */ @@ -1845,7 +1845,7 @@ ComFuncall(LispCom *com, LispObj *function, LispObj *arguments, int eval) LispObj *definition = atom->property->structure.definition; if (!CONSP(arguments) || CONSP(CDR(arguments))) - LispDestroy("%s: too %s arguments", atom->string, + LispDestroy("%s: too %s arguments", atom->key->value, CONSP(arguments) ? "many" : "few"); ComEval(com, CAR(arguments)); @@ -1870,7 +1870,7 @@ ComFuncall(LispCom *com, LispObj *function, LispObj *arguments, int eval) else { /* Not yet defined function/macro. */ ++com->warnings; - LispWarning("call to undefined function %s", atom->string); + LispWarning("call to undefined function %s", atom->key->value); com_Funcall(com, function, arguments); } break; diff --git a/app/xedit/lisp/core.c b/app/xedit/lisp/core.c index 684081af5..89f5d5c3c 100644 --- a/app/xedit/lisp/core.c +++ b/app/xedit/lisp/core.c @@ -1070,7 +1070,7 @@ Lisp_Defmacro(LispBuiltin *builtin) name = ARGUMENT(0); CHECK_SYMBOL(name); - alist = LispCheckArguments(LispMacro, lambda_list, ATOMID(name), 0); + alist = LispCheckArguments(LispMacro, lambda_list, ATOMID(name)->value, 0); if (CONSP(body) && STRINGP(CAR(body))) { LispAddDocumentation(name, CAR(body), LispDocFunction); @@ -1086,7 +1086,8 @@ Lisp_Defmacro(LispBuiltin *builtin) } /* redefining these may cause surprises if bytecode * compiled functions references them */ - LispWarning("%s: %s is being redefined", STRFUN(builtin), ATOMID(name)); + LispWarning("%s: %s is being redefined", STRFUN(builtin), + ATOMID(name)->value); LispRemAtomBuiltinProperty(name->data.atom); } @@ -1112,7 +1113,7 @@ Lisp_Defun(LispBuiltin *builtin) name = ARGUMENT(0); CHECK_SYMBOL(name); - alist = LispCheckArguments(LispFunction, lambda_list, ATOMID(name), 0); + alist = LispCheckArguments(LispFunction, lambda_list, ATOMID(name)->value, 0); if (CONSP(body) && STRINGP(CAR(body))) { LispAddDocumentation(name, CAR(body), LispDocFunction); @@ -1128,7 +1129,8 @@ Lisp_Defun(LispBuiltin *builtin) } /* redefining these may cause surprises if bytecode * compiled functions references them */ - LispWarning("%s: %s is being redefined", STRFUN(builtin), ATOMID(name)); + LispWarning("%s: %s is being redefined", STRFUN(builtin), + ATOMID(name)->value); LispRemAtomBuiltinProperty(name->data.atom); } @@ -1166,7 +1168,7 @@ Lisp_Defsetf(LispBuiltin *builtin) return (function); } - alist = LispCheckArguments(LispSetf, lambda_list, ATOMID(function), 0); + alist = LispCheckArguments(LispSetf, lambda_list, ATOMID(function)->value, 0); store = CAR(body); if (!CONSP(store)) @@ -2050,7 +2052,7 @@ Lisp_Lambda(LispBuiltin *builtin) body = ARGUMENT(1); lambda_list = ARGUMENT(0); - alist = LispCheckArguments(LispLambda, lambda_list, Snil, 0); + alist = LispCheckArguments(LispLambda, lambda_list, Snil->value, 0); name = OPAQUE(alist, LispArgList_t); lambda_list = LispListProtectedArguments(alist); @@ -2675,7 +2677,7 @@ Lisp_MakeArray(LispBuiltin *builtin) type = LispOpaque_t; else LispDestroy("%s: unsupported element type %s", - STRFUN(builtin), ATOMID(element_type)); + STRFUN(builtin), ATOMID(element_type)->value); } } @@ -3240,7 +3242,7 @@ Lisp_Member(LispBuiltin *builtin) } else { for (; CONSP(list); list = CDR(list)) - if (FCOMPARE(lambda, item, CAR(list), code) == expect) + if ((FCOMPARE(lambda, item, CAR(list), code)) == expect) return (list); } } @@ -3253,7 +3255,7 @@ Lisp_Member(LispBuiltin *builtin) else { for (; CONSP(list); list = CDR(list)) { compare = APPLY1(key, CAR(list)); - if (FCOMPARE(lambda, item, compare, code) == expect) + if ((FCOMPARE(lambda, item, compare, code)) == expect) return (list); } } @@ -3942,7 +3944,7 @@ Lisp_Proclaim(LispBuiltin *builtin) object = CAR(arguments); CHECK_SYMBOL(object); - operation = ATOMID(object); + operation = ATOMID(object)->value; if (strcmp(operation, "SPECIAL") == 0) { for (arguments = CDR(arguments); CONSP(arguments); arguments = CDR(arguments)) { @@ -4988,7 +4990,7 @@ LispDeleteRemoveXSubstitute(LispBuiltin *builtin, } /* Skip initial removed elements, if any */ - for (i = 0; objects[i] == NULL && i < xlength; i++) + for (i = 0; i < xlength && objects[i] == NULL; i++) ; for (i = 0; i < xlength; i++, object = CDR(object)) { diff --git a/app/xedit/lisp/format.c b/app/xedit/lisp/format.c index abbb49db4..ab855655d 100644 --- a/app/xedit/lisp/format.c +++ b/app/xedit/lisp/format.c @@ -556,7 +556,7 @@ format_ascii(LispObj *stream, LispObj *object, FmtArgs *args) if (collon) LispWriteStr(stream, "()", 2); else - LispWriteStr(stream, Snil, 3); + LispWriteStr(stream, Snil->value, 3); } else { /* if string is not NIL, atsign was specified diff --git a/app/xedit/lisp/hash.c b/app/xedit/lisp/hash.c index 595933086..a6b91ec37 100644 --- a/app/xedit/lisp/hash.c +++ b/app/xedit/lisp/hash.c @@ -153,8 +153,6 @@ LispHashKey(LispObj *object, int function) case LispString_t: string = THESTR(object); length = STRLEN(object); - if (length > 32) - length = 32; for (i = 0, key = 0; i < length; i++) key = (key << 1) ^ string[i]; break; diff --git a/app/xedit/lisp/helper.c b/app/xedit/lisp/helper.c index 100ed2e08..be3ee7b62 100644 --- a/app/xedit/lisp/helper.c +++ b/app/xedit/lisp/helper.c @@ -343,8 +343,8 @@ LispCharacterCoerce(LispBuiltin *builtin, LispObj *object) return (object); else if (STRINGP(object) && STRLEN(object) == 1) return (SCHAR(THESTR(object)[0])); - else if (SYMBOLP(object) && ATOMID(object)[1] == '\0') - return (SCHAR(ATOMID(object)[0])); + else if (SYMBOLP(object) && ATOMID(object)->value[1] == '\0') + return (SCHAR(ATOMID(object)->value[0])); else if (INDEXP(object)) { int c = FIXNUM_VALUE(object); @@ -374,9 +374,9 @@ LispStringCoerce(LispBuiltin *builtin, LispObj *object) return (LSTRING(string, 1)); } else if (object == NIL) - return (LSTRING(Snil, 3)); + return (LSTRING(Snil->value, 3)); else if (object == T) - return (LSTRING(St, 1)); + return (LSTRING(St->value, 1)); else LispDestroy("%s: cannot convert %s to string", STRFUN(builtin), STROBJ(object)); @@ -442,7 +442,7 @@ LispCoerce(LispBuiltin *builtin, type = LispPathname_t; else LispDestroy("%s: invalid type specification %s", - STRFUN(builtin), ATOMID(result_type)); + STRFUN(builtin), ATOMID(result_type)->value); } if (OBJECT_TYPE(object) == LispOpaque_t) { @@ -559,7 +559,7 @@ LispCoerce(LispBuiltin *builtin, coerce_fail: LispDestroy("%s: cannot convert %s to %s", - STRFUN(builtin), STROBJ(object), ATOMID(result_type)); + STRFUN(builtin), STROBJ(object), ATOMID(result_type)->value); /* NOTREACHED */ return (NIL); } diff --git a/app/xedit/lisp/internal.h b/app/xedit/lisp/internal.h index 68c8be2fd..2ca499196 100644 --- a/app/xedit/lisp/internal.h +++ b/app/xedit/lisp/internal.h @@ -1,4 +1,4 @@ -/* $XdotOrg: app/xedit/lisp/internal.h,v 1.3 2004/12/04 00:43:13 kuhn Exp $ */ +/* $XdotOrg: xc/programs/xedit/lisp/internal.h,v 1.2 2004/04/23 19:54:44 eich Exp $ */ /* * Copyright (c) 2001 by The XFree86 Project, Inc. * @@ -39,6 +39,8 @@ #include "mp.h" #include "re.h" +#include "util.h" + /* * Defines */ @@ -110,14 +112,14 @@ typedef struct _LispMac LispMac; #define UPROTECT(key, list) LispUProtect(key, list) /* create a new unique static atom string */ -#define GETATOMID(string) LispGetAtomString(string, 1) +#define GETATOMID(string) LispGetAtomKey(string, 1) #define GCDisable() ++gcpro #define GCEnable() --gcpro /* pointer to something unique to all atoms with the same print representation */ -#define ATOMID(object) (object)->data.atom->string +#define ATOMID(object) (object)->data.atom->key @@ -432,7 +434,7 @@ typedef struct _LispMac LispMac; #define LispFileno(file) ((file)->descriptor) -#define STRFUN(builtin) ATOMID(builtin->symbol) +#define STRFUN(builtin) ATOMID(builtin->symbol)->value #define STROBJ(obj) LispStrObj(obj) /* fetch builtin function/macro argument value @@ -457,9 +459,9 @@ typedef struct _LispMac LispMac; #define ERROR_CHECK_SPECIAL_FORM(atom) \ - if (atom->property->fun.builtin->compile) \ + if ((atom)->property->fun.builtin->compile) \ LispDestroy("%s: the special form %s cannot be redefined", \ - STRFUN(builtin), atom->string) + STRFUN(builtin), (atom)->key->value) @@ -489,7 +491,7 @@ typedef struct _LispHashTable LispHashTable; /* Bytecode compiler data */ typedef struct _LispCom LispCom; -typedef char *Atom_id; +typedef hash_key *Atom_id; typedef enum _LispType { /* objects encoded in the LispObj pointer */ diff --git a/app/xedit/lisp/io.c b/app/xedit/lisp/io.c index 56da49bdb..3a338558e 100644 --- a/app/xedit/lisp/io.c +++ b/app/xedit/lisp/io.c @@ -633,26 +633,34 @@ LispFwrite(LispFile *file, void *data, int size) int LispSwrite(LispString *string, void *data, int size) { + int bytes; + if (size < 0) return (EOF); if (string->output + size >= string->space) { if (string->fixed) { /* leave space for a ending nul character */ - size = string->space - string->output - 1; + bytes = string->space - string->output - 1; + + if (bytes < size) + size = bytes; if (size <= 0) return (-1); } else { - char *tmp = realloc(string->string, string->space + - (size / pagesize) * pagesize + pagesize); + char *tmp; + + bytes = string->space + size; + bytes += pagesize - (bytes % pagesize); + tmp = realloc(string->string, bytes); if (tmp == NULL) return (-1); string->string = tmp; - string->space += pagesize; + string->space = bytes; } } memcpy(string->string + string->output, data, size); diff --git a/app/xedit/lisp/lisp.c b/app/xedit/lisp/lisp.c index 87bf2cf6c..4b393c136 100644 --- a/app/xedit/lisp/lisp.c +++ b/app/xedit/lisp/lisp.c @@ -935,22 +935,20 @@ Lisp__GC(LispObj *car, LispObj *cdr) /* Traverse atom list, protecting properties, and function/structure * definitions if lisp__data.gc.immutablebits set */ - for (i = 0; i < STRTBLSZ; i++) { - atom = pack->atoms[i]; - while (atom) { - if (atom->property != NOPROPERTY) { - if (atom->a_property) - LispMark(atom->property->properties); - if (lisp__data.gc.immutablebits) { - if (atom->a_function || atom->a_compiled) - LispProt(atom->property->fun.function); - if (atom->a_defsetf) - LispProt(atom->property->setf); - if (atom->a_defstruct) - LispProt(atom->property->structure.definition); - } + for (atom = (LispAtom *)hash_iter_first(pack->atoms); + atom; + atom = (LispAtom *)hash_iter_next(pack->atoms)) { + if (atom->property != NOPROPERTY) { + if (atom->a_property) + LispMark(atom->property->properties); + if (lisp__data.gc.immutablebits) { + if (atom->a_function || atom->a_compiled) + LispProt(atom->property->fun.function); + if (atom->a_defsetf) + LispProt(atom->property->setf); + if (atom->a_defstruct) + LispProt(atom->property->structure.definition); } - atom = atom->next; } } } @@ -1285,97 +1283,88 @@ LispSetVariable(LispObj *var, LispObj *val, char *fname, int eval) int LispRegisterOpaqueType(char *desc) { + int length; LispOpaque *opaque; - int ii = STRHASH(desc); - for (opaque = lisp__data.opqs[ii]; opaque; opaque = opaque->next) - if (strcmp(opaque->desc, desc) == 0) - return (opaque->type); - opaque = (LispOpaque*)LispMalloc(sizeof(LispOpaque)); - opaque->desc = LispStrdup(desc); - opaque->next = lisp__data.opqs[ii]; - lisp__data.opqs[ii] = opaque; - LispMused(opaque->desc); - LispMused(opaque); + length = strlen(desc); + opaque = (LispOpaque *)hash_check(lisp__data.opqs, desc, length); + + if (opaque == NULL) { + opaque = (LispOpaque*)LispMalloc(sizeof(LispOpaque)); + opaque->desc = (hash_key*)LispCalloc(1, sizeof(hash_key)); + opaque->desc->value = LispStrdup(desc); + opaque->desc->length = length; + hash_put(lisp__data.opqs, (hash_entry *)opaque); + LispMused(opaque->desc->value); + LispMused(opaque->desc); + LispMused(opaque); + opaque->type = ++lisp__data.opaque; + } - return (opaque->type = ++lisp__data.opaque); + return (opaque->type); } char * LispIntToOpaqueType(int type) { - int i; LispOpaque *opaque; if (type) { - for (i = 0; i < STRTBLSZ; i++) { - opaque = lisp__data.opqs[i]; - while (opaque) { - if (opaque->type == type) - return (opaque->desc); - opaque = opaque->next; - } + for (opaque = (LispOpaque *)hash_iter_first(lisp__data.opqs); + opaque; + opaque = (LispOpaque *)hash_iter_next(lisp__data.opqs)) { + if (opaque->type == type) + return (opaque->desc->value); } LispDestroy("Opaque type %d not registered", type); } - return (Snil); -} - -int -LispDoHashString(char *string) -{ - char *pp; - int ii, count; - - for (pp = string, ii = count = 0; *pp && count < 32; pp++, count++) - ii = (ii << 1) ^ *pp; - if (ii < 0) - ii = -ii; - - return (ii % STRTBLSZ); + return (Snil->value); } -char * -LispGetAtomString(char *string, int perm) +hash_key * +LispGetAtomKey(char *string, int perm) { - LispStringHash *entry; - int ii = STRHASH(string); - - for (entry = lisp__data.strings[ii]; entry != NULL; entry = entry->next) - if (strcmp(entry->string, string) == 0) - return (entry->string); - - entry = (LispStringHash*)LispCalloc(1, sizeof(LispStringHash)); - if (perm) - entry->string = string; - else - entry->string = LispStrdup(string); - LispMused(entry); - if (!perm) - LispMused(entry->string); - entry->next = lisp__data.strings[ii]; - lisp__data.strings[ii] = entry; + int length; + hash_entry *entry; + + length = strlen(string); + entry = hash_check(lisp__data.strings, string, length); + if (entry == NULL) { + entry = LispCalloc(1, sizeof(hash_entry)); + entry->key = LispCalloc(1, sizeof(hash_key)); + if (perm) + entry->key->value = string; + else + entry->key->value = LispStrdup(string); + entry->key->length = length; + + hash_put(lisp__data.strings, entry); + if (!perm) + LispMused(entry->key->value); + LispMused(entry->key); + LispMused(entry); + } - return (entry->string); + return (entry->key); } LispAtom * LispDoGetAtom(char *str, int perm) { + int length; LispAtom *atom; - int ii = STRHASH(str); - for (atom = lisp__data.pack->atoms[ii]; atom; atom = atom->next) - if (strcmp(atom->string, str) == 0) - return (atom); + length = strlen(str); + atom = (LispAtom *)hash_check(lisp__data.pack->atoms, str, length); - atom = (LispAtom*)LispCalloc(1, sizeof(LispAtom)); - atom->string = LispGetAtomString(str, perm); - LispMused(atom); - atom->next = lisp__data.pack->atoms[ii]; - lisp__data.pack->atoms[ii] = atom; - atom->property = NOPROPERTY; + if (atom == NULL) { + atom = (LispAtom*)LispCalloc(1, sizeof(LispAtom)); + atom->key = LispGetAtomKey(str, perm); + hash_put(lisp__data.pack->atoms, (hash_entry *)atom); + atom->property = NOPROPERTY; + LispMused(atom); + } return (atom); } @@ -1464,7 +1453,7 @@ LispSetAtomObjectProperty(LispAtom *atom, LispObj *object) if (atom->object == lisp__data.package) { if (!PACKAGEP(object)) LispDestroy("Symbol %s must be a package, not %s", - ATOMID(lisp__data.package), STROBJ(object)); + ATOMID(lisp__data.package)->value, STROBJ(object)); lisp__data.pack = object->data.package.package; } } @@ -1752,7 +1741,7 @@ LispCheckKeyword(LispObj *keyword) if (KEYWORDP(keyword)) return (keyword); - return (KEYWORD(ATOMID(keyword))); + return (KEYWORD(ATOMID(keyword)->value)); } void @@ -1904,7 +1893,7 @@ LispCheckArguments(LispFunType type, LispObj *list, char *name, int builtin) if (list != NIL) LispDestroy("%s %s: %s cannot be a %s argument list", fnames[type], name, STROBJ(list), types[type]); - alist->description = GETATOMID(""); + alist->description = GETATOMID("")->value; return (alist); } @@ -2048,14 +2037,14 @@ LispCheckArguments(LispFunType type, LispObj *list, char *name, int builtin) else { Atom_id atom = ATOMID(spec); - if (atom[0] == '&') { + if (atom->value[0] == '&') { if (atom == Srest) { if (rest || aux || CDR(list) == NIL || !SYMBOLP(CADR(list)) /* only &aux allowed after &rest */ || (CDDR(list) != NIL && !SYMBOLP(CAR(CDDR(list))) && ATOMID(CAR(CDDR(list))) != Saux)) LispDestroy("%s %s: syntax error parsing %s", - fnames[type], name, ATOMID(spec)); + fnames[type], name, ATOMID(spec)->value); if (key) LispDestroy("%s %s: %s not allowed after %s", fnames[type], name, keys[IREST], keys[IKEY]); @@ -2066,7 +2055,7 @@ LispCheckArguments(LispFunType type, LispObj *list, char *name, int builtin) else if (atom == Skey) { if (rest || aux) LispDestroy("%s %s: %s not allowed after %s", - fnames[type], name, ATOMID(spec), + fnames[type], name, ATOMID(spec)->value, rest ? keys[IREST] : keys[IAUX]); key = 1; continue; @@ -2075,7 +2064,7 @@ LispCheckArguments(LispFunType type, LispObj *list, char *name, int builtin) else if (atom == Soptional) { if (rest || optional || aux || key) LispDestroy("%s %s: %s not allowed after %s", - fnames[type], name, ATOMID(spec), + fnames[type], name, ATOMID(spec)->value, rest ? keys[IREST] : optional ? keys[IOPTIONAL] : @@ -2088,7 +2077,7 @@ LispCheckArguments(LispFunType type, LispObj *list, char *name, int builtin) /* &AUX must be the last keyword parameter */ if (aux) LispDestroy("%s %s: syntax error parsing %s", - fnames[type], name, ATOMID(spec)); + fnames[type], name, ATOMID(spec)->value); else if (builtin) LispDestroy("builtin function cannot have &AUX arguments"); aux = 1; @@ -2099,7 +2088,7 @@ LispCheckArguments(LispFunType type, LispObj *list, char *name, int builtin) * argument names starting with the '&' character */ else LispDestroy("%s %s: %s not allowed/implemented", - fnames[type], name, ATOMID(spec)); + fnames[type], name, ATOMID(spec)->value); } /* Add argument to alist */ @@ -2170,7 +2159,7 @@ LispCheckArguments(LispFunType type, LispObj *list, char *name, int builtin) fnames[type], name, STROBJ(list), types[type]); *desc = '\0'; - alist->description = LispGetAtomString(description, 0); + alist->description = LispGetAtomKey(description, 0)->value; return (alist); } @@ -2214,7 +2203,7 @@ LispAddBuiltinFunction(LispBuiltin *builtin) LispPopInput(&stream); atom = name->data.atom; - alist = LispCheckArguments(builtin->type, CDR(list), atom->string, 1); + alist = LispCheckArguments(builtin->type, CDR(list), atom->key->value, 1); builtin->symbol = CAR(list); LispSetAtomBuiltinProperty(atom, builtin, alist); LispUseArgList(alist); @@ -2758,8 +2747,8 @@ LispSymbolName(LispObj *symbol) --atomseg.nfree; name->type = LispString_t; - THESTR(name) = atom->string; - STRLEN(name) = strlen(atom->string); + THESTR(name) = atom->key->value; + STRLEN(name) = atom->key->length; name->data.string.writable = 0; atom->name = name; @@ -3156,6 +3145,8 @@ LispNewPackage(LispObj *name, LispObj *nicknames) package->data.package.nicknames = nicknames; package->data.package.package = pack; + package->data.package.package->atoms = hash_new(STRTBLSZ, NULL); + LispMused(pack); return (package); @@ -3185,30 +3176,18 @@ LispSymbolFunction(LispObj *symbol) static INLINE LispObj * LispGetVarPack(LispObj *symbol) { - int ii; - char *string; LispAtom *atom; - string = ATOMID(symbol); - ii = STRHASH(string); - - atom = lisp__data.pack->atoms[ii]; - while (atom) { - if (strcmp(atom->string, string) == 0) - return (atom->object); + atom = (LispAtom *)hash_get(lisp__data.pack->atoms, + symbol->data.atom->key); - atom = atom->next; - } - - /* Symbol not found, just import it */ - return (NULL); + return (atom ? atom->object : NULL); } /* package must be of type LispPackage_t */ void LispUsePackage(LispObj *package) { - unsigned i; LispAtom *atom; LispPackage *pack; LispObj **pentry, **eentry; @@ -3242,13 +3221,11 @@ LispUsePackage(LispObj *package) pack = package->data.package.package; /* Traverse atom list, searching for extern symbols */ - for (i = 0; i < STRTBLSZ; i++) { - atom = pack->atoms[i]; - while (atom) { - if (atom->ext) - LispImportSymbol(atom->object); - atom = atom->next; - } + for (atom = (LispAtom *)hash_iter_first(pack->atoms); + atom; + atom = (LispAtom *)hash_iter_next(pack->atoms)) { + if (atom->ext) + LispImportSymbol(atom->object); } } @@ -3272,7 +3249,7 @@ LispImportSymbol(LispObj *symbol) } /* Create copy of atom in current package */ - atom = LispDoGetAtom(ATOMID(symbol), 0); + atom = LispDoGetAtom(ATOMID(symbol)->value, 0); /* Need to create a copy because if anything new is atached to the * property, the current package is the owner, not the previous one. */ @@ -3285,7 +3262,7 @@ LispImportSymbol(LispObj *symbol) /* Symbol already exists in the current package, * but does not reference the same variable */ LispContinuable("Symbol %s already defined in package %s. Redefine?", - ATOMID(symbol), THESTR(PACKAGE->data.package.name)); + ATOMID(symbol)->value, THESTR(PACKAGE->data.package.name)); atom = current->data.atom; @@ -3375,7 +3352,7 @@ LispGetVar(LispObj *atom) * binding if it is not -1, and if no binding is found, because the * lexical scope was left, reset offset to -1. */ offset = name->offset; - id = name->string; + id = name->key; base = lisp__data.env.lex; i = lisp__data.env.head - 1; @@ -3496,7 +3473,7 @@ LispDoAddVar(LispObj *symbol, LispObj *value) atom->offset = lisp__data.env.length; lisp__data.env.values[lisp__data.env.length] = value; - lisp__data.env.names[lisp__data.env.length++] = atom->string; + lisp__data.env.names[lisp__data.env.length++] = atom->key; } LispObj * @@ -3509,7 +3486,7 @@ LispSetVar(LispObj *atom, LispObj *obj) name = atom->data.atom; offset = name->offset; - id = name->string; + id = name->key; base = lisp__data.env.lex; i = lisp__data.env.head - 1; @@ -5192,6 +5169,9 @@ LispBegin(void) pagesize = LispGetPageSize(); segsize = pagesize / sizeof(LispObj); + lisp__data.strings = hash_new(STRTBLSZ, NULL); + lisp__data.opqs = hash_new(STRTBLSZ, NULL); + /* Initialize memory management */ lisp__data.mem.mem = (void**)calloc(lisp__data.mem.space = 16, sizeof(void*)); @@ -5275,7 +5255,7 @@ LispBegin(void) /* Create the KEYWORD package */ Skeyword = GETATOMID("KEYWORD"); - object = LispNewPackage(STRING(Skeyword), + object = LispNewPackage(STRING(Skeyword->value), CONS(STRING(""), NIL)); /* Update list of packages */ @@ -5474,7 +5454,7 @@ LispBegin(void) } void -LispEnd() +LispEnd(void) { /* XXX needs to free all used memory, not just close file descriptors */ } diff --git a/app/xedit/lisp/math.c b/app/xedit/lisp/math.c index f9b69529c..bdca0348e 100644 --- a/app/xedit/lisp/math.c +++ b/app/xedit/lisp/math.c @@ -71,7 +71,7 @@ LispMathInit(void) obj_one = FIXNUM(1); Oequal_ = STATIC_ATOM("="); - Ocomplex = STATIC_ATOM(Scomplex); + Ocomplex = STATIC_ATOM(Scomplex->value); Oshort_float = STATIC_ATOM("SHORT-FLOAT"); LispExportSymbol(Oshort_float); Osingle_float = STATIC_ATOM("SINGLE-FLOAT"); diff --git a/app/xedit/lisp/modules/indent.lsp b/app/xedit/lisp/modules/indent.lsp index 6fd32a9c6..1ba8b72c7 100644 --- a/app/xedit/lisp/modules/indent.lsp +++ b/app/xedit/lisp/modules/indent.lsp @@ -1038,6 +1038,12 @@ ;; Initial input already read (go :ind-loop) + ;; Just to avoid a warning about unused variable, as this + ;; variable is somewhat redundant as code should already + ;; know before entering indent parser, but useful inside + ;; indent macros. + *ind-point* + ;------------------------------------------------------------------------ ; Read a text line :ind-read diff --git a/app/xedit/lisp/modules/progmodes/auto.lsp b/app/xedit/lisp/modules/progmodes/auto.lsp new file mode 100644 index 000000000..aa4543ef9 --- /dev/null +++ b/app/xedit/lisp/modules/progmodes/auto.lsp @@ -0,0 +1,110 @@ +;; Copyright (c) 2007,2008 Paulo Cesar Pereira de Andrade +;; +;; Permission is hereby granted, free of charge, to any person obtaining a +;; copy of this software and associated documentation files (the "Software"), +;; to deal in the Software without restriction, including without limitation +;; the rights to use, copy, modify, merge, publish, distribute, sublicense, +;; and/or sell copies of the Software, and to permit persons to whom the +;; Software is furnished to do so, subject to the following conditions: +;; +;; The above copyright notice and this permission notice (including the next +;; paragraph) shall be included in all copies or substantial portions of the +;; Software. +;; +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +;; THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +;; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +;; DEALINGS IN THE SOFTWARE. +;; +;; Author: Paulo Cesar Pereira de Andrade +;; + +;; Mode for editing autoconf/automake m4 files + +(require "syntax") +(in-package "XEDIT") + +(defsynprop *prop-macro* + "macro" + :font "*courier-bold-r*-12-*" + :foreground "green4") + +(defsynprop *prop-separator* + "separator" + :font "*courier-bold-r*-12-*" + :foreground "Red3") + +(defsynprop *prop-variable* + "variable" + :font "*lucidatypewriter-medium-r*-12-*" + :foreground "Gold4") + +(defsynprop *prop-escape* + "escape" + :font "*lucidatypewriter-medium-r*-12-*" + :foreground "Red3") + +(defsyntax *auto-mode* :main nil nil nil + ;; dont consider dnl a macro call at top level + (syntoken "(#.*|\\<dnl($|\\>.*))" :property *prop-comment*) + + ;; shell keywords + (syntoken + (string-concat + "\\<(" + "if|then|else|elif|else|fi|case|in|esac|do|done" + ")\\>") :property *prop-keyword*) + + ;; toplevel no arguments macro + (syntoken "^[a-zA-Z0-9_]+$" :property *prop-macro*) + + (syntable :string *prop-string* nil + ;; ignore escaped characters + (syntoken "\\\\.") + (syntoken "\"" :nospec t :switch -1) + (synaugment :variables)) + (syntable :constant *prop-constant* nil + (syntoken "\\\\.") + (syntoken "'" :nospec t :switch -1) + (synaugment :variables)) + (syntable :escape *prop-escape* nil + (syntoken "\\\\.") + (syntoken "`" :nospec t :switch -1) + (synaugment :variables)) + + (syntable :quoted-string *prop-string* nil + (syntoken "\\\"" :nospec t :switch -1)) + + (syntable :macro *prop-default* nil + (syntoken "," :property *prop-separator*) + (syntoken "[" :nospec t :property *prop-separator* :begin :quoted) + (syntable :quoted *prop-default* nil + ;; allow nesting + (syntoken "[" :nospec t :property *prop-separator* :begin :quoted) + (syntoken "]" :nospec t :property *prop-separator* :switch -1) + (synaugment :shared :variables)) + (syntoken ")" :nospec t :property *prop-macro* :switch -1) + (synaugment :shared :variables :comments)) + + (syntable :shared nil nil + (syntoken "[a-zA-Z0-9_]+\\(" :property *prop-macro* :begin :macro) + ;; variable assignment + (syntoken "[a-zA-Z0-9_-]+=" :property *prop-keyword*) + (syntoken "\"" :nospec t :begin :string :contained t) + (syntoken "'" :nospec t :begin :constant :contained t) + (syntoken "`" :nospec t :begin :escape :contained t) + (syntoken "\\\"" :nospec t :begin :quoted-string :contained t) + ) + + (syntable :variables nil nil + (syntoken "\\$[a-zA-Z0-9_-]+" :property *prop-variable*) + (syntoken "\\$\\{[a-zA-Z0-9_-]+\\}" :property *prop-variable*) + (syntoken "\\$\\([a-zA-Z0-9_-]+\\)" :property *prop-variable*)) + + (syntable :comments nil nil + (syntoken "(#.*|\\<dnl($|\\>.*))" :property *prop-comment*)) + + (synaugment :shared :variables)) diff --git a/app/xedit/lisp/modules/progmodes/c.lsp b/app/xedit/lisp/modules/progmodes/c.lsp index e49630ea3..fba6b99b1 100644 --- a/app/xedit/lisp/modules/progmodes/c.lsp +++ b/app/xedit/lisp/modules/progmodes/c.lsp @@ -1099,9 +1099,33 @@ ;; Preprocessor includes comments. (syntoken "/*" :nospec t :begin :comment :contained t) + ;; Ignore strings and constants in the same line and finishes table + ;; This is kind hackish, but must be done because the current parser + ;; will not flag eol. Maybe it could be extended to properly handle + ;; and have an internal flag to tell it to pass again if there + ;; is a regex that can match eol on an empty string. + ;; A test is already done (but at compile time) to not allow patterns + ;; that match an empty string (but allow patterns matching + ;; bol, eol or both on an empty string). + (syntoken "\"([^\\\"]|\\\\.)*\"$" :property *prop-string* :switch -1) + (syntoken "'([^']|\\\\.)*'$" :property *prop-constant* :switch -1) + + ;; Ignore strings and constants in the same line + (syntoken "\"([^\\\"]|\\\\.)*\"" :property *prop-string*) + (syntoken "'([^']|\\\\.)*'" :property *prop-constant*) + ;; Ignore lines finishing with a backslash. (syntoken "\\\\$") + ;; multiline strings + (syntoken "\"" :nospec t :begin :string) + + ;; multiline constants + (syntoken "'" :nospec t :begin :character) + + ;; C++ style comments + (syntoken "//.*$" :property *prop-comment* :switch -1) + ;; Return to previous state if end of line found. (syntoken ".?$" :switch -1) ) diff --git a/app/xedit/lisp/modules/progmodes/lisp.lsp b/app/xedit/lisp/modules/progmodes/lisp.lsp index c15352b3f..2472b723a 100644 --- a/app/xedit/lisp/modules/progmodes/lisp.lsp +++ b/app/xedit/lisp/modules/progmodes/lisp.lsp @@ -43,7 +43,7 @@ (defsynprop *prop-quote* "quote" :font "*courier-bold-r*-12-*" - :foreground "Red3" + :foreground "Red4" ) (defsynprop *prop-package* diff --git a/app/xedit/lisp/modules/progmodes/perl.lsp b/app/xedit/lisp/modules/progmodes/perl.lsp new file mode 100644 index 000000000..25a62c530 --- /dev/null +++ b/app/xedit/lisp/modules/progmodes/perl.lsp @@ -0,0 +1,507 @@ +;; Copyright (c) 2007,2008 Paulo Cesar Pereira de Andrade +;; +;; Permission is hereby granted, free of charge, to any person obtaining a +;; copy of this software and associated documentation files (the "Software"), +;; to deal in the Software without restriction, including without limitation +;; the rights to use, copy, modify, merge, publish, distribute, sublicense, +;; and/or sell copies of the Software, and to permit persons to whom the +;; Software is furnished to do so, subject to the following conditions: +;; +;; The above copyright notice and this permission notice (including the next +;; paragraph) shall be included in all copies or substantial portions of the +;; Software. +;; +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +;; THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +;; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +;; DEALINGS IN THE SOFTWARE. +;; +;; Author: Paulo Cesar Pereira de Andrade +;; + +;; Perl syntax and indentation mode +;; Based on the C/C++ and Lisp modes. Attempting to make simple +;; syntax/indentation rules, that should work correctly with most +;; perl code. + +;; *cont-indent* is somewhat buggy, that if pressing C-A,Tab, will +;; not generate the same output as when normally typing the expression. +;; This is because the parser doesn't search for a matching ';', '{', +;; '[' or '(' to know where the expression starts. The C mode has the +;; same problem. Example: +;; a + +;; b; <-- if pressing C-A,Tab will align "b;" with "a +" + +;; Maybe most of the code here, and some code in the C mode could be +;; merged to have a single "default mode" parser for languages that +;; basically only depend on { and } for indentation. + +(require "syntax") +(require "indent") +(in-package "XEDIT") + +;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +(defsynprop *prop-string-escape* + "string-escape" + :font "*lucidatypewriter-bold-r*-12-*" + :foreground "RoyalBlue2" + :underline t) + +(defsynprop *prop-string-keyword-bold* + "string-variable-bold" + :font "*lucidatypewriter-bold-r*-12-*" + :foreground "RoyalBlue4") + +(defsynprop *prop-string-keyword* + "string-variable" + :font "*lucidatypewriter-medium-r*-12-*" + :foreground "RoyalBlue4") + +(defsynprop *prop-constant-escape* + "constant-escape" + :font "*lucidatypewriter-medium-r*-12-*" + :foreground "VioletRed3" + :underline t) + +(defsynprop *prop-regex* + "regex" + :font "*courier-medium-o*-12-*" + :foreground "black") + +(defsynprop *prop-shell* + "shell" + :font "*lucidatypewriter-medium-r*-12-*" + :foreground "red3") + +(defsynprop *prop-shell-escape* + "shell-escape" + :font "*lucidatypewriter-bold-r*-12-*" + :foreground "red3" + :underline t) + +(defsynprop *prop-documentation* + "documentation" + :font "fixed" + :foreground "black" + :background "rgb:e/e/e" +) + + +;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +(defsynoptions *perl-DEFAULT-style* + ;; Positive number. Basic indentation + (:indentation . 4) + + ;; Boolean. Add one indentation level to continuations? + (:cont-indent . t) + + ;; Boolean. Move cursor to the indent column after pressing <Enter>? + (:newline-indent . t) + + ;; Boolean. Set to T if tabs shouldn't be used to fill indentation. + (:emulate-tabs . nil) + + ;; Boolean. Only calculate indentation after pressing <Enter>? + ;; This may be useful if the parser does not always + ;; do what the user expects... + (:only-newline-indent . nil) + + ;; Boolean. Remove extra spaces from previous line. + ;; This should default to T when newline-indent is not NIL. + (:trim-blank-lines . t) + + ;; Boolean. If this hash-table entry is set, no indentation is done. + ;; Useful to temporarily disable indentation. + (:disable-indent . nil)) + + + +;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +(defvar *perl-mode-options* *perl-DEFAULT-style*) + +;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +;; Parenthesis are usually not required, just distinguish as: +;; expression: code without an ending ';' +;; statement: code ending in a ';' +;; block: code enclosed in '{' and '}' +;; In Perl a simpler logic can be used, unlikely the C mode, as in +;; perl braces are mandatory +(defindent *perl-mode-indent* :main + ;; this must be the first token + (indtoken "^\\s*" :indent + :code (or *offset* (setq *offset* (+ *ind-offset* *ind-length*)))) + ;; this may cause some other patterns to fail, due to matching single \' + (indtoken "(&?(\\w+)|&(\\w+)?)'\\w+" :expression) + ;; special variables + (indtoken "\\$(\\d|^\\u|[][0-9!#$*()_@<>?/|,\"'])" :expression) + ;; ignore comments + (indtoken "#.*$" nil) + ;; treat regex as expressions to avoid confusing parser + (indtoken "m?/([^/]|\\\\/)+/\\w*" :expression) + (indtoken "m\\{[^}]+\\}\\w*" :expression) + (indtoken "m<[^>]+>\\w*" :expression) + (indtoken "(s|tr)/[^/]+/([^/]|\\\\/)*/\\w*" :expression) + (indtoken "//" :expression :nospec t) + ;; fast resolve deferences to expressions + (indtoken "[$@%&*]?\\{\\$?\\S+\\}" :expression) + + (indtoken "($%@*)?\\w+" :expression) + (indtoken ";" :semi :nospec t) + (indinit (braces 0)) + (indtoken "{" :obrace :nospec t + :code (decf braces)) + (indtoken "}" :cbrace :nospec t + :code (incf braces)) + (indinit (parens&bracks 0)) + (indtoken ")" :cparen :nospec t :code (incf parens&bracks)) + (indtoken "(" :oparen :nospec t :code (decf parens&bracks)) + (indtoken "]" :cbrack :nospec t :code (incf parens&bracks)) + (indtoken "[" :obrack :nospec t :code (decf parens&bracks)) + ;; if in the same line, reduce now, this must be done because the + ;; delimiters are identical + (indtoken "'([^\\']|\\\\.)*'" :expression) + (indtoken "\"([^\\\"]|\\\\.)*\"" :expression) + (indtoken "\"" :cstring1 :nospec t :begin :string1) + (indtoken "'" :cstring2 :nospec t :begin :string2) + ;; This must be the last rule + (indtoken "\\s*$" :eol) + + (indtable :string1 + ;; Ignore escaped characters + (indtoken "\\." nil) + ;; Return to the toplevel when the start of the string is found + (indtoken "\"" :ostring1 :nospec t :switch -1)) + (indtable :string2 + (indtoken "\\." nil) + (indtoken "'" :ostring2 :nospec t :switch -1)) + + ;; This avoids some problems with *cont-indent* adding an indentation + ;; level to an expression after an empty line + (indreduce nil + t + ((:indent :eol))) + + ;; Reduce to a single expression token + (indreduce :expression + t + ((:indent :expression) + (:expression :eol) + (:expression :parens) + (:expression :bracks) + (:expression :expression) + ;; multiline strings + (:ostring1 (not :ostring1) :cstring1) + (:ostring2 (not :ostring2) :cstring2) + ;; parenthesis and brackets + (:oparen (not :oparen) :cparen) + (:obrack (not :obrack) :cbrack))) + + ;; Statements end in a semicollon + (indreduce :statement + t + ((:semi) + (:indent :semi) + (:expression :statement) + (:statement :eol) + ;; Doesn't necessarily end in a semicollon + (:expression :block))) + + (indreduce :block + t + ((:obrace (not :obrace) :cbrace) + (:block :eol))) + (indreduce :obrace + (< *ind-offset* *ind-start*) + ((:indent :obrace)) + (setq *indent* (offset-indentation (+ *ind-offset* *ind-length*) :resolve t)) + (indent-macro-reject-left)) + + ;; Try to do an smart indentation on open parenthesis and brackets + (indreduce :parens + t + ((:oparen (not :oparen) :cparen)) + (when (and + (< *ind-offset* *ind-start*) + (> (+ *ind-offset* *ind-length*) *ind-start*)) + (setq *indent* (1+ (offset-indentation *ind-offset* :align t))) + (indent-macro-reject-left))) + (indreduce :bracks + t + ((:obrack (not :obrack) :cbrack)) + (when (and + (< *ind-offset* *ind-start*) + (> (+ *ind-offset* *ind-length*) *ind-start*)) + (setq *indent* (1+ (offset-indentation *ind-offset* :align t))) + (indent-macro-reject-left))) + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Assuming previous lines have correct indentation, try to + ;; fast resolve brace indentation + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Line ended with an open brace + (indreduce :obrace + (< *ind-offset* *ind-start*) + ((:expression :obrace)) + (setq *indent* (offset-indentation *ind-offset* :resolve t)) + (indent-macro-reject-left)) + ;; Line starts with an open brace + (indreduce nil + (< *ind-offset* *ind-start* (+ *ind-offset* *ind-length*)) + ;; Just set initial indentation + ((:indent :obrace)) + (setq + *indent* (- (offset-indentation *ind-offset* :resolve t) *base-indent*)) + (indent-macro-reject-left)) + + (indresolve :statement + (when (< *ind-offset* *ind-start*) + (while (> braces 0) + (setq + *indent* (- *indent* *base-indent*) + braces (1- braces))))) + + (indresolve :obrace + (and (< *ind-offset* *ind-start*) + (incf *indent* *base-indent*))) + (indresolve :cbrace + (decf *indent* *base-indent*)) + (indresolve :expression + (and + *cont-indent* + (> *indent* 0) + (zerop parens&bracks) + (< *ind-offset* *ind-start*) + (> (+ *ind-offset* *ind-length*) *ind-start*) + (incf *indent* *base-indent*))) + + (indresolve (:oparen :obrack) + (and (< *ind-offset* *ind-start*) + (setq *indent* (1+ (offset-indentation *ind-offset* :align t))))) +) + +;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +(defun perl-offset-indent (&aux char (point (point))) + ;; Skip spaces forward + (while (member (setq char (char-after point)) indent-spaces) + (incf point)) + (if (member char '(#\})) (1+ point) point)) + +(compile 'perl-offset-indent) + +;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +(defun perl-should-indent (options &aux char point start offset) + (when (hash-table-p options) + ;; check if previous line has extra spaces + (and (gethash :trim-blank-lines options) + (indent-clear-empty-line)) + + ;; indentation disabled? + (and (gethash :disable-indent options) + (return-from perl-should-indent)) + + (setq + point (point) + char (char-before point) + start (scan point :eol :left)) + + ;; if at bol and should indent only when starting a line + (and (gethash :only-newline-indent options) + (return-from perl-should-indent (= point start))) + + ;; at the start of a line + (and (= point start) + (return-from perl-should-indent (gethash :newline-indent options))) + + ;; if first character + (and (= point (1+ start)) + (return-from perl-should-indent t)) + + ;; check if is the first non-blank character in a new line + (when (and + (gethash :cont-indent options) + (= point (scan point :eol :right)) + (alphanumericp char)) + (setq offset (1- point)) + (while (and + (> offset start) + (member (char-before offset) indent-spaces)) + (decf offset)) + ;; line has only one character with possible spaces before it + (and (<= offset start) + (return-from perl-should-indent t))) + + ;; if one of these was typed, should check indentation + (if (member char '(#\})) (return-from perl-should-indent t)) + ) + ;; Should not indent + nil) + +(compile 'perl-should-indent) + +;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +(defun perl-indent (syntax syntable) + (let* + ((options (syntax-options syntax)) + *base-indent* + *cont-indent*) + + (or (perl-should-indent options) (return-from perl-indent)) + (setq + *base-indent* (gethash :indentation options 4) + *cont-indent* (gethash :cont-indent options t)) + + (indent-macro + *perl-mode-indent* + (perl-offset-indent) + (gethash :emulate-tabs options)))) + +(compile 'perl-indent) + +;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +;; some example macros to easily add new patterns for strings and possibly +;; regex or other patterns +(defmacro perl-q-string-token (token) + `(syntoken (string-concat "\\<q(q|w)?\\s*\\" ,token) + :icase t :contained t :begin + (intern (string-concat "string" ,token) 'keyword))) +(defmacro perl-q-string-table (start end) + `(syntable (intern (string-concat "string" ,start) 'keyword) + *prop-string* #'default-indent + (syntoken ,end :nospec t :switch -1) + (synaugment :inside-string))) + +;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +(defsyntax *perl-mode* :main nil #'perl-indent *perl-mode-options* + ;; keywords + (syntoken + (string-concat + "\\<(" + "and|for|foreach|gt|if|else|elsif|eq|goto|le|lt|last|ne|" + "neg|next|not|or|return|shift|sub|unless|unshift|until|while" + ")\\>") + :property *prop-keyword*) + + ;; pseudo keywords + (syntoken + (string-concat + "\\<(" + "BEGIN|END|bless|blessed|defined|delete|eval|local|my|our|" + "package|require|undef|use" + ")\\>") + :property *prop-preprocessor*) + ;; this may cause some other patterns to fail, due to matching single \' + (syntoken "(&?(\\w+)|&(\\w+)?)'\\w+" :property *prop-preprocessor*) + + ;; numbers + (syntoken + (string-concat + "\\<(" + ;; Integers + "(\\d+|0x\\x+)|" + ;; Floats + "\\d+\\.?\\d*(e[+-]?\\d+)?" + ")\\>") + :icase t + :property *prop-number*) + + ;; special variables + (syntoken "\\$(\\d|^\\u|[][0-9!#$*()_@<>?/|,\"'])" :property *prop-keyword*) + + ;; also match variables + (syntable :inside-string nil nil + ;; escaped characters + + ;; XXX This pattern was matching the empty string and entering an + ;; infinite loop in code like: +#| +---%<--- +" <-- *** if an backslash is added it fails. Inverting +a"; *** the pattern fixed the problem, but was the wrong +---%<--- *** solution. Note that C-G stops the interpreter, and + *** special care must be taken with patterns matching + *** empty strings. +|# + + (syntoken "\\\\\\d{3}|\\\\." :property *prop-string-escape*) + (syntoken "(\\{\\$|\\$\\{)" :property *prop-string-keyword-bold* :begin :string-varbrace) + (syntoken "[$@]" :property *prop-string-keyword-bold* :begin :string-variable) + (syntoken "\\$(\\d|^\\u|[][0-9!#$*()_@<>?/|,\"'])" :property *prop-string-keyword-bold*)) + + ;; variables insided strings + (syntable :string-variable *prop-string-keyword* nil + (syntoken "\\w+" :switch -1)) + (syntable :string-varbrace *prop-string-keyword* nil + (syntoken "}" + :nospec t + :property *prop-string-keyword-bold* + :switch -1) + (synaugment :inside-string)) + + ;; comments + (syntoken "#.*$" :property *prop-comment*) + + ;; regex + (syntoken "(\\<m)?/([^/]|\\\\/)+/\\w*" :property *prop-regex*) + (syntoken "\\<m\\{[^}]+\\}\\w*" :property *prop-regex*) + (syntoken "\\<m<[^>]+>\\w*" :property *prop-regex*) + (syntoken "\\<(s|tr)/[^/]+/([^/]|\\\\/)*/\\w*":property *prop-regex*) + ;; just to avoid confusing the parser on something like split //, ... + (syntoken "//" :nospec t :property *prop-regex*) + + ;; strings + (syntoken "\"" :nospec t :contained t :begin :string) + (syntable :string *prop-string* #'default-indent + (syntoken "\"" :nospec t :switch -1) + (synaugment :inside-string)) + + ;; more strings + (perl-q-string-token "{") + (perl-q-string-table "{" "}") + (perl-q-string-token "[") + (perl-q-string-table "[" "]") + (perl-q-string-token "(") + (perl-q-string-table "(" ")") + (perl-q-string-token "/") + (perl-q-string-table "/" "/") + + ;; yet more strings + (syntoken "'" :nospec t :contained t :begin :constant) + (syntable :constant *prop-constant* #'default-indent + (syntoken "'" :nospec t :switch -1) + (syntoken "\\\\." :property *prop-string-escape*)) + + ;; shell commands + (syntoken "`" :nospec t :contained t :begin :shell) + (syntable :shell *prop-shell* #'default-indent + (syntoken "`" :nospec t :switch -1) + (synaugment :inside-string)) + + ;; punctuation + (syntoken "[][$@%(){}/*+:;=<>,&!|^~\\.?-]" :property *prop-punctuation*) + (syntoken "\\<x\\>" :property *prop-punctuation*) + + ;; primitive faked heredoc support, doesn't match the proper string, just + ;; expects an uppercase identifier in a single line + (syntoken "<<\"[A-Z][A-Z0-9_]+\"" :property *prop-string* :begin :heredoc) + (syntoken "<<'[A-Z][A-Z0-9_]+'" :property *prop-constant* :begin :heredoc) + (syntoken "<<[A-Z][A-Z0-9_]+" :property *prop-preprocessor* :begin :heredoc) + (syntable :heredoc *prop-documentation* #'default-indent + (syntoken "^[A-Z][A-Z0-9_]+$" :switch -1)) + + (syntoken "^=(pod|item|over|head\\d)\\>.*$" :property *prop-documentation* :begin :info) + (syntable :info *prop-documentation* nil + (syntoken "^=cut\\>.*$" :switch -1) + (syntoken "^.*$")) + + (syntoken "^(__END__|__DATA__)$" :property *prop-documentation* + :begin :documentation) + + (syntoken "__\\u+__" :property *prop-preprocessor*) + + (syntable :documentation *prop-documentation* nil + (syntoken "^.*$")) + +) diff --git a/app/xedit/lisp/modules/progmodes/python.lsp b/app/xedit/lisp/modules/progmodes/python.lsp new file mode 100644 index 000000000..ff708567b --- /dev/null +++ b/app/xedit/lisp/modules/progmodes/python.lsp @@ -0,0 +1,306 @@ +;; Copyright (c) 2008 Paulo Cesar Pereira de Andrade +;; +;; Permission is hereby granted, free of charge, to any person obtaining a +;; copy of this software and associated documentation files (the "Software"), +;; to deal in the Software without restriction, including without limitation +;; the rights to use, copy, modify, merge, publish, distribute, sublicense, +;; and/or sell copies of the Software, and to permit persons to whom the +;; Software is furnished to do so, subject to the following conditions: +;; +;; The above copyright notice and this permission notice (including the next +;; paragraph) shall be included in all copies or substantial portions of the +;; Software. +;; +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +;; THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +;; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +;; DEALINGS IN THE SOFTWARE. +;; +;; Author: Paulo Cesar Pereira de Andrade +;; + +(require "syntax") +(require "indent") +(in-package "XEDIT") + +;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +(defsynprop *prop-indent* + "indent" + :font "*courier-medium-r*-12-*" + :background "Gray92") + +;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +(defsynoptions *python-DEFAULT-options* + ;; Positive number. Basic indentation + (:indentation . 4) + + ;; Boolean. Move cursor to the indent column after pressing <Enter>? + (:newline-indent . t) + + ;; Boolean. Set to T if tabs shouldn't be used to fill indentation. + (:emulate-tabs . t) + + ;; Boolean. Only calculate indentation after pressing <Enter>? + ;; This may be useful if the parser does not always + ;; do what the user expects... + (:only-newline-indent . nil) + + ;; Boolean. Remove extra spaces from previous line. + ;; This should default to T when newline-indent is not NIL. + (:trim-blank-lines . nil) + + ;; Boolean. If this hash-table entry is set, no indentation is done. + ;; Useful to temporarily disable indentation. + (:disable-indent . nil)) + + +;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +;; Not doing "special" indentation of multiline ( because it is attempting +;; to do a "smart" indentation and usually don't read more then one line +;; back to resolve indentation. +;; Code for multiline { and [, usually declaring vector/hash like variables +;; should be working properly. +;; Note that the indent lisp hook is only run on character additions, so +;; it doesn't do a "smart" tabbing when pressing backspace, but it will +;; properly align to the "closest tab stop" when typping a character. +(defindent *python-mode-indent* :main + ;; this must be the first token + (indtoken "^\\s*" :indent + :code (or *offset* (setq *offset* (+ *ind-offset* *ind-length*)))) + + ;; ignore comments + (indtoken "#.*$" nil) + + (indtoken ":" :collon :nospec t) + + ;; don't directly match {}, [], () strings, and : + (indtoken "[a-zA-Z0-9+*/%^&<>=.,|!~-]+" :expression) + + ;; if in the same line, reduce now, as delimiters are identical + (indtoken "'([^\\']|\\\\.)*'" :expression) + (indtoken "\"([^\\\"]|\\\\.)*\"" :expression) + ;; otherwise, use a table + (indtoken "\"" :cstring :nospec t :begin :string) + (indtoken "'" :cconstant :nospec t :begin :constant) + (indtoken "\"\"\"" :cstring3 :nospec t :begin :string3) + (indtoken "'''" :cconstant :nospec t :begin :constant3) + + (indinit (braces 0)) + (indtoken "}" :cbrace :nospec t :code (incf braces)) + (indtoken "{" :obrace :nospec t :code (decf braces)) + (indtoken ")" :cparen :nospec t :code (incf braces)) + (indtoken "(" :oparen :nospec t :code (decf braces)) + (indtoken "]" :cbrack :nospec t :code (incf braces)) + (indtoken "[" :obrack :nospec t :code (decf braces)) + + ;; This must be the last token + (indtoken "$" :eol) + + (indtable :string + ;; Ignore escaped characters + (indtoken "\\." nil) + ;; Return to the toplevel when the start of the string is found + (indtoken "\"" :ostring :nospec t :switch -1)) + (indtable :constant + (indtoken "\\." nil) + (indtoken "'" :oconstant :nospec t :switch -1)) + + (indtable :string3 + (indtoken "\"\"\"" :ostring3 :nospec t :switch -1)) + (indtable :constant3 + (indtoken "'''" :oconstant3 :nospec t :switch -1)) + + ;; Reduce what isn't reduced in regex pattern match + (indreduce :expression + t + ((:expression :expression) + ;; multiline strings + (:ostring (not :ostring) :cstring) + (:oconstant (not :oconstant) :cconstant) + (:ostring3 (not :ostring3) :cstring3) + (:oconstant3 (not :oconstant3) :cconstant3) + ;; braces, parenthesis and brackets + (:obrace (not :obrace) :cbrace) + (:oparen (not :oparen) :cparen) + (:obrack (not :obrack) :cbrack))) + + ;; This should be the most common exit point; + ;; just copy previous line indentation. + (indreduce :align + (< *ind-offset* *ind-start*) + ((:indent :eol) + (:indent :expression :eol)) + (setq *indent* (offset-indentation *offset* :resolve t)) + + ;; If cursor is not in an indentation tab, assume user is trying to align + ;; to another block, and just use the resolve code to round it down + (unless (/= (mod *indent* *base-indent*) 0) + ;; else use "previous-line" indentation. + (setq *indent* (offset-indentation *ind-offset* :resolve t))) + (indent-macro-reject-left)) + + ;; This should be second most common exit point; + ;; add one indentation level. + (indreduce :align + (< *ind-offset* *ind-start*) + ((:indent :expression :collon :eol)) + (setq *indent* (+ *base-indent* (offset-indentation *ind-offset* :resolve t))) + (indent-macro-reject-left)) + + (indresolve :align + (setq *indent* (- *indent* (mod *indent* *base-indent*)))) + + ;; Calculate special indentation for [ and { + (indresolve (:obrack :obrace) + (and + (< *ind-offset* *ind-start*) + (setq *indent* (+ *base-indent* + (offset-indentation *ind-offset* :resolve t))))) + (indresolve (:cbrack :cbrace) + (setq *indent* (- (offset-indentation *ind-offset* :resolve t) + (if (>= *ind-offset* *ind-start*) + *base-indent* 0)))) +) + + +;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +(defun python-offset-indent (&aux char (point (point))) + ;; Skip spaces forward + (while (member (setq char (char-after point)) indent-spaces) + (incf point)) + point) + +(compile 'python-offset-indent) + +;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +(defun python-should-indent (options &aux point start end offset) + (when (hash-table-p options) + ;; check if previous line has extra spaces + (and (gethash :trim-blank-lines options) + (indent-clear-empty-line)) + + ;; indentation disabled? + (and (gethash :disable-indent options) + (return-from python-should-indent)) + + (setq + point (point) + start (scan point :eol :left) + end (scan point :eol :right)) + + ;; if at bol and should indent only when starting a line + (and (gethash :only-newline-indent options) + (return-from python-should-indent (= point start))) + + ;; at the start of a line + (and (= point start) + (return-from python-should-indent (gethash :newline-indent options))) + + ;; if first character + (and (= point (1+ start)) + (return-from python-should-indent t)) + + (setq offset start) + (while (and + (< offset end) + (member (char-after offset) indent-spaces)) + (incf offset)) + + ;; cursor is at first character in line, with possible spaces before it + (return-from python-should-indent (or (= offset end) (= offset (1- point)))) + ) + ;; Should not indent + nil) + +(compile 'python-should-indent) + +;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +(defun python-indent (syntax syntable) + (let* + ((options (syntax-options syntax)) + *base-indent*) + + (or (python-should-indent options) (return-from python-indent)) + (setq + *base-indent* (gethash :indentation options 4)) + + (indent-macro + *python-mode-indent* + (python-offset-indent) + (gethash :emulate-tabs options)))) + +(compile 'python-indent) + + +;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +(defvar *python-mode-options* *python-DEFAULT-options*) + + +;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +(defsyntax *python-mode* :main nil #'python-indent *python-mode-options* + ;; keywords + (syntoken + (string-concat + "\\<(" + "and|break|class|continue|def|del|enumerate|except|False|for|" + "elif|else|if|in|is|len|None|not|or|pass|print|raise|range|" + "return|self|True|try|type|while|yield" + ")\\>") + :property *prop-keyword*) + + (syntoken "^\\s+" :property *prop-indent*) + + ;; preprocessor like + (syntoken + (string-concat + "\\<(" + "from|import" + ")\\>") + :property *prop-preprocessor*) + + ;; namespaces/accessors + (syntoken "(\\w+\\.)+" :property *prop-preprocessor*) + + ;; more preprocessor like + (syntoken "\\<__[a-zA-Z0-9]+__\\>" :property *prop-keyword*) + + ;; numbers + (syntoken + (string-concat + "\\<(" + ;; Integers + "(\\d+|0x\\x+)L?|" + ;; Floats + "\\d+\\.?\\d*(e[+-]?\\d+)?" + ")\\>") + :icase t + :property *prop-number*) + + ;; comments + (syntoken "#.*" :property *prop-comment*) + + ;; punctuation + (syntoken "[][(){}+*/%^&<>=.,|!~:-]+" :property *prop-punctuation*) + + ;; constant or constant like + (syntoken "'" :nospec t :property *prop-constant* :begin :constant) + (syntoken "'''" :nospec t :property *prop-constant* :begin :constant3) + + ;; strings + (syntoken "\"" :nospec t :property *prop-string* :begin :string) + (syntoken "\"\"\"" :nospec t :property *prop-string* :begin :string3) + + (syntable :constant *prop-constant* nil + (syntoken "\\\\.") + (syntoken "'" :nospec t :switch -1)) + (syntable :constant3 *prop-constant* nil + (syntoken "'''" :nospec t :switch -1)) + (syntable :string *prop-string* nil + (syntoken "\\\\.") + (syntoken "\"" :nospec t :switch -1)) + (syntable :string3 *prop-string* nil + (syntoken "\"\"\"" :nospec t :switch -1)) +) diff --git a/app/xedit/lisp/modules/xedit.lsp b/app/xedit/lisp/modules/xedit.lsp index fa43d1e62..9b916d58c 100644 --- a/app/xedit/lisp/modules/xedit.lsp +++ b/app/xedit/lisp/modules/xedit.lsp @@ -27,7 +27,7 @@ ;; Author: Paulo César Pereira de Andrade ;; ;; -;; $XdotOrg: app/xedit/lisp/modules/xedit.lsp,v 1.3 2004/12/04 00:43:14 kuhn Exp $ +;; $XdotOrg: xc/programs/xedit/lisp/modules/xedit.lsp,v 1.2 2004/04/23 19:54:45 eich Exp $ ;; $XFree86: xc/programs/xedit/lisp/modules/xedit.lsp,v 1.9 2003/01/16 03:50:46 paulo Exp $ ;; @@ -54,17 +54,25 @@ ;; syntax-p, the entry is removed. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defvar *auto-modes* '( - ("\\.(c|cc|C|cxx|h|bm|xbm|xpm|l|y)$" + ("\\.(c|cc|C|cxx|cpp|h|hpp|bm|xbm|xpm|y|h\\.in)$" "C/C++" "c" . *c-mode*) - ("\\.(li?sp|scm)$" + ("\\.(l|li?sp|scm)$" "Lisp/Scheme" "lisp" . *lisp-mode*) - ("Imakefile|(\\.(cf|rules|tmpl|def|cpp)$)" - "X imake" "imake" . *imake-mode*) - ("[Mm]akefile.*|\\.mk$" - "Makefile" "make" . *make-mode*) ("\\.sh$" "Unix shell" "sh" . *sh-mode*) - ("\\.sgml?$" + ("\\.(diff|patch)" + "Patch file" "patch" . *patch-mode*) + ("/[Mm]akefile.*|\\.mk$" + "Makefile" "make" . *make-mode*) + ("\\.(ac|in|m4)$" + "Autotools" "auto" . *auto-mode*) + ("\\.spec$" + "RPM spec" "rpm" . *rpm-mode*) + ("\\.(pl|pm|ph)$" + "Perl" "perl" . *perl-mode*) + ("\\.(py)$" + "Python" "python". *python-mode*) + ("\\.(sgml?|dtd)$" "SGML" "sgml" . *sgml-mode*) ("\\.html?$" "HTML" "html" . *html-mode*) @@ -72,14 +80,12 @@ "Man page" "man" . *man-mode*) ("app-defaults/\\w+|\\u[A-Za-z0-9_-]+\\.ad" "X resource" "xrdb" . *xrdb-mode*) - ("\\<XF86Config[^/]*" + ("\\<(XF86Config|xorg.conf)[^/]*" "XF86Config" "xconf" . *xconf-mode*) - ("\\.spec$" - "RPM spec" "rpm" . *rpm-mode*) - ("\\<XFree86\\.\\d+\\.log$" + ("\\<(XFree86|Xorg)\\.\\d+\\.log(\\..*|$)" "XFree86 log" "xlog" . *xlog-mode*) - ("\\.(diff|patch)" - "Patch file" "patch" . *patch-mode*) + ("Imakefile|(\\.(cf|rules|tmpl|def)$)" + "X imake" "imake" . *imake-mode*) )) diff --git a/app/xedit/lisp/package.c b/app/xedit/lisp/package.c index 6ba23c9ee..8b941ecda 100644 --- a/app/xedit/lisp/package.c +++ b/app/xedit/lisp/package.c @@ -87,7 +87,7 @@ LispFindPackage(LispObj *name) return (name); if (SYMBOLP(name)) - string = ATOMID(name); + string = ATOMID(name)->value; else if (STRINGP(name)) string = THESTR(name); else @@ -169,22 +169,18 @@ LispDoExport(LispBuiltin *builtin, if (package == PACKAGE) symbol->data.atom->ext = export ? 1 : 0; else { - int i; - char *string; + Atom_id string; LispAtom *atom; LispPackage *pack; string = ATOMID(symbol); pack = package->data.package.package; - i = STRHASH(string); - atom = pack->atoms[i]; - while (atom) { - if (strcmp(atom->string, string) == 0) { - atom->ext = export ? 1 : 0; - return; - } + atom = (LispAtom *)hash_check(pack->atoms, + string->value, string->length); - atom = atom->next; + if (atom) { + atom->ext = export ? 1 : 0; + return; } LispDestroy("%s: the symbol %s is not available in package %s", @@ -203,9 +199,9 @@ LispDoImport(LispBuiltin *builtin, LispObj *symbol) static LispObj * LispReallyDoSymbols(LispBuiltin *builtin, int only_externs, int all_symbols) { - int i, head = lisp__data.env.length; + int head = lisp__data.env.length; LispPackage *pack = NULL; - LispAtom *atom, *next_atom; + LispAtom *atom; LispObj *variable, *package = NULL, *list, *code, *result_form; LispObj *init, *body; @@ -251,21 +247,17 @@ LispReallyDoSymbols(LispBuiltin *builtin, int only_externs, int all_symbols) } /* Traverse the symbol list, executing body */ - for (i = 0; i < STRTBLSZ; i++) { - atom = pack->atoms[i]; - while (atom) { + for (atom = (LispAtom *)hash_iter_first(pack->atoms); + atom; + atom = (LispAtom *)hash_iter_next(pack->atoms)) { /* Save pointer to next atom. If variable is removed, * predicatable result is only guaranteed if the bound * variable is removed. */ - next_atom = atom->next; - - if (LispDoSymbol(package, atom, only_externs, all_symbols)) { - LispSetVar(variable, atom->object); - for (code = body; CONSP(code); code = CDR(code)) - EVAL(CAR(code)); - } - atom = next_atom; + if (LispDoSymbol(package, atom, only_externs, all_symbols)) { + LispSetVar(variable, atom->object); + for (code = body; CONSP(code); code = CDR(code)) + EVAL(CAR(code)); } } @@ -306,7 +298,6 @@ LispDoSymbols(LispBuiltin *builtin, int only_externs, int all_symbols) LispObj * LispFindSymbol(LispBuiltin *builtin, int intern) { - int i; char *ptr; LispAtom *atom; LispObj *symbol; @@ -342,15 +333,9 @@ LispFindSymbol(LispBuiltin *builtin, int intern) return (symbol); } - i = STRHASH(ptr); - atom = pack->atoms[i]; - while (atom) { - if (strcmp(atom->string, ptr) == 0) { - symbol = atom->object; - break; - } - atom = atom->next; - } + atom = (LispAtom *)hash_check(pack->atoms, ptr, strlen(ptr)); + if (atom) + symbol = atom->object; if (symbol == NULL || symbol->data.atom->package == NULL) { RETURN(0) = NIL; @@ -436,46 +421,45 @@ Lisp_FindAllSymbols(LispBuiltin *builtin) LispAtom *atom; LispPackage *pack; LispObj *list, *package, *result; - int i; + int length = 0; LispObj *string_or_symbol; string_or_symbol = ARGUMENT(0); - if (STRINGP(string_or_symbol)) + if (STRINGP(string_or_symbol)) { string = THESTR(string_or_symbol); - else if (SYMBOLP(string_or_symbol)) - string = ATOMID(string_or_symbol); + length = STRLEN(string_or_symbol); + } + else if (SYMBOLP(string_or_symbol)) { + string = ATOMID(string_or_symbol)->value; + length = ATOMID(string_or_symbol)->length; + } else LispDestroy("%s: %s is not a string or symbol", STRFUN(builtin), STROBJ(string_or_symbol)); result = NIL; - i = STRHASH(string); /* Traverse all packages, searching for symbols matching specified string */ for (list = PACK; CONSP(list); list = CDR(list)) { package = CAR(list); pack = package->data.package.package; - atom = pack->atoms[i]; - while (atom) { - if (strcmp(atom->string, string) == 0 && - LispDoSymbol(package, atom, 0, 1)) { - /* Return only one pointer to a matching symbol */ + atom = (LispAtom *)hash_check(pack->atoms, string, length); + if (atom && LispDoSymbol(package, atom, 0, 1)) { + /* Return only one pointer to a matching symbol */ - if (result == NIL) { - result = CONS(atom->object, NIL); - GC_PROTECT(result); - } - else { - /* Put symbols defined first in the - * beginning of the result list */ - RPLACD(result, CONS(CAR(result), CDR(result))); - RPLACA(result, atom->object); - } + if (result == NIL) { + result = CONS(atom->object, NIL); + GC_PROTECT(result); + } + else { + /* Put symbols defined first in the + * beginning of the result list */ + RPLACD(result, CONS(CAR(result), CDR(result))); + RPLACA(result, atom->object); } - atom = atom->next; } } GC_LEAVE(); @@ -651,7 +635,7 @@ Lisp_MakePackage(LispBuiltin *builtin) /* Error checks done, package_name is either a symbol or string */ if (!XSTRINGP(package_name)) - package_name = STRING(ATOMID(package_name)); + package_name = STRING(ATOMID(package_name)->value); GC_PROTECT(package_name); @@ -667,7 +651,7 @@ Lisp_MakePackage(LispBuiltin *builtin) /* Store all nicknames as strings */ package = CAR(list); if (!XSTRINGP(package)) - package = STRING(ATOMID(package)); + package = STRING(ATOMID(package)->value); if (nicks == NIL) { nicks = cons = CONS(package, NIL); GC_PROTECT(nicks); diff --git a/app/xedit/lisp/private.h b/app/xedit/lisp/private.h index b4f683e46..ef44ab235 100644 --- a/app/xedit/lisp/private.h +++ b/app/xedit/lisp/private.h @@ -27,7 +27,7 @@ * Author: Paulo César Pereira de Andrade */ -/* $XdotOrg: app/xedit/lisp/private.h,v 1.3 2004/12/04 00:43:13 kuhn Exp $ */ +/* $XdotOrg: xc/programs/xedit/lisp/private.h,v 1.2 2004/04/23 19:54:44 eich Exp $ */ /* $XFree86: xc/programs/xedit/lisp/private.h,v 1.41 2003/05/27 22:27:04 tsi Exp $ */ #ifndef Lisp_private_h @@ -192,6 +192,9 @@ struct _LispProperty { }; struct _LispAtom { + hash_key *key; + struct _LispAtom *next; + /* hint: dynamically binded variable */ unsigned int dyn : 1; @@ -222,14 +225,12 @@ struct _LispAtom { /* Symbol value is constant, cannot be changed */ unsigned int constant : 1; - char *string; LispObj *object; /* backpointer to object ATOM */ int offset; /* in the environment list */ LispObj *package; /* package home of symbol */ LispObj *function; /* symbol function */ LispObj *name; /* symbol string */ LispProperty *property; - struct _LispAtom *next; LispObj *documentation[5]; }; @@ -243,20 +244,13 @@ struct _LispObjList { struct _LispPackage { LispObjList glb; /* global symbols in package */ LispObjList use; /* inherited packages */ - LispAtom *atoms[STRTBLSZ]; /* atoms in this package */ + hash_table *atoms; /* atoms in this package */ }; struct _LispOpaque { - int type; - char *desc; + hash_key *desc; LispOpaque *next; -}; - -/* These strings are never released, they are used to avoid - * the need of strcmp() on two symbol names, just compare pointers */ -struct _LispStringHash { - char *string; - LispStringHash *next; + int type; }; typedef enum _LispBlockType { @@ -357,8 +351,8 @@ struct _LispMac { int average; /* of cells freed after gc calls */ } gc; - LispStringHash *strings[STRTBLSZ]; - LispOpaque *opqs[STRTBLSZ]; + hash_table *strings; + hash_table *opqs; int opaque; LispObj *standard_input, *input, *input_list; @@ -452,6 +446,7 @@ void LispExportSymbol(LispObj*); void LispImportSymbol(LispObj*); /* always returns the same string */ +hash_key *LispGetAtomKey(char*, int); char *LispGetAtomString(char*, int); /* destructive fast reverse, note that don't receive a LispMac* argument */ @@ -474,8 +469,6 @@ void LispBlockUnwind(LispBlock*); void LispUpdateResults(LispObj*, LispObj*); void LispTopLevel(void); -#define STRHASH(string) LispDoHashString(string) -int LispDoHashString(char*); LispAtom *LispDoGetAtom(char *str, int); /* get value from atom's property list */ LispObj *LispGetAtomProperty(LispAtom*, LispObj*); diff --git a/app/xedit/lisp/re/re.c b/app/xedit/lisp/re/re.c index abf5cc4af..fca7e2856 100644 --- a/app/xedit/lisp/re/re.c +++ b/app/xedit/lisp/re/re.c @@ -782,7 +782,8 @@ next_lcstl:; case Re_AltNext: bas = eng.off - 1; /* Check if matched and if it is a better match */ - if (eng.sv[eng.off] - eng.so[eng.off] < + if (eng.eo[eng.off] >= eng.so[eng.off] && + eng.sv[eng.off] - eng.so[eng.off] < eng.eo[eng.off] - eng.so[eng.off]) eng.sv[eng.off] = eng.eo[eng.off]; diff --git a/app/xedit/lisp/re/tests.c b/app/xedit/lisp/re/tests.c index 6a82d413f..21b1e1028 100644 --- a/app/xedit/lisp/re/tests.c +++ b/app/xedit/lisp/re/tests.c @@ -164,7 +164,7 @@ main(int argc, char *argv[]) else { if (failed) { reerror(failed, &cod, buf, sizeof(buf)); - fprintf(stderr, "%s, at line %d\n", line); + fprintf(stderr, "%s, at line %d\n", buf, line); break; } if (sscanf(buf, "%ld,%ld:", &so, &eo) != 2) { diff --git a/app/xedit/lisp/re/tests.txt b/app/xedit/lisp/re/tests.txt index b8d3e22b3..35fd90bba 100644 --- a/app/xedit/lisp/re/tests.txt +++ b/app/xedit/lisp/re/tests.txt @@ -459,3 +459,12 @@ /.*(\d+)/ :BADRPT + +# Regression fix, was matching empty string +/\\\d{3}|\\./ +>\\ +:NOMATCH + +/\\.|\\\d{3}/ +>\\ +:NOMATCH diff --git a/app/xedit/lisp/read.c b/app/xedit/lisp/read.c index 3c5df3ed1..9c70b6433 100644 --- a/app/xedit/lisp/read.c +++ b/app/xedit/lisp/read.c @@ -1127,6 +1127,13 @@ LispReadObject(int unintern, read_info *info) collon = 1; string[length++] = ch; symbol = string + 1; + ch = LispGet(); + if (ch == '|') { + quote = ch; + unreadable = 1; + } + else if (ch != EOF) + LispUnget(ch); } else if (ch) { if (islower(ch)) @@ -1220,12 +1227,6 @@ LispReadObject(int unintern, read_info *info) else if (quote == '"') object = LSTRING(string, length); - else if (quote == '|' || (unreadable && !collon)) { - /* Set unreadable field, this atom needs quoting to be read back */ - object = ATOM(string); - object->data.atom->unreadable = 1; - } - else if (collon) { /* Package specified in object name */ symbol[-1] = '\0'; @@ -1236,6 +1237,12 @@ LispReadObject(int unintern, read_info *info) read__stream, read__line); } + else if (quote == '|' || (unreadable && !collon)) { + /* Set unreadable field, this atom needs quoting to be read back */ + object = ATOM(string); + object->data.atom->unreadable = 1; + } + /* Check some common symbols */ else if (length == 1 && string[0] == 'T') /* The T */ @@ -1322,7 +1329,7 @@ LispParseAtom(char *package, char *symbol, int intern, int unreadable, /* Get the object pointer */ if (pack == lisp__data.key) - object = KEYWORD(LispDoGetAtom(symbol, 0)->string); + object = KEYWORD(LispDoGetAtom(symbol, 0)->key->value); else object = ATOM(symbol); if (unreadable) @@ -1336,19 +1343,11 @@ LispParseAtom(char *package, char *symbol, int intern, int unreadable, else { /* Symbol must exist (and be extern) in the specified package */ - int i; LispAtom *atom; - i = STRHASH(symbol); - atom = pack->atoms[i]; - while (atom) { - if (strcmp(atom->string, symbol) == 0) { - object = atom->object; - break; - } - - atom = atom->next; - } + atom = (LispAtom *)hash_check(pack->atoms, symbol, strlen(symbol)); + if (atom) + object = atom->object; /* No object found */ if (object == NULL || object->data.atom->ext == 0) @@ -1875,13 +1874,13 @@ LispReadStruct(read_info *info) GC_PROTECT(fields); - len = strlen(ATOMID(CAR(fields))); + len = ATOMID(CAR(fields))->length; /* MAKE- */ if (len + 6 > sizeof(stk)) str = LispMalloc(len + 6); else str = stk; - sprintf(str, "MAKE-%s", ATOMID(CAR(fields))); + sprintf(str, "MAKE-%s", ATOMID(CAR(fields))->value); RPLACA(fields, ATOM(str)); if (str != stk) LispFree(str); diff --git a/app/xedit/lisp/stream.c b/app/xedit/lisp/stream.c index a43e711bc..aad89cf1c 100644 --- a/app/xedit/lisp/stream.c +++ b/app/xedit/lisp/stream.c @@ -303,7 +303,7 @@ Lisp_Open(LispBuiltin *builtin) ; /* do nothing */ else LispDestroy("%s: only :%s and %s supported for :ELEMENT-TYPE, not %s", - STRFUN(builtin), Sdefault, Scharacter, STROBJ(element_type)); + STRFUN(builtin), Sdefault->value, Scharacter->value, STROBJ(element_type)); } if (if_exists != UNSPEC) { @@ -360,7 +360,7 @@ Lisp_Open(LispBuiltin *builtin) ; /* do nothing */ else LispDestroy("%s: only :%s and %s supported for :EXTERNAL-FORMAT, not %s", - STRFUN(builtin), Sdefault, Scharacter, STROBJ(external_format)); + STRFUN(builtin), Sdefault->value, Scharacter->value, STROBJ(external_format)); } /* string representation of pathname */ @@ -600,7 +600,7 @@ Lisp_MakeStringOutputStream(LispBuiltin *builtin) ; /* do nothing */ else LispDestroy("%s: only :%s and %s supported for :ELEMENT-TYPE, not %s", - STRFUN(builtin), Sdefault, Scharacter, STROBJ(element_type)); + STRFUN(builtin), Sdefault->value, Scharacter->value, STROBJ(element_type)); } return (LSTRINGSTREAM("", STREAM_WRITE, 1)); @@ -695,7 +695,7 @@ Lisp_MakePipe(LispBuiltin *builtin) ; /* do nothing */ else LispDestroy("%s: only :%s and %s supported for :ELEMENT-TYPE, not %s", - STRFUN(builtin), Sdefault, Scharacter, STROBJ(element_type)); + STRFUN(builtin), Sdefault->value, Scharacter->value, STROBJ(element_type)); } if (external_format != UNSPEC) { @@ -707,7 +707,7 @@ Lisp_MakePipe(LispBuiltin *builtin) ; /* do nothing */ else LispDestroy("%s: only :%s and %s supported for :EXTERNAL-FORMAT, not %s", - STRFUN(builtin), Sdefault, Scharacter, STROBJ(external_format)); + STRFUN(builtin), Sdefault->value, Scharacter->value, STROBJ(external_format)); } string = THESTR(command_line); diff --git a/app/xedit/lisp/string.c b/app/xedit/lisp/string.c index b5151ece5..604fb6c95 100644 --- a/app/xedit/lisp/string.c +++ b/app/xedit/lisp/string.c @@ -27,7 +27,7 @@ * Author: Paulo César Pereira de Andrade */ -/* $XdotOrg: app/xedit/lisp/string.c,v 1.3 2004/12/04 00:43:13 kuhn Exp $ */ +/* $XdotOrg: xc/programs/xedit/lisp/string.c,v 1.2 2004/04/23 19:54:44 eich Exp $ */ /* $XFree86: xc/programs/xedit/lisp/string.c,v 1.24tsi Exp $ */ #include "lisp/helper.h" diff --git a/app/xedit/lisp/struct.c b/app/xedit/lisp/struct.c index 7fbb4866c..b6ecf140e 100644 --- a/app/xedit/lisp/struct.c +++ b/app/xedit/lisp/struct.c @@ -55,7 +55,7 @@ Lisp_Defstruct(LispBuiltin *builtin) int intern; LispAtom *atom; int i, size, length, slength; - char *name, *strname, *sname; + char *name, *strname; LispObj *list, *cons, *object, *definition, *documentation; LispObj *oname, *description; @@ -65,8 +65,8 @@ Lisp_Defstruct(LispBuiltin *builtin) CHECK_SYMBOL(oname); - strname = ATOMID(oname); - length = strlen(strname); + strname = ATOMID(oname)->value; + length = ATOMID(oname)->length; /* MAKE- */ size = length + 6; @@ -101,13 +101,13 @@ Lisp_Defstruct(LispBuiltin *builtin) cons = object; object = CAR(object); } - if (!SYMBOLP(object) || strcmp(ATOMID(object), "P") == 0) + if (!SYMBOLP(object) || strcmp(ATOMID(object)->value, "P") == 0) /* p is invalid as a field name due to `type'-p */ LispDestroy("%s: %s cannot be a field for %s", - STRFUN(builtin), STROBJ(object), ATOMID(oname)); + STRFUN(builtin), STROBJ(object), ATOMID(oname)->value); if (!KEYWORDP(object)) - CAR(cons) = KEYWORD(ATOMID(object)); + CAR(cons) = KEYWORD(ATOMID(object)->value); /* check for repeated field names */ for (object = description; object != list; object = CDR(object)) { @@ -143,16 +143,18 @@ Lisp_Defstruct(LispBuiltin *builtin) LispExportSymbol(object); for (i = 0, list = description; CONSP(list); i++, list = CDR(list)) { + Atom_id id; + if (CONSP(CAR(list))) - sname = ATOMID(CAR(CAR(list))); + id = ATOMID(CAR(CAR(list))); else - sname = ATOMID(CAR(list)); - slength = strlen(sname); + id = ATOMID(CAR(list)); + slength = id->length; if (length + slength + 2 > size) { size = length + slength + 2; name = LispRealloc(name, size); } - sprintf(name, "%s-%s", strname, sname); + sprintf(name, "%s-%s", strname, id->value); atom = (object = ATOM(name))->data.atom; LispSetAtomStructProperty(atom, definition, i); if (!intern) @@ -202,7 +204,7 @@ Lisp_XeditMakeStruct(LispBuiltin *builtin) CHECK_KEYWORD(CAR(list)); if (!CONSP(CDR(list))) LispDestroy("%s: values must be provided as pairs", - ATOMID(struc)); + ATOMID(struc)->value); nfld++; list = CDR(list); } @@ -272,8 +274,8 @@ Lisp_XeditMakeStruct(LispBuiltin *builtin) } if (!CONSP(object)) LispDestroy("%s: %s is not a field for %s", - ATOMID(struc), STROBJ(CAR(list)), - ATOMID(CAR(definition))); + ATOMID(struc)->value, STROBJ(CAR(list)), + ATOMID(CAR(definition))->value); list = CDR(list); } } @@ -316,7 +318,7 @@ LispStructAccessOrStore(LispBuiltin *builtin, int store) /* check if the object is of the required type */ if (!STRUCTP(struc) || struc->data.struc.def != definition) LispDestroy("%s: %s is not a %s", - ATOMID(name), STROBJ(struc), ATOMID(CAR(definition))); + ATOMID(name)->value, STROBJ(struc), ATOMID(CAR(definition))->value); for (list = struc->data.struc.fields; offset; list = CDR(list), offset--) ; diff --git a/app/xedit/lisp/test/regex.lsp b/app/xedit/lisp/test/regex.lsp index fa6b2feb7..9e28efaa7 100644 --- a/app/xedit/lisp/test/regex.lsp +++ b/app/xedit/lisp/test/regex.lsp @@ -438,3 +438,14 @@ foo" :notbol t :noteol t) (setq re (re-comp "(.*a)?")) (re-test '((0 . 1)) re "aaaa") ; expected, minimal match (re-test '((0 . 1) (0 . 1)) re "aaaa" :count 2) + + +;; Tue Dec 11 22:22:51 BRST 2007 Fix a regression with the pattern below +;; returning a match to an empty string. +;; Note that inverting the order of the "alternatives" works with the +;; versions of libre prior to this (one line) fix +(setq re (re-comp "\\\\\\d{3}|\\\\.")) +(re-test :nomatch re "\\") +;; previous version should work with the pattern inverted +(setq re (re-comp "\\\\.|\\\\\\d{3}")) +(re-test :nomatch re "\\") diff --git a/app/xedit/lisp/write.c b/app/xedit/lisp/write.c index c5d7f24a8..6c7d979c0 100644 --- a/app/xedit/lisp/write.c +++ b/app/xedit/lisp/write.c @@ -522,15 +522,15 @@ LispPrintCircle(LispObj *stream, LispObj *object, long circle, static int LispWriteAlist(LispObj *stream, LispArgList *alist, write_info *info) { - char *name; + Atom_id name; int i, length = 0, need_space = 0; #define WRITE_ATOM(object) \ name = ATOMID(object); \ - length += LispDoWriteAtom(stream, name, strlen(name), \ + length += LispDoWriteAtom(stream, name->value, name->length, \ info->print_case) -#define WRITE_STRING(string) \ - length += LispDoWriteAtom(stream, string, strlen(string), \ +#define WRITE_ATOMID(atomid) \ + length += LispDoWriteAtom(stream, atomid->value, atomid->length, \ info->print_case) #define WRITE_OBJECT(object) \ length += LispDoWriteObject(stream, object, info, 1) @@ -552,7 +552,7 @@ LispWriteAlist(LispObj *stream, LispArgList *alist, write_info *info) if (alist->optionals.num_symbols) { if (need_space) WRITE_SPACE(); - WRITE_STRING(Soptional); + WRITE_ATOMID(Soptional); WRITE_SPACE(); for (i = 0; i < alist->optionals.num_symbols; i++) { WRITE_OPAREN(); @@ -572,7 +572,7 @@ LispWriteAlist(LispObj *stream, LispArgList *alist, write_info *info) if (alist->keys.num_symbols) { if (need_space) WRITE_SPACE(); - length += LispDoWriteAtom(stream, Skey, 4, info->print_case); + length += LispDoWriteAtom(stream, Skey->value, 4, info->print_case); WRITE_SPACE(); for (i = 0; i < alist->keys.num_symbols; i++) { WRITE_OPAREN(); @@ -599,7 +599,7 @@ LispWriteAlist(LispObj *stream, LispArgList *alist, write_info *info) if (alist->rest) { if (need_space) WRITE_SPACE(); - WRITE_STRING(Srest); + WRITE_ATOMID(Srest); WRITE_SPACE(); WRITE_ATOM(alist->rest); need_space = 1; @@ -607,7 +607,7 @@ LispWriteAlist(LispObj *stream, LispArgList *alist, write_info *info) if (alist->auxs.num_symbols) { if (need_space) WRITE_SPACE(); - WRITE_STRING(Saux); + WRITE_ATOMID(Saux); WRITE_SPACE(); for (i = 0; i < alist->auxs.num_symbols; i++) { WRITE_OPAREN(); @@ -622,7 +622,7 @@ LispWriteAlist(LispObj *stream, LispArgList *alist, write_info *info) WRITE_CPAREN(); #undef WRITE_ATOM -#undef WRITE_STRING +#undef WRITE_ATOMID #undef WRITE_OBJECT #undef WRITE_OPAREN #undef WRITE_SPACE @@ -867,9 +867,9 @@ write_again: switch (OBJECT_TYPE(object)) { case LispNil_t: if (object == NIL) - string = Snil; + string = Snil->value; else if (object == T) - string = St; + string = St->value; else if (object == DOT) string = "#<DOT>"; else if (object == UNSPEC) @@ -1017,7 +1017,7 @@ write_again: ->data.atom->property->alist, info); } else { - length += LispDoWriteAtom(stream, Snil, 3, info->print_case); + length += LispDoWriteAtom(stream, "NIL", 3, info->print_case); length += LispWriteChar(stream, ' '); length += LispWriteAlist(stream, (LispArgList*)object-> data.lambda.name->data.opaque.data, @@ -1264,7 +1264,7 @@ LispWriteAtom(LispObj *stream, LispObj *object, write_info *info) { int length = 0; LispAtom *atom = object->data.atom; - Atom_id id = atom->string; + Atom_id id = atom->key; if (atom->package != PACKAGE) { if (atom->package == lisp__data.keyword) @@ -1299,7 +1299,7 @@ LispWriteAtom(LispObj *stream, LispObj *object, write_info *info) } if (atom->unreadable) length += LispWriteChar(stream, '|'); - length += LispDoWriteAtom(stream, id, strlen(id), + length += LispDoWriteAtom(stream, id->value, id->length, atom->unreadable ? UPCASE : info->print_case); if (atom->unreadable) length += LispWriteChar(stream, '|'); diff --git a/app/xedit/tags.c b/app/xedit/tags.c new file mode 100644 index 000000000..b8f397092 --- /dev/null +++ b/app/xedit/tags.c @@ -0,0 +1,635 @@ +/* + * Copyright © 2007 Paulo César Pereira de Andrade + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Author: Paulo César Pereira de Andrade + */ + +/* + * Certain tag files may require quite some time and memory to load. + * Linux kernel 2.6x is an example, the tags file itself is almost 80Mb + * and xedit will use over 100Mb to store the data, and take quite some + * time to load it (and can grow drastically with every loaded files + * due to the memory used by the file contents and internal structures, + * like the syntax highlight ones). + * Possible workarounds could be to load the tags file in a separate + * process or thread. The memory problem would be hard to circunvent, + * as the tags file metadata would need to be stored in some very fast + * database, or at least some special format that would not require + * a linear search in a huge tags file. + */ + +#include "xedit.h" +#include "util.h" +#include "re.h" +#include <unistd.h> + +/* + * Types + */ +typedef struct _TagsEntry TagsEntry; +typedef struct _RegexEntry RegexEntry; + +struct _TagsEntry { + hash_key *symbol; + TagsEntry *next; + + int nentries; + hash_entry **filenames; + char **patterns; +}; + +struct _RegexEntry { + hash_key *pattern; + RegexEntry *next; + + re_cod regex; +}; + +struct _XeditTagsInfo { + hash_key *pathname; + XeditTagsInfo *next; + + hash_table *entries; + hash_table *filenames; + hash_table *patterns; + + /* Used when searching for alternate tags and failing descending to + * root directory */ + Boolean visited; + + /* Flag to know if tags file is in xedit cwd and allow using relative + * pathnames when loading a file with some tag definition, so that + * other code will not fail to write file (or even worse, write to + * wrong file) if file is edited and tags is not in the current dir */ + Boolean incwd; + + /* Cache information for circulating over multiple definitions */ + XeditTagsInfo *tags; /* If trying another TagsInfo */ + TagsEntry *entry; /* Entry in tags->tags */ + int offset; + Widget textwindow; + XawTextPosition position; +}; + +/* + * Prototypes + */ +static XeditTagsInfo *LoadTagsFile(char *tagsfile); +static XeditTagsInfo *DoLoadTagsFile(char *tagsfile, int length); +static void FindTagFirst(XeditTagsInfo *tags, char *symbol, int length); +static void FindTagNext(XeditTagsInfo *tags, + Widget window, XawTextPosition position); +static void FindTag(XeditTagsInfo *tags); + +/* + * Initialization + */ +extern Widget texts[3]; +static hash_table *ht_tags; + +/* + * Implementation + */ +void +TagsAction(Widget w, XEvent *event, String *params, Cardinal *num_params) +{ + xedit_flist_item *item; + char buffer[1024]; + XawTextPosition position, left, right; + XawTextBlock block; + int length; + Widget source; + + source = XawTextGetSource(w); + item = FindTextSource(source, NULL); + if (item->tags == NULL) + SearchTagsFile(item); + + if (item->tags) { + position = XawTextGetInsertionPoint(w); + XawTextGetSelectionPos(w, &left, &right); + if (right > left) { + XawTextSourceRead(source, left, &block, right - left); + length = block.length + 1; + if (length >= sizeof(buffer)) + length = sizeof(buffer); + XmuSnprintf(buffer, length, "%s", block.ptr); + item->tags->textwindow = w; + item->tags->position = position; + FindTagFirst(item->tags, buffer, length - 1); + } + else + FindTagNext(item->tags, w, position); + } + else + Feep(); +} + +void +SearchTagsFile(xedit_flist_item *item) +{ + if (app_resources.loadTags) { + char buffer[BUFSIZ]; + char *ptr, *tagsfile; + int length; + Boolean exists; + FileAccess file_access; + + tagsfile = NULL; + + /* If path fully specified in resource */ + if (app_resources.tagsName[0] == '/') + tagsfile = ResolveName(app_resources.tagsName); + /* Descend up to root directory searching for a tags file */ + else { + /* *scratch* buffer */ + if (item->filename[0] != '/') { + ptr = ResolveName(app_resources.tagsName); + strncpy(buffer, ptr ? ptr : "", sizeof(buffer)); + } + else + strncpy(buffer, item->filename, sizeof(buffer)); + + /* Make sure buffer is nul terminated */ + buffer[sizeof(buffer) - 1] = '\0'; + ptr = buffer + strlen(buffer); + + for (;;) { + while (ptr > buffer && ptr[-1] != '/') + --ptr; + if (ptr <= buffer) + break; + length = ptr - buffer; + if (length >= sizeof(buffer)) + length = sizeof(buffer); + strncpy(ptr, app_resources.tagsName, + sizeof(buffer) - length); + buffer[sizeof(buffer) - 1] = '\0'; + + /* Check if tags filename exists */ + tagsfile = ResolveName(buffer); + if (tagsfile != NULL) { + file_access = CheckFilePermissions(tagsfile, &exists); + /* Check if can read tagsfile */ + if (exists && + (file_access == READ_OK || file_access == WRITE_OK)) + break; + else + tagsfile = NULL; + } + *--ptr = '\0'; + } + } + + if (tagsfile) + item->tags = LoadTagsFile(tagsfile); + else { + XeditPrintf("No tags file found." + " Run \"ctags -R\" to build a tags file.\n"); + item->tags = NULL; + } + } +} + +static void +FindTagFirst(XeditTagsInfo *tags, char *symbol, int length) +{ + char *ptr; + TagsEntry *entry; + char buffer[BUFSIZ]; + + /* Check for malformed parameters */ + ptr = symbol; + while (*ptr) { + if (*ptr == ' ' || *ptr == '\t' || *ptr == '\n' || *ptr == '\r' || + *ptr == '(' || *ptr == ')') { + Feep(); + return; + } + ptr++; + } + + /* First try in buffer tags */ + tags->tags = tags; + entry = (TagsEntry *)hash_check(tags->entries, symbol, length); + if (entry == NULL) { + /* Try to find in alternate tags */ + strncpy(buffer, tags->pathname->value, tags->pathname->length); + buffer[tags->pathname->length] = '\0'; + ptr = buffer + tags->pathname->length - 1; + + for (tags->tags = (XeditTagsInfo *)hash_iter_first(ht_tags); + tags->tags; + tags->tags = (XeditTagsInfo *)hash_iter_next(ht_tags)) + tags->tags->visited = False; + + tags->visited = True; + + while (ptr > buffer && entry == NULL) { + --ptr; + while (ptr > buffer && ptr[-1] != '/') + --ptr; + if (ptr <= buffer) + break; + *ptr = '\0'; + + /* Try an upper directory tags */ + tags->tags = (XeditTagsInfo *) + hash_check(ht_tags, buffer, ptr - buffer); + if (tags->tags) { + tags->tags->visited = True; + entry = (TagsEntry *) + hash_check(tags->tags->entries, symbol, length); + } + } + + /* If still failed, check other available tags + * for possible different projects */ + if (entry == NULL) { + for (tags->tags = (XeditTagsInfo *)hash_iter_first(ht_tags); + tags->tags; + tags->tags = (XeditTagsInfo *)hash_iter_next(ht_tags)) { + if (tags->tags->visited == False) { + entry = (TagsEntry *) + hash_check(tags->tags->entries, symbol, length); + /* Stop on first match */ + if (entry != NULL) + break; + } + } + } + + if (entry == NULL) { + XeditPrintf("Symbol %s not in tags\n", symbol); + Feep(); + return; + } + } + + tags->entry = entry; + tags->offset = 0; + + FindTag(tags); +} + +static void +FindTagNext(XeditTagsInfo *tags, Widget window, XawTextPosition position) +{ + if (window != tags->textwindow || position != tags->position) + Feep(); + else { + if (tags->entry->nentries > 1) { + if (++tags->offset >= tags->entry->nentries) + tags->offset = 0; + FindTag(tags); + } + else + Feep(); + } +} + +static XeditTagsInfo * +LoadTagsFile(char *tagsfile) +{ + XeditTagsInfo *tags; + int length; + + if (ht_tags == NULL) + ht_tags = hash_new(11, NULL); + + /* tags key is only the directory name with ending '/' */ + length = strlen(tagsfile) - strlen(app_resources.tagsName); + tags = (XeditTagsInfo *)hash_check(ht_tags, tagsfile, length); + + return (tags ? tags : DoLoadTagsFile(tagsfile, length)); +} + +static XeditTagsInfo * +DoLoadTagsFile(char *tagsfile, int length) +{ + char *ptr; + FILE *file; + XeditTagsInfo *tags; + TagsEntry *entry; + hash_entry *file_entry; + char buffer[BUFSIZ]; + char *symbol, *filename, *pattern; + + file = fopen(tagsfile, "r"); + if (file) { + char *cwd; + + tags = XtNew(XeditTagsInfo); + + cwd = getcwd(buffer, sizeof(buffer)); + tags->incwd = cwd && + (strlen(cwd) == length - 1 && + memcmp(cwd, tagsfile, length - 1) == 0); + + /* Build pathname as a nul terminated directory specification string */ + tags->pathname = XtNew(hash_key); + tags->pathname->value = XtMalloc(length + 1); + tags->pathname->length = length; + memcpy(tags->pathname->value, tagsfile, length); + tags->pathname->value[length] = '\0'; + tags->next = NULL; + + tags->entries = hash_new(809, NULL); + tags->filenames = hash_new(31, NULL); + tags->patterns = hash_new(47, NULL); + + /* Cache information */ + tags->tags = tags; /* :-) */ + tags->entry = NULL; + tags->offset = 0; + tags->textwindow = NULL; + tags->position = 0; + + while (fgets(buffer, sizeof(buffer) - 1, file)) { + /* XXX Ignore malformed lines and tags file format information */ + if (isspace(buffer[0]) || buffer[0] == '!') + continue; + + /* Symbol name */ + symbol = ptr = buffer; + while (*ptr && !isspace(*ptr)) + ptr++; + *ptr++ = '\0'; + while (isspace(*ptr)) + ptr++; + + /* Filename with basename of tagsfile for symbol definition */ + filename = ptr; + while (*ptr && !isspace(*ptr)) + ptr++; + *ptr++ = '\0'; + while (isspace(*ptr)) + ptr++; + + pattern = ptr; + /* Check for regex */ + if (*pattern == '/' || *pattern == '?') { + ptr++; + while (*ptr && *ptr != *pattern) { + if (*ptr == '\\') { + if (ptr[1] == *pattern || ptr[1] == '\\') { + /* XXX tags will escape pattern end, and backslash + * not sure about other special characters */ + memmove(ptr, ptr + 1, strlen(ptr)); + } + else { + ++ptr; + if (!*ptr) + break; + } + } + ptr++; + } + + if (*ptr != *pattern) + continue; + ++pattern; + /* Will do a RE_NOSPEC search, that means ^ and $ + * would be literally search (do this to avoid escaping + * other regex characters and building a fast/simple literal + * string search pattern. + * Expect patterns to be full line */ + if (*pattern == '^' && ptr[-1] == '$') { + ++pattern; + --ptr; + } + } + /* Check for line number */ + else if (isdigit(*ptr)) { + while (isdigit(*ptr)) + ptr++; + } + /* Format not understood */ + else + continue; + + *ptr = '\0'; + + length = strlen(symbol); + entry = (TagsEntry *)hash_check(tags->entries, + symbol, length); + if (entry == NULL) { + entry = XtNew(TagsEntry); + entry->symbol = XtNew(hash_key); + entry->symbol->value = XtNewString(symbol); + entry->symbol->length = length; + entry->next = NULL; + entry->nentries = 0; + entry->filenames = NULL; + entry->patterns = NULL; + hash_put(tags->entries, (hash_entry *)entry); + } + + length = strlen(filename); + file_entry = hash_check(tags->filenames, filename, length); + if (file_entry == NULL) { + file_entry = XtNew(hash_entry); + file_entry->key = XtNew(hash_key); + file_entry->key->value = XtNewString(filename); + file_entry->key->length = length; + file_entry->next = NULL; + hash_put(tags->filenames, file_entry); + } + + if ((entry->nentries % 4) == 0) { + entry->filenames = (hash_entry **) + XtRealloc((char *)entry->filenames, + sizeof(hash_entry *) * + (entry->nentries + 4)); + entry->patterns = (char **) + XtRealloc((char *)entry->patterns, + sizeof(char *) * + (entry->nentries + 4)); + } + entry->filenames[entry->nentries] = file_entry; + entry->patterns[entry->nentries] = XtNewString(pattern); + ++entry->nentries; + } + fclose(file); + + /* Add tags information to global hash table */ + hash_put(ht_tags, (hash_entry *)tags); + XeditPrintf("Tags file %s loaded\n", tagsfile); + } + else { + XeditPrintf("Failed to load tags file %s\n", tagsfile); + tags = NULL; + } + + return (tags); +} + +static void +FindTag(XeditTagsInfo *tags) +{ + static String params[] = { "vertical", NULL }; + + char buffer[BUFSIZ]; + char *pattern; + int length; + char *line; + char *text; + RegexEntry *regex; + re_mat match; + XawTextPosition position, left, right, last; + Widget source; + XawTextBlock block; + int size; + int lineno; + Boolean found; + xedit_flist_item *item; + Widget otherwindow; + + XmuSnprintf(buffer, sizeof(buffer), "%s%s", tags->tags->pathname->value, + tags->entry->filenames[tags->offset]->key->value); + + pattern = tags->entry->patterns[tags->offset]; + if (isdigit(*pattern)) { + lineno = atoi(pattern); + regex = NULL; + } + else { + lineno = 0; + length = strlen(pattern); + regex = (RegexEntry *)hash_check(tags->patterns, pattern, length); + if (regex == NULL) { + regex = XtNew(RegexEntry); + regex->pattern = XtNew(hash_key); + regex->pattern->value = XtNewString(pattern); + regex->pattern->length = length; + regex->next = NULL; + if (recomp(®ex->regex, pattern, RE_NOSUB | RE_NOSPEC)) { + XeditPrintf("Failed to compile regex %s\n", pattern); + Feep(); + return; + } + hash_put(tags->patterns, (hash_entry *)regex); + } + } + + /* Short circuit to know if split horizontally */ + if (!XtIsManaged(texts[1])) + XtCallActionProc(textwindow, "split-window", NULL, params, 1); + + /* Switch to "other" buffer */ + XtCallActionProc(textwindow, "other-window", NULL, NULL, 0); + + /* This should print an error message if tags file cannot be read */ + if (!LoadFileInTextwindow(tags->incwd ? + tags->entry->filenames[tags->offset]->key->value : + buffer, buffer)) + return; + + otherwindow = textwindow; + + item = FindTextSource(XawTextGetSource(textwindow), NULL); + source = item->source; + left = XawTextSourceScan(source, 0, XawstAll, XawsdLeft, 1, True); + + found = False; + + if (lineno) { + right = RSCAN(left, lineno, False); + left = LSCAN(right, 1, False); + found = True; + } + else { + right = RSCAN(left, 1, True); + last = XawTextSourceScan(source, 0, XawstAll, XawsdRight, 1, True); + text = buffer; + + size = sizeof(buffer); + for (;;) { + length = right - left; + match.rm_so = 0; + match.rm_eo = length; + XawTextSourceRead(source, left, &block, right - left); + if (block.length >= length) + line = block.ptr; + else { + if (length > size) { + if (text == buffer) + text = XtMalloc(length); + else + text = XtRealloc(text, length); + size = length; + } + line = text; + memcpy(line, block.ptr, block.length); + length = block.length; + for (position = left + length; + position < right; + position += block.length) { + XawTextSourceRead(source, position, &block, right - position); + memcpy(line + length, block.ptr, block.length); + length += block.length; + } + } + + /* If not last line or if it ends in a newline */ + if (right < last || + (right > left && line[match.rm_eo - 1] == '\n')) { + --match.rm_eo; + length = match.rm_eo; + } + + /* Accept as a match when matching the entire line, as the regex + * search pattern is optmized to not need to start with ^ and not + * need to end with $*/ + if (reexec(®ex->regex, line, 1, &match, RE_STARTEND) == 0 && + match.rm_eo > match.rm_so && + match.rm_so == 0 && match.rm_eo == length) { + right = left + match.rm_so + (match.rm_eo - match.rm_so); + found = True; + break; + } + else if (right >= last) { + XeditPrintf("Failed to match regex %s\n", pattern); + Feep(); + break; + } + else { + left = LSCAN(right + 1, 1, False); + right = RSCAN(left, 1, True); + } + } + + if (text != buffer) + XtFree(text); + } + + /* Switch back to editing buffer */ + XtCallActionProc(otherwindow, "other-window", NULL, NULL, 0); + + if (found) { + if (source != XawTextGetSource(tags->textwindow) || + right < tags->position || left > tags->position) { + XawTextSetInsertionPoint(otherwindow, left); + XawTextSetSelection(otherwindow, left, right); + } + } +} diff --git a/app/xedit/util.c b/app/xedit/util.c index 1d7c5f316..f65bf4d00 100644 --- a/app/xedit/util.c +++ b/app/xedit/util.c @@ -28,7 +28,10 @@ #include <stdio.h> #include <stdarg.h> + +#include <libgen.h> /* POSIX basename() */ #include <stdlib.h> /* for realpath() */ +#include <errno.h> /* for ENOENT */ #include "xedit.h" #include <X11/Xfuncs.h> @@ -72,41 +75,63 @@ extern XawTextWrapMode wrapmodes[3]; void XeditPrintf(const char *format, ...) { - char *str; - size_t size; - va_list va, - va2; - XawTextBlock text; - XawTextPosition pos; - - va_start(va, format); + static struct { + XawTextPosition last; + int size; + int length; + int repeat; + char *buffer; + } info; + + size_t size; + va_list va; + XawTextBlock text; + XawTextPosition left, right; + char buffer[BUFSIZ]; + char *string, rbuffer[32]; - va_copy(va2, va); - size = vsnprintf(NULL, 0, format, va2); - va_end(va2); - - str = (char *)malloc(size + 1); - if (str == NULL) - return; - - vsnprintf(str, size + 1, format, va); - str[size] = 0; - + va_start(va, format); + size = vsnprintf(buffer, sizeof(buffer), format, va); va_end(va); - - pos = XawTextSourceScan(XawTextGetSource(messwidget), - 0, XawstAll, XawsdRight, 1, True); - text.length = strlen(str); - text.ptr = str; - text.firstPos = 0; - text.format = FMT8BIT; + /* Should never happen... */ + if (size >= sizeof(buffer)) { + strcpy(buffer + sizeof(buffer) - 5, "...\n"); + size = sizeof(buffer) - 1; + } + else if (size) { + left = right = XawTextSourceScan(XawTextGetSource(messwidget), + 0, XawstAll, XawsdRight, 1, True); + + if (left == info.last && + info.buffer && + strcmp(buffer, info.buffer) == 0) { + string = rbuffer; + if (info.repeat == 1) + left -= info.buffer[strlen(info.buffer) - 1] == '\n'; + else + left -= info.length; + size = info.length = XmuSnprintf(rbuffer, sizeof(rbuffer), + " [%d times]\n", ++info.repeat); + } + else { + string = buffer; + if (size >= info.size) + info.buffer = XtMalloc(size + 1); + strcpy(info.buffer, buffer); + info.repeat = 1; + } - XawTextReplace(messwidget, pos, pos, &text); + text.length = size; + text.ptr = string; + text.firstPos = 0; + text.format = FMT8BIT; - XawTextSetInsertionPoint(messwidget, pos + text.length); - - free(str); + XawTextReplace(messwidget, left, right, &text); + + info.last = left + text.length; + XawTextSetInsertionPoint(messwidget, info.last); + } } Widget @@ -219,8 +244,11 @@ AddTextSource(Widget source, char *name, char *filename, int flags, item->file_access = file_access; item->display_position = item->insert_position = 0; item->mode = 0; + item->mtime = 0; item->properties = NULL; item->xldata = NULL; + /* Try to load associated tags file */ + SearchTagsFile(item); flist.itens = (xedit_flist_item**) XtRealloc((char*)flist.itens, sizeof(xedit_flist_item*) @@ -243,7 +271,7 @@ AddTextSource(Widget source, char *name, char *filename, int flags, else ++wid_name; item->sme = XtVaCreateManagedWidget(wid_name, smeBSBObjectClass, - flist.popup, XtNlabel, filename, + flist.popup, XtNlabel, item->filename, NULL, NULL); XtAddCallback(item->sme, XtNcallback, SwitchSourceCallback, (XtPointer)item); @@ -454,18 +482,53 @@ SwitchTextSource(xedit_flist_item *item) XtSetArg(args[num_args], XtNstring, NULL); ++num_args; } XtSetValues(filenamewindow, args, num_args); + /* XXX This probably should be done by the TextWidget, i.e. notice + * if the cursor became inivisible due to an horizontal scroll */ + _XawTextShowPosition((TextWidget)filenamewindow); } -/* XXX sizeof(name) must match argument size for realpath */ -static char name[BUFSIZ]; char * ResolveName(char *filename) { +#ifndef __UNIXOS2__ + static char *name; + char *result, *tmp = name; +#endif + if (filename == NULL) filename = GetString(filenamewindow); #ifndef __UNIXOS2__ - return (realpath(filename, name)); + /* Ensure not passing the same pointer again to realpath */ + name = XtMalloc(BUFSIZ); + XtFree(tmp); + result = realpath(filename, name); + + if (result == NULL && errno == ENOENT) { + int length; + char *dir, *file; + + length = strlen(filename); + tmp = dir = XtMalloc(length + 1); + strcpy(dir, filename); + + file = basename(filename); + dir = dirname(tmp); + + /* Creating a new file? */ + if (dir && file && strcmp(dir, file) && + access(dir, F_OK) == 0 && + (result = realpath(dir, name)) == name) { + int length = strlen(result); + + XmuSnprintf(result + length, BUFSIZ - length, "%s%s", + dir[length - 1] == '/' ? "" : "/", file); + } + + XtFree(tmp); + } + + return (result); #else return filename; #endif @@ -515,6 +578,8 @@ XeditFocus(Widget w, XEvent *event, String *params, Cardinal *num_params) XtSetArg(args[0], XtNstring, NULL); XtSetValues(filenamewindow, args, 1); + + line_edit = False; } void diff --git a/app/xedit/util.h b/app/xedit/util.h new file mode 100644 index 000000000..9717589b1 --- /dev/null +++ b/app/xedit/util.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2007,2008 Paulo Cesar Pereira de Andrade + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Author: Paulo Cesar Pereira de Andrade + */ + +/* Generic hash table */ + +#ifndef _util_h +#define _util_h + +/* + * Types + */ +typedef struct _hash_key hash_key; +typedef struct _hash_entry hash_entry; +typedef struct _hash_table hash_table; +typedef int (*hash_compare)(hash_key *left, hash_key *right); + +struct _hash_key { + char *value; + unsigned int length; +}; + +struct _hash_entry { + hash_key *key; + hash_entry *next; +}; + +struct _hash_table { + hash_entry **entries; + unsigned int count; /* length of entries */ + unsigned int length; /* sum of entries */ + hash_compare compare; + + struct { + int offset; + hash_entry *entry; + } iter; +}; + +/* + * Prototypes + */ +hash_table *hash_new(unsigned int length, hash_compare compare); +hash_entry *hash_put(hash_table *hash, hash_entry *entry); +hash_entry *hash_get(hash_table *hash, hash_key *name); +hash_entry * hash_check(hash_table *hash, char *name, unsigned int length); +void hash_rem(hash_table *hash, hash_entry *entry); +/* Removes from hash table but doesn't release any memory */ +hash_entry *hash_rem_no_free(hash_table *hash, hash_entry *entry); +void hash_rehash(hash_table *hash, unsigned int length); +hash_entry *hash_iter_first(hash_table *hash); +hash_entry *hash_iter_next(hash_table *hash); + +/* Frees all data. When casting to another type, use the + * iterator to free extra data */ +void hash_clr(hash_table *hash); +void hash_del(hash_table *hash); + +#endif /* _util_h */ diff --git a/app/xedit/xedit.c b/app/xedit/xedit.c index 8d9625843..7917d23fe 100644 --- a/app/xedit/xedit.c +++ b/app/xedit/xedit.c @@ -60,7 +60,8 @@ static XtActionsRec actions[] = { {"xedit-keyboard-reset",XeditKeyboardReset}, #endif {"ispell", IspellAction}, -{"line-edit", LineEditAction} +{"line-edit", LineEditAction}, +{"tags", TagsAction} }; #define DEF_HINT_INTERVAL 300 /* in seconds, 5 minutes */ @@ -73,6 +74,7 @@ static XawTextPositionInfo infos[3]; Widget topwindow, textwindow, messwidget, labelwindow, filenamewindow; Widget scratch, hpane, vpanes[2], labels[3], texts[3], forms[3], positions[3]; Widget options_popup, dirlabel, dirwindow; +Boolean international; Boolean line_edit; XawTextWrapMode wrapmodes[3]; @@ -108,164 +110,184 @@ static XtResource resources[] = { Offset(position_format), XtRString, "L%l"}, {"autoReplace", "Replace", XtRString, sizeof(char*), Offset(auto_replace), XtRImmediate, NULL}, + {"tagsName", "TagsName", XtRString, sizeof(char *), + Offset(tagsName), XtRString, "tags"}, + {"loadTags", "LoadTags", XtRBoolean, sizeof(Boolean), + Offset(loadTags), XtRImmediate, (XtPointer)TRUE}, }; #undef Offset +#ifdef INCLUDE_XPRINT_SUPPORT String fallback_resources[] = { "*international: True", /* set this globally for ALL widgets to avoid wiered crashes */ NULL }; +#endif int main(int argc, char *argv[]) { - XtAppContext appcon; - unsigned num_loaded = 0; - - XtSetLanguageProc(NULL, NULL, NULL); - topwindow = XtAppInitialize(&appcon, "Xedit", NULL, 0, &argc, argv, fallback_resources, NULL, 0); - - XtAppAddActions(appcon, actions, XtNumber(actions)); - XtOverrideTranslations - (topwindow, XtParseTranslationTable ("<Message>WM_PROTOCOLS: quit()")); - - XtGetApplicationResources(topwindow, (XtPointer) &app_resources, resources, - XtNumber(resources), NULL, 0); - - CurDpy = XtDisplay(topwindow); - XawSimpleMenuAddGlobalActions(appcon); - XtRegisterGrabAction(PopupMenu, True, - ButtonPressMask | ButtonReleaseMask, - GrabModeAsync, GrabModeAsync); - - makeButtonsAndBoxes(topwindow); - - StartHints(); - StartFormatPosition(); - (void)StartHooks(appcon); - if (position_format_mask == 0) { - int i; - - for (i = 0; i < 3; i++) - XtRemoveCallback(texts[i], XtNpositionCallback, PositionChanged, NULL); - } - XtRealizeWidget(topwindow); + Boolean exists; + char *filename; + FileAccess file_access; + Widget source; + XtAppContext appcon; + unsigned int i, num_loaded, lineno; + + num_loaded = lineno = 0; + +#ifdef INCLUDE_XPRINT_SUPPORT + XtSetLanguageProc(NULL, NULL, NULL); +#endif + topwindow = XtAppInitialize(&appcon, "Xedit", NULL, 0, &argc, argv, +#ifdef INCLUDE_XPRINT_SUPPORT + fallback_resources, +#else + NULL, +#endif + NULL, 0); + + XtAppAddActions(appcon, actions, XtNumber(actions)); + XtOverrideTranslations(topwindow, + XtParseTranslationTable("<Message>WM_PROTOCOLS: quit()")); + + XtGetApplicationResources(topwindow, (XtPointer) &app_resources, resources, + XtNumber(resources), NULL, 0); + + CurDpy = XtDisplay(topwindow); + XawSimpleMenuAddGlobalActions(appcon); + XtRegisterGrabAction(PopupMenu, True, + ButtonPressMask | ButtonReleaseMask, + GrabModeAsync, GrabModeAsync); + + makeButtonsAndBoxes(topwindow); + + StartHints(); + StartFormatPosition(); + (void)StartHooks(appcon); + if (position_format_mask == 0) { + for (i = 0; i < 3; i++) + XtRemoveCallback(texts[i], XtNpositionCallback, + PositionChanged, NULL); + } + XtRealizeWidget(topwindow); #ifndef __UNIXOS2__ - XeditLispInitialize(); + XeditLispInitialize(); #endif - options_popup = XtCreatePopupShell("optionsMenu", simpleMenuWidgetClass, - topwindow, NULL, 0); - XtRealizeWidget(options_popup); - XtAddCallback(XtCreateManagedWidget("ispell", smeBSBObjectClass, - options_popup, NULL, 0), - XtNcallback, IspellCallback, NULL); - CreateEditPopup(); - - wm_delete_window = XInternAtom(XtDisplay(topwindow), "WM_DELETE_WINDOW", - False); - (void) XSetWMProtocols (XtDisplay(topwindow), XtWindow(topwindow), + options_popup = XtCreatePopupShell("optionsMenu", simpleMenuWidgetClass, + topwindow, NULL, 0); + XtRealizeWidget(options_popup); + XtAddCallback(XtCreateManagedWidget("ispell", smeBSBObjectClass, + options_popup, NULL, 0), + XtNcallback, IspellCallback, NULL); + CreateEditPopup(); + + wm_delete_window = XInternAtom(XtDisplay(topwindow), "WM_DELETE_WINDOW", + False); + (void)XSetWMProtocols(XtDisplay(topwindow), XtWindow(topwindow), &wm_delete_window, 1); - /* This first call is just to save the default font and colors */ - UpdateTextProperties(0); - - if (argc > 1) { - Boolean exists; - xedit_flist_item *item; - FileAccess file_access; - char *filename; - Widget source; - Arg args[2]; - unsigned i, num_args; - char buf[BUFSIZ]; - - for (i = 1; i < argc; i++) { - struct stat st; - - num_args = 0; - filename = ResolveName(argv[i]); - if (filename == NULL || FindTextSource(NULL, filename) != NULL) - continue; - if (stat(filename, &st) == 0 && !S_ISREG(st.st_mode)) { - if (S_ISDIR(st.st_mode)) { - if (!num_loaded) { - char path[BUFSIZ + 1]; - - strncpy(path, filename, sizeof(path) - 2); - path[sizeof(path) - 2] = '\0'; - if (*path) { - if (path[strlen(path) - 1] != '/') - strcat(path, "/"); - } - else - strcpy(path, "./"); - XtSetArg(args[0], XtNlabel, ""); - XtSetValues(dirlabel, args, 1); - SwitchDirWindow(True); - DirWindowCB(dirwindow, path, NULL); - ++num_loaded; - } - continue; - } - } - - switch (file_access = CheckFilePermissions(filename, &exists)) { - case NO_READ: - if (exists) - XmuSnprintf(buf, sizeof(buf), "File %s, %s %s", argv[i], - "exists, and could not be opened for", - "reading.\n"); - else - XmuSnprintf(buf, sizeof(buf), "File %s %s %s %s", argv[i], - "does not exist, and", - "the directory could not be opened for", - "writing.\n"); - break; - case READ_OK: - XtSetArg(args[num_args], XtNeditType, XawtextRead); num_args++; - XmuSnprintf(buf, sizeof(buf), "File %s opened READ ONLY.\n", - argv[i]); - break; - case WRITE_OK: - XtSetArg(args[num_args], XtNeditType, XawtextEdit); num_args++; - XmuSnprintf(buf, sizeof(buf), "File %s opened read - write.\n", - argv[i]); - break; - } - if (file_access != NO_READ) { - int flags; - - if (exists) { - flags = EXISTS_BIT; - XtSetArg(args[num_args], XtNstring, filename);num_args++; - } - else { - flags = 0; - XtSetArg(args[num_args], XtNstring, NULL); num_args++; - } - source = XtVaCreateWidget("textSource", - multiSrcObjectClass, topwindow, - XtNtype, XawAsciiFile, - XtNeditType, XawtextEdit, - NULL, NULL); - XtSetValues(source, args, num_args); - item = AddTextSource(source, argv[i], filename, - flags, file_access); - XtAddCallback(item->source, XtNcallback, SourceChanged, - (XtPointer)item); - if (exists && file_access == WRITE_OK) - item->mode = st.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); - if (!num_loaded) - SwitchTextSource(item); - ++num_loaded; - ResetSourceChanged(item); - } - XeditPrintf(buf); - } - } + /* This first call is just to save the default font and colors */ + UpdateTextProperties(0); + + if (argc > 1) { + xedit_flist_item *item; + Arg args[2]; + unsigned int num_args; + + for (i = 1; i < argc; i++) { + struct stat st; + + if (argv[i][0] == '+') { + char *endptr; + + lineno = strtol(argv[i], &endptr, 10); + /* Don't warn or anything about incorrect input? */ + if (*endptr) + lineno = 0; + continue; + } + + filename = ResolveName(argv[i]); + if (filename == NULL || FindTextSource(NULL, filename) != NULL) + continue; + + num_args = 0; + if (stat(filename, &st) == 0 && !S_ISREG(st.st_mode)) { + if (S_ISDIR(st.st_mode)) { + if (!num_loaded) { + char path[BUFSIZ + 1]; + + strncpy(path, filename, sizeof(path) - 2); + path[sizeof(path) - 2] = '\0'; + if (*path) { + if (path[strlen(path) - 1] != '/') + strcat(path, "/"); + } + else + strcpy(path, "./"); + XtSetArg(args[0], XtNlabel, ""); + XtSetValues(dirlabel, args, 1); + SwitchDirWindow(True); + DirWindowCB(dirwindow, path, NULL); + ++num_loaded; + } + continue; + } + } + + switch (file_access = CheckFilePermissions(filename, &exists)) { + case NO_READ: + if (exists) + XeditPrintf("File %s exists, and could not be opened for " + "reading.\n", argv[i]); + else + XeditPrintf("File %s does not exist, and the directory " + "could not be opened for writing.\n", argv[i]); + break; + case READ_OK: + XtSetArg(args[num_args], XtNeditType, XawtextRead); num_args++; + XeditPrintf("File %s opened READ ONLY.\n", argv[i]); + break; + case WRITE_OK: + XtSetArg(args[num_args], XtNeditType, XawtextEdit); num_args++; + XeditPrintf("File %s opened read - write.\n", argv[i]); + break; + } + if (file_access != NO_READ) { + int flags; + + if (exists) { + flags = EXISTS_BIT; + XtSetArg(args[num_args], XtNstring, filename);num_args++; + } + else { + flags = 0; + XtSetArg(args[num_args], XtNstring, NULL); num_args++; + } + source = XtVaCreateWidget("textSource", international ? + multiSrcObjectClass + : asciiSrcObjectClass, topwindow, + XtNtype, XawAsciiFile, + XtNeditType, XawtextEdit, + NULL, NULL); + XtSetValues(source, args, num_args); + item = AddTextSource(source, argv[i], filename, + flags, file_access); + XtAddCallback(item->source, XtNcallback, SourceChanged, + (XtPointer)item); + if (exists && file_access == WRITE_OK) + item->mode = st.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); + if (!num_loaded) + SwitchTextSource(item); + ++num_loaded; + ResetSourceChanged(item); + } + } + } if (!flist.pixmap && strlen(app_resources.changed_pixmap_name)) { XrmValue from, to; @@ -278,15 +300,25 @@ main(int argc, char *argv[]) XtConvertAndStore(flist.popup, XtRString, &from, XtRBitmap, &to); } - if (num_loaded == 0) { - XtSetKeyboardFocus(topwindow, filenamewindow); - XtVaSetValues(textwindow, XtNwrap, XawtextWrapLine, NULL); - } - else - XtSetKeyboardFocus(topwindow, textwindow); + if (num_loaded == 0) { + XtSetKeyboardFocus(topwindow, filenamewindow); + XtVaSetValues(textwindow, XtNwrap, XawtextWrapLine, NULL); + } + else { + XtSetKeyboardFocus(topwindow, textwindow); + if (lineno) { + XawTextPosition position; + + source = XawTextGetSource(textwindow); + position = RSCAN(XawTextGetInsertionPoint(textwindow), + lineno, False); + position = LSCAN(position, 1, False); + XawTextSetInsertionPoint(textwindow, position); + } + } - XtAppMainLoop(appcon); - return EXIT_SUCCESS; + XtAppMainLoop(appcon); + return EXIT_SUCCESS; } static void @@ -354,11 +386,22 @@ makeButtonsAndBoxes(Widget parent) XtSetArg(arglist[num_args], XtNeditType, XawtextEdit); ++num_args; textwindow = XtCreateManagedWidget(editWindow, asciiTextWidgetClass, vpanes[0], arglist, num_args); + +#ifdef INCLUDE_XPRINT_SUPPORT + international = True; +#else + /* Get international resource value form the textwindow */ + num_args = 0; + XtSetArg(arglist[num_args], XtNinternational, &international); ++num_args; + XtGetValues(textwindow, arglist, num_args); +#endif + num_args = 0; XtSetArg(arglist[num_args], XtNtype, XawAsciiFile); ++num_args; XtSetArg(arglist[num_args], XtNeditType, XawtextEdit); ++num_args; - scratch = XtVaCreateWidget("textSource", - multiSrcObjectClass, topwindow, + scratch = XtVaCreateWidget("textSource", international ? + multiSrcObjectClass : + asciiSrcObjectClass, topwindow, XtNtype, XawAsciiFile, XtNeditType, XawtextEdit, NULL, NULL); diff --git a/app/xedit/xedit.h b/app/xedit/xedit.h index eeb7ca34c..0abda4c86 100644 --- a/app/xedit/xedit.h +++ b/app/xedit/xedit.h @@ -29,6 +29,7 @@ /* $XFree86: xc/programs/xedit/xedit.h,v 1.17 2002/10/06 17:11:39 paulo Exp $ */ #include <stdio.h> +#include <time.h> #include <X11/Intrinsic.h> #include <X11/StringDefs.h> #include <X11/cursorfont.h> @@ -49,6 +50,11 @@ #include <X11/Xmu/SysUtil.h> +#define LSCAN(from, count, include) \ + XawTextSourceScan(source, from, XawstEOL, XawsdLeft, count, include) +#define RSCAN(from, count, include) \ + XawTextSourceScan(source, from, XawstEOL, XawsdRight, count, include) + typedef struct _xedit_hints { char *resource; unsigned long interval; @@ -61,6 +67,7 @@ typedef struct _xedit_hints { typedef enum {NO_READ, READ_OK, WRITE_OK} FileAccess; typedef struct _XeditLispData XeditLispData; +typedef struct _XeditTagsInfo XeditTagsInfo; #define CHANGED_BIT 0x01 #define EXISTS_BIT 0x02 @@ -73,9 +80,11 @@ typedef struct _xedit_flist_item { FileAccess file_access; XawTextPosition display_position, insert_position; int mode; + time_t mtime; XawTextPropertyList *properties; XawTextWrapMode wrap; XeditLispData *xldata; + XeditTagsInfo *tags; } xedit_flist_item; extern struct _xedit_flist { @@ -96,10 +105,13 @@ extern struct _app_resources { char *changed_pixmap_name; char *position_format; char *auto_replace; + char *tagsName; + Boolean loadTags; } app_resources; extern Widget topwindow, textwindow, labelwindow, filenamewindow, messwidget; extern Widget dirlabel, dirwindow; +extern Boolean international; extern Boolean line_edit; /* externals in xedit.c */ @@ -137,6 +149,7 @@ void DoPrint(Widget, XtPointer, XtPointer); void CancelFindFile(Widget, XEvent*, String*, Cardinal*); void FindFile(Widget, XEvent*, String*, Cardinal*); void LoadFile(Widget, XEvent*, String*, Cardinal*); +Bool LoadFileInTextwindow(char *name, char *resolved_name); #ifdef INCLUDE_XPRINT_SUPPORT void PrintFile(Widget, XEvent*, String*, Cardinal*); #endif /* INCLUDE_XPRINT_SUPPORT */ @@ -170,6 +183,10 @@ void UnsetTextProperties(xedit_flist_item*); void CreateEditModePopup(Widget); void SetEditModeMenu(void); +/* tags.c */ +void TagsAction(Widget, XEvent*, String*, Cardinal*); +void SearchTagsFile(xedit_flist_item *item); + /* externs for system replacement functions */ #ifdef NEED_STRCASECMP int strcasecmp(const char *s1, const char *s2); diff --git a/app/xedit/xedit.man b/app/xedit/xedit.man index 0c2f5401e..3491bd129 100644 --- a/app/xedit/xedit.man +++ b/app/xedit/xedit.man @@ -245,6 +245,14 @@ of the this button and displays it in the Edit window. .SH RESOURCES For \fIxedit\fP the available resources are: .TP 8 +.B tagsName (\fPClass\fB TagsName) +Specifies the name of the tags file to search when loading a new file. +Default value is \fItags\fP. +.TP 8 +.B loadTags (\fPClass\fB LoadTags) +Boolean value to enable or disabling searching for tags files. +Default is \fITrue\fP. +.TP 8 .B enableBackups (\fPClass\fB EnableBackups) Specifies that, when edits made to an existing file are saved, .I xedit |